Skip to content

Fix #71: bound transcribe's subprocess output retention - #78

Merged
REPPL merged 1 commit into
mainfrom
fix-71-bounded-subprocess-output
Aug 27, 2026
Merged

Fix #71: bound transcribe's subprocess output retention#78
REPPL merged 1 commit into
mainfrom
fix-71-bounded-subprocess-output

Conversation

@REPPL

@REPPL REPPL commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Validated against main, with one drift from the issue text: the two whisper sites' CombinedOutput calls have since been funnelled through runWithHeartbeat (#57), whose bytes.Buffer was equally unbounded — so the fix lands there, plus convertRunner and deriveOffset.

Fix: tailSink (8 KiB trailing window, stderrRetain's sizing and rationale) for the combined-output sites; headSink (1 MiB leading window, probeSink's sizing) for ffprobe stdout, where truncation degrades to the same graceful (0, false) no-derivation path as a missing tag. Both honour the io.Writer full-count contract. Regression tests: a 300 KB chatter run through the heartbeat must retain ≤ 8 KiB ending with the child's last words; an oversized -show_format dump must not yield an offset; sink retention/contract unit tests. go test -race clean. CHANGELOG entry added.

Fixes #71

All four transcribe subprocess sites buffered child output unbounded
(CombinedOutput/Output, and the heartbeat's bytes.Buffer the engine sites
now funnel through) while at most an 800-byte tail — or one JSON field —
was ever consumed. record already closed this assumption twice, with
written OOM rationale; transcribe is the one package handing
attacker-authorable media to a media parser. Add a tailSink (8 KiB
trailing window; stderrRetain's sizing) for the ffmpeg conversion and
runWithHeartbeat, and a headSink (1 MiB leading window; probeSink's
sizing) for ffprobe's -show_format stdout, where a truncated JSON lands
on the same graceful no-derivation path as a missing tag. Both sinks
honour the io.Writer full-count contract (probeSink.Write's lesson).

Fixes #71.

Assisted-by: Claude:claude-fable-5
@REPPL
REPPL merged commit 8c61f90 into main Aug 27, 2026
6 checks passed
@REPPL
REPPL deleted the fix-71-bounded-subprocess-output branch August 27, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant