Skip to content

Python and the browser read registry facts from one copy #4113

Closed

Description

@max-sixty

Python and the browser can read different values for the same registry fact while someone is developing, and nothing reports it until pnpm run check. It's the same failure #3886 removes for stylesheets.

Reproduced. I raised $passages.context in browser/registry.json from 24 to 31. Python read 31 at once. The served runtime/passage-facts.js still said CONTEXT = 24, and the kernel stayed in use. build/registry.mjs generates seven runtime modules from the registry: names.js, marks.js, passage-facts.js, event-kinds.js, protocol.js, syntax-languages.js and drawing-schema.js. Each one is a copy that is stale until the build runs.

Proposal. The runtime reads the served /registry.json as a JSON module, so both runtimes read one table. That deletes the seven generated modules and build/registry.mjs (126 lines), about 168 lines in all.

Cost, unmeasured. The registry would then load before any module evaluates, so it needs a startup comparison (AGENTS.md, "Working on the repository"). Generating the modules from Python at serve time instead would need Node-to-Python generation for tsc, test:runtime and rolldown, and would still leave the Shiki-dependent syntax-languages.js.

Related prose to correct when this is decided. The $names and $passages descriptions in browser/registry.json say a page's runtime "keeps the one it was vendored with". Since #3448 a page runs the serving Leaf's runtime. Whether those changes still need a protocol bump, for the page's vendored declarations, should be settled together with this issue.

Waits on the user: whether a startup cost is acceptable for one source of truth.

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

Activity

  1. added
    backlog
    next
    dev-velocity
    waits-on-user
    on Oct 25, 2026
  2. added a commit that references this issue on Oct 26, 2026
    55864e9
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

    backlogdev-velocitynextwaits-on-user

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions