Repository navigation
Description
Filed by the release-3 audit for v0.29.0..HEAD (round 1, dispatch token gate3-682bbe1d0550).
#599 added control-byte flattening inside log() at scripts/log.sh:528, and both the code comment and changelog.d/599.fixed.md:12-14 claim the class is closed everywhere log() is used. It is closed for the daily log, but four reporters write the same message string a second time, raw, to hook-errors.log: _dispatch_report_failure (log.sh:805), _dispatch_report_skip (:824), report_error (:842), _dispatch_report_timeout (:873). That file is the one /remember:doctor tails under "Recent errors" (scripts/doctor.sh:826-831) and is what maintainers ask a reporter to paste (CHANGELOG:1381). For the timeout/failure paths the embedded $_said/$_why is a third-party hook's own stderr.
Control run (in-memory, no writes):
printf 'a\rFORGED\vB\fC\n' | while IFS= read -r l; do printf 'LINE=[%s]\n' "$l"; done | cat -v
-> LINE=[a^MFORGED^KB^LC]
printf 'a\rFORGED\vB\fC' | LC_ALL=C tr '[:cntrl:]' ' '
-> a FORGED B C
CR/VT/FF survive bash read -r (used by _dispatch_stderr_excerpt:726 and doctor.sh:829) while the same string reaching the daily log has them replaced with spaces.
Not ranked forges: the LF route is already closed (_dispatch_stderr_excerpt:732 folds lines with " | ", so a newline cannot reach the sink), and no current consumer of hook-errors.log splits records on CR/VT/FF/0x85 (checked: the only two splitlines() calls in the tree, pipeline/consolidate.py:216 and pipeline/spawn_guard.py:152, do not read this file). If a consumer that splits on those bytes is ever added, this becomes forges and blocks a release.
Fix: move the flatten into the shared sink so all writers to hook-errors.log get it, or apply the same tr '[:cntrl:]' at each of the four call sites, and correct the #599 changelog/comment claim of full coverage.
Row: misreports (can ship behind a filed issue, not blocking).
[AI-generated]
Activity
fix(#621): drop the hot-path control-byte pre-check, restore uncondit…
Guard basename SESSION_ID, cut a hot-path tr fork, flatten hook-error…
Flatten lib-staging-lock.sh's fallback report_error() hook-errors.log…
Document #621's abandoned hot-path pre-check accurately, and record t…
Cut $( ) subshell forks on SessionStart's config/timestamp/slug paths (…
refactor(#898): one reporting path and one hook launch in dispatch
refactor(#898): give the three dispatch reporters their own bodies again
fix(#881): flatten control characters in pipeline/log.py's log() (#956)