Browse Source

_vfscommon.vfs: refresh built punk modules to current versions

make.tcl vfscommonupdate output batched per src/AGENTS.md build-output
policy: punk::ansi 0.1.2 -> 0.1.3, punk::args 0.12.0 -> 0.12.3,
punk::lib 0.4.3 -> 0.5.0, punk::ns 0.5.0 -> 0.8.0, punk::repl
0.5.1 -> 0.5.2.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
e8cc18962e
  1. 21
      src/vfs/_vfscommon.vfs/modules/punk/ansi-0.1.3.tm
  2. 1423
      src/vfs/_vfscommon.vfs/modules/punk/args-0.12.3.tm
  3. 99
      src/vfs/_vfscommon.vfs/modules/punk/lib-0.5.0.tm
  4. 1476
      src/vfs/_vfscommon.vfs/modules/punk/ns-0.8.0.tm
  5. 9
      src/vfs/_vfscommon.vfs/modules/punk/repl-0.5.2.tm

21
src/vfs/_vfscommon.vfs/modules/punk/ansi-0.1.2.tm → src/vfs/_vfscommon.vfs/modules/punk/ansi-0.1.3.tm

@ -7,7 +7,7 @@
# (C) 2023
#
# @@ Meta Begin
# Application punk::ansi 0.1.2
# Application punk::ansi 0.1.3
# Meta platform tcl
# Meta license <unspecified>
# @@ Meta End
@ -16,7 +16,7 @@
# doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[manpage_begin punkshell_module_punk::ansi 0 0.1.2]
#[manpage_begin punkshell_module_punk::ansi 0 0.1.3]
#[copyright "2023"]
#[titledesc {Ansi string functions}] [comment {-- Name section and table of contents description --}]
#[moddesc {punk Ansi library}] [comment {-- Description at end of page heading --}]
@ -1336,6 +1336,8 @@ tcl::namespace::eval punk::ansi {
@leaders -min 0 -max 0
@opts
#2026-07-14 Agent-Updated: summarydict choicelabel corrected - the linemap key is ALWAYS present
#(the old text claimed -n-only; behaviour pinned in tests ansi/grepstr.test)
-r|-return -mash true -type string -typesynopsis matched|all -default breaksandmatches -choicecolumns 1 -choices {matched all breaksandmatches summarydict} -choicelabels {
"matched"\
" Return only lines that matched."
@ -1350,13 +1352,12 @@ tcl::namespace::eval punk::ansi {
indicator after the linenumber will only be highlighted for lines with matches,
and the following matchcount will indicate zero for non-matching lines."
"summarydict"\
" Return a summary dict with keys 'matches', 'matchlines' and 'totallines' giving
the count of matched patterns, lines with matches and total number of lines
respectively.
If -n is also supplied, the summary dict will also include a 'linemap' key
with a dict value mapping line numbers (1-based) to match counts for each line.
This allows the caller to determine which lines had matches and how many
matches each line had, without returning the matched lines themselves.
" Return a summary dict with keys 'matches', 'matchlines', 'totallines' and
'linemap' giving the count of matched patterns, lines with matches, total
number of lines, and a dict mapping line numbers (1-based) to match counts
for each line respectively.
The linemap allows the caller to determine which lines had matches and how
many matches each line had, without returning the matched lines themselves.
"
}
-B|--before-context= -parsekey "--before-context" -default 0 -type integer -typesynopsis num
@ -13640,7 +13641,7 @@ namespace eval ::punk::args::register {
## Ready
package provide punk::ansi [tcl::namespace::eval punk::ansi {
variable version
set version 0.1.2
set version 0.1.3
}]
return

1423
src/vfs/_vfscommon.vfs/modules/punk/args-0.12.0.tm → src/vfs/_vfscommon.vfs/modules/punk/args-0.12.3.tm

File diff suppressed because it is too large Load Diff

99
src/vfs/_vfscommon.vfs/modules/punk/lib-0.4.3.tm → src/vfs/_vfscommon.vfs/modules/punk/lib-0.5.0.tm

@ -8,7 +8,7 @@
# (C) 2024
#
# @@ Meta Begin
# Application punk::lib 0.4.3
# Application punk::lib 0.5.0
# Meta platform tcl
# Meta license BSD
# @@ Meta End
@ -18,7 +18,7 @@
# doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[manpage_begin punkshell_module_punk::lib 0 0.4.3]
#[manpage_begin punkshell_module_punk::lib 0 0.5.0]
#[copyright "2024"]
#[titledesc {punk general utility functions}] [comment {-- Name section and table of contents description --}]
#[moddesc {punk library}] [comment {-- Description at end of page heading --}]
@ -292,7 +292,7 @@ tcl::namespace::eval punk::lib::check {
if {$replversion eq ""} {
#not loaded - determine what version would be provided, without loading it:
#an unsatisfiable require triggers the package unknown scan (registering ifneeded
#scripts) then fails before any load (0.4.3 dev modules are alpha - below 999999).
#scripts) then fails before any load (0.5.0 dev modules are alpha - below 999999).
catch {package require punk::repl 999999}
set available [package versions punk::repl]
if {[llength $available]} {
@ -307,6 +307,97 @@ tcl::namespace::eval punk::lib::check {
return [dict create bug $bug bugref f10d91c2d3 description $description level major mitigated $mitigated mitigation $mitigation]
}
#pure classifier, separated for testability - facts in, verdict out.
#The bug's signature is a MIXTURE within one switch: the default arm reports its
#single command arm-relative (line 2 of the arm script) while arm 1 reports it
#shifted by (line of the switch command within its containing script - 1), which
#is 3 in the probe layout below. A self-consistent upstream fix of either flavour
#(uniform arm-relative, or uniform container-relative) breaks the signature and
#reports no bug - if upstream instead changes attribution semantics some other
#way, revisit this classifier.
proc tclbug_nestedswitch_tracelines_signature {arm1line defaultline} {
return [expr {$defaultline == 2 && $arm1line == 3}]
}
proc has_tclbug_nestedswitch_tracelines {} {
#Execution-trace line mis-attribution for nested single-block switch arm bodies.
#https://core.tcl-lang.org/tcl/tktview/5d5b1052280c976ea3d4 (reported by punkshell author 2025-11-10)
#For a proc without source-line correlation (e.g dynamically defined - also the regime
#module-loaded punkshell procs trace in), an arm body whose index into the split
#pattern/body list lands on a LITERAL word of the switch command (an option word, --,
#or the block itself) reports enterstep/info-frame lines shifted by (line of the switch
#command within its containing script - 1) - attributed as if the arm body began at the
#switch command's line. Arms whose index lands on a dynamic word or beyond the command's
#word count report correctly arm-relative - so WHICH arms mismark varies with the option
#words used. Verified identical on Tcl 8.6.17 / 8.7a6 / 9.0.3 (2026-07-14).
#Standalone repro/write-up: scriptlib/developer/tcl_switch_traceline_repro.tcl
#
#Behavioural probe (no version gate needed - detection flips automatically when a fixed
#Tcl runtime is in use): a dynamically-defined proc with a nested 'switch -- $c {...}'
#is enterstep-traced once for arm 1 and once for the default arm, and the reported lines
#are matched against the characterized wrong/right signature (see the classifier above).
#
#Followup when upstream fixed (this check starts reporting bug 0 on a new Tcl release):
# - re-verify with scriptlib/developer/tcl_switch_traceline_repro.tcl on that runtime
# - flip the GAP pins in test suite ns/cmdtrace.test
# (cmdtrace_marks_nested_upstream_mismark_GAP and the fixed-canary test there)
# - update the punk::ns::cmdtrace argdoc caveat that cites the ticket
# - note the fixed-in version here
#Consumers: punk::ns::cmdtrace switch-arm line marking accuracy; 'help tcl' warning report.
set pname [namespace current]::Nestedswitch_traceline_probeproc
set lvar [namespace current]::Nestedswitch_traceline_probelines
#the body must be passed via a variable so the probe proc has no source-line
#correlation (the absolute-source regime does not exhibit the mis-attribution)
#inner switch is the 4-word shape (switch -- $string <block>): per the law, split-list
#body indices 1 and 3 are affected (they land on the literal -- and block words), so the
#middle arm exists purely to push the default arm's body to index 5 - beyond the switch
#command's word count and therefore correctly arm-relative. (A 2-arm probe would put the
#default body at index 3 and BOTH arms would mismark - hiding the signature.)
set probebody {
switch -- [string index $s 0] {
a {
switch -- [string index $s 1] {
1 {
llength probemark
}
2 {
llength probeunused
}
default {
llength probemark
}
}
}
default {}
}
}
proc $pname {s} $probebody
set $lvar [list]
set handler [list ::apply [list {pname lvar args} {
set f [::tcl::info::frame -2]
if {[dict exists $f proc] && [dict get $f proc] eq $pname && [dict exists $f cmd]} {
if {[string match "llength probemark*" [dict get $f cmd]]} {
catch {lappend $lvar [dict get $f line]}
}
}
}] $pname $lvar]
set bug 0
try {
trace add execution $pname enterstep $handler
$pname a1 ;#inner arm 1
$pname a9 ;#inner default arm
lassign [set $lvar] arm1line defaultline
if {$arm1line ne "" && $defaultline ne ""} {
set bug [tclbug_nestedswitch_tracelines_signature $arm1line $defaultline]
}
} finally {
catch {trace remove execution $pname enterstep $handler}
catch {rename $pname ""}
catch {unset $lvar}
}
set description "Execution traces on a nested single-block switch mis-attribute lines for the arm bodies\nwhose split-list index lands on a literal word of the switch command (options/--/block):\nthose arms report lines as if their body began at the switch command's line, while other\narms report correctly arm-relative. Debug/trace tooling line markers (e.g punk::ns::cmdtrace)\nare wrong for the affected arms - which arms are affected varies with the switch options used."
return [dict create bug $bug bugref 5d5b1052280c976ea3d4 description $description level medium]
}
#has_libbug_* procs report bugs in bundled/vendored library packages rather than the Tcl core.
#They are surfaced through the same 'help tcl' warning report as the has_tclbug_* checks.
@ -9238,7 +9329,7 @@ namespace eval ::punk::args::register {
package provide punk::lib [tcl::namespace::eval punk::lib {
variable pkg punk::lib
variable version
set version 0.4.3
set version 0.5.0
}]
return

1476
src/vfs/_vfscommon.vfs/modules/punk/ns-0.5.0.tm → src/vfs/_vfscommon.vfs/modules/punk/ns-0.8.0.tm

File diff suppressed because it is too large Load Diff

9
src/vfs/_vfscommon.vfs/modules/punk/repl-0.5.1.tm → src/vfs/_vfscommon.vfs/modules/punk/repl-0.5.2.tm

@ -582,7 +582,12 @@ proc repl::start {args} {
interp eval code {
namespace eval ::punk::repl::codethread {}
set ::punk::repl::codethread::is_running 1
namespace eval ::punk::nav::ns::ns_current {}
#2026-07-14 Agent-Updated: this previously namespace-eval'd the full
#ns_current VARIABLE name, creating a stray namespace of that name in
#every code interp (visible as a phantom child in n/ listings of the
#nav namespace). Only the parent namespace needs to exist for the
#variable set below. Guarded by tests repl/nscurrent.test.
namespace eval ::punk::nav::ns {}
set ::punk::nav::ns::ns_current %ns1%
}
}]
@ -4525,7 +4530,7 @@ namespace eval ::punk::args::register {
package provide punk::repl [namespace eval punk::repl {
variable version
set version 0.5.1
set version 0.5.2
}]
#repl::start $program_read_stdin_pipe
Loading…
Cancel
Save