GeezerVison is showing github.com — feat(id): hosted data-plane scaffold — binding-backed per-user Durable Object (#5199) by dezren39 · Pull Request #5286 · developing-today/code
Conversation
dezren39
commented
Nov 4, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements #5199 (slice 3 of #2852, child of #3811) — first local-only hosted data-plane vertical slice, queue task 8897.
What
New isolated package pkgs/id/hosted-worker:
- Front door (
src/worker.ts): resolves an already-authenticated binding context (X-Binding-Id / X-Jurisdiction from the authenticated internal caller; ceremony stays in pkgs/id/src/hosted_binding.rs), strips client-supplied internal headers, forwards to the per-user DO. No Iroh QUIC in the Worker.
- Routing (
src/routing.ts): the only module touching the raw USERS namespace. Object named by the stable binding_id (32 lowercase hex, minted in id: implement hosted account + ID binding ceremony (from #2046/#2852 slice 1) #3808) — never email, never a provider subject. ID and stub both come from the same env.USERS.jurisdiction(j) restricted namespace; no unrestricted fallback — unavailable restriction fails closed.
- UserDO (
src/user-do.ts): versioned SQLite schema bootstrapped idempotently in blockConcurrencyWhile before serving; first routed request binds the object immutably to (binding_id, jurisdiction); a common guard runs before any read/write (unrouted → 403, identity mismatch → 409, runtime-reported jurisdiction mismatch → 409). Minimal /v1/state + /v1/kv/<key> surface proving lazy creation and isolation. R2/metering/caps are later id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) #3811 steps, out of scope.
- Doc reconciliation: the stale
google:<sub> / userObjectId(sub) sketch in doc/2026-11-01_jurisdiction_aware_user_store_design.md now states the binding_id contract per id: design: hosted provisioning + SSO→ID binding spec — account/binding records, challenge ceremony, delayed rebind, metering, export (from #2045) #2258/id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) #3811.
Verified locally (laptop, workerd)
node --test test/routing.test.ts — 4/4 pass (validation, restricted selection, fail-closed).
node smoke/smoke.mjs — 15/15 pass across two wrangler dev passes.
tsc --noEmit — clean.
Honest limits
Local workerd does not implement jurisdiction restrictions (namespace.jurisdiction() throws), so the app worker fails closed 503 jurisdiction_unavailable for valid requests locally — by design (see README). DO behaviour is exercised via the documented test-only harness (wrangler.test.toml). No deployment, production binding/config, or billable resource is created; the real-account canary and residency proof stay gated on #2285 / #3403.
Refs #5199 · queue task 8897 · lane code-p
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…e Object (#5199)
New isolated package pkgs/id/hosted-worker (slice 3 of #2852, child of #3811): a Worker front door that resolves an already-authenticated binding context to a per-user Durable Object named by the stable binding_id (hosted_binding.rs, #3808), routed only through the jurisdiction-restricted namespace (userStub takes ID and stub from the same restricted namespace; no unrestricted fallback — an unavailable restriction fails closed). UserDO bootstraps a versioned SQLite schema idempotently before serving, binds immutably to (binding_id, jurisdiction) on first routed request, and guards every route before side effects (unrouted, identity mismatch, runtime jurisdiction mismatch all fail closed). Minimal kv surface proves lazy creation and cross-binding isolation.
Local workerd does not implement jurisdiction restrictions (namespace.jurisdiction() throws), so locally the app worker fails closed 503 jurisdiction_unavailable by design; UserDO behaviour is exercised through a documented test-only harness. No deployment, production binding, or billable resource — the real-account canary stays gated on #2285/#3403. Also reconciles the stale google:<sub>/userObjectId(sub) example in the jurisdiction design doc with the binding_id contract.
Tests: node --test test/routing.test.ts 4/4; node smoke/smoke.mjs 15/15 (two wrangler dev passes); tsc --noEmit clean.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 24 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
35bedb9d-3b64-492e-a7fa-a1b2701e783a
Commits
-
Reviewing files that changed from the base of the PR and between ef55926 and 933de63.
Files selected for processing: 13
-
doc/2026-11-01_jurisdiction_aware_user_store_design.md
pkgs/id/hosted-worker/.gitignore
pkgs/id/hosted-worker/README.md
pkgs/id/hosted-worker/package.json
pkgs/id/hosted-worker/smoke/smoke.mjs
pkgs/id/hosted-worker/src/routing.ts
pkgs/id/hosted-worker/src/test-harness.ts
pkgs/id/hosted-worker/src/user-do.ts
pkgs/id/hosted-worker/src/worker.ts
pkgs/id/hosted-worker/test/routing.test.ts
pkgs/id/hosted-worker/tsconfig.json
pkgs/id/hosted-worker/wrangler.test.toml
pkgs/id/hosted-worker/wrangler.toml
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-04T04:49:54.740927Z |
933de63 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 4, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 4, 2026
This was referenced Nov 8, 2026
This was referenced Nov 20, 2026
This was referenced Nov 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|