Repository navigation
Hold Leaf's boundary records to what current code writes - #3197
Merged
Merged
Conversation
Reads of records only an older Leaf wrote are gone (root AGENTS.md, "Stage"): - `data.read_source` reads a value file as a publication. A file holding a bare value now fails like any malformed file instead of reading as that source's error. Its test is deleted. - `layer_metadata` requires `$layer.server`; a layer without it is refused as `layer-identity`, which names the re-vendor. - `thread.is_answer` no longer excludes progress addressed to an input, which only logs before #1727 held; the kernel schema refuses an ephemeral reply with `responds`. Its case in `test_success_readers_require_the_same_exact_agent_answer` is dropped. `GET /api/user-view` is gone, with the page sources' `user_views()` and the leaf.page snapshot's saved copy of it; nothing requested it. The browser's POST stays. `$state` and `$awaits` in the kernel registry now document every field `VERB_SCHEMA` and `AWAITS_SCHEMA` admit (`detail`, `writer`, `text`; `retired`, `reply`, `encloses`), each with a description. The `$keys` check generalizes to all three facts (`registry.layer.DOCUMENTED_KEYS`), and the `keys-documentation` finding names the fact. `test_the_field_docs_hold_to_the_fields_their_schema_admits` holds it. `event-batches.md` describes the envelope `delivery.py` writes: each event's `was` and `suggestion` on a rewritten message, the `correction` a refused answer's retry carries, and the paged reading's `part`, `parts`, `text`, `next` and last-part `acknowledge`. The state home's owner-only mode now holds. `state.state_home` is the one function every state-home path resolves through (`state_home_path` and `machine.state_home` are gone); it creates the home 0700 and returns an existing home to 0700. `server.host_key` holds `access.json` at 0600 even when the file already existed. Both write the mode only when it differs, so a sandboxed reader can still resolve paths. `test_the_state_home_and_its_key_stay_owner_only` holds both. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The feature gallery's "Read observed views" button was the one caller of `GET /api/user-view`. Its section now says where the agent reads the observations (`user_views` in `leaf page state`), and the corpus is regenerated. `build_threads` reads a reply's thread directly. Admission keeps every reply's parent in force, so the branch that skipped a reply whose parent was withdrawn read only logs from before that rule; the admission test no longer writes such a log. The data test that rewrites a value file now writes an invalid value inside a publication, since a bare value is no longer a file any writer produces. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
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.
An audit of Leaf's boundary data structures found five places where code and records disagreed. This change fixes each one.
Reads of records only an older Leaf wrote are deleted (root AGENTS.md, "Stage"):
data.read_sourcereads a value file as a publication. A file holding a bare value now fails like any other malformed file instead of reading as that source's error.registry.storage.layer_metadatarequires$layer.server. A layer without it is refused aslayer-identity, whose message names the re-vendor.thread.is_answerno longer excludes progress addressed to an input. Only logs from before Fold ephemeral thread updates when an answer arrives #1727 held that, and the kernel schema refuses an ephemeral reply withresponds.events.build_threadsreads a reply's thread directly. Admission keeps every reply's parent in force, so the branch that skipped a reply to a withdrawn message read only logs from before that rule.The tests that built those old records are deleted. A data test that rewrites a value file now writes an invalid value inside a publication.
GET /api/user-viewis deleted, along with the page sources'user_views()and the leaf.page snapshot's saved copy of the route. The browser's POST stays. The feature gallery's "Read observed views" button was the route's one caller. Its section now says that the agent reads the observations underuser_viewsinleaf page state, and the corpus is regenerated.$stateand$awaitsnow document every field their schemas admit.$stategainsdetail,writerandtext, and$awaitsgainsretired,replyandencloses, each with a description. The check that held$keystoEXTENSION_SCHEMAnow holds all three facts to their schemas (registry.layer.DOCUMENTED_KEYS:EXTENSION_SCHEMA,VERB_SCHEMA,AWAITS_SCHEMA), and thekeys-documentationfinding names the fact.test_the_field_docs_hold_to_the_fields_their_schema_admitscovers it.event-batches.mdnow describes the envelopedelivery.pywrites:wasandsuggestionon an event that rewrites a user's message, thecorrectionthat a refused answer's retry carries, and the paged reading (part,parts,text,next, andacknowledgeon the last part).The state home now stays owner-only.
state.state_homereplaces bothstate_home_pathandmachine.state_home, so every path into the state home goes through it. It creates the home with mode 0700 and resets an existing home to 0700.server.host_keykeepsaccess.jsonat 0600 even when the file already existed. Both write the mode only when it differs, so a sandboxed command that can only read still resolves its paths.test_the_state_home_and_its_key_stay_owner_onlycovers both, and fails with either reset removed.Two older-Leaf reads remain on purpose.
server.read_serviceand the stop path inhostinghandle aservice.jsonthat another installed Leaf wrote, which can happen while that Leaf's server is still running.registry.contract.same_state_operationkeeps a user's decision through a re-vendor (#2431).