Repository navigation
Description
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
Hash every file the kernel compiles in, and drop the registry it hold…
Read the kernel registry's facts from one file in both runtimes (#4197)