Skip to content

List the words a declared attribute takes in page instructions - #3690

Merged
max-sixty merged 1 commit into
mainfrom
agent-a255fa4dfc3c84d73
Oct 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-a255fa4dfc3c84d73

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

leaf page instructions --use <tag> now lists the words an attribute takes when the registry declares that the attribute names a layer-wide word. A column's tone lists the layer's $tones (ok, warn, danger, ...), and a code block's language lists $languages. The list comes from validation.instances.DECLARED_WORDS, the same table validation refuses unknown words against, so a new x- word declaration is covered with no edit here.

Why: an entry's schema says only that tone is a string, so agents guessed (tone="success") and had their reply refused, which cost a 5-9 s extra call.

Evidence (Max's decision #47 on the overnight report):

  • Before: Codex agents guessed a tone the layer lacks in 20 of 65 journeys.
  • After: 9 runs (6 Codex, 3 Pi) had no refusals.
  • No time cut was measured for the whole reply: the roughly 5 s run-to-run spread hides it. The change lands for removing the refusal.

The test checks every entry that declares x-tone or x-language against the layer's list.

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

An entry's schema says only that tone or language is a string, so agents guessed a word the layer lacks and had the reply refused. `leaf page instructions --use` now names the layer's list for every attribute the registry declares through DECLARED_WORDS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 47b1580 into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a255fa4dfc3c84d73 branch October 23, 2026 04:44
max-sixty added a commit that referenced this pull request Oct 23, 2026
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 #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_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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