hwcontract

v0.6.1
io.github.MohibShaikh/hwcontract Checked 20 hours ago Published 1 month ago

Judge hardware timing/serial against a contract: pass/marginal/fail (WS2812, DShot, logs)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_contracts

List bundled contract templates, names, kinds, installed paths, and capture adapter requirements. No hardware.

judge_contract

Judge observations against a timing contract -> PASS/MARGINAL/FAIL/MISSING. No hardware; use for replay or when an adapter already captured.

ParameterTypeDescription
contract_path *string
observations *array

capture_ws2812

Capture the WS2812 data line via sigrok and return measured pulse-width observations (T0H/T1H/...).

ParameterTypeDescription
channelstring
driverstring
sampleratenumber
samplesnumber

check_ws2812

Capture a live WS2812 signal AND judge it against a contract in one call. The one-shot an agent reaches for.

ParameterTypeDescription
contract_path *string
channelstring
driverstring
sampleratenumber
samplesnumber

check_dshot

Capture a live DShot600 ESC signal AND judge it against a contract in one call.

ParameterTypeDescription
contract_path *string
channelstring
driverstring
sampleratenumber
samplesnumber

judge_serial

Judge a captured serial log against expect/forbid patterns. No hardware; use for replay or logs another tool already captured.

ParameterTypeDescription
contract_path *string
log *string

judge_events

Judge decoded hardware events against an events contract's temporal assertions (when/require/within, forbid/while/before). Events: [{source, type, start_ns, end_ns, fields}].

ParameterTypeDescription
contract_path *string
events *array

check_serial

Read a serial port for N seconds AND judge its log against a contract's expect/forbid patterns.

ParameterTypeDescription
contract_path *string
port *string
baudnumber
secondsnumber