[GH-ISSUE #6580] [Bug] Signal autodetection loses headered CSV support when the private copy drops .csv #3969

Closed
opened 2026-10-31 00:45:40 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6580

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

Source-only finding; runtime reproduction NOT RUN. decode_signal_recording copies every selected file to the private basename recording and passes --input-file=recording to sigrok. A valid headered CSV selected as capture.csv therefore loses the filename hint that libsigrok uses to admit CSV files whose first line contains channel names. Omitting input_format no longer gives the same autodetection as sigrok reading the selected filename.

Reproduction

Runtime reproduction NOT RUN. Source tracing only; no decoder process was launched.

Proposed steps, UNEXECUTED:

  1. On the supported Linux setup, use sigrok-cli 0.7.2 with libsigrok 0.5.2 and libsigrokdecode. Save an ordinary two-channel SPI waveform as capture.csv, beginning with CLK,MOSI followed by LF-separated 0,0 / 1,0 / 0,1 / 1,1 sample rows.
  2. Request decode_signal_recording with {"path":"/artifacts/capture.csv","decoders":"spi:clk=CLK:mosi=MOSI"}, omitting input_format.
  3. Compare the same request with "input_format":"csv" and a direct sigrok invocation reading the .csv filename. The source-derived failure is loss of CSV selection in step 2, before annotations can be produced. No annotation values or process exit were observed.

Expected behavior

Keep the private-copy isolation while preserving filename information needed for the producer's normal autodetection. REA documents omitted input_format as requesting sigrok autodetection. libsigrok's CSV reader supports channel-name headers by default; such a valid recording should not need an explicit format merely because REA renamed its copy.

Impact and scope

A documented default path cannot select the CSV importer for headered CSV recordings under the cited producer implementation. Callers receive no protocol observation from that request. Explicit input_format: "csv" bypasses autodetection in source and is the practical recovery candidate; it was not runtime-tested. No file mutation or security finding is alleged. Other libsigrok releases and format importers are untested.

REA version

6.7.0; source baseline 46111dd091f2ae01baab9eb119b53b9bd309a05b on main. The supplied release baseline is npm 6.7.0.

Runtime and platform

Source-only (no REA or provider runtime run). The producer source examined is released sigrok-cli 0.7.2 and libsigrok 0.5.2. No local Node.js, sigrok or provider version was measured.

Target and artifact context

An existing CSV logic recording with a .csv suffix and named logic channels in its first line, within REA's input allowance. No hardware acquisition.

Interface

MCP

Earliest failure stage

Capture or observation

Relevant output or evidence

Evidence provenance: source-derived. Runtime reproduction: NOT RUN.

Typed outcome or recovery expected

Return the selected decoder's normal observation for the supported CSV input, or explicitly expose an autodetection limitation. Supplying input_format: "csv" is an unexecuted workaround proposal.

Analysis or suspected cause

The private-copy boundary preserves bytes but discards filename metadata consumed by the input-format classifier. The issue is in REA's adapter, not a request to change libsigrok's format matcher.

Additional context

The supplied open-issue and open-PR snapshots were searched by titles and relevant bodies. #5984 / #6395 concern the earlier version probe and are distinct. A final live search of open and closed issues for sigrok/CSV, signal/autodetection, and recording/filename found no matching report. No separate reverification pass was run.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: A valid default CSV import representation loses required format-selection evidence before the producer can decode the recording; the affected branch is directly reachable from the public request.
  • Workaround status: unverified
  • Workaround basis: Explicit input_format csv selects the producer's non-autodetection branch, but no actual producer request was executed.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6580 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior Source-only finding; runtime reproduction NOT RUN. `decode_signal_recording` copies every selected file to the private basename `recording` and passes `--input-file=recording` to sigrok. A valid headered CSV selected as `capture.csv` therefore loses the filename hint that libsigrok uses to admit CSV files whose first line contains channel names. Omitting `input_format` no longer gives the same autodetection as sigrok reading the selected filename. ### Reproduction Runtime reproduction NOT RUN. Source tracing only; no decoder process was launched. Proposed steps, UNEXECUTED: 1. On the supported Linux setup, use sigrok-cli 0.7.2 with libsigrok 0.5.2 and libsigrokdecode. Save an ordinary two-channel SPI waveform as `capture.csv`, beginning with `CLK,MOSI` followed by LF-separated `0,0` / `1,0` / `0,1` / `1,1` sample rows. 2. Request `decode_signal_recording` with `{"path":"/artifacts/capture.csv","decoders":"spi:clk=CLK:mosi=MOSI"}`, omitting `input_format`. 3. Compare the same request with `"input_format":"csv"` and a direct sigrok invocation reading the `.csv` filename. The source-derived failure is loss of CSV selection in step 2, before annotations can be produced. No annotation values or process exit were observed. ### Expected behavior Keep the private-copy isolation while preserving filename information needed for the producer's normal autodetection. REA [documents omitted `input_format` as requesting sigrok autodetection](https://github.com/morluto/rea/blob/46111dd091f2ae01baab9eb119b53b9bd309a05b/docs/signal-recordings.md#L32-L37). libsigrok's CSV reader supports channel-name headers by default; such a valid recording should not need an explicit format merely because REA renamed its copy. ### Impact and scope A documented default path cannot select the CSV importer for headered CSV recordings under the cited producer implementation. Callers receive no protocol observation from that request. Explicit `input_format: "csv"` bypasses autodetection in source and is the practical recovery candidate; it was not runtime-tested. No file mutation or security finding is alleged. Other libsigrok releases and format importers are untested. ### REA version 6.7.0; source baseline `46111dd091f2ae01baab9eb119b53b9bd309a05b` on main. The supplied release baseline is npm 6.7.0. ### Runtime and platform Source-only (no REA or provider runtime run). The producer source examined is released sigrok-cli 0.7.2 and libsigrok 0.5.2. No local Node.js, sigrok or provider version was measured. ### Target and artifact context An existing CSV logic recording with a `.csv` suffix and named logic channels in its first line, within REA's input allowance. No hardware acquisition. ### Interface MCP ### Earliest failure stage Capture or observation ### Relevant output or evidence Evidence provenance: source-derived. Runtime reproduction: NOT RUN. - REA [chooses the extensionless snapshot name](https://github.com/morluto/rea/blob/46111dd091f2ae01baab9eb119b53b9bd309a05b/src/signals/SigrokRecordingProvider.ts#L177-L180), then [writes the copy and omits `--input-format` when the caller omitted it](https://github.com/morluto/rea/blob/46111dd091f2ae01baab9eb119b53b9bd309a05b/src/signals/SigrokRecordingProvider.ts#L315-L335). - Released sigrok-cli [passes the filename to `sr_input_scan_file` for automatic selection](https://github.com/sigrokproject/sigrok-cli/blob/b584f959edb788f1731d5a304badf241ac21bf65/input.c#L77-L108). - Released libsigrok [accepts a `.csv` filename before checking content](https://github.com/sigrokproject/libsigrok/blob/a6b07d7e28fe445afccf36922ef7d20e63e54fe6/src/input/csv.c#L1082-L1109). Without that hint, [its content matcher requires binary digits in every first-line column](https://github.com/sigrokproject/libsigrok/blob/a6b07d7e28fe445afccf36922ef7d20e63e54fe6/src/input/csv.c#L1130-L1166), so `CLK,MOSI` is rejected by the CSV matcher. - The same CSV implementation [advertises headers enabled by default](https://github.com/sigrokproject/libsigrok/blob/a6b07d7e28fe445afccf36922ef7d20e63e54fe6/src/input/csv.c#L1796-L1799) and [uses header captions as channel names](https://github.com/sigrokproject/libsigrok/blob/a6b07d7e28fe445afccf36922ef7d20e63e54fe6/src/input/csv.c#L660-L694). This is a supported CSV representation, not an invalid decoder wiring assumption. ### Typed outcome or recovery expected Return the selected decoder's normal observation for the supported CSV input, or explicitly expose an autodetection limitation. Supplying `input_format: "csv"` is an unexecuted workaround proposal. ### Analysis or suspected cause The private-copy boundary preserves bytes but discards filename metadata consumed by the input-format classifier. The issue is in REA's adapter, not a request to change libsigrok's format matcher. ### Additional context The supplied open-issue and open-PR snapshots were searched by titles and relevant bodies. #5984 / #6395 concern the earlier version probe and are distinct. A final live search of open and closed issues for sigrok/CSV, signal/autodetection, and recording/filename found no matching report. No separate reverification pass was run. ## Triage assessment - Impact level: P2 - Assessment status: supported - Impact basis: A valid default CSV import representation loses required format-selection evidence before the producer can decode the recording; the affected branch is directly reachable from the public request. - Workaround status: unverified - Workaround basis: Explicit input_format csv selects the producer's non-autodetection branch, but no actual producer request was executed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3969
No description provided.