Skip to content

Keep captured widget publications independent of page revisions - #2336

Merged
max-sixty merged 64 commits into
mainfrom
codex/guidance-code-fixes
Oct 13, 2026
Merged

max-sixty merged 64 commits into
mainfrom
codex/guidance-code-fixes

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A reply can carry a widget introduced after the page a reader has pinned, or use a different meaning of an existing widget. Previously, every pinned page had to accept that markup and one globally registered implementation rendered all revisions. Each page and frozen message now retains its own widget publication: declarations, constructors, private modules, styles, initial drawings and recorded command meaning. Decisions and asks keep their captured meaning while the reader changes page versions.

The document still runs one current Leaf kernel and one instance of shared runtime/vendor libraries. Publication-addressed widget resources and scoped custom-element registries isolate their implementations. Samples preserve those identities, including generated children; served pages, captured exports and Worker delivery follow the same resource ownership. Classic initial drawings remain classic scripts outside the module graph. Shared reaction chrome follows the viewed document.

Registry-declared widgets now default-export a constructor; Leaf owns registration. Generated child widgets use createWidgetElement(owner, tag, Constructor), and layerFact(owner, name) reads the owning publication. All maintained widgets, authoring examples, public references and callers are converted together. Removing the old registration wrapper outdents class bodies by two spaces and accounts for most raw changed lines; the loader and all maintained widget callers move to this registration contract together.

Independent survey fixes landed first in #2672 (preview producer), #2673 (preparation lifetime), #2679 (deferred presence), #2680 (annotation seats), #2683 (preview shutdown), and #2685 (native Git evidence). This PR now contains only the publication migration and its integration proof: 228 files, +17,248/−14,329 lines; ignoring whitespace leaves +5,052/−2,133 (77% of raw changed lines disappear).

Validation exercises different meanings of the same tag, new reply widgets in old pinned pages, captured actions and undo, generated sample children, classic initial drawings, private-module/shared-runtime identity, and historical offline exports with zero external requests. Independent readers used desktop, keyboard and phone interactions. The last browser-startup source caac297 served triage comparison against maina3a139255 adds four code requests and 19,133 code bytes before presentation; both arms have no browser errors, identical layout shifts and byte-identical settled screenshots. The current integrated source passes 108 framework/build checks, 410 runtime tests, the complete lint gate and focused model/browser contrasts. Earlier source-specific proof includes 82 Worker and eight eval-runner checks; the integrated 51310e7 build passes all 105 site pages and three public Worker startup checks against main250595204. Its product/triage add about 4.7 KB with unchanged code request counts, while the frozen gallery adds 94,125 code bytes for its captured registry, scoped styles and separately addressed constructors. Layout shifts are identical in each pair.

Integration with main3a7414145 preserves the upgraded commenting interface while private history loads. Local comments now paint through the canonical publication presenter in that waiting phase; existing early-send, arrival and refusal controls pass. Sample conversation selection captures intent when its command arrives, before waiting for child history, and carries it through both canonical destinations. Four held-child contrasts verify ordinary page/panel selection and cancellation after newer child typing. Structured admission and source refusals now preserve canonical finding codes through the publication-specific callers; seven focused model/process controls cover captured commands, retired captures, approval and quiet hooks. The subsequent CLI JSON integration also passes five reply/refusal controls and the complete-publication atomicity control; the constructor and browser runtime source is unchanged. The newly merged late-shadow usability fixture also uses the constructor export; its unchanged browser assertions pass. The scoped-registry vendoring adapter forwards native retained-move callbacks; the unchanged composer selection assertion and five lifecycle/browser contrasts pass.

Broad CI exposed eager page-parser imports in the quiet Codex hook. Reserved revision identities now stay lightweight, while content reads use the unchanged canonical capture validator. Quiet/pending hook paths and seven incomplete/obsolete/duplicate capture controls pass. Ten other failures were outdated fixtures for complete captures, captured replies, native Git headers, scoped child creation, split widget styles, structured findings and the ask API; all eleven original failures pass locally with their behavioral assertions preserved. Final exact-head Linux CI passes the broad Python suite, complete website lifecycle including dormant reads and wake/restore/write, all bundle/runtime/Worker/eval assertions, pre-commit, website build and bundled-release Chrome measurement. The fresh automated review approves 80d3708 with no findings. Final CI run.

The main risk is a constructor-timing or generated-child caller missed by the focused contrasts. The scoped-registry dependency and the across-corpus API cutover are the architectural cost of removing the old pinned-page vocabulary restriction.

This was written by Codex on behalf of max-sixty

Each publication owns its widget vocabulary, constructors, private modules,
styles, initial values and admitted action meaning. Keep installed runtime and
vendor libraries shared within the executable epoch, and preload constructors
without activating an inert source document. Cut maintained consumers over to
publication-owned constructors and historical readings.

Represent native Git file operations separately from textual hunks, and give
annotations one final seat in a shared held-and-arrival order across rails and
pins. Visible clipped obstacles and canonical revealed labels own exclusion;
semantic targets retain identity and visibility.

Use each paired runtime's own data producer and join temporary server cleanup
before releasing its scratch page.
leaf-agent
leaf-agent previously approved these changes Oct 11, 2026

@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 historical side of Compare still calls stateSpecs() without its doc, even though the new API selects a publication from the scope. In applyDiff, that skips a recorded body edit on an older lf-draft if its edit declaration has changed or disappeared in the current publication. diffBlocks(doc) then compares the old authored text instead of the text the reader saw at that version, so Compare can mark a passage as changed when it is not. Read the base pass from stateSpecs(doc); keep the live pass on the current document. See the base pass and the scope-aware API.

…lifetimes

Observe each capable producer through its canonical mechanical hold. Cancellation retires attribution without granting landing credit; rejection and out-of-order siblings retain independent landing ownership. Keep aggregate semantic proof separate and avoid eagerly importing widget-controller for diagnostics.
Preserve publication-owned constructors and clear annotation placement while adopting main focus ancestry and diagram source identities. Update the shared-shadow constructor fixture and action/undo waits to current canonical APIs, preserving all behavioral assertions.
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
List reserved revision identities without importing the publication model; lazily apply the canonical manifest validator when reading captured contents. Preserve obsolete capture filtering and duplicate complete-capture refusal. Update CI fixtures to produce complete publications, captured replies and scoped child widgets, and assert the current stylesheet, ask and structured-finding contracts.
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
Preserve captured publication ownership while composing the registry and browser Finding contracts. Cut the new projected-datum fixture over to constructor exports, preserve draft retention assertions, and read captured failure records through their canonical fields. Focused model, runtime, browser, framework, lint and served startup controls pass.
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
leaf-agent
leaf-agent previously approved these changes Oct 13, 2026
@max-sixty
max-sixty merged commit 4ce9bc2 into main Oct 13, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/guidance-code-fixes branch October 13, 2026 02:27
max-sixty added a commit that referenced this pull request Oct 13, 2026
The eight files that conflicted take main's content with the sweep's edits
re-applied by .tmp/standing/apply.py. #2336 re-indented the code under seven
entries; those entries are now line-local, so a fresh run on 4ce9bc2 applies
with no problems. Its new reads of renamed fields follow the rename: lf-suggestion
and lf-options read the application's per-verb `inForce`, and projection.py names
StateProjection's frozenset fields `absorbed` and `in_force` (with "standing" the
merge of frozen publications called `.items()` on a frozenset).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 13, 2026
…, after #2336 (#2725)

#2336 broke three browser tests on main (each passes on its parent
6b9352e); main's push CI had not reported it. Two were real
regressions:

- **A live tab stopped following a runtime edit**
(`test_every_tab_follows_a_runtime_edit`). #2336 made `/api/state`
report the active revision's layer, so after a runtime edit the open tab
refuses that state and falls back to probing the server, but the probe
read `/revisions/r1-…/registry.json`, which never changes, so the tab
waited forever. A server without a release now probes the page-root
`/registry.json`, which follows the active revision (`http.py`).
Release-bearing delivery (leaf.page, live shells) keeps its probe: there
a changed kernel is always a changed release, and the Worker serves no
page-root registry.
- **A shadow stage built before its host is in the page threw**
(`test_native_top_layers_bound_the_keyboard_stack`, and
`test_a_stage_built_before_its_host_arrives_holds_its_links_and_bounds`,
whose contract says a widget may fill its stage while detached). A
detached host now stages under the document's publication, the fallback
`registryFor` already uses (`shadow.js`).

One was a stale expectation: since #2336 the "Accept all" buttons are
built from the asks waiting, so before the first state answer none
exists rather than a hidden one
(`test_a_current_auxiliary_choice_replaces_a_persisted_drawer_during_replay`);
the checks after the state lands are unchanged.

A tab following a runtime edit now reloads plainly, which keeps scroll
but not the in-progress edit, passage landmark or comparison that a
revision handoff carries.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 13, 2026
…#2734)

#2336 made the source check refuse a page this Leaf can't serve as
vendored (a foreign protocol, or a layer that declares a retired `x-`
key such as `x-question-context`), so `page state` reports `source.live:
false` with the refusal, naming `leaf page init`, in `source.error`, and
writes no revision. Nothing tested that reading or told an agent what to
do with it.

- `test_page_state_reports_a_layer_this_leaf_cannot_serve` covers both
kinds and runs `page state` in a fresh process, since in-process a
cached revision hides the retired-key case.
- `authoring-revisions.md`: where `source.error` names `leaf page init`,
run it and read the state again before trusting the rest of the reading.
- `serving-pages.md`, `page-storage.md` and the `incompatible_layer` and
`agent_state` docstrings list the state reading among the places that
report the refusal.

> _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