check_port_contract
Compare a live cortical area with a datasheet port row to validate shape, drive, coding, bins and geometry, returning per-check pass/fail results with observed and datasheet values.
Instructions
Check one live area against one datasheet port row; per-check pass/fail with numbers.
Reads the area (get_area_parameters) and compares shape, drive scalars (threshold,
psp, leak, refractory, accumulate), code and bins (live_bins must be at least
min_bins_that_pass). For a live IPU or OPU it compares kind and signed (decoded from
the cortical id), frame and positioning (live encoding_type / encoding_format), X/Y
per device (dev_count multiplies X) and Z depth against the port's fits; the result
adds advisory text on conversions (nothing is wired). A null datasheet value is
skipped: datasheet states no value; with latency_probe it also checks that the
port's path responds within the datasheet latency. Each check reports the datasheet value, the
observed value and the tolerance used (the contract has no tolerance field: exact unless
the row's drive.tolerance_rel / latency_tolerance_bursts or the arguments say
otherwise). Nothing is fixed; a mismatch is reported with the datasheet's number.
The datasheet does not say how you encode your device, so pass live_code and
live_bins yourself; checks lacking a live value are skipped, not passed.
WARNING: latency_probe STIMULATES the area and CHANGES LIVE ACTIVITY (it force-fires
voxels via probe_area_response). Use it only when the brain is not mid-experiment.
Without it this tool is read-only. Polarity (sign) is not auto-compared: the datasheet
states positive as free text, so check it with auto_polarity_probe and compare by hand.
Args:
port: One port row from get_block_datasheet (datasheet.ports[i]).
area_id: Cortical id of YOUR area that plays this port.
live_code: Code your area uses (binary, thermometer, one-hot, value plane, rate).
live_bins: Number of value bins you drive or read on this port.
latency_probe: Optional {"stimulus_area", "stimulus_voxels", "observe_area", "burst_period_ms"}. The after-window waits (latency_bursts + 1) * burst_period_ms; path_responds is then checked.
drive_rel_tolerance: Relative tolerance for drive scalars (default exact).
latency_tolerance_bursts: Allowed latency difference in bursts (default 0).
Returns:
{"port", "passed", "failed_checks", "checks": [...], "area_id"}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"port": "<port>",
"area_id": "<area_id>"
},
"name": "check_port_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | ||
| area_id | Yes | ||
| live_bins | No | ||
| live_code | No | ||
| latency_probe | No | ||
| drive_rel_tolerance | No | ||
| latency_tolerance_bursts | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||