Skip to content

fix: name page version skew before admitting events - #2416

Merged
leaf-agent merged 3 commits into
mainfrom
fix/issue-2415-event-admission
Oct 11, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/issue-2415-event-admission

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

A page left vendored across a Leaf update can have a registry that rejects fields the running CLI now writes. Event admission now compares the page's recorded runtime and serving code identities with the running Leaf when the installed registry is readable, and directs the agent to leaf page init when they differ. A missing or corrupt candidate registry still leaves the active revision's captured vocabulary in charge, and an already accepted attempt still returns its recorded event.

The new response reply --ephemeral regression fails before this change because the command writes through a mismatched layer; it passes for both runtime and server identity mismatches after the change. Focused tests also pass for re-vendoring, captured vocabulary with a broken installed registry, and event admission.

This addresses the reply failure in part 1. Historical pictures, delivery command guidance, and wake delivery in parts 2–4 remain open.

Refs #2415 — automated triage

Event writers now refuse a page whose installed runtime or serving code belongs to another Leaf, directing the agent to re-vendor before a new event is validated. Existing accepted attempts still return their recorded result. The response reply regression covers both identities.

Refs #2415
@leaf-agent
leaf-agent merged commit 36d09d7 into main Oct 11, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-2415-event-admission branch October 11, 2026 19:10
leaf-agent added a commit that referenced this pull request Oct 11, 2026
The [public release
journey](https://github.com/max-sixty/leaf/actions/runs/38166862461)
failed when its triage-board comment received HTTP 400.
[#2416](#2416) made event
admission compare the page's serving identity with the running Leaf.
That identity included `sys.version`: CI built the page with Python
3.12, while [the website
container](https://github.com/max-sixty/leaf/blob/36d09d7abc691768ed67ea1c7a00261185630d25/Dockerfile.website)
runs Python 3.14. The first comment therefore looked like a write
through another Leaf's contract.

The serving identity now hashes the Python serving files and dependency
manifests, which define the vendored event contract, without the
interpreter's version string. A focused regression reproduced the HTTP
400 before this change and now verifies that a page remains current
under `page init --dry-run` and accepts the comment after the Python
version changes. The existing checks for changed serving files and
manifests, and for genuinely foreign runtime and server identities, also
pass (6 focused tests total).

The hosted Chrome journey cannot run in this sandbox because Chrome
aborts at startup when it cannot create a socket; the public deployment
check will exercise the full route after landing.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 12, 2026
…col bump (#2476)

Open pages stop breaking on every Leaf update. Until now each page
server refused a page whose vendored runtime fingerprint (a hash of all
of `assets/runtime/`) differed from the running Leaf's, and since #2416
the append door also refused every write when the hash of all Leaf's
Python differed. Over the last 30 days those hashes changed in 751 and
494 of 1828 commits, so almost any plugin update left every open page
unservable and unwritable by the new Leaf, its hooks included, until
`leaf page init`. That is how a live session's hook came to deliver a
batch, fail to record the pickup, and redeliver it every turn.

Compatibility is now a declared number. `layer.PROTOCOL` is recorded by
`page init` as `$layer.protocol`; page servers (`http.page_endpoint`,
the website's `page_binding`) and the append door
(`event_contracts.write_refusal`) refuse only a page vendored at another
number, through `layer.incompatible_layer`. The comment on `PROTOCOL`
says when to bump it. A bump is when consumers have to re-vendor;
between bumps, pages keep working.

Additive kernel changes stay compatible at one number because the
running Leaf owns the kernel's event records: admission, the browser
event door and sample histories validate against
`registry.kernel.kernel_event_kinds()` rather than the page's captured
`$events`, and `registry/layer.validate_event_contracts` is gone
(`merge_layer_declarations` still stops a layer changing `$events`).
This fixes the first half of #2415 — a newer CLI's reply refused by an
older page's schema — without a re-vendor.

The hook also plans each page's write refusal once
(`PagePlan.unwritable`): `pick_up_acknowledged` records no pickup on a
page it cannot write, and the turn's attention names the refusal with
its `leaf page init` remedy, instead of the prompt hook exiting 1 with
nothing delivered.

Behavior changes:

- A page another Leaf vendored at the same protocol is served, written
and checked.
- A page vendored at another protocol, which includes every page
vendored before this change, is refused once with the `leaf page init`
command.
- The render gate (`page check --render`, `page picture`) still requires
the exact runtime, now checked in `render_gate/preview.py`, because its
probe modules import the page's runtime modules by name.

Part of #2415

> _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 25, 2026
…pair (#4149)

Since `merge: yolo`, Tend's self-review is the only gate on the 626 pull
requests it has authored and merged, and at least 17 of them were later
reverted, replaced or broke main. Most cost every user or later change
something to fix one case: room reserved in every margin message for a
rewrite that may never open (#2959), a third wrapping mode (#3678), a
guard refusing writes whenever a code hash changed (#2416), a public
knob nobody needed (#3830), every sent message narrowed 86px to pass a
test (#3679). The review threshold ended the review once the claimed
path worked and omitted "minor simplification", and the review logs show
reviewers stopping there; the upstream "Does the change carry its
weight?" never produced a finding.

## Changes

- **`/developing-leaf` gains "Weigh what a change adds"**, the forward
version of the Regular maintenance bar, for whoever writes or reviews a
change: what it adds, what that buys, who pays and who gains, and the
cheaper change.
- **The running-tend review threshold** points to it, counts an addition
that costs more than it buys as a finding rather than polish, widens
"regressions on the claimed path" to anywhere the change reaches, and
has the reviewer state the weighing in the session before searching for
defects, since on Tend's own pull request a defect found in an addition
gets fixed and the addition lands. Findings that ask a change to cover
more (compatibility, bounded edge cases, work outside the diff) stay
omitted.
- **A CI repair that changes what a page draws** names the states it
changes, and its review captures each with `leaf-dev stills` on base and
head and looks at the crops before the verdict. The review makes the
captures because a bot's description can't carry images.

## Validation

An offline replay of Tend's Codex reviewer (`gpt-6.1-sol`, the tend
review skill, history cut at each merge, no network or tests), with only
these two files differing between arms, over five bad merges and three
good ones:

| Arm | Bad PRs held for the cost the later fix removed | Good PRs held
for complexity |
|---|---|---|
| main | 0 of 10 | 0 of 6 |
| criterion as a pointer only | 0 of 5 | 0 of 3 |
| weighing stated before the verdict (four wordings, pooled) | 7 of 40 |
0 of 24 |

A hold for an edge-case bug didn't count. The counts are small (p ≈
0.3), though the direction held in every round. #3679 was never caught
by any arm, which is what the stills rule is for; that rule has no
replay, since the replay ran without a browser.

Closes #4130

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

1 participant