Investigation record only - no fix yet (goal remains proposed).
Root cause: the Tcl core delivers the transform 'clear' op before every
write (output-buffer flush-down; tclsh 8.7 and 9.0.3), and
::punkboot::ansistrip's transchan handles 'clear' with 'dict unset carry'
- discarding a split sequence's held tail at every chunk boundary. The
tail's remainder (e.g. 0;1m) passes through unstripped while the held
ESC[ bytes are never emitted, so the zero-ESC pin (maketclcolour.test)
stays green while fragments leak. Evidence: pre-transform stream captured
via NO_COLOR+PUNK_FORCE_COLOR is fully well-formed (textblock/punk::ansi
exonerated; G-056 not the mechanism); the verbatim strip proc is correct
for every possible 2-chunk split and 512..8192 block sizes; an identity
logging transform under ansistrip captured the boundary byte-exactly;
minimal isolated repro on a bare file channel reproduces both the
per-write 'clear' op sequence and a fragment. Deterministic per table
geometry, matching the observed intermittency.
Upstream (TEMP_REFERENCE/tcl9 survey): per-write 'clear' is intentional,
test-pinned core behavior (ioTrans.test iortrans-7.1 "chan write, write
clears read buffers") but transchan.n and TIP 230 document it as
seek-only and read-side-scoped - an upstream documentation gap, not an
implementation bug; no existing Tcl ticket found. A write-only
transform's contract-conformant 'clear' is a no-op; fix layer recorded
in the goal file (drop 'clear' from the supported-methods list or make
it a no-op; 'finalize' keeps dropping the carry).
- goals/G-145-piped-usage-ansi-remnants.md: root cause, evidence chain,
upstream documentation status, fix layer, encoding note, repro recipes
- shellfilter: G-145 warning comment over the commented-out 'clear'
method so future refactors don't discard o_encbuf/stream state there
goals_lint clean (83 active-index goals, 62 archived).
Assisted-by: harness=opencode; primary-model=opencode/kimi-k3; api-location=unknown
G-143 make.tcl help depth: multi-form tool/buildsuite definitions and
per-action usage - @form sections with literal action leaders so help
shows which actions take <toolname>/-test, 'help <sub> <action>' renders
the single form, tool dispatch becomes fully declared, buildsuite keeps
its passthrough driver-args contract.
G-144 punk::args auto-synopsis @cmd -name fallback for non-command ids -
unblocks dropping make.tcl's hand-written ?...? @form -synopsis lines in
favour of the automatic bracket notation (retires the G-030 workaround
for (script):: ids).
G-145 remnant-free piped usage tables - root-cause and eliminate the
orphan CSI fragments ([0;1m / [0m / lone m) observed beside table borders
in piped help output; extends the G-113 zero-ESC guarantee to zero
sequence-fragment text.
All three born from the 2026-08-01 argdoc restyle evaluation (mechanisms
verified live on bootsupport punk::args 0.12.7). Overlap surveys recorded
in each detail file; goals_lint clean (83 active-index goals); xref score
reviewed per goal - the top term-scored unlinked pairs for G-143 (G-085,
G-021) checked and judged lexical-only, no relation recorded.
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com