Repository navigation
Host live specimens as isolated Leaf pages - #924
Conversation
…ancestry # Conflicts: # skills/leaf/assets/runtime/interaction-gallery.js
leaf-agent
left a comment
There was a problem hiding this comment.
version check no longer reads inside a specimen template, so a page can pass the authoring gate and still refuse to open its specimen for the reader. _specimen_resources parses the template into a SourceDocument of its own for dependency capture and drops that document's errors, and the template's lf-* elements no longer reach lf_elements/all_ids the way _visit_interaction_page used to put them there.
Measured on this branch: a page whose template holds <noscript>invisible</noscript> reports ✓ index.html: parses, widgets, authored modules, and theme validate, while the same markup written in the page body is refused with <noscript> at line 8: the browser renders none of its content; write it plainly or leave it out. The author learns at read time instead, when activate_source inside Specimens.create raises and the POST returns invalid specimen: … into the widget's status line — after the page has been handed over.
The level this belongs at is the traversal, not the message: a revision now carries more than one authored document, and revision_artifact._capture_artifact already walks the specimen documents to capture their dependencies. Validation is the one pass that stayed single-document. test_source_reading_keeps_a_specimen_out_of_its_parent_identity_space currently states the gap as the intent ("Child widgets are validated when the child page is created"), so it moves with the fix.
Keeping the child out of the parent's identity space is right — ids, holders and passages should not merge. Errors and registry conformance are a separate question from identity, and folding the child document's own reading back into the parent's errors keeps them apart.
…ancestry # Conflicts: # skills/leaf/assets/leaf.js
|
Addressed both findings in 78b60b9, now integrated with main at 60a3f6a. Authoring validation traverses complete child documents using the ordinary markup, registry, data, media, presentation, and fresh-transition checks. Each child retains its own IDs and selected conversation history; allocation consumes the same parsed child source. Coverage includes nested invalid markup, unknown widgets, independent IDs/data contracts, missing template IDs, and seeded rich markup. The server now declares the child's canonical reader-storage scope once. Bootstrap and runtime consume that same declaration without deriving separate pathname rules. The existing prepaint test now writes through the real runtime store and checks both ordinary and child-page restoration. The repairs passed independent review, 413 contract/server tests, 157 product/server tests, the affected browser checks, and the 81-page site build.
|
leaf-agent
left a comment
There was a problem hiding this comment.
Every error the new gate reports from inside a specimen carries a line number from the synthetic child document, which restarts at 1, so it names a line of index.html that holds unrelated content. _specimen_resources wraps template.inner_html in a fresh <!doctype html>…<main> preamble, and each child SourceDocument counts from there.
Measured on this branch, with a <noscript> authored on line 30 of index.html inside <template id="practice" data-specimen> opened on line 27:
✗ index.html: 1 issue(s)
- specimen 'practice': <noscript> at line 4: the browser renders none of its content; write it plainly or leave it out
Line 4 of that file is inside <head>. The template id narrows it to a template, but the number is the part an author acts on, and it points somewhere real and wrong — which is worse than omitting it. It also disagrees with the one specimen message this commit raises in the parent's own frame: needs a stable id uses self._position(template), so that error alone reports the authored line.
Padding the preamble by the template's own offset makes the child's numbering the parent's, without moving where validation reads the bytes from — template["document"].data stays the exact source Specimens.create writes. Suggested inline. With it applied the example above reports at line 30, and test_interact_contract.py, test_interact_server.py, and test_interact_product.py stay green over the specimen, data-contract, and fixture selections (30 passed).
Otherwise this reads as the right level for both earlier findings. check_source now walks a work list of authored documents rather than one, so nested specimens are covered by construction; specimen_events moving to thread_context puts the traversal and the seeding in one place for the gate, the server, and the corpus generator; and working_data_document_readings falling back to initial_data_document_readings is what makes a revision-less page with seeded markup readable at all — page_data_document_readings would have hit max() on an empty registry set. The declared data-lf-reader-scope leaves one home for the scope rule and survives /versions/vN.html, which the location.pathname reading did not.
…ancestry # Conflicts: # skills/leaf/assets/runtime/keyboard/page.js
leaf-agent
left a comment
There was a problem hiding this comment.
examples/corpus.html can no longer be stamped, so every fixture that serves the corpus page fails. Reproduced on 7ecb5bfa in a clean worktree:
$ uv run pytest tests/test_render_export.py::test_the_exported_corpus_stands_on_its_own \
tests/test_render_gate.py::test_every_aim_the_layer_offers_takes_a_finger -q -n0 --run-nightly
refusing to stamp index.html: specimen 'bg-motion-comment-page': unknown specimen
conversations: 2be2443f0bb6cc49fc86b52f340e6073; specimen 'bg-motion-threads-page':
unknown specimen conversations: 2be2443f0bb6cc49fc86b52f340e6073
2 failed in 5.14s
test_render_gate.py::test_the_adopted_sheet_decides_nothing_by_standing_last fails the same way. All three carry pytest.mark.nightly, and the corpus is held out of the site build by INTERNAL_EXAMPLES = {"corpus"} in scripts/site.py, so neither the PR gate nor the 81-page build named in the description touches it — this lands on main and reddens the nightly run.
The conversation is not missing: examples/corpus.jsonl carries 2be2443f…. It is not there yet when the stamp runs. prepare_page in scripts/page_fixtures.py stamps each authored version in order and appends the seed log only after the first stamp, so a page's v1 is always stamped against an empty log, and examples/corpus.html has no prior versions — that one stamp is its only stamp. examples/developer/feature-gallery.html survives only by accident: neither versions/feature-gallery.v1.html nor .v2.html carries data-specimen-threads, so the declaration first appears at the final stamp, after the seed. Every builder in the tree — site.py, preview.py, render_harness.py — goes through that same prepare_page.
Underneath it, check_source resolves data-specimen-threads against the page's current event log and refuses the whole document when a declared root is absent. The authored document is the initial condition and the log arrives after it, so a markup declaration naming a log entry is a forward reference; gating the stamp on it means the declaration can never be introduced in a page's first version. That is precisely what examples/CLAUDE.md now claims the corpus does — "The corpus carries only the conversations its embedded specimens declare in data-specimen-threads" — and the corpus is a single-version page, so it can never satisfy the gate.
Specimens.create already raises the same unknown specimen conversations at allocation, where the reference is actually consumed and the log is whatever it is by then. Letting that be the door, and having authoring resolve the conversations the log holds without refusing the ones it does not, fixes the corpus and the general case in one place. Seeding before the first stamp in prepare_page would move the corpus past the gate and leave an author's first version still unstampable, so it is the shallower of the two.
Nothing else in the two commits since the last review changes the verdict: the specimen source slice reports authored lines correctly, including through a nested specimen and across a multiline start tag, and the base merge's standingOnPage → standingFloor resolution in keyboard/page.js keeps main's guard semantics.
Superseded by the review on a later commit.
|
Fixed the authoring/allocation boundary. Stamping validates the child source, its declared conversation-reference namespace, and the subset of selected history already available. The existing strict conversation selector still owns allocation and corpus generation, so opening a specimen requires every selected root to exist. Partial history continues through the normal data, collision, and fresh-child transition checks; missing roots no longer erase that history. No placeholder events or validation-mode flag were added. Coverage now includes nested forward declarations, undeclared references, partial-history collisions, and a first stamp followed by allocation refusal, seeding, and successful allocation without republishing. The authoring reference states when the conversations must exist.
|
leaf-agent
left a comment
There was a problem hiding this comment.
skills/leaf/scripts/leaf/validation.md, "Static validation", still tells its reader that version check holds each lf-suggestion to "resolves naming a real comment". Inside a specimen template it no longer does, and that sidecar is where a maintainer goes to learn which door resolves the reference.
Measured on this branch, on a freshly initialized page with an empty event log:
<lf-specimen id="practice" label="practice page">
<template id="practice-page" data-specimen data-specimen-threads="deadbeefdeadbeef">
<h1 id="child-title">Child</h1>
<p><lf-suggestion id="answer" resolves="deadbeefdeadbeef"><lf-new>Answer</lf-new></lf-suggestion></p>
</template>
</lf-specimen>
$ leaf version check <page>
✓ index.html: parses, widgets, authored modules, and theme validate, protected ids and decisions carried over, nothing overflows the 720px column
The behaviour is the one this commit argues for, and I agree with it: the document is the initial condition, the log arrives after it, so a child's resolves is checked against the ids its template declares rather than the ones the log happens to hold. suggestion_errors moved its own docstring to "names a comment in the document's reference namespace" in the same diff, and the error text moved with it. The contract sentence is the third consumer of that rule and it stayed behind, so the tree now states two different gates. Say I should and I'll push the sentence.
Second, and the shape underneath it: the predicate that decides which ids a specimen may name is now written three times. check_source builds available from the same {event["id"] for event in events if event["kind"] == "comment"} that specimen_events builds its own guard from, and intersects selected with it for no other purpose than to keep that guard from firing — before this commit the comprehension appeared once, in _instance_errors. Nothing states that the two copies must agree, and they must. Widen specimen_events later — replies becoming declarable roots, say — and check_source goes on filtering the difference out of the child's history, so the gate validates the child against less history than allocation copies, and a collision or a data-contract error first reaches a reader as a 400 when they open the specimen.
The strictness split is at the right level; what it lacks is a name. Let specimen_events copy whatever of selected the log holds and say nothing about the rest, and put the guard in one reading beside it that Specimens.create and scripts/corpus.py call and check_source deliberately does not. available and the intersection go away, the predicate lives once, and which callers are strict becomes the statement of the rule rather than a comment explaining an intersection.
The corpus blocker from the previous round is gone: test_the_exported_corpus_stands_on_its_own, test_every_aim_the_layer_offers_takes_a_finger, and test_the_adopted_sheet_decides_nothing_by_standing_last all pass under --run-nightly on this head, as do 61 selected specimen, suggestion, and thread cases across test_interact_contract.py, test_interact_server.py, and test_interact_document.py.
|
Updated the validation sidecar to distinguish an ordinary document's logged comment roots from a specimen's declared reference namespace, and to name allocation/corpus generation as the strict boundaries. It also now documents the specimen framing policy. Centralized actual root membership in The independent implementation review is clean, and the focused specimen/suggestion tests pass.
|
test_g_hints_reach_a_late_visible_action_only_location passes on 4ffc2bd and fails on ff34b91: #924 inserted the live-specimen section between #bg-quoted-and-visual and #bg-shot, so scrolling to the containing section no longer brings the case's margin entry into the scrollport, and the hint layer was right not to draw a chip for it. The case could reach that state because its guard was `to_be_visible`, which says a control is laid out rather than that the reader can see it. It now scrolls to the location's own anchor and reads `to_be_in_viewport`, so the premise it states is the one the hint layer acts on.
…s, banner shelf, and gallery layout (#930) `ci` on `main` is red: the [scheduled complete suite on 4ffc2bd](https://github.com/max-sixty/leaf/actions/runs/35718248873) reported nineteen failures. Fourteen of those node ids, across twelve nightly browser cases, read chrome shapes that three of the morning's merges moved, and this updates those readings. A fifteenth case, which that run did not reach, broke on the merge after it. The remaining five are #917's, already open against #905's native `<details>`; nothing here touches them, so `main` needs both to come back green. No runtime code changes. ## What moved, and what each test reads now **#921 (4ffc2bd) gave the thread panel two selection levels.** Escape from a selected thread now returns to whole-panel selection, and the press after that closes the panel. Nine node ids across four files walked out of Threads in two presses and asserted the panel gone on the second. Each now states the level it gained — `.lf-threads` holds the selection — before the press that closes the panel, which is the shape #921 gave the tests it could see in `test_render_navigation.py`. The intermediate `expect` is also the arrangement: it settles the release before the next Escape rather than firing two presses into one turn. **#918 (a45144d) made the thread lifecycle filters a `wa-radio` group.** Three tests read the standing choice off `aria-pressed`, which a radio does not wear; they now use `to_be_checked()`, the reading the everyday-gate tests #918 updated already use. The same change also made the group exclusive, so re-pressing the standing member no longer widens the list — `test_an_ok_on_the_agents_latest_reply_takes_the_thread_out_of_waiting` pressed "On you" a second time to get every thread back and now chooses the group's open member instead. That second fault was behind the first: the test stops at the `aria-pressed` read, so the run never reached it. **#923 (c6c9cb3) added touch-only selection controls to the banner shelf and renamed the `s` command.** `commentSelection` and `cancelSelection` rank after `threads`, and `select-element` is `alwaysFolded`, so two tests counting the shelf's markup — the last child of `.lf-banner-actions`, the number of children in `.lf-banner-menu` — were reading inventory where they meant what the reader meets. Both now read what stands: the last *visible* control in the row, and, for the door, what is behind it once it is opened. A third read the reference's wording for `target.chooser.open`, a string `test_render_semantic_selection.py` also reads; this reads the reference row by its command id instead, so the words are stated in one place rather than two. Both cases are nightly, so nothing holds that string before `main` either way — #923 updated the one and not the other, which is the whole fault. **#924 (ff34b91) grew the feature gallery between a case's scroll target and its subject.** `test_g_hints_reach_a_late_visible_action_only_location` scrolled to `#bg-quoted-and-visual` and asked for the go-to chip belonging to `#bg-shot`'s margin entry; the new `#bg-live-practice` section sits between the two, so that scroll now leaves the entry about 1,200px below the scrollport and the hint layer is right not to draw a chip for it. The case reached that state because its guard was `to_be_visible`, which says a control is laid out rather than that a reader can see it. It now scrolls to the location's own anchor and reads `to_be_in_viewport`, so the premise it states is the one the hint layer acts on. Checked alone at both commits: green on 4ffc2bd, red on `ff34b919`. ## Why these are updates rather than a fix under them Each failure is a nightly test hand-reading a shape the runtime or the corpus owns, changed by a pull request whose own gate could not reach it: `ci` runs the complete suite on `main` and on the schedule, never on a pull request, because it holds a runner for over an hour on a shared pool — a trade-off `ci.yaml` states, with `main`'s own run and `tend-ci-fix` as the designed repair step. So the level above these tests is working as intended, and the durable improvement available inside them is to read a declaration instead of an incidental shape. Every fault here but the Escape depth moves that way: a radio's checked-ness and its exclusivity, a command id, and — twice — the run that stands rather than the shelf's markup. The Escape-depth nine have nothing more declarative to read — the press count *is* the behaviour — and each states the unwind because the assertion around it is about where focus lands and what stays open, so they keep their own narration. The gallery case is the same move at the arrangement end: it now states the premise the hint layer actually reads, so corpus content growing under it fails loudly rather than quietly changing what the case is about. That leaves the seam #917 named for the thread card exactly as reachable as it found it: the panel's chrome has no single place a change to it can find its readers. ## Verification All fourteen failed in the scheduled run on 4ffc2bd, and each passes on this branch under `uv run pytest --run-nightly -n0` on this CI host. The fifteenth was found by running the six changed files whole: `test_render_aim.py`, `test_render_anchors.py`, `test_render_controls.py`, `test_render_margin.py`, `test_render_navigation.py` and `test_render_reactions.py` are 574 cases under `--run-nightly -n2`, and the only two failures were `test_g_hints_reach_a_late_visible_action_only_location`, now fixed here, and `test_a_thread_at_rest_shows_only_the_marks_that_stand_in_it`, which is #917's. `pre-commit` passes on the changed files. Besides the gallery case above, two cases have their arrangement changed rather than only their assertions, so those three are the ones worth a second look: `test_the_responsive_action_row_keeps_primary_actions_in_reach` opens the overflow door to read what stands behind it and closes it again, because the shelf freezes its partition while the door is open and the test registers another control straight after; and `test_covering_threads_keeps_the_reader_and_their_work_inside` reads the document's scroll position after the thread releases to the panel rather than before, the release being the press that no longer closes the sheet. A pull request runs the everyday gate, which reaches none of these files, so `ci` here says nothing about them; `main`'s own complete suite on the merge is the first run that reads them. --------- Co-authored-by: leaf-agent <[email protected]>
…d assets in the site fixture (#931) The complete suite on [ff34b91](https://github.com/max-sixty/leaf/actions/runs/35720951649) — this branch's merge base — reported twenty-one failures and two errors over twenty-two distinct node ids. Nineteen were already red on its parent 4ffc2bd ([its own run](https://github.com/max-sixty/leaf/actions/runs/35718248873)) and belong to #930 and #917, which are open against them. Three are first red on ff34b91 and so are #924's: the two this fixes, and `tests/test_render_margin.py::test_g_hints_reach_a_late_visible_action_only_location`, which #930 already rewrites. No test here overlaps either of those branches. ## A specimen refused to open on a page whose log had not been written into `test_an_anchor_written_from_the_mapped_revision_lands_on_the_page[feature-gallery]` failed in teardown on four browser problems, the first of which is `POST /api/specimens` answering `400 unknown specimen conversations: 2be2443f0bb6cc49fc86b52f340e6073`. That sweep serves the gallery with `seed_log=False` — the page as its markup and its data make it, which is the ordinary shape of one created from its source — and the gallery's four templates each declare that root. Allocation required every declared root to be in the log, so on such a page no specimen opened at all and the runtime's rejection reached the console as an unhandled error. The declaration is a selection over the parent's standing log, and the log is not something the document owns: `specimen_events` now copies the conversations the log holds and lets a root it does not hold read as absent, so a first version, or a page re-created from its source, opens its specimens the same as any other. Nothing above the door was stating that rule either way — `version check` deliberately permits the forward reference and allocation refused it, so the same declaration decided two different things at two boundaries. What the strictness was protecting is still held, in two places that can tell a typo from a page nobody has written into yet: - `scripts/corpus.py` selects against the example's own shipped log, where every declared root exists by construction, and exits naming the source and the ids. - The child's ordinary document checks still refuse a child that names a conversation it does not have. `test_specimens_seed_only_the_declared_conversations_and_reset_by_recreation` now covers both halves: a template whose markup does not depend on the conversation opens with an empty log, while the one carrying `<lf-suggestion resolves="aabb0011">` is refused in that element's own words. `validation/source.py` also drops the `selected & available` it was narrowing with before calling in — the same rule stated a second time at a caller — so static validation and allocation build the same child from one reading. ## The site fixture served a document only the edge could complete `test_every_published_page_stands_as_a_live_page@site` timed out waiting for the gallery's four `iframe[data-interaction-ready]`, with 404s on `/_leaf-release/<release>/examples--feature-gallery/revisions/r3-…/leaf.js` behind it. Production is not affected: one public origin is two servers there, and `worker/src/index.ts` answers `/_leaf-release/<release>/<key>/…` from the build's sibling asset tree — the tree `publish_live_shells` writes — before handing every other route to `worker/server.py` inside the reader's container. `WebsitePageEndpoint._specimen_asset_root` captures that release namespace for a published revision, which is what lets a child share the shell's release-captured graph. #924 thereby made a specimen the first container-served document to depend on bytes only the edge holds, and `served_example` and `hosted` stand the adapter up with nothing in front of it. Both fixtures now answer the release namespace from the build's asset tree, using `releaseAssetRoute`'s own rewrite: the key after the release names the page, and what follows it is that page's published path under the tree. `hosted` gets it too, so the next test to reach a specimen through it does not find the same hole. ## Verification Both cases fail at ff34b91 and pass here, checked on this CI host. Around them: `tests/test_site.py` whole (51 cases, `--run-nightly -n0`), `tests/test_render_pages.py` whole (53, `--run-nightly`), `tests/test_interact_server.py` and `tests/test_interact_document.py` (276), `tests/test_interact_contract.py`, `tests/test_website_server.py`, `tests/test_render_startup.py` and `tests/test_interact_mcp.py`. `scripts/corpus.py` regenerates the corpus byte-identically. `pre-commit` passes on the changed files. The everyday suite leaves six failures this sandbox owns rather than the branch — `AF_UNIX` is unavailable here, and the published-capture case needs the browser-build dependencies — and the same six fail identically with these changes stashed. CI's own `test` job was green on ff34b91. A pull request runs the everyday gate, which reaches neither `test_site.py` nor `test_render_pages.py`, so `ci` here says nothing about either case; main's complete suite on the merge is the first run that reads them. Co-authored-by: leaf-agent <[email protected]>
This week's duplicate sweep of `dev/`, `build/`, `tests/` and `worker/` (week 47) moves six duplicated helpers onto one home each and moves every caller. Behavior stays the same. The touched model tests, the dev js_facts tests and the Worker's routing, storage and index tests pass. A script compared the old and new outputs of the consolidated `leaf_dev` functions and the seeded-log reads across the corpus, and they match. | Question | Home | Copies removed (introducing PR) | |---|---|---| | Which stylesheets do the core and the bundled packages ship, leaving out vendored files? | new `interact_support.shipped_sheets` | `sheets()` in `test_interface_fonts.py` (#4804) and `test_theme_tokens.py` (#6025). Five inline loops in `test_interact_layer.py` (#3138, #3886) | | Run `tests/js_facts.mjs` | `interact_support.js_facts` (#2666) | its own subprocess call in `dev/tests/test_js_facts.py` (#5118) | | Lowercase hex of bytes in the Worker | `routing.hex`, which is `newSessionId` (#313) renamed, plus a `sha256Hex` in `storage.ts` | the publication-identity and chunk-digest copies in `storage.ts` (#2652) | | Is this pid alive? | `leaf.machine.pid_alive` | `_alive` in `tests/process/test_codex_tool.py` (#3331). `running()` in `test_interact_layer.py` (#1774) | | Read an example's seeded log | `read_event_lines(seed_log(source))` (#4484) | inline parsers in `test_render_pages.py`, `test_interact_product.py` (#924) and `test_render_gate.py` (#509). The last one split lines with `splitlines()`, which also breaks at U+2028 | | Paths of the bundled registries and packages; which registry keys name elements | `leaf.schema.ASSETS` / `BUNDLED_PACKAGES` / `DEFAULT_PACKAGE`, `leaf.registry.contract.is_element_name`, `docs.registries()` | `docs.py`'s own `ASSETS`/`PACKAGES` (#3593) and its `startswith("lf-")` checks (#2660). `logs usage`'s hand-written regex and registry list (#5970). `ROOT / "packages" / "default"` in `stills.py` (#3927) and `test_product_page.py` (#3593) | `is_element_name` and the two checks it replaces give the same answer for every key in the bundled registries today. A selector key such as `lf-options.selected` would have passed the `lf-` prefix test. <details><summary>Sets found and left alone</summary> - **Sets an open PR is changing.** Nothing in this diff overlaps another open PR's hunks. #6732 moves tests out of `test_render_gate.py`, `test_render_pages.py` and `test_interact_layer.py`, but none of the tests changed here. - **Changes to browser tests with nothing run to check them.** The WCAG contrast computation exists as about 11 copies across browser, journey and model tests. Other copies: about 9 `EDITOR_ROOTS` shadow-root keepers, the `/api/interaction` batch predicates, CDP `touch()` closures, one-line patch templates, reply-holding route handlers, and the `data-lf-entry` runtime-module import snippet in `dev/leaf_dev/states.py` and in tests. Each would mean editing browser tests that this sweep can't run on a shared host. They suit a sweep that can run those tests. - **Vendor bundling.** `build/browser/build.mjs` builds signals-core and Lit with esbuild calls that repeat `build/vendor.mjs`'s `bundle()`. Merging them changes build options and needs a full `check:browser` byte comparison, so it was left for a change that runs that. - **Copies that are near but not the same.** `_build.py`'s `check_links` repeats `leaf_website.released_path`, but it also needs the matched page's root and kind. The list of API-key variables an eval drops is repeated across Python and the Promptfoo configs, as subsets and supersets of one another. The Codex token-expiry check has different thresholds, 1 h and 60 s. - **Too small to be worth it.** Picking a free loopback port (`eval_user.py`, `interact_support.available_loopback_port`). The XDG state root in `leaf_dev.state_home` and `leaf.state.state_home`. The `settled` helper in two `tests/runtime` files. </details> Co-authored-by: leaf-agent <[email protected]>
Leaf can now host an operable page inside
lf-specimen, with its own choices, comments, drafts, and reset lifecycle. The developer gallery uses the same host for its passive replays, retaining playback, looping, pointer choreography, and viewport controls while removing its separate document/bootstrap construction.The child is an ordinary server-backed Leaf page created from a captured template, layer, data, and optional conversation history. Authoring validation traverses each child with the ordinary document checks while preserving separate identity spaces and authored diagnostic lines, and allocation uses those same child-document bytes. A template can declare conversation references before its seed log arrives; allocation requires every selected root to exist. Children use normal event admission and state projection; the parent owns allocation and disposal. Runtime requests follow document identity independently of shared immutable asset URLs. Delivery declares each child's reader-storage scope once for prepaint and runtime. Static export recursively bakes the rendered child with the same exporter used for its parent; offline-interactive export refuses server-dependent specimens.
The main boundaries are
runtime/specimen.jsfor browser lifetime and focus,leaf/specimens.pyfor captured child-page creation, and the ordinary HTTP page endpoint for serving it. Host labels, controls, and instructions sit outside the specimen gutter. Authoring and package references document the contract.This adds live-page hosting rather than claiming a net reduction in repository complexity. It removes duplicated startup knowledge and shares production behavior, at the cost of temporary child-page allocation and lifecycle management. The final simplification pass removed an unused resizing API and reduced seeded child creation to one activation.
Coverage includes parent/sibling isolation, real choices and comments, optimistic refusal, nested Escape, reset/disconnect races, captured resources, read-only render previews, scoped MCP/website routes, and standalone export. The live specimen and retained gallery interactions were also exercised in Chrome.
Local validation: 1,272 everyday tests and 635 focused contract/server/document/product cases pass. All 59 export tests and both corpus render-gate cases pass, including first-version specimen seeding. Eight focused specimen/Escape integration cases, 33 runtime tests, 64 Worker tests, and 10 specimen/startup cases also passed during review. The complete controls file has 95 passes and one obsolete walked-thread ring expectation; that failure reproduces identically on clean base
4486b342and is already addressed by PR #917. The website build produces all 81 pages. The final gallery renders cleanly in Chrome, light/dark and desktop/mobile sizes.