Repository navigation
Route the Worker by the manifest's directory kinds, and hold both position folds to one fixture - #1282
Conversation
… the browser
Which x-state verb decides a widget, and which member tags each of its outcomes takes
off the page, were derived from the registry twice: Python's `deciding_verb` and
`retirement_slots`, and the runtime's `decidingVerb`, `settlementSlots`, the retired-slot
selector walk in `passages.js`, and the owner walk in `version.js`'s diff-opaque
selector.
Composition now writes the relation into the vocabulary as `$decisions` (owner tag ->
`{verb, retires: {outcome: [member tags]}}`), from `registry.state.stamp_decisions`.
`page init`'s layer composition stamps it after validation, and a page's composition
stamps it again over the page's own declarations. The browser requires it at intake
and reads it through `registry.js`'s `decisionFor`; the four JS walks are gone. Python
keeps calling `deciding_verb` and `retirement_slots`, which the stamp is derived from,
because validation asks them of declarations nothing has stamped yet.
A page whose composition equals its active revision's vocabulary still skips
validation (#1227): the vendored layer carries the stamp, so the comparison holds
unless the page's declarations add to the relation, which revalidates and restamps.
The verb writer default (`agent` where declared, else `user`) stays resolved at
intake on each side, now held to one fixture, `tests/verb_writer_cases.json`, that
`verb_writer` and `adoptRegistry` both read. Stamping it would change the author
contract, whose schema admits only `writer: "agent"`, and would make every page that
declares its own verb differ from its validated vocabulary, so #1227's shortcut would
never hold for it.
Behaviour that moved: a served vocabulary without `$decisions` now fails startup with
the other required `$` facts.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ition folds to one fixture Three places where one fact was spelled on both sides of a runtime boundary. **The Worker's page directories.** #1228 moved a page's URL namespace into the site manifest, but the Worker still spelled which directories the session writes (`media`, `revisions`, `versions`, where a static miss falls back to the container) and which one is the API (`api`). `schema.py` now names each kind (`API_ROUTE_DIR`, `SESSION_ROUTE_DIRS`, beside `BROWSER_DIRS`), `PAGE_ROUTE_DIRS` is their union, and `scripts/site.py` writes the manifest's `routes` as `{api, layer, session, files}`. `isPageApiRequest`, `isPageSessionFileRequest` and `releaseAssetRoute` read the manifest, and a Worker test renames the API directory and adds a session directory to show both are read rather than known. **Position ordering.** `projection.py`'s `folded_positions` and `projection/model.js`'s `foldWidgetStates` each implement the position fold, and only their rank rules shared `tests/rank_cases.json`. The fixture now also holds fold cases (authored containers and standing moves, to each container's order), covering the fold's skip rules (a container or unit the markup lacks, an absorbed move) and ties broken by id. `test_interact_document.py` and `tests/runtime/board-order.test.mjs` both run them. **The unnamed agent's name.** `schema.UNCLAIMED_AGENT` is now `UNNAMED_AGENT`, the name for an agent nothing names: an unclaimed page's, and an agent-authored event's with no `agent`. The transcript reads it with `or` rather than spelling `"Agent"` through `.get`. The browser's five `|| "Agent"` fallbacks stay: three of them sit in functions an in-progress change is editing (`thread/messages.js`'s `messageReading`, `margin-projection.js`, `thread/thread-card.js`), so serving the name to them is a TODO entry. Behaviour that moved: the site manifest's `routes` shape, which the Worker and `scripts/site.py` change together. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
routes.api does not yet own the API directory throughout the Worker. With the renamed rpc manifest used by the new test, pageRoute and isPageApiRequest accept /rpc/state, but index.ts still recognizes api/state for the published-state fast path and rollout response, and api/event, api/interaction, and api/performance for their special handling. A request to /rpc/state therefore goes to the container instead of the published-state path; the Python page server also still exposes /api/.... The test checks the routing helpers but cannot establish the claimed rename behavior. Either keep api a fixed protocol path and remove it as a manifest-controlled kind, or carry the configured directory through these endpoint checks and the page server.
…t kind The Worker handles api/state, api/event and api/interaction by name and the page server serves /api/..., so a manifest that renamed the directory would route it without either following. The manifest carries the layer and session kinds only. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Three places where one fact was spelled on both sides of a runtime boundary.
The Worker's page directories. #1228 moved a page's URL namespace into the site
manifest, but the Worker still spelled which directories the session writes
(
media,revisions,versions), where a static miss falls back to the page'scontainer.
schema.pynow names themSESSION_ROUTE_DIRS,PAGE_ROUTE_DIRSisapiplusBROWSER_DIRSplus those, andscripts/site.pywrites the manifest'sroutesas{layer, session, files}.isPageSessionFileRequestreadsroutes.session, and a Worker test adds a session directory to show it is readrather than known.
apistays a fixed protocol prefix in the Worker, named once asAPI_DIR: the page server serves/api/...and the Worker handlesapi/state,api/eventandapi/interactionby name, so the manifest cannotrename it.
Position ordering.
projection.py'sfolded_positionsandprojection/model.js'sfoldWidgetStateseach implement the position fold, andonly their rank rules shared
tests/rank_cases.json. The fixture now also holdsfold cases (authored containers and standing moves, to each container's order),
covering the fold's skip rules (a container or unit the markup lacks, an absorbed
move) and ties broken by id.
test_interact_document.pyandtests/runtime/board-order.test.mjsboth run them.The unnamed agent's name.
schema.UNCLAIMED_AGENTis nowUNNAMED_AGENT,the name for an agent nothing names: an unclaimed page's, and an agent-authored
event's with no
agent. The transcript reads it withorrather than spelling"Agent"through.get. The browser's five|| "Agent"fallbacks stay: three ofthem sit in functions an in-progress change is editing
(
thread/messages.js'smessageReading,margin-projection.js,thread/thread-card.js), so serving the name to them is a TODO entry.Behaviour that moved: the site manifest's
routesshape, which the Worker andscripts/site.pychange together.🤖 Generated with Claude Code