Skip to content

Route the Worker by the manifest's directory kinds, and hold both position folds to one fixture - #1282

Merged
max-sixty merged 5 commits into
mainfrom
consolidate-routes-and-folds
Sep 27, 2026
Merged

max-sixty merged 5 commits into
mainfrom
consolidate-routes-and-folds

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

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's
container. schema.py now names them SESSION_ROUTE_DIRS, PAGE_ROUTE_DIRS is
api plus BROWSER_DIRS plus those, and scripts/site.py writes the manifest's
routes as {layer, session, files}. isPageSessionFileRequest reads
routes.session, and a Worker test adds a session directory to show it is read
rather than known. api stays a fixed protocol prefix in the Worker, named once as
API_DIR: the page server serves /api/... and the Worker handles
api/state, api/event and api/interaction by name, so the manifest cannot
rename it.

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.

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

🤖 Generated with Claude Code

max-sixty and others added 4 commits September 26, 2026 21:45
… 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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@max-sixty
max-sixty merged commit 22dc1c8 into main Sep 27, 2026
5 checks passed
@max-sixty
max-sixty deleted the consolidate-routes-and-folds branch September 27, 2026 05:45
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.

2 participants