From c4d948f97567a5d04b3bf322696831708f0d737b Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Wed, 22 Jul 2026 13:17:48 +1000 Subject: [PATCH] defaults.txt: curated per-platform recommended default fetch runtime The default a no-name 'punk-runtime fetch' retrieves is a release DECISION, so it lives on the artifact server as hand-curated data (never generated) - updated in the same change-set that publishes the artifact it points at, taking effect for every deployed punk-runtime immediately with no punkshell release. src/build_sha1sums.tcl validates entries (warns on unknown platforms / missing artifact files) so the publish and the recommendation cannot drift silently. Seeded from the values previously baked into punk-runtime's payloads, with one correction those baked values got WRONG: linux-arm's actual artifact is tclkit-9.0.2-Linux64-arm-dyn (dotted), not the baked tclkit-902-Linux64-arm-dyn - a no-name fetch on linux-arm has been broken until now, which is the config-in-code failure mode this file removes. freebsd-x86_64 deliberately has no line (its only artifact is a legacy 8.5-era kit, not a recommendation). Documented in AGENTS.md Local Contracts with the release process. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com --- AGENTS.md | 10 ++++++++++ defaults.txt | 14 ++++++++++++++ src/build_sha1sums.tcl | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 defaults.txt diff --git a/AGENTS.md b/AGENTS.md index 6dc7f77..1d4f29a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,16 @@ This artifact repository is specific to the punkshell project. for raw-file consumers that have no directory-listing capability (`punk-runtime.cmd platforms -remote`, and third-party mirrors using the same layout should carry the same file). Regenerated by `src/build_sha1sums.tcl`. +- `defaults.txt` at the repo root is the CURATED per-platform recommended default + fetch runtime (` ` per line; `#` comments/blanks + ignored) consulted by `punk-runtime.cmd fetch` when no runtime name is given. + Hand-edited, never generated - it records a release DECISION. The release + process: publish the artifact (add, `git add`, run `src/build_sha1sums.tcl`), + then point the platform's `defaults.txt` line at it IN THE SAME CHANGE-SET - + the script validates entries (warns on unknown platforms or missing artifact + files) so drift between the halves is caught. A platform with no line has no + recommendation (punk-runtime tells the user to name a runtime explicitly). + Mirrors may curate their own recommendations. - Every platform folder (and tool subfolder) carries a `sha1sums.txt` with one ` *` line per artifact (binary-mode marker `*`). - `sha1sums.txt` (and `platforms.txt`) are regenerated with diff --git a/defaults.txt b/defaults.txt new file mode 100644 index 0000000..699f500 --- /dev/null +++ b/defaults.txt @@ -0,0 +1,14 @@ +#recommended default fetch runtime per platform - CURATED BY HAND (not generated). +#punk-runtime 'fetch' with no runtime name consults this file for the resolved +#platform. Update as part of the release/publication change-set: publish the +#artifact, then point the platform's line at it (immutable -r artifact names +#once family runtimes publish). Format: , one per line; +#'#' comments and blanks ignored. src/build_sha1sums.tcl warns about entries +#naming unknown platforms or missing artifact files. +#(platforms with no line here have no recommended default - punk-runtime tells +#the user to name a runtime explicitly, e.g. freebsd-x86_64's only artifact is +#a legacy 8.5-era kit not suitable as a recommendation.) +win32-x86_64 tclsh902z.exe +linux-x86_64 tclkit-902-Linux64-intel-dyn +linux-arm tclkit-9.0.2-Linux64-arm-dyn +macosx tclkit-902-Darwin64-dyn diff --git a/src/build_sha1sums.tcl b/src/build_sha1sums.tcl index 2ef72d1..9411dc7 100644 --- a/src/build_sha1sums.tcl +++ b/src/build_sha1sums.tcl @@ -145,4 +145,44 @@ if {$new_platforms ne $existing_platforms} { } else { puts stderr "platforms.txt unchanged ([llength $new_platforms] platforms)" } + +#defaults.txt validation - the file itself is CURATED BY HAND (a release +#recommendation, not derivable facts - deliberately never generated here). +#Warn when an entry names a platform this run did not serve or an artifact +#file that does not exist: the release process is 'publish artifact + edit +#defaults.txt in one change-set', and this check catches the halves drifting. +set defaultsfile [file join $basedir defaults.txt] +if {[file exists $defaultsfile]} { + set fd [open $defaultsfile r] + set dcount 0 + set dwarn 0 + set dln 0 + foreach ln [split [read $fd] \n] { + incr dln + set trimln [string trim $ln] + if {$trimln eq "" || [string index $trimln 0] eq "#"} {continue} + if {[llength $trimln] != 2} { + puts stderr "${Y}WARNING: defaults.txt line $dln: expected ' ' - got: $trimln$RST" + incr dwarn + continue + } + lassign $trimln dplat dname + incr dcount + if {$dplat ni $new_platforms} { + puts stderr "${Y}WARNING: defaults.txt line $dln: platform '$dplat' is not a served platform folder$RST" + incr dwarn + } elseif {![file exists [file join $basedir $dplat $dname]]} { + puts stderr "${Y}WARNING: defaults.txt line $dln: default '$dname' does not exist in $dplat/$RST" + incr dwarn + } + } + close $fd + if {$dwarn} { + puts stderr "${Y}defaults.txt: $dcount entries, $dwarn warning(s)$RST" + } else { + puts stderr "defaults.txt: $dcount entries OK" + } +} else { + puts stderr "${Y}no defaults.txt found - punk-runtime no-name fetch will have no server recommendation$RST" +} cd $original_cwd