Skip to content

A plugin upgrade leaves a live page unable to validate, reply, or re-vendor #820

Closed

Description

@max-sixty

What happens

A live page authored and served under one Leaf version stops validating after the plugin auto-updates to the next, and the documented remedy, re-vendoring, refuses to run.

With the new leaf on PATH, every command that validates the source fails before looking at index.html:

✗ index.html: 1 issue(s)
  - <page>/registry.json: $events.kinds must equal Leaf's fixed transport contract

So version check, reply, and version stamp all refuse, and the page is frozen at its last stamped version while its threads still take reader comments that cannot be answered.

leaf page init <page> (after server stop) declines to re-vendor:

  - 13 events of kind `reply` record: 'agent' was expected
re-vendoring would silently stop these replaying — the user's recorded decisions among them.

Those replies were written by the previous version's own leaf reply, which recorded "agent": "Claude" on each. Running the previous version's CLI from its cached runtime directory against the page still validates, renders and replies, so the page itself is fine; it is the pair of checks in the new version that has no path forward for it.

What I expected

One of:

  • an upgrade that leaves an existing page's registry and event log readable, or migrates them, so the same page can be served and replied to by the next version;
  • or page init offering the re-vendor with the incompatible events kept as they are, since refusing leaves the page unable to take any reply at all;
  • or, failing both, the error naming the way out (run the version the page was made with, or how to find it), rather than only the contract that was not met.

Smallest repro

  1. With version A, leaf page init <page>, author a page with one section, start its server, and answer a reader comment with leaf reply <page> --for <event> --text "...".
  2. Upgrade the plugin to version B (an auto-update did this here mid-session).
  3. leaf version check <page> fails on registry.json: $events.kinds must equal Leaf's fixed transport contract.
  4. leaf server stop <page> then leaf page init <page> refuses with events of kind reply record: 'agent' was expected.
  5. <cache>/<version A>/bin/leaf version check <page> passes.

Seen on leaf f56b814.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    bug
    on Sep 19, 2026
  2. leaf-agent commented on Sep 19, 2026

    @leaf-agent
    Collaborator

    #822 opens both doors your page ran into; it still needs review before it lands.

    Two separate refusals, one cause. $events.kinds is Leaf's fixed kernel transport contract, and your page's registry.json holds the copy the Leaf that vendored it wrote — so after the update it cannot equal the running kernel's, and every command that needs the page's vocabulary refused on it. page init is the only move that resolves that, and it refused too: its vocabulary guard checked each logged event against the incoming per-kind record schema, which no package selection can ever change. The remedy and the thing blocking it were the same command.

    The 13 replies are the second half. It is author, not the agent name you spotted, that fails: the agent's side of a thread was spelled "author": "claude" until #811 renamed that role to agent, #811 shipped a read shim for logs written before it, and #813 removed the shim on the reasoning that every event is written by the running version. An auto-update mid-session is how that stops being true.

    After #822, version check still refuses a page vendored by another Leaf — but it names leaf page init, and page init runs. The log is untouched by the re-vendor: it never reads the per-kind record schema back, so everything projects exactly as it did the moment before. The sequence is the quiescent one in serving-pages.md, which gains a paragraph saying so:

    leaf server stop <page>
    leaf page init <page>
    leaf server start <page>
    

    Worth knowing separately, because re-vendoring does not undo it: with the shim gone, those 13 replies read as user turns. I checked — leaf transcript prints a reply carrying the old token as User, since the projection tests author == "agent" and the log says claude. #813 removed the shim deliberately under Stage, so this PR leaves that where you put it rather than re-landing a migration you had just ruled out.

    One thing the PR leaves open rather than settles: removing that guard leaves the complete stored record with no validator anywhere — the browser door only ever sees the client's half of it, and the CLI writers check none. Restoring that belongs at the append boundary, where a violation is still the writer's to fix, not several commands later where the only response was to freeze the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions