Repository navigation
Declare agent-written state in x-state, and trim done and x-work to what is used - #1076
Merged
Merged
Conversation
x-work had one user, lf-card's {"seat": "content"}. Its conversation seat and
its replayed-attribute `when` filter had no declaration anywhere, yet carried
schema, validation, a projection read in `status --on`, and tests. The key is now
`true` and means the content seat; `status --on` reads the declaration directly
rather than folding the widget's replayed attributes first.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e transcript
A `done` event carried `revision`, which the version's own note already maps,
and `text`, which the banner always wrote as "Looks good". It now carries only
`version`: the append door derives the revision from the stamp (refusing a
version nothing stamped), and the banner and the undo offer match an approval
on the stamp alone.
`leaf transcript` printed "Approved at …" for the first `done` in the log even
after the user withdrew it. Standing approvals are now one reading in events.py,
shared by the transcript and the browser's conversation view, and the
transcript names each approved version ("Approved v1 at …").
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
x-state and x-report were one schema read twice, with `"x-state" if action else "x-report"` in every fold and a rule that a same-named verb in both must agree on unit and record. No tag used that overlap: lf-agent's `state` and lf-task's `status` were report-only, every other verb user-only. A verb now lives once under x-state, and `"writer": "agent"` marks the ones the agent reports through `leaf report`; absent, the user writes it. What moved: - Each verb has one writer, so a coordinate never holds both an action and a report. The action-outranks-report precedence is gone from the Python fold, the browser fold, and the version diff; a report is outranked only by a newer report at its coordinate. - The agent/user differences are one conditional schema: an agent verb requires a record other than body, takes no `creates`; only an agent verb names `update`. `overruled` is required by any agent verb, `restated` by any user widget-unit verb. - x-awaits may answer only with user verbs, and the deciding verb must be the user's. - Agent verbs are not in a widget controller's `actions` reading. - `$command.widgets.*.report` is gone: a role's report verb is its state verb when that verb is agent-written. Tests that asserted the shared-coordinate rule and user-over-report precedence are deleted or rewritten to a user verb and an agent verb standing side by side. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/references/packages.md # skills/leaf/scripts/leaf/transcript.py
A done event names its version rather than a revision, so admission fell back to the newest revision's registry; it now reads the registry the version's own revision captured. A verb sent by the side that does not write it is refused as such rather than as undeclared, and both doors' tests hold that refusal. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 24, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 24, 2026
…rb's writer once (#1101) This finishes cut-overs that #1076, #1082 and #1091 left half done, as found in a review of those PRs. **`meaning.scope` replaces `meaning.document`.** - Before, "document" named two shapes: the stored `"page" | "thread"` and the `{kind, revision}` identity that requests, lifecycle seats and the runtime use. - Admission now stores `meaning.scope`. - One helper, `events.document_identity(scope, revision)`, builds the identity. `event_document`, admission's request check and the served request readings all use it. The two direct reads of `meaning["document"]` now go through it too. - *Contract:* the `$events` meaning schemas and `handling` `when` clauses, `events.md`, the seed logs, three snapshots and the delivery sample in `how-it-works.html` are updated. Each snapshot diff is only the rename. **One word for deferred payloads.** The contract already said `records.deferred`. The door and the API now say it too: - `data_fragment` → `deferred_value`; - `/api/data` → `/api/deferred`; - `loadDataFragment` → `loadDeferred`; - the error strings; - `packages.md` and `page-storage.md`. **The writer is resolved once.** - In Python, `state_specs(entry, writer=…)` filters by writer, and `verb_writer(spec)` answers for one verb. The five call sites that restated "absent means user" use them. - In the browser, `registry.adoptRegistry()` sets `writer` on every `x-state` verb when the vocabulary arrives, so `stateSpecs`, widgets and the command hub read one value. **Created children.** - `gesture_words` and the version gate take a created child's tag from `meaning.creates` rather than re-deriving it. - `passages.shown_words` is now the one reading of a created child's `x-text-format`, used by passage capture, the gate and gesture wording. **`example_data.captured_value`** refuses a `lines` range on a `unified-diff` capture instead of silently ignoring it. **The event-log page.** Its captured records are regenerated for `scope`, the note anchors follow them, and the note on `meaning` names `scope`. **Tests.** Everyday suite on the merge with main: 1364 passed, and one failure under parallel load that passed alone. `npm run test:runtime`: 91. `check:browser` clean; `test:browser` 64. A nightly subset over diff, data, deferred, request, receipt, create, writer and report passed 303. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Three more places the event API said one thing twice. Net −76 lines.
x-reportfolds intox-state. An agent-written verb is now anx-stateverb with"writer": "agent"; leavingwriterout means the user writes it. No registry had a verb both sides wrote (lf-agentstateand lf-taskstatuswere report-only, everything else user-only), so each verb has exactly one writer and a coordinate never holds both a user's action and an agent's report.body; only agent verbs may nameupdate; only user verbs may declarecreates.writer()/event_spec()inregistry/contract.py, replaces the"x-state" if action else "x-report"branches in the fold, admission and meaning code.x-awaits.answeredand the deciding verb may name only user verbs.actions.'status' is a verb the agent writes; this action came from the user), at both the browser door andleaf report.donecarries onlyversion.revisionwas derivable andtextwas always "Looks good". Admission derives the revision from the version's note, reads that revision's registry, and refuses a version nothing stamped. A new shared reading,standing_approvals(), feeds the transcript and the browser conversation view. The transcript used to print "Approved" for a withdrawn approval; it now prints only approvals that still stand, with a test that undoes one.x-workistrue. Onlylf-card's content seat was used; the conversation seat andwhenfilter, their validation, docs and tests are deleted.Contracts (
packages.md,events.md,layer-registry.md), both registries,docs/registry.htmland the browser bundle are updated.Tests. Everyday suite: 1354 passed on the merged branch; the five interact files pass (857) after the review fixes.
npm run test:runtime84/84;check:browserclean andtest:browser64/64. A nightly subset over projection, gate, widgets and export passed 520 with one workspace-layout failure that passes alone. An independent review found no correctness bugs; its four smaller findings (sign-off registry, refusal wording, a stale docstring, missing door tests) are fixed here.🤖 Generated with Claude Code