Browse Source

G-096/G-097 authored: tracked zig buildsuite with piperepl recovery; bin punk- naming sweep

G-096 [proposed]: suite_tcl90 under src/buildsuites (VCS ignore flip, _build
untracked build area, vendorbuild concept retired), punk-getzig rename with
the punk- naming policy documented in bin/AGENTS.md, TCLSH_PIPEREPL patch
recovered into tracked form and rebased. G-097 [proposed]: punk- prefix sweep
for the remaining punkshell-own utilities (bits/runtime/tclargs scriptsets,
selfsign experiment scripts). goals_lint clean.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 5 days ago
parent
commit
15d3d6235c
  1. 8
      GOALS.md
  2. 100
      goals/G-096-zig-buildsuite-piperepl.md
  3. 38
      goals/G-097-bin-utility-naming-sweep.md

8
GOALS.md

@ -345,3 +345,11 @@ Detail: goals/G-094-punkcheck-single-lifecycle.md
### G-095 [proposed] punkcheck concurrent-writer safety: atomic saves and advisory event-scoped locking
Scope: src/modules/punkcheck-999999.0a1.0.tm (save/load chokepoint: atomic rename, lockfile protocol, merge-on-flush, non-interactive recovery), src/make.tcl + src/modules/punk/mix/cli-999999.0a1.0.tm (event-scoped lock consumers as verified), src/tests/modules/punkcheck/testsuites/punkcheck/ (new concurrency suite)
Detail: goals/G-095-punkcheck-concurrent-writer-safety.md
### G-096 [proposed] Tracked zig tcl buildsuite (suite_tcl90) with recovered TCLSH_PIPEREPL kit-repl capability
Scope: src/buildsuites/ (suite_tcl90 new; samplesuite1 sketch reconciliation; VCS ignore flip), src/buildsuites/_build/ (untracked build/source area via existing _build globs), .gitignore + .fossil-settings/ignore-glob, src/scriptapps/bin/ (getzig scriptset rename), bin/ (regenerated punk-getzig wrapper twins, old names retired, AGENTS.md naming policy), bin/tools/ (untracked zig toolchains, existing), TEMP_REFERENCE/2024zig (read-only recovery origin)
Detail: goals/G-096-zig-buildsuite-piperepl.md
### G-097 [proposed] bin utility naming sweep: punk- prefix for remaining punkshell-own tools
Scope: src/scriptapps/ + src/scriptapps/bin/ (bits, runtime, tclargs scriptset renames; selfsign experiment scripts), bin/ (regenerated wrapper twins + renamed experiment scripts, old names retired), src/tests/modules/punk/mix/testsuites/scriptwrap/ + src/tests/shell/testsuites/binscripts/ (roundtrip pins), bin/AGENTS.md + referencing docs
Detail: goals/G-097-bin-utility-naming-sweep.md

100
goals/G-096-zig-buildsuite-piperepl.md

@ -0,0 +1,100 @@
# G-096 Tracked zig tcl buildsuite (suite_tcl90) with recovered TCLSH_PIPEREPL kit-repl capability
Status: proposed
Scope: src/buildsuites/ (suite_tcl90 new; samplesuite1 sketch reconciliation; VCS ignore flip), src/buildsuites/_build/ (untracked build/source area via existing _build globs), .gitignore + .fossil-settings/ignore-glob, src/scriptapps/bin/ (getzig scriptset rename), bin/ (regenerated punk-getzig wrapper twins, old names retired, AGENTS.md naming policy), bin/tools/ (untracked zig toolchains, existing), TEMP_REFERENCE/2024zig (read-only recovery origin)
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.
## Context
- src/buildsuites (2026-07-10 sketch: samplesuite1 with a Tcl-script-style
download_and_build.config carrying SOURCEDOWNLOAD/CONFIGSTART records) is blanket-ignored
in BOTH VCSes today (.gitignore `/src/buildsuites`, .fossil-settings/ignore-glob
`src/buildsuites`) - deliberately untracked while the sketch was non-final. User decision
2026-07-20: buildsuites is the home for build source-pull/recipe declarations ("it was
essentially for this purpose"); this goal makes suite content tracked.
- Untracked build/source area: src/buildsuites/_build (user 2026-07-20: "seems neater to
keep it all under src/buildsuites/_build"). Already covered by the existing _build ignore
globs in both VCSes (git `**/_build/`; fossil `_build` + `*/_build`) - no new ignore
rules needed for it. The sketch's `<PROJECTDIR>/vendorbuild/<suite>` buildprefix and the
root `/vendorbuilds/` ignore entries are retired in its favour.
- The TCLSH_PIPEREPL patch (Aug 2024; c:/buildtcl/2024zig/build_tcl90/patch/
tclMain.c.piperepl.patch + tclMain_piperepl.c, snapshot under git-ignored
TEMP_REFERENCE/2024zig) enables returning to a standard C-level tcl repl after a kit
main.tcl - not possible with unmodified sources (user 2026-07-20). Semantics: gated by
the TCLSH_PIPEREPL env var (unset/0 = stock behaviour); publishes ::tclsh(istty) plus
linked ::tclsh(dorepl)/::tclsh(evalinput); unconsumed piped input accumulates in
::tclsh(inputbuffer) rather than being eval'd (unless evalinput is set - protects
arbitrary piped data from accidental eval); on stdin eof with dorepl set, stdin reopens
from the console (CONIN$ on windows, /dev/tty elsewhere) giving a live standard repl.
Companion patches in the same folder: tclZipfs.patch, tclCmdIL.patch (unexamined).
None of these files are VCS-tracked anywhere - recovery into the suite is the
durability fix.
- Recipe baseline: the validated build provenance in
goals/G-076-tcl9-deadconsole-fix-adoption.md (2026-07-20 entries) - build90.zig /
build905.zig with zig 0.14.0-dev.2074, the fresh-checkout generated-file preconditions
(tclUuid.h from manifest.uuid; tclsh.exe.manifest from its .in with
@TCL_WIN_VERSION@/@MACHINE@), and the 9.0.5+ mingw_unicode_entry_point requirement
(upstream removed TCL_BROKEN_MAINARGS from win/tclAppInit.c).
- getzig today: scriptset src/scriptapps/bin/getzig.{bash,ps1} + getzig_wrap.toml, wrapped
by punk::mix::commandset::scriptwrap::multishell into bin/getzig.cmd (tracked) with a
bin/getzig.ps1 twin. The twin is a deliberate polyglot-launchability artifact - windows
users may start from cmd.exe or powershell - not residue. Fetches zig into bin/tools
(untracked via the existing bin/* globs) with minisign signature material, sourcing
ziglang.org, community-mirrors.txt and the punkbin gitea mirror. bin/tools currently
holds zig 0.15.1/0.15.2/0.16.0-dev toolchains; the known-good recipe used a manual
C:/zig install (0.14.0-dev.2074).
- Toolchain policy (user 2026-07-20, recorded in G-076 and agent memory): zig is the only
build mechanism approved to become part of the punkshell project; msys/mingw and MS
toolchains are test/validation only (MS last resort).
## Approach
- suite_tcl90 tracked layout: the zig recipe (build905.zig lineage, parameterized for
suite paths), patches/ (piperepl + tclZipfs + tclCmdIL + a notes doc carrying the
semantics summary and rebase history), suite README. Transient content under
src/buildsuites/_build/<suite>/ (source checkouts, build prefixes/outputs); fossil
clones stay in the shared ~/.fossils.
- The recipe generates tclUuid.h and tclsh.exe.manifest itself (wrapfiletofile-style
steps) so fresh checkouts build with no hand-placed files.
- Pin an exact zig version retrievable via punk-getzig (punkbin can host the pinned zip);
migrating the recipe from 0.14.0-dev.2074 to the pinned version is in-scope (zig build
API churn), with the validated exact-combo build as fallback per the duplicate-first
policy.
- Naming policy: punk- (hyphenated) prefix approved by user 2026-07-20 over bare punk
concatenation - readable, groups in listings, distinct from the punk*.exe shell-kit
namespace. Applied here to getzig (touched anyway); the sweep of the remaining
punkshell-own utilities is G-097.
- Suite config format stays pragmatic (zig/script files); toml-based suite declarations
remain a G-005-era decision - buildsuites structure beyond what this goal claims is
still non-final.
## Alternatives considered
- `<PROJECTDIR>/vendorbuild/<suite>` as the untracked build area (samplesuite1 sketch +
`/vendorbuilds/` ignores) - retired 2026-07-20 in favour of src/buildsuites/_build:
one area adjacent to the suites, already ignore-covered in both VCSes.
- Upstreaming the piperepl capability instead of carrying a patch - not precluded as a
future path; tracked in-suite recovery is the durability baseline either way and is
required regardless while nothing upstream provides it.
- Folding the bin-wide utility rename sweep into this goal - split to G-097 to keep this
acceptance verifiable and let the sweep wait for a suitable time (user 2026-07-20).
## Notes
- Related goals: G-005 (zig build infrastructure - this suite is its first concrete
increment), G-018 (zig plain tclsh kits), G-006 (prebuilt artifact download consent;
punkbin mirror overlap), G-004 (no committed binaries - untracked bin/tools and _build
align), G-076 (verification-runtime provenance this recipe formalizes), G-038
(punkshell-level piped session continuity - the punk-repl analogue of piperepl), G-060
(qemu cross-platform matrix - see G-097 notes on the windows-sandbox experiments),
G-089 (scriptlib in kits; the scriptapps/bin deployment surface).
- getpunk (naming-policy exception): intended future single-download cross-platform
starting point - run in a new folder, the folder becomes the repo automatically; needs
smarts to pull the repo and then update itself safely without snagging on the now-dirty
repo (user 2026-07-20). The polyglot .cmd/.ps1 twin mechanism serves that
cmd.exe-or-powershell first-contact story and may need review in that light; candidate
goal when picked up.
- The G-076 kill-procedure runtime (zig-out905 under c:/buildtcl/2024zig) predates this
suite; once suite_tcl90 reproduces it, the ad-hoc c:/buildtcl/2024zig builds become
historical reference only.

38
goals/G-097-bin-utility-naming-sweep.md

@ -0,0 +1,38 @@
# G-097 bin utility naming sweep: punk- prefix for remaining punkshell-own tools
Status: proposed
Scope: src/scriptapps/ + src/scriptapps/bin/ (bits, runtime, tclargs scriptset renames; selfsign experiment scripts), bin/ (regenerated wrapper twins + renamed experiment scripts, old names retired), src/tests/modules/punk/mix/testsuites/scriptwrap/ + src/tests/shell/testsuites/binscripts/ (roundtrip pins), bin/AGENTS.md + referencing docs
Goal: the punkshell-own bin utilities beyond getzig - the bits, runtime and tclargs scriptsets and the selfsign experiment scripts - carry the punk- prefix per the naming policy recorded in bin/AGENTS.md (G-096), so a user who adds <project>/bin to their PATH gets collision-resistant names, while external-tool wrappers (dtplite, sdx, kettle) and getpunk stay unprefixed.
Acceptance: bin/ presents punk-bits, punk-runtime and punk-tclargs (wrapper twins where the polyglot system emits them) and punk- prefixed selfsign experiment scripts, with the old names removed; scriptset sources and _wrap.toml configs are renamed to match; the byte-roundtrip pins (scriptwrap multishell runtime roundtrip, binscripts suites as affected) and every doc/script reference to the old names are updated with the affected test suites passing; no behaviour changes ride along with the renames.
## Context
Utilities in bin/ are on a plausible user PATH ("<project>/bin"), so generic names like
bits, runtime and tclargs are collidable. User decision 2026-07-20 (recorded with the
policy statement in G-096): punkshell-own utilities take a punk- prefix; wrappers for
external tools (dtplite, sdx, kettle) stay unprefixed, as does getpunk (already specific,
intended future cross-platform entry point). getzig itself is renamed within G-096; this
goal sweeps the remainder at a suitable time (user 2026-07-20: the renames "can wait").
Current inventory (2026-07-20): bits and tclargs are wrapped scriptsets (sources in
src/scriptapps/, e.g. bits.pl/bits.ps1/bits.sh + bits_wrap.toml; outputs bin/bits.cmd +
twins), runtime's scriptset lives in src/scriptapps/bin/ (bin/runtime.cmd pinned
byte-for-byte by the scriptwrap multishell roundtrip test; bin/AGENTS.md carries its
fetch/selection contract), and the selfsign material is loose experiment scripts
(bin/selfsign.ps1, selfsign1.ps1, selfsign_test1.{bat,ps1},
create-localmachine-selfsigned-cert.ps1 + exported cert).
## Notes
- bits background (user 2026-07-20): Windows Sandbox experiments for starting things on a
clean machine. Windows Sandbox differs from a true fresh windows install but remains a
reasonable initialization proving ground if automatable; qemu may be the better target
for full cross-platform testing (G-060). bits is kept regardless of sweep timing.
- selfsign experiments likewise kept (user 2026-07-20); rename only, no productization
implied by this goal.
- runtime.cmd has the widest blast radius: the scriptwrap roundtrip pin
(src/tests/modules/punk/mix/testsuites/scriptwrap/multishell.test
scriptwrap_runtime_cmd_roundtrip_no_drift), the bin/AGENTS.md runtime fetch/selection
contract section, and runbook references - all updated as part of the rename.
- Related goals: G-096 (policy home + getzig rename), G-060 (qemu test matrix), G-089
(scriptlib/kit deployment surface).
Loading…
Cancel
Save