Skip to content

State each declared attribute's words as its schema's enum - #3718

Merged
max-sixty merged 2 commits into
mainfrom
registry-words-enum
Oct 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
registry-words-enum

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

An attribute that names one of the layer's words, such as lf-column's tone or lf-code's language, now carries those words as a standard JSON Schema enum in the vocabulary a page composes. Before this, its schema said only {"type": "string"}. The words lived under $tones and $languages, so an agent reading the entry went looking for them. Claude Code reads page/registry.json directly, never page instructions, and spent a model call on that lookup in most replies.

Composing the vocabulary (registry.layer.stamp_composition, at page init and over a page's own declarations) now writes each list into the attribute's enum. That is registry.contract.stamp_words, beside $decisions and $states. Source registries still declare only x-tone or x-language, so a new tag that takes a tone still needs only that key, and the lists stay the one home of the words.

That leaves one mechanism where there were three:

  • Validation reads the enum through the attribute schema it already checks. The separate DECLARED_WORDS pass and its unknown-word finding are deleted. An unknown tone now reads 'success' is not one of ['ok', 'warn', 'danger'].
  • page instructions --use lists the words of every attribute whose schema has an enum, read from the schema. That replaces List the words a declared attribute takes in page instructions #3690's listing from the layer's lists.
  • Composition stamps before it validates the examples, so examples are checked against the vocabulary as pages read it.

This bumps the page protocol from 21 to 22. No page runtime reads the property schemas, but a page vendored before this change carries a registry without the enum. A Leaf at the same number would then stop checking that page's tones and languages. The bump has the session holding such a page re-vendor it on its first command, and the stamped registry checks again.

Measured with Claude Code waiting journeys, side by side on this branch's base 7c0aa359f and on the change, 7 completed runs per arm:

Before After
Registry lookup calls per reply, mean 2.14 0.43
Replies that looked up the tones 6 of 7 2 of 7
Model calls per reply, mean 5.43 3.86
Whole reply, median 26.4 s 18.9 s
Generation, median 17.9 s 13.0 s

The whole-reply drop is within the run-to-run spread at this sample size. The lookup is gone from most replies, and removing that lookup was the point. One Codex App Server journey and one Pi journey were also run to spot-check that both still see the words.

This is the coordinator's #48 follow-up to Max's decision #40 on the overnight report.

This was written by Claude Code on behalf of max-sixty

Composing a vocabulary now writes $tones and $languages into the enum of
each attribute marked x-tone or x-language (stamp_words), so the entry
an agent reads lists the words. Validation reads that enum through the
attribute schema, replacing the separate DECLARED_WORDS pass and its
unknown-word finding, and `page instructions --use` lists any
attribute's enum from the schema, replacing #3690's listing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed declared_word_errors check leaves older active pages unable to catch an unknown tone or language. compose_page_registry skips stamping when its composition equals the active revision's saved vocabulary; a revision captured before this change has no attribute enum. With that registry, fragment_errors accepts tone="dangre" (I reproduced this with an unstamped lf-column schema), so page check can pass while the intended tint silently fails. This changes a guarantee for pages at the current protocol. Bump $events.protocol so those pages are refused and re-vendored before validation or writes rely on the new enum.

…gistry

A page vendored before the declared words moved into each attribute's
enum carries a registry without them, and would pass an unknown tone or
language.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit e56e1ca into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the registry-words-enum branch October 23, 2026 08:36
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.

2 participants