Skip to content

feat(id): hosted data-plane scaffold — binding-backed per-user Durable Object (#5199) - #5286

Merged
dezren39 merged 1 commit into
mainfrom
queue/8897-5199-hosted-worker
Nov 4, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/8897-5199-hosted-worker

Conversation

@dezren39

@dezren39 dezren39 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

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:

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
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@dezren39
dezren39 requested a review from a team as a code owner November 4, 2026 04:47
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

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.

@dezren39
dezren39 merged commit 71a9ff1 into main Nov 4, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/8897-5199-hosted-worker branch November 4, 2026 05:18
@dezren39
dezren39 restored the queue/8897-5199-hosted-worker branch November 8, 2026 04:27
@dezren39
dezren39 deleted the queue/8897-5199-hosted-worker branch November 16, 2026 13:19
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.

1 participant