Browse Source

punk::mod 0.1.2: version-aware punk::apps latest selection (audit fix)

User-requested audit of naive [package versions] selection: punk::apps'
appinfo 'latest' used a plain lexical lsort (misorders 1.10 vs 1.9) AND
took lindex 0 - the LOWEST version - as latest (the '#todo - natsort!'
site). Now lsort -command {package vcompare} taking the highest, with
empty (unversioned-main) entries excluded before comparison since
vcompare errors on empty operands; only-unversioned yields latest "".

Audit sweep results: every other punk-owned consumer already sorts with
vcompare (punk::lib repl/udp checks, libunknown, repl autocomplete,
loadedlib copy/promote, punk_main/project_main starkit selection - the
latter even carries the 'package versions does not always return
versions in increasing order!' warning comment); packagepreference's
uses are mappings/exact-pins, not max-picks. Naive sorts remain only in
VENDORED third-party code (tcllib doctools docidx/doctoc/doctools.tcl,
vendormodules pattern-1.2.8.tm:267) - flagged, not edited, per the
vendorlib no-edit policy. Project 0.18.9.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 6 days ago
parent
commit
cf8449e4c9
  1. 4
      CHANGELOG.md
  2. 2
      punkproject.toml
  3. 14
      src/modules/punk/mod-999999.0a1.0.tm
  4. 3
      src/modules/punk/mod-buildversion.txt

4
CHANGELOG.md

@ -5,6 +5,10 @@ The latest `## [X.Y.Z]` header must match the `version` field in `punkproject.to
Entries are newest-first; one bullet per notable change. See the root `AGENTS.md`
"Project Versioning" section for the bump policy.
## [0.18.9] - 2026-07-22
- punk::mod 0.1.2: punk::apps `latest` app-version selection fixed (version-selection audit) - a plain lexical sort picked the LOWEST version as latest (and misorders 1.10 vs 1.9); now `package vcompare`-sorted highest, empty unversioned-main entries excluded. Audit outcome: all other punk-owned `[package versions]` consumers already sort with vcompare; naive sorts remain only in vendored third-party code (tcllib doctools, pattern-1.2.8.tm) - flagged, not edited, per the vendor no-edit policy.
## [0.18.8] - 2026-07-22
- `bin/punk-runtime.cmd` `list -remote`: remote-only rows skip support files (artifact metadata tomls etc now ride in the server's sha1sums beside runtimes - same extension set the local candidate filter excludes); the `(= server default)` active marker also recognizes a materialized working copy via its beside-toml artifact identity (the default names an immutable `-r<N>` artifact while the active is typically its working name - exact-name matching alone would never fire post-family). Verified live against the first published family artifacts.

2
punkproject.toml

@ -1,4 +1,4 @@
[project]
name = "punkshell"
version = "0.18.8"
version = "0.18.9"
license = "BSD-2-Clause"

14
src/modules/punk/mod-999999.0a1.0.tm

@ -71,12 +71,16 @@ namespace eval punk::mod::cli {
}
}
dict set appinfo versions $versions
#todo - natsort!
set sorted_versions [lsort $versions]
set latest [lindex $sorted_versions 0]
if {$latest eq "" && [llength $sorted_versions] > 1} {
set latest [lindex $sorted_versions 1]
#version-aware selection (2026-07-22 audit): was a plain lexical lsort
#(1.10 sorts before 1.9) with lindex 0 - the LOWEST - as 'latest'.
#Empty version (unversioned main) is excluded from comparison (package
#vcompare errors on empty operands); latest = highest by vcompare.
set realversions {}
foreach v $versions {
if {$v ne ""} {lappend realversions $v}
}
set sorted_versions [lsort -command {package vcompare} $realversions]
set latest [lindex $sorted_versions end] ;#"" when only an unversioned main exists
dict set appinfo latest $latest
dict set appinfo bases $bases

3
src/modules/punk/mod-buildversion.txt

@ -1,3 +1,4 @@
0.1.1
#First line must be a semantic version number
#all other lines are ignored.
#all other lines are ignored.
#0.1.2 - punk::apps appinfo 'latest' selection fixed (2026-07-22 version-selection audit): was a plain lexical lsort (1.10 before 1.9) taking lindex 0 - the LOWEST - as latest; now lsort -command {package vcompare} taking the highest, with empty (unversioned-main) entries excluded from comparison (vcompare errors on empty operands).
Loading…
Cancel
Save