Repository navigation
Refuse to serve a page whose runtime came from another Leaf - #1211
Merged
Merged
Conversation
A page's server is whichever Leaf starts it, while its browser runtime is whatever the last `page init` vendored. Nothing compared the two outside the render gate, so after a contract change (#1193's `conversation` → `thread`) a newer server left an older page throwing on every state read. `layer.foreign_runtime` is now the one comparison of the page's `$layer.runtime` with this payload's runtime fingerprint, and `http.page_endpoint` refuses on it, naming `leaf page init <page>`. Every one-page server binds through that function: `server start`, `server run` (including `--temporary`), a `leaf wait` revival, and the render gate's ephemeral server, whose private check it replaces. `cmd_serve` builds the endpoint before taking the lease or writing `service.json`, so a refused start leaves the service as it found it and `starting_claim` gives the claim back. A refused revival prints the refusal and the page reads as lost. The fingerprint still covers `assets/runtime/` alone; layer-registry.md now says what passes it. Tests: a refused `server start` takes no claim, writes no service, and succeeds after `page init`; a wait does not revive a dead server over a mismatched page and prints the re-vendor. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 26, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2026
The sentence in authoring-on-me.md's "Make each question self-contained" told the agent to name work by what it does "rather than by its number". Max wants the number kept, since it is how the user finds the pull request, with words beside it that say what the work is. The sentence now asks for that, with "Merging #431, the retry for dropped uploads" as its title example, and moves to the end of the paragraph, after what a question mainly holds, since he still found it prefatory where it stood. The naming rubrics now let an option cite a number its ask's title describes, as "Merge #812" under "Merging #812, the LRU result cache", since the card gives the number its context. Evals (Claude Code, this tree, 3 runs a case): fork asks name the work 6/6, items-right 27/27, guardrails 9/9. The agent's merge ask after a compaction titles every thread with both, as "Merging #1211, the badge on notes waiting to sync", but in each run still mentions #1204 in passing without saying what it is, so names scores 0/3. The page-sections case names 1/3. A version whose example was a passing mention ("#431, the retry for dropped uploads", not a bare "#431") raised sections to 2/3 but titled merge asks "Merging #1211" in 3/3, so the title example stays. About $14 of runs.
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2026
…6560) Agents on Leaf pages ask the user to decide about work they name only by number: thread titles "Merging #6551", options "Merge #6551", passing mentions such as "It doesn't depend on #6538". The user meets each ask on its own in On Me or Threads, often hours later, and can't tell what it is about. Of 43 merge asks on this machine's pages since 5 Nov, 17 were titled by number alone, and the turn-end check's fork wrote 31 of the 43. This adds one sentence to the end of `authoring-on-me.md`'s "Make each question self-contained": beside each pull request, issue or commit a question mentions, say what that work is, with "Merging #431, the retry for dropped uploads" as the title example. Every writer of an ask reads that paragraph, the fork included through `clerk.GUIDANCE`. It also adds a `names` rubric to the evals that score asks, which lets an option cite a number its ask's title describes. To weigh: passing mentions still slip. The agent's merge ask after a compaction titles every thread well but mentions #1204 without saying what it is in 3/3 runs, and page sections name their PRs 1/3. A version whose example was a passing mention raised sections to 2/3 but brought back bare "Merging #1211" titles, so the title example stays. Requested by the maintainer, who rejected earlier versions that put the rule in `SKILL.md`'s "Must remember" and that dropped the number; he hasn't read this diff. Evals (Claude Code, 3 runs a case): fork asks name the work 6/6 (main 0/6), items-right 27/27, guardrails 9/9. Tests: `test_clerk.py`, `dev/tests/test_evals.py`. > _This was written by Claude Code on behalf of max-sixty_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A page's server is whatever Leaf ran the start, while its browser runtime is whatever the last
leaf page initcopied in, and nothing compared the two. After #1193 renamedconversationtothread, a post-rename server serving a pre-rename page left the page throwingread failed: can't access property "threads", state.browser.conversation is undefinedon every state read. The page stayed up while it was broken.Now every one-page server refuses such a page and names the fix:
Where it lives
layer.foreign_runtime(page_dir, layer)is the one comparison of the page's recorded$layer.runtimewith this Leaf'spayload_runtime_fingerprint(). It replaces the render gate's_refuse_a_foreign_runtime.http.page_endpointcalls it, and every one-page server is built through it:server start,server run,server run --temporary, a revival byleaf wait, a--userpreview's restart, and the render gate's own server.cmd_servenow builds the endpoint before it takes the server lease or writesservice.json, so a refused start writes nothing and gives the claim back. A server that is already running is still reused.What changes for agents
leaf wait's revival is refused and prints theleaf page initmessage.assets/runtime/, so a contract change made only in Python passes it.layer-registry.mdsays so. The MCP App'sProcessPageServerisn't built throughpage_endpointand doesn't check the runtime. Its stale side is usually the long-runningleaf mcpprocess rather than the page, soleaf page initwould be the wrong advice there.layer-registry.mdrecords that gap too.Tests
server startexits non-zero, names both runtime ids andleaf page init, and takes no claim, writes noservice.jsonand holds no lease. Afterpage initthe start succeeds.leaf page initmessage.Results: the everyday suite passes, as do the nightly session, server, layer, export and gate files and
npm run test:runtime. Pre-commit is clean.🤖 Generated with Claude Code