Skip to content

Validate a page's registry and vendored sheets only where they differ from the active revision - #1227

Merged
max-sixty merged 2 commits into
mainfrom
activation-gate-cost
Sep 26, 2026
Merged

max-sixty merged 2 commits into
mainfrom
activation-gate-cost

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A fresh server's first read of a page spent ~300ms in activation re-checking an unchanged index.html. About 280ms of that re-validated inputs the active revision already carries:

  • the vendored registry through jsonschema's metaschema, twice: once as the layer, and again as the composition, which a page with no declarations leaves equal to the layer;
  • a syntax pass over the vendored theme.css (425KB) and shadow.css;
  • a second parse of the theme for the column width.

The author's own page took ~5ms.

A revision is written only after check_source passes, so its registry and sheets were validated when it activated. With this change:

  • compose_page_registry takes the vocabulary already validated and skips validation when the composition equals it. read_page_registry passes the active revision's.
  • The source check lints a vendored sheet only where its bytes differ from the active revision's captured copy, and parses the theme for the column only when the page states a width.
  • Hand edits and re-vendors still differ from the active revision, so they are still checked; the existing tests for both pass unchanged.
  • load_registry keeps the one check the running Leaf can disagree with: the kernel's event contract, which a page vendored by an earlier Leaf may carry in an older form.

SourceCheck.column is gone: version check computes the column it prints.

Cold activate_source on a preview page (fresh process, unchanged source): 305–380ms before, 36–42ms after. A new test pins that a fresh process reading an unchanged page validates neither the registry nor the vendored sheets, and that an edited shadow.css is still linted; reverting either skip turns it red.

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

🤖 Generated with Claude Code

… from the active revision

A fresh server's first read of a page spent ~300ms in activation re-checking an
unchanged index.html, and ~280ms of that re-validated inputs the active revision
already carries: the vendored registry through jsonschema's metaschema, twice
(once as the layer, again as the composition a page with no declarations leaves
equal to it), a syntax pass over the 425KB vendored theme.css and shadow.css,
and a second theme parse for the column width. The author's own page took ~5ms.

A revision is written only after `check_source` passes, so its registry and
sheets were validated when it activated. `compose_page_registry` now takes the
vocabulary already validated and skips validation when the composition equals
it; `read_page_registry` passes the active revision's. The source check lints a
vendored sheet only where its bytes differ from the active revision's captured
copy, and parses the theme for the column only when the page states a width.
Hand edits and re-vendors still differ, so they are still checked.
`load_registry` keeps the one check the running Leaf can disagree with, the
kernel's event contract.

`SourceCheck.column` is gone: `version check` computes the column it prints.
Cold activation on a preview page: 305–380ms before, 36–42ms after.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Sep 26, 2026
# Conflicts:
#	skills/leaf/scripts/leaf/registry/storage.py
@max-sixty
max-sixty merged commit a76cbe3 into main Sep 26, 2026
7 of 8 checks passed
@max-sixty
max-sixty deleted the activation-gate-cost branch September 26, 2026 18:08
max-sixty added a commit that referenced this pull request Sep 27, 2026
… the browser (#1275)

Which x-state verb decides a widget, and which member tags each of its
outcomes takes
off the page, were derived from the registry twice: Python's
`deciding_verb` and
`retirement_slots`, and the runtime's `decidingVerb`, `settlementSlots`,
the retired-slot
selector walk in `passages.js`, and the owner walk in `version.js`'s
diff-opaque
selector.

Composition now writes the relation into the vocabulary as `$decisions`
(owner tag ->
`{verb, retires: {outcome: [member tags]}}`), from
`registry.state.stamp_decisions`.
`page init`'s layer composition stamps it after validation, and a page's
composition
stamps it again over the page's own declarations. The browser requires
it at intake
and reads it through `registry.js`'s `decisionFor`; the four JS walks
are gone. Python
keeps calling `deciding_verb` and `retirement_slots`, which the stamp is
derived from,
because validation asks them of declarations nothing has stamped yet.

A page whose composition equals its active revision's vocabulary still
skips
validation (#1227): the vendored layer carries the stamp, so the
comparison holds
unless the page's declarations add to the relation, which revalidates
and restamps.

The verb writer default (`agent` where declared, else `user`) stays
resolved at
intake on each side, now held to one fixture,
`tests/verb_writer_cases.json`, that
`verb_writer` and `adoptRegistry` both read. Stamping it would change
the author
contract, whose schema admits only `writer: "agent"`, and would make
every page that
declares its own verb differ from its validated vocabulary, so #1227's
shortcut would
never hold for it.

Behaviour that moved: a served vocabulary without `$decisions` now fails
startup with
the other required `$` facts.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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