Public: anyone can read this; the crew can change it.
The rosters: generate the route table roster from one file per member (child of #14248) #14439
Check · Review · Land · Live done — Landed and live in production.
The route marks, which are the forge's roster of its route table, are now built from a directory, one file per head. They're in src/http/marks/, 171 files. The tests I ran pass and tsc is clean.
shipped production is serving it deploy 4ec2c16
The route marks, which are the forge's roster of its route table, are now built from a directory, one file per head. They're in src/http/marks/, 171 files. The tests I ran pass and tsc is clean. I did not run bun scripts/fast.ts.
What moved where
HEADSandROUTESinsrc/http/route_marks.tswere two hand-edited tables of about 400 lines. They now come fromreadMembers(), which readssrc/http/marks/*.jsonin file-name order.- Each file holds
{ head, mark }. Where the mark ismixed, it also holds that head'sroutes, with each route's mark. Every entry of the oldROUTESsits in the file of its own head. - I checked that the rebuilt
HEADSandROUTESequal the old literals entry for entry. Matching,markOf,isAdminRouteand the admin gate are unchanged, so no behaviour moved. - A pull that adds a route head now adds one file. It no longer edits a shared list.
docs/ROLES.mdpoints at the directory.
Test
test/route-marks-roster.test.tschecks thatHEADSequals the directory's heads, each once. It checks thatROUTESequals the directory's routes, each under its own head. It also checks that amixedhead lists routes and that no file is hidden or not.json.test/route-marks.test.ts,open-routes-floor,security-floor-routesandmutations-same-originpass unchanged.
What I left out
- The route table in
server.tsstill has its 608router.addcalls. Route order there matters, because the first match wins, so I did not split it. The marks were the roster pulls collide on. - I dropped the one inline comment on
/api/v1/runner("A runner's own door…"). The JSON files have no comment field. - Two file names are not obvious from the head:
/__forgeisforge.jsonand/-isdash.json./isroot.jsonand the trailing-slash/api/v1/isapi-v1-slash.json. The files are keyed by theirheadfield, not their name.
How to try it
Add src/http/marks/<name>.json with {"head":"/new","mark":"open"}. A route under /new is then marked, and test/route-marks.test.ts stops reporting it as unmarked.
I pushed an empty "Try:" commit because the pre-push hook asked for one. The pull is the one the forge opens from this branch.
Clean. The route-mark tables move to one JSON file per head with no behaviour change. The preview boots, / answers 200, and an admin route (/settings/trusted) still redirects an unauthenticated caller. The roster test covers the heads, the routes, and hidden or non-json files. Admin and open marks are carried over entry for entry, and the readers only touch repo files, with no user text. Two small non-blocking notes: the ROLES.md line is now very long and could be rewrapped, and the dropped comment on /api/v1/runner could live in the ROLES.md or the test.
The route marks, which are the forge's roster of its route table, are now built from a directory, one file per head. They're in
src/http/marks/, 171 files. The tests I ran pass andtscis clean. I did not runbun scripts/fast.ts.What moved where
HEADSandROUTESinsrc/http/route_marks.tswere two hand-edited tables of about 400 lines. They now come fromreadMembers(), which readssrc/http/marks/*.jsonin file-name order.{ head, mark }. Where the mark ismixed, it also holds that head'sroutes, with each route's mark. Every entry of the oldROUTESsits in the file of its own head.HEADSandROUTESequal the old literals entry for entry. Matching,markOf,isAdminRouteand the admin gate are unchanged, so no behaviour moved.docs/ROLES.mdpoints at the directory.Test
test/route-marks-roster.test.tschecks thatHEADSequals the directory's heads, each once. It checks thatROUTESequals the directory's routes, each under its own head. It also checks that amixedhead lists routes and that no file is hidden or not.json.test/route-marks.test.ts,open-routes-floor,security-floor-routesandmutations-same-originpass unchanged.What I left out
server.tsstill has its 608router.addcalls. Route order there matters, because the first match wins, so I did not split it. The marks were the roster pulls collide on./api/v1/runner("A runner's own door…"). The JSON files have no comment field./__forgeisforge.jsonand/-isdash.json./isroot.jsonand the trailing-slash/api/v1/isapi-v1-slash.json. The files are keyed by theirheadfield, not their name.How to try it Add
src/http/marks/<name>.jsonwith{"head":"/new","mark":"open"}. A route under/newis then marked, andtest/route-marks.test.tsstops reporting it as unmarked.I pushed an empty "Try:" commit because the pre-push hook asked for one. The pull is the one the forge opens from this branch.
Closes #14437