Title: id(web): program-only router pins only its root page — the merged world session bridge serves every hosted world by name · Issue #5728 · developing-today/code · GitHub
Open Graph Title: id(web): program-only router pins only its root page — the merged world session bridge serves every hosted world by name · Issue #5728 · developing-today/code
X Title: id(web): program-only router pins only its root page — the merged world session bridge serves every hosted world by name · Issue #5728 · developing-today/code
Description: Summary The #2146 phase-2 program-only router (create_program_router, merged in PR #5537 commit bde2ec004f) pins only its root page to the bound world. The world session bridge it merges is the shared, unpinned bridge: every bridge handl...
Open Graph Description: Summary The #2146 phase-2 program-only router (create_program_router, merged in PR #5537 commit bde2ec004f) pins only its root page to the bound world. The world session bridge it merges is the sha...
X Description: Summary The #2146 phase-2 program-only router (create_program_router, merged in PR #5537 commit bde2ec004f) pins only its root page to the bound world. The world session bridge it merges is the sha...
Opengraph URL: https://github.com/developing-today/code/issues/5728
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): program-only router pins only its root page — the merged world session bridge serves every hosted world by name","articleBody":"## Summary\n\nThe #2146 phase-2 program-only router (`create_program_router`, merged in PR #5537 commit `bde2ec004f`) pins only its root page to the bound world. The world session bridge it merges is the shared, unpinned bridge: every bridge handler leases whatever world the caller names, so a listener bound to `program:\u003cworld-A>` also serves the full world session API for every other world the hub hosts.\n\n## Evidence (verified this run against laptop primary main `57119df82e`)\n\n- `pkgs/id/src/web/routes.rs:515-531` — `create_program_router` sets `state.program_world` (read only by `program_page_handler`, routes.rs:614) and merges `world_ws::world_routes_at(&world_socket)` with a `WorldWebState { hub: state.world.clone(), cookie_secure }` — the whole hub, no world restriction.\n- `pkgs/id/src/web/world_ws.rs:40-47` — `WorldWebState` has only `hub` and `cookie_secure`; there is no pinned-world field for the bridge to enforce.\n- Bridge handlers route by caller-supplied world name:\n - host-view: world_ws.rs:137 `hub.lease(query.world.as_deref(), None)`\n - directory read/write: world_ws.rs:427 `hub.lease(world.as_deref(), token)` (world from `DirectoryQuery`/`DirectoryRequest`)\n - invite: world_ws.rs:545 `hub.lease(request.world.as_deref(), supplied)` — with the hub admin token, an invite can be minted for a different world through this listener, and `lease` with an admin token may create the named world.\n - websocket: `handler` upgrades and `run_session(&hub, ...)` (world_session/mod.rs:857) joins the world the session names.\n - explore routes merged by `world_http_routes` ride along the same way.\n- The stated contract this breaks: `create_program_router`'s doc (routes.rs:506-514) says the program surface is the bound world's frontend + bridge \"and nothing else\", and `program_page_handler` (routes.rs:610-613) 404s for a world the hub does not host because the surface must never become \"a lobby for a different world\". The existing test `program_router_serves_only_the_program_surface` checks explorer paths 404 and that invite minting without the admin secret is 401 — but never tries a *different hosted world* through the bridge.\n\n## Why it matters\n\nA program binding is the surface an operator deliberately exposes for one world (potentially publicly, per #2146 programs-as-websites). Today that exposure silently includes every other hosted world's session bridge: directory reads/writes, host-view, invite minting, explore pages, and guest session joins for worlds the operator never bound to that listener. Per-world authority inside the bridge (guest caps, admin token) still applies, but the listener-level isolation the phase-2 design promises — one listener, one world — does not exist, and it fails silently: nothing in the router or tests names the gap.\n\n## Acceptance criteria\n\n- [ ] The program router's bridge is pinned to the bound world: requests naming any other world (host-view `?world=`, directory `world`, invite `world`, explore, websocket join) are refused (404, matching `program_page_handler`'s convention) without leasing or creating that world.\n- [ ] Requests naming the bound world, or omitting the world where the bridge defaults, work exactly as on the explorer surface.\n- [ ] Tests extend `program_router_serves_only_the_program_surface`'s pattern: with a hub hosting two worlds, a program router for world A refuses world B on each bridge entry point (invite, host-view, directory read/write, websocket join) and serves world A.\n- [ ] The mechanism is structural (the pin lives in the bridge state or an equivalent single choke point), not per-handler ad-hoc checks that a future bridge route can forget.\n\nRelated: #5537 (parent implementation), #5711 (the phase-1 parse-time companion gap: program target names not validated against the world-name rule). Distinct from #5711 — that is about which names parse; this is about which worlds a live program listener serves.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-05T00:43:03Z","url":"https://github.com/developing-today/code/issues/5728"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e4e9a81-11e0-cc73-dfc2-0cc187962531 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E00:39ABD:72D81F:99CED8:6B062F94 |
| html-safe-nonce | 51a75c16698b363b32c2564d8d8c5fd17487611d03f07d69bc85cf4047ee6fec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTAwOjM5QUJEOjcyRDgxRjo5OUNFRDg6NkIwNjJGOTQiLCJ2aXNpdG9yX2lkIjoiMjg3NDk5NzU5MDE1MDQ5MjA1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3d0099fff4b2e4d0bd129a69dc870d8fe73fc31bccf35e6238a17a52f3368d81 |
| hovercard-subject-tag | issue:6214279275 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/5728/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69957b7035e4143e3762dd0abd88bd001a5541dd8f55062089d2046797447c18/developing-today/code/issues/5728 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69957b7035e4143e3762dd0abd88bd001a5541dd8f55062089d2046797447c18/developing-today/code/issues/5728 |
| og:image:alt | Summary The #2146 phase-2 program-only router (create_program_router, merged in PR #5537 commit bde2ec004f) pins only its root page to the bound world. The world session bridge it merges is the sha... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width