Browse Source
G-084 (punk::args 0.23.0) increment 1 - parsekey completeness part 1:
Value -parsekey is now supported (was: accepted at define time but aborted
parse). A value record declaring -parsekey renames its result `values` slot
and its `received` key to the parsekey (e.g `@values {v1 -parsekey renamed
-type string}` parses `hello` to `values={renamed hello}`, `received` keyed
by `renamed`), and -multiple value members collect under the parsekey (the
`variable` setvalues form `?name value...?` pairs collect under `name_value`
- the motivating caller that carried the `#todo - fix -parsekey for leaders
and values` moduledoc comment).
Implementation: VAL_DEFAULTS and the values_dict init/storage are keyed by
parsekey (matching the already-parsekey-keyed VAL_REQUIRED); a new
api_valnames_received list tracks the parsekey (the internal valnames_received
stays argname-keyed for the -multiple first/continuation gate and G-053
occurrence enforcement); api_valnames_received drives the
required-satisfaction check and the received dict; a per-form
val_pk2name/leader_pk2name reverse map lets the valmin clause-length fallback
and the post-parse validation loop resolve a parsekey back to its argname
for ARG_INFO/arg_checks lookups.
-parsekey on a leader is now REJECTED at define time with a clear message
(was: silently ignored) - no live caller uses a leader -parsekey, so the
goal's no-silent-ignore contract is met by rejection rather than parallel
hot-path surgery; the dead req_name derivation in the leaders resolve branch
is removed. The @values directive line still rejects -parsekey (a
group-default parsekey is not a feature; per-arg value -parsekey is).
The defaulted-members precedence rule for a shared-parsekey group (none
received) is now documented as last-defined-member-wins (deterministic in
definition order) and the in-code `? review` is removed.
parsekey.test: the value GAP flipped to parsekey_value_result_key_settled,
the leader GAP flipped to parsekey_leader_parsekey_rejected, the @values-line
GAP split to parsekey_values_line_rejects_parsekey; the defaults GAP flipped
to a settled pin (parsekey_shared_key_member_defaults).
dev/parsekey-knownbugs.test: the value and leader disabled pins retired
(settled in parsekey.test); the cross-member -multiple accumulation pin
remains (increment 3, pending the design decision).
Full punk/args suite 399/0 (1 skipped), punk/ns 125/125, broader punk sweep
989/0. Cross-member -multiple collection (inc 3) and the parse_report/
parse_status received-attribution display gap (inc 2) remain.
Assisted-by: harness=pi; primary-model=huggingface/zai-org/GLM-5.2; api-location=huggingface.co
master
7 changed files with 121 additions and 85 deletions
Loading…
Reference in new issue