Skip to content

spec(0.10.0): §3.5 — param_index is the ordinal among the template's whole-token wildcards; a producer MUST bind one param to each - #18

Merged
coderoast-dev merged 1 commit into
mainfrom
spec/param-index-is-the-whole-token-wildcard-ordinal
Oct 4, 2026
Merged

coderoast-dev merged 1 commit into
mainfrom
spec/param-index-is-the-whole-token-wildcard-ordinal

Conversation

@coderoast-dev

Copy link
Copy Markdown
Collaborator

What

SPEC.md §3.5 called param_index a "0-based wildcard position". This PR makes the binding between a template's wildcards and its params exact:

  • the example's comment now reads "0-based ordinal among the template's tokens that are exactly the wildcard";
  • one paragraph after the example adds a producer MUST:

A producer MUST emit exactly one param for every template token that is the wildcard, in token order, and none for a wildcard inside a token, which is a normalization.

followed by two worked readings ("GET <*> -> <*>"; "fetch cache/<*> took <*> ms", whose only param is the duration).

CHANGELOG.md records it under 0.10.0 (still unreleased) › Changed, and the 0.10.0 headline lists it among the breaking items.

Why

  • "Wildcard position" is ambiguous once a normalization writes a wildcard inside a token (a path segment, a bracketed index). Counting every wildcard puts param i on a slot that carries no value; a consumer reading the value's neighbours from the template (to render it back, or to read a unit written after it) reads the wrong slot.
  • The reference producer broke the reading the other way too: it emitted no param for a whole token its normalization reduced to the bare wildcard (a dashed UUID standing alone), so every index after it pointed one slot early. It adopts this rule in the same release.
  • With the rule, a template's arity is a function of its text, and (template_id, param_index) names one column on every document.

Change class

Breaking: a producer emitting a param for a wildcard inside a token, or none for a whole-token wildcard, becomes non-conformant. Under GOVERNANCE.md §2's 0.x rule, the editor merges it with no rfc: issue. No schema change: the rule relates a template's text to its params, which no keyword can see. conformance/metalog_validate.py --selftest: 31/31 fixtures pass.

The reference implementation (insight-metalog over its canonicalizer) conforms in the same release: template text and template ids do not move; only templates carrying a whole-token wildcard with no param gain one (measured on three private CI-log views: 63, 62 and 132 such templates, every one a whole dashed UUID).

🤖 Generated with Claude Code

…whole-token wildcards, and a producer MUST emit exactly one param for each, in token order, and none for a wildcard inside a token

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderoast-dev
coderoast-dev merged commit c33c91c into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant