The recovered 2024 TCLSH_PIPEREPL patch applies cleanly to current
core-9-0-branch tclMain.c (8 hunks, offset 4). Tracked as
patches/tclMain_piperepl_905.c = stock 9.0.5 + patch + gate-default flip:
ENABLED unless TCLSH_PIPEREPL=0 (2024 was opt-in set-and-not-"0") per the
G-103 punk-kit policy - the goal's Goal/Acceptance were aligned to that
policy first at user request. Era files kept unmodified as recovered
artifacts; patches/README updated (status, gate semantics, known
tcl_interactive early-link divergence when the gate is open).
build905.zig gains tclsh90spr (per-source construction mirroring tclsh90s
with both tclMain compiles - unicode + TCL_ASCII_MAIN ansi - swapped to
the patched file; stock products stay byte-for-byte unpatched) and
tclsh90sprzip (zipfs_mkimg wrap of the pr exe, -infile form). patches/
added to suite.tcl's staged recipe items. Full suite build PASS.
Behaviour matrix recorded in the goal: 9/9 stock-equivalence rows
IDENTICAL (script-arg / script-consuming-stdin / piped-commands x
unset/0/1 - open-gate plain scripts behave stock; unread piped payload
never eval'd); feature row proves buffering verbatim into
::tclsh(inputbuffer) (write-trace capture), console reopen success and
repl landing; =0 feature row identical to stock; przip variant identical
to pr - the G-103 punk-kit precursor works.
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
Goal: src/buildsuites gains its first real, VCS-tracked suite (suite_tcl90) that reproducibly builds the Tcl 9.0 windows runtime from clean sources using only project-managed tooling - a punk-getzig wrapper fetching a pinned zig into untracked bin/tools, with all transient checkouts and outputs under untracked src/buildsuites/_build - and the 2024 TCLSH_PIPEREPL tclMain patch is recovered into the suite in tracked form and rebased onto current Tcl 9 sources, so a suite-built runtime can return to a standard interactive repl after a kit-style main.tcl completes with unconsumed piped input buffered rather than eval'd, while stock behaviour is preserved whenever the env gate is unset.
Acceptance: from a clean checkout plus a punk-getzig-fetched pinned zig, the suite builds tclsh90s/tclsh90szip from a fresh core-9-0-branch checkout under src/buildsuites/_build with recipe-generated tclUuid.h and tclsh.exe.manifest (no hand-placed files) and the result reports the expected patchlevel; the recovered patch set (piperepl plus the companion tclZipfs/tclCmdIL patches and a notes doc) is tracked in the suite; a piperepl-patched build with TCLSH_PIPEREPL unset behaves identically to the unpatched build on a tty/piped/script-arg matrix, and with TCLSH_PIPEREPL=1 a script setting ::tclsh(dorepl) 1 lands in a live interactive console repl after piped-input eof with the unconsumed input available in ::tclsh(inputbuffer); src/buildsuites is tracked in both VCSes with only _build content ignored and the samplesuite1 vendorbuild-prefix residue reconciled (vendorbuild concept retired); bin/AGENTS.md documents the utility naming policy (punk- prefix for punkshell-own utilities; exceptions: external-tool wrappers such as dtplite/sdx/kettle, and getpunk as the intended future cross-platform entry point) and the getzig scriptset and its bin wrapper twins (getzig.cmd/getzig.ps1) are renamed to punk-getzig with the old names removed and references updated.
Goal: src/buildsuites gains its first real, VCS-tracked suite (suite_tcl90) that reproducibly builds the Tcl 9.0 windows runtime from clean sources using only project-managed tooling - a punk-getzig wrapper fetching a pinned zig into untracked bin/tools, with all transient checkouts and outputs under untracked src/buildsuites/_build - and the 2024 TCLSH_PIPEREPL tclMain patch is recovered into the suite in tracked form and rebased onto current Tcl 9 sources, so a suite-built runtime can return to a standard interactive repl after a kit-style main.tcl completes with unconsumed piped input buffered rather than eval'd. The gate default follows the G-103 kit-family policy (2026-07-20): the patched binary is ENABLED unless TCLSH_PIPEREPL=0 (opt-out; the unpatched plain build serves those wanting stock semantics) - and even enabled it is inert for scripts that never set ::tclsh(dorepl): script-arg runs default dorepl to 0 and unconsumed piped input is buffered, not eval'd, so plain scripts behave stock.
Acceptance: from a clean checkout plus a punk-getzig-fetched pinned zig, the suite builds tclsh90s/tclsh90szip from a fresh core-9-0-branch checkout under src/buildsuites/_build with recipe-generated tclUuid.h and tclsh.exe.manifest (no hand-placed files) and the result reports the expected patchlevel; the recovered patch set (piperepl plus the companion tclZipfs/tclCmdIL patches and a notes doc) is tracked in the suite; the rebased piperepl build gates per the G-103 punk-kit policy: with TCLSH_PIPEREPL=0 it behaves identically to the unpatched build on a tty/piped/script-arg matrix, with the gate open (unset or any other value - the default) scripts that never touch ::tclsh(dorepl) still behave stock on the same matrix (script-arg runs default dorepl to 0; unconsumed piped input is buffered in ::tclsh(inputbuffer), not eval'd), and a script setting ::tclsh(dorepl) 1 lands in a live interactive console repl after piped-input eof with the unconsumed input available in ::tclsh(inputbuffer); src/buildsuites is tracked in both VCSes with only _build content ignored and the samplesuite1 vendorbuild-prefix residue reconciled (vendorbuild concept retired); bin/AGENTS.md documents the utility naming policy (punk- prefix for punkshell-own utilities; exceptions: external-tool wrappers such as dtplite/sdx/kettle, and getpunk as the intended future cross-platform entry point) and the getzig scriptset and its bin wrapper twins (getzig.cmd/getzig.ps1) are renamed to punk-getzig with the old names removed and references updated.
## Context
@ -295,14 +295,49 @@ Remaining for acceptance:
- punk-getzig per-version fetch argument, so the wrapper itself can materialize
arbitrary pinned versions into versioned dirs (payload growth needs the 512-byte
spacer check on re-wrap).
- Rebase the piperepl patch onto current core-9-0-branch sources; build a
piperepl-enabled variant; behaviour matrix (TCLSH_PIPEREPL unset == stock on
tty/piped/script-arg forms; =1 with a script setting ::tclsh(dorepl) 1 -> live
interactive console repl after piped eof with unconsumed input in
::tclsh(inputbuffer)).
KIT-DEFAULT POLICY UPDATE (2026-07-20, G-103): with a kit FAMILY the env gating
flips for punk kits - the patch is applied and ENABLED BY DEFAULT there (env
opt-OUT, e.g TCLSH_PIPEREPL=0), while the PLAIN family member carries no patch
for stock semantics. The matrix above still characterizes the patch itself on
the patched binary; restate it in opt-out terms when the variant lands.
- DONE 2026-07-20 (see the Progress increment): piperepl rebase + variant builds +
behaviour matrix. (Acceptance/Goal wording was first aligned to the G-103
kit-default policy at user request - the pre-G-103 text described the 2024
opt-in gating.) Residual user-level check: a true interactive-typing session
on tclsh90spr (tty launch behaves as the normal repl; TCLSH_PIPEREPL=0
likewise) - the automated matrix covers the piped/script-arg forms and the
console-reopen landing, not keystroke-driven use.
- Final clean-checkout re-verification of the whole flow once the above land.
### 2026-07-20 increment: piperepl rebased, gate flipped to G-103 policy, variants built + matrix PASS
- Rebase was clean: the recovered 2024 patch applies to current core-9-0-branch
(9.0.5) tclMain.c with all 8 hunks at offset 4. Tracked as