Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dccb8024ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| timeoutMs: LIMITS.command_timeout_ms, | ||
| diagnosticBytes: LIMITS.output_bytes, | ||
| acceptNonZeroExit: true, |
There was a problem hiding this comment.
Bound decoder expansion before launching sigrok
For archive-backed formats accepted by sigrok, the 32 MiB input cap does not bound expanded data, and this runOwnedCommand configuration limits only time and diagnostic output; the provider's own limitation confirms that child heap and format expansion remain unbounded. A small selected recording can therefore make sigrok exhaust host memory before the timeout, so enforce an address-space/heap limit or preflight and reject formats whose expansion cannot be bounded.
AGENTS.md reference: AGENTS.md:L46-L46
Useful? React with 👍 / 👎.
| libsigrokdecode. It does not acquire samples or communicate with hardware. | ||
|
|
||
| ```sh | ||
| export REA_SIGROK_COMMAND=/absolute/path/to/sigrok-cli |
There was a problem hiding this comment.
Add the signal provider to the canonical README inventory
Although this introduces the only setup instruction for REA_SIGROK_COMMAND, a repo-wide search finds no signal/sigrok entry or guide link in README's supported-target and provider sections. Users following the repository's canonical provider setup inventory therefore cannot discover this feature or its configuration, so add a README inventory entry linking this guide.
AGENTS.md reference: AGENTS.md:L5-L5
Useful? React with 👍 / 👎.
| LIMITS.input_bytes, | ||
| options?.signal, | ||
| ); | ||
| await writeFile(snapshotPath, selected.bytes, { |
There was a problem hiding this comment.
Separate workspace write failures from invalid input
When the source read succeeds but this write fails because the temporary filesystem is full, phase is still artifact, so #failure returns an AnalysisInputError against input.path; an EACCES here is likewise reported as access denial on the source path. This tells callers to change a valid recording and loses the actual workspace/resource cause, so distinguish snapshot-write failures and map them to a resource or provider error.
AGENTS.md reference: AGENTS.md:L25-L25
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 619832f9d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| withAdmittedAnalysis?: WithAdmittedAnalysis, | ||
| ): void => { | ||
| const contract = toolContract("decode_signal_recording"); | ||
| const handler = createEvidenceToolHandler( |
There was a problem hiding this comment.
Record completed partial Evidence in MCP sessions
When decoding has already produced Evidence but SignalRecordingService returns it as partialObservation for a late abort or cleanup failure, createEvidenceToolHandler takes its error branch before invoking recordEvidence. In a session this makes get_evidence_bundle omit the completed observation, and a cancelled MCP request may suppress the only inline copy, so bind this tool through a handler that records Evidence partials before projecting the error.
AGENTS.md reference: AGENTS.md:L5-L5
Useful? React with 👍 / 👎.
| // The provider cleans each call before returning, including failed calls. | ||
| // A second close here could replace a cleanup error carrying partial Evidence. | ||
| run: ({ args, options }) => |
There was a problem hiding this comment.
Retry retained cleanup before the CLI exits
When decode-signal-recording ends with cleanupIncomplete, the provider deliberately keeps the runtime/process supervisor in service for close() to retry, but this one-shot CLI path never calls close() and discards the only owner as the process finishes. A failed process-group stop can therefore leave the decoder running, and a failed root removal can leave the private recording on disk; retry close while preserving the original projected error/partial Evidence instead of skipping it.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
| const current = await readStableArtifact( | ||
| command, | ||
| 64 * 1024 * 1024, | ||
| options?.signal, |
There was a problem hiding this comment.
Preserve decoder output during post-run cancellation
If cancellation arrives after runOwnedCommand has returned the decoder output but during this up-to-64 MiB executable rehash (or the subsequent recording-copy rehash), passing the aborted signal makes readStableArtifact throw before output can be returned and #failure emits a bare cancellation. The already captured annotations/stderr are then absent even from capturedOutput; retain that snapshot or finish the bounded integrity checks before honoring the late abort.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82d0f2c67a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "file-size", | ||
| reason, | ||
| { input_bytes: LIMITS.input_bytes }, |
There was a problem hiding this comment.
Scope size-limit errors to the selected input
When the decoder grows the private recording copy past 32 MiB (or the executable/limiter grows past its 64 MiB rehash cap), those producer-phase reads also throw ArtifactReaderFailure("limit"), but this unconditional projection reports the 32 MiB input_bytes bound. The source has already passed admission, so callers are told to replace a valid recording instead of being told that the decoder mutated its copy or that a tool identity changed; gate this mapping to the source-read phase and classify post-run snapshot/tool failures against the actual resource.
AGENTS.md reference: AGENTS.md:L25-L25
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 847c7cc673
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| cause, | ||
| userMessage: `${reason} On Linux, configure sigrok-cli 0.7.2 through REA_SIGROK_COMMAND and util-linux prlimit through REA_SIGROK_PRLIMIT_COMMAND (default /usr/bin/prlimit).`, | ||
| }, |
There was a problem hiding this comment.
Preserve failed version-probe diagnostics
When the configured executable returns exit 0 for --version but emits an unsupported banner (for example, 0.7.1 or no libsigrokdecode), execute has already placed its stdout/stderr in capturedOutput; this configuration branch keeps only cause, which projectAnalysisError does not expose. Linux CLI/MCP users consequently see only the generic “Expected sigrok-cli...” message and lose the observed banner needed to fix the installation, so pass observedOutput through as capturedOutput.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
Summary
Add
decode_signal_recording/decode-signal-recordingfor an analyst who already has a logic-analyzer recording and wants protocol-decoder annotations in REA Evidence. For example, a UART VCD plusuart:rx=RX:baudrate=9600yields sample ranges and decoded display text through the same CLI/MCP workflow.Problem and expected behavior
REA can investigate firmware but cannot currently interpret recorded digital signals. The separate packet-capture proposal #2130 is independent and can be reviewed or merged separately. This additive capability delegates decoding to caller-supplied sigrok-cli 0.7.2, preserves the selected decoder/channel/options and producer diagnostics, and works without opening a binary target. There is no linked issue; this PR proposes that focused enhancement for review.
Change and scope
One file-analysis tool, an optional sigrok adapter, shared application validation/Evidence, CLI/MCP registration, capability/catalog entries, a guide, canonical README capability rows in every translation, and authored skill guidance. No physical acquisition, device control, installer, native-analysis changes or automatic protocol guessing.
Contract and boundary impact
REA_SIGROK_COMMAND, sigrok-cli 0.7.2 with libsigrokdecode. Linux with util-linuxprlimitis required; unsupported hosts fail before workspace allocation.REA_SIGROK_PRLIMIT_COMMANDcan override/usr/bin/prlimit.prlimitenforces soft and hard limits of at most 1 GiB address space, 64 MiB per file, 30 CPU seconds and no core dumps. Stricter inherited soft/hard limits are preserved and effective values are reported. These are per-process/per-file limits, not aggregate quotas or an OS sandbox; caller tools/modules and the limiter are trusted. Workspace failures are distinguished from invalid input. Post-run identity errors identify the private copy/tool/limiter involved and retain captured output. Resource-signal failures retain the signal and effective limits without claiming the signal proves its cause.Evidence and regression coverage
Tests added: command-boundary coverage of warnings/options, immutable snapshot verification, nonzero exit, output overflow, cancellation, cleanup retry and pre-admission validation, and completed observations on late cancellation; workspace failures, unsupported hosts, advertised MCP schemas and unavailable-tool diagnostics. A Linux kernel test verifies inherited hard/soft limits and refused allocation with a synthetic producer; this is separate from real sigrok coverage. A second Linux process test confirms lower inherited file/CPU limits are preserved during the actual launch.
Executed real evidence: synthesized 9600-baud 8N1 UART recording carrying
REAproduces annotations for52,45,41with sample ranges. CLI/MCP return the same Evidence ID; stored Evidence and source identity are checked.Real verifier also exercises format autodetection, annotation selection, invalid decoder, absent/malformed recording and rejected extra arguments. No remaining owned descendants.
Remaining proof gaps: other decoders/formats and physical hardware. macOS and Windows are explicitly unsupported. The real provider and Linux kernel-limit checks run in the linked fork workflow below; upstream CI remains visible under Checks; the links below are independently executed fork verification.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run check— passed (existing repository lint warnings remain).npm run docs:check— passed.npm run verify:test-discovery— all 920 test files discovered exactly once.847c7cc67— passed: 26 provider/CLI/MCP/resource-limit tests, plus 6 real sigrok CLI/MCP cases on Ubuntu 24.04 (sigrok-cli 0.7.2, libsigrok 0.5.2, libsigrokdecode 0.5.3). Kernel tests verify refused oversized allocation and preservation of lower inherited file/CPU limits.git diff --checkand staged-diff Gitleaks scan — passed.Compatibility, safety, and release
Review checklist