feat(signals): decode recordings with bounded sigrok output (#2339)

Decode caller-selected protocols from existing recordings through shared
CLI/MCP Evidence. Page literal output lines after complete decoding;
preserve explicit full output, source identity and failed cleanup ownership.

Verified real sigrok-cli 0.7.2 workflows, published UART/SPI/I2C recordings,
independent UART values, selector limits, SDK schemas and cleanup regressions.

Co-authored-by: Olorinm <59321404+Olorinm@users.noreply.github.com>
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
Ysopwnable
2026-10-12 20:59:02 +00:00
committed by GitHub
co-authored by Olorinm
parent 5f79c852af
commit 91b8f587cd
50 changed files with 2715 additions and 252 deletions
@@ -0,0 +1,29 @@
import {
decodeSignalRecordingInputSchema,
signalRecordingSchema,
} from "../../domain/signals/signalRecording.js";
import type { ToolContract } from "../toolContractTypes.js";
import { toolContractMetadata } from "../toolEffects.js";
import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
export const SIGNAL_TOOL_CONTRACTS = [
{
name: "decode_signal_recording",
...toolContractMetadata("decode_signal_recording"),
kind: "artifact-provider",
description:
"Decode an existing local logic/signal recording on Linux with sigrok-cli 0.7.2 and util-linux prlimit. Supply decoder stack, channels and options explicitly; optionally select input format and annotation classes. Return 50 literal output lines by default, with line_offset/line_limit paging; line_limit:null requests all remaining lines. Output windows count display lines, not annotations or samples, and do not shorten decoding. Preserve selected text, sample ranges, stderr, source/tool identity and coverage inline. Configure absolute REA_SIGROK_COMMAND. File-only analysis; no hardware acquisition or device communication. Empty output does not prove absence of traffic.",
inputSchema: decodeSignalRecordingInputSchema,
outputSchema: evidenceResultOf(signalRecordingSchema),
examples: [
{
title: "Decode recorded UART RX bytes",
input: {
path: "/artifacts/uart.vcd",
input_format: "vcd",
decoders: "uart:rx=RX:baudrate=9600",
annotations: "uart=rx-data",
},
},
],
},
] as const satisfies readonly ToolContract[];