Activated per user direction; activated goal flipped proposed -> active (overlap
survey re-run at activation; new Related: G-016 - sibling json round-trip
consumer. G-042/G-019/G-061/G-110/G-167/G-171 deliberate non-overlap).
::punk::path gains three options:
- -return text|dict|json (default table, byte-unchanged): the structured modes
build an ordered entry list from the shared collect dicts
(d_path_info/d_bin_info/d_index_executables) and serialise without
ANSI/textblock. text is a fixed-key plain-ASCII layout; dict returns a Tcl
dict; json is emitted via tcllib json::write (the preferred encoder settled
by the runtests json_emit hardening) so booleans/counts are bare JSON
numbers/1-0 and the decoded form equals the dict form byte-for-byte.
- -context <namespace> (default the caller's namespace): makes the
TCL-context conflict verdict stable for a machine consumer invoked through
a wrapper.
- -conflicts 0|1 (default 1): skip conflict computation for a small perf win.
The table render is kept verbatim (byte-identical default output). The
structured modes use a clean exact|nocase conflict classification
(path_conflicts_for_exe) independent of the table render's ANSI path. A
duplicate-path entry now reports the original's exe_count with an empty
executables list (mirroring the table column).
PUNKARGS argdoc updated; new options documented (whatis -doc punk::path shows
the synopsis + per-option help + choices).
Tests: src/tests/modules/punk/pathcmd/testsuites/tests/pathcmd.test (7 tests:
dict shape, duplicate/overshadowed fields, json ansi-freeness + round-trip
parity, text ansi-freeness, -context stability, -conflicts 0, default-table
still ANSI). Passes on Tcl 9.0.5 and Tcl 8.6. Existing punk::path module tests
(path.test, 67) unchanged/green.
Versioning: punk module buildversion 0.2.8 -> 0.3.0 (minor - new user-visible
options on ::punk::path); punkproject.toml 0.57.1 -> 0.58.0 (minor - new
user-visible shell behaviour) + CHANGELOG entry. goals_lint clean;
projectversion OK.
Assisted-by: harness=pi; primary-model=zai-org/GLM-5.2; api-location=huggingface.co
Drafted per the proposal-first goals workflow (overlap survey run this session:
goals_xref.tcl paths over src/modules/punk-999999.0a1.0.tm,
src/tests/modules/punk/path, src/tests/testsupport/json_emit.tcl; cross-refs
recorded to G-064 sibling surface, G-049 established the -return dict pattern).
Status proposed; not activated.
The goal adopts tcllib json::write as the preferred JSON encoder for the
punk::path -return json mode - the decision surfaced by the runtests json_emit
hardening committed just prior (f70aa632 / fossil bda7f0cc), which closed a
defect class in a hand-rolled emitter and confirmed json::write is robust.
goals_lint: clean (82 active-index goals, 91 archived).
Assisted-by: harness=pi; primary-model=zai-org/GLM-5.2; api-location=huggingface.co