Tree:
3abfe674fa
master
v0.1a
${ noResults }
2 Commits (3abfe674fa23fcaae7ec8a71e9c1e6ddcd99775c)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
3abfe674fa |
punk::args 0.26.0: bound received-value display in validation error messages (G-151 follow-on)
Serves the engine's 'truncate/summarize values in error messages' todo (G-151 lean 5, explicitly deferred from that goal's acceptance). New private::error_display_value wraps the G-151 report_display_value / ansistring TRUNCATE machinery (string mode: single-line-ize with visible control/ANSI rendering, then grapheme-cap with '...' plus ' (len N)') and is applied at every site interpolating a received word into a validation error message: the check_clausecolumn type/size/range/regexprefail reports, the leaders/values allocation-rejection and choiceviolation/ ambiguous-prefix sites, the multi-value clause echo, the -allow_ansi character-view (previously unbounded ansistring VIEW), and the Unexpected-option unknown-flag word. Width cascade: definition-level '@cmd -reportvaluewidth' > built-in 48; 0 = no cap (define -help documents the extension). Display-only: -badarg/-badval errorcode fields keep the raw words. Safety properties: a short plain value (within budget, no C0/C1/DEL content) displays byte-identical via a cheap fast path - important both for the existing message pins (all held unchanged) and because check_clausecolumn builds candidate messages for type alternatives that may never be raised; and the helper catches-and-degrades to the plain non-ansistring fallbacks, since punk::ansi loaded without punk::lib dies in ansistring TRUNCATE (RANGE calls punk::lib::lindex_resolve) - an error message must never die on its display helper. parse_report's own value cells retain that uncaught exposure (pre-existing, success-side). validation.test +4 pins (long-value truncation with raw -badval retention, multiline single-line-ization, @cmd -reportvaluewidth cap, unexpected-option word truncation with raw -badarg retention). Args subtree 415/0 on tclsh90s (9.0.5) and tclsh86ts; full suite at the recorded 13-failure environment baseline (maketclhelp re-verified 12/12 with a real tclsh on PATH). Minted modules/punk/args-0.26.0.tm. Project version 0.66.1 (patch: kit-shipped error-display behaviour) with CHANGELOG entry; G-151 archive follow-on disposition flipped to landed. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com |
1 day ago |
|
|
b0c92567a3 |
G-151 achieved: punk::args::parse_report landing report + ansistring TRUNCATE (args 0.18.0, ansi 0.2.0)
User-directed activation and implementation in one arc (proposed -> active at
the user's word with the activation-freshness overlap survey recorded, ->
achieved + archived on acceptance).
punk::args 0.18.0 - new parse_report: the annotated SUCCESS render (the
arg_error usage table's success-side sibling). One row per value-holding
argument (received, or -default in effect) in declaration-section order
(leaders, opts, values), columns Argument | Source | Value; Source carries
received / received xN / default (the plain-mode twin of the colour marking:
CLR(check)/CLR(parsekey_hint)); absent optionals get no row. Entry forms per
acceptance: a punk::args::parse result dict, or '<arglist> withid <id>' (the
parse is performed first - a rejected line raises the same validation error
parse would; errorcode parity pinned). Returns: table (bordered textblock
block, default), tableobject, string (plain lines; also the degraded
no-textblock path), dict (machine form - never elided). The canonical
demonstration pinned: {build punk95 -confirm 0} lands
'args (received x2) = -confirm 0' - a flag-like word consumed as a VALUE
visibly attributed to its consuming argument (the make.tcl dry-run
'kitname = punk91 -confirm 0' class from the G-143 sessions).
Display elision is type-aware, deterministic, always marked: strings
single-line-ized (ansistring VIEW -lf 1 -vt 1 -sp 0 - controls and embedded
ANSI render visibly so a value cannot disturb the table, real spaces stay
real) then grapheme-capped with '...' + ' (len N)'; -multiple/-type list
values element-capped '(+N more)'; -type dict values pair-capped
'(+N pairs)'. Width cascade per the G-149 plumbing precedent: caller
-valuewidth > new @cmd directive key -reportvaluewidth (documented in
define -help) > built-in 48; 0 = no cap; never console-derived (the G-007
emit-then-query lesson). Row data rides the G-049
private::parse_status_build structure - no second status assembler;
display-level bridging recovers the value-in-effect across the parse
result's storage-key folds (-parsekey renames, aliased optionsets'
last-|-member finalopts fold) so received aliased args keep their row -
engine-level rationalization recorded as a G-084 follow-on disposition.
The registered two-form definition (parsed/withid) follows parse_status's
structure - per-form @leaders first, then the shared @opts via a re-widened
@form selection (the resolver rejects leaders declared after a form's
options).
punk::ansi 0.2.0 - new ansistring TRUNCATE ?-ellipsis marker? string
maxgraphemes (design lean 4: the ANSI/grapheme-safe truncate primitive
homes in ansistring beside RANGE/VIEW): fits => byte-identical passthrough
(trailing and non-SGR codes included); truncation => RANGE-extracted prefix
(merged SGR re-application per the contract documented at 0.1.4) + marker
totalling exactly maxgraphemes, with an SGR reset appended before the
marker when the prefix carries codes; the marker is charged against the
budget and itself truncated when it alone meets/exceeds it; maxgraphemes 0
=> empty string. Grapheme-count based (column-aware variant a recorded
follow-on). Strict option handling (deliberately unlike VIEW's pinned
silent tolerance). Ensemble export + PUNKARGS argdoc + doctools comment.
Tests: new args/parsereport.test (13 - canonical attribution, entry
parity, dict shape/row order/row policy, solo+multi xN multiplicity,
per-type elision markers, dict-never-elided, width cascade,
single-line-ization, alias bridging, bordered/tableobject renders, failure
parity, bad calls, own-definition render); ansi/ansistring.test +2
TRUNCATE pins (budget/passthrough/errors; ANSI-reset + CJK +
combining-cluster safety). Full punk/args subtree 331 passed / 3
pre-existing skips / 0 failed and punk/ansi subtree 73/73 - each on native
tclsh90 (9.0.3) AND tclsh87; failure-side rendering unchanged per
acceptance. Minted modules/punk/args-0.18.0.tm + ansi-0.2.0.tm via
make.tcl modules; bootsupport/vfscommon promotion left to the next cycle -
make.tcl keeps its interim one-line report (and its 4-copy 'no annotated
success render yet' comment) until the promotion-gated follow-on lands.
Goals: G-151 entry moved to GOALS-archive.md, detail file to goals/archive/
with verification evidence and 5 Follow-on lines (make.tcl interim-report
retirement open; arg_error value-truncation via the same helpers open;
storage-key rationalization => goal G-084; column-aware TRUNCATE open;
word-oriented inverse view open). Activation-survey Related: lines recorded
(G-166, G-084, G-167 back-pointer); reference sweep updated G-170
(sequencing lean honoured - its dry-run arm consumes this render), G-167
archive marker, G-084 back-pointer note. src/tests/modules AGENTS.md
punk/args + punk/ansi bullets extended. goals_lint clean (83 active / 87
archived).
Claude-Session: https://claude.ai/code/session_0156PuejSCGjgeGb7jiABrDU
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
|
5 days ago |