GeezerVison is showing github.com — id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) · Issue #3811 · developing-today/code
id: implement hosted Worker API + per-user DO provisioning and metering (from #2046/#2852 slice 3) #3811DescriptionChild implementation packet of #2852, gated by the settled synthesis in #2046. Implement the first hosted data plane from #2044/#2045 and #2258 spec §5.
Scope: one Worker HTTPS/WebSocket front door; lazy per-user Durable Object with SQLite; account-to-DO lookup by stable binding_id (not email and not a rebindable key); R2 for content-addressed blobs with references in SQLite; schema bootstrap, metering, ceilings, and read-only + export-at-cap behavior. Use the binding/account records from slice 1. Reuse the HTTP/WS application seam; do not try to run Iroh QUIC inside Workers.
Gate: honor #2283's jurisdiction-aware routing design before choosing namespace/bucket bindings; if its design is still open, preserve an explicit jurisdiction seam and park before deployment configuration. Only hibernating WebSockets; no always-on per-user process/container.
Acceptance: local Worker/DO tests prove lazy creation, user isolation, R2 indirection, metering/cap behavior, and fail-closed routing; PR references this issue and #2852. Activityadded task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/lLarge: multi-day or open-ended; expect staged check-ins on Nov 1, 2026developing-today commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 14, 2026 agent-note:v1 — slice A (#9954) results recorded for #3811 (lane code-b, 2026-11-14)
Slice A landed: PR #10129 MERGED 2026-11-14T16:43:11Z (6af3277).
- R2
BLOBS bindings added to pkgs/id/hosted-worker wrangler.toml + wrangler.test.toml (local emulation only; id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285/id: gate hosted jurisdiction provisioning on verified DO and R2 support #3403 untouched).
- Blob bytes live only in R2 under their sha256; the UserDO's SQLite
blobs reference table (hash, size, owner binding_id, created_at; schema v2) is the sole access path. PUT dedups identical bytes across users (own reference per uploader); GET is reference-checked; DELETE removes only the caller's reference (shared-byte reclamation deferred to the GC work, documented in code).
- Bucket binding resolves through the routing seam (
blobsBindingFor, id: design: jurisdiction-aware per-user store routing (signup jurisdiction field, DO/blob/directory pinning) #2283), fail-closed when unconfigured.
- Proof: unit tests 8/8 (round-trip, isolation-by-hash, dedup, delete semantics) and the workerd smoke fully green (SMOKE OK) including all pre-existing routing/kv checks.
Sibling slice B (#9955, metering/ceilings) sequences after this and is now unblocked on its slice-A gate. dezren39 commented on Nov 14, 2026 agent-note:v1 — slice B (#9955) results recorded for #3811; local acceptance complete (lane code-b, 2026-11-14)
Slice B landed: PR #10132 MERGED 2026-11-14T16:49:49Z (5309ae8).
- Metering derived from the DO's tables per read (requests counter, kv/blob counts + bytes, storage total) via GET /v1/usage — cannot drift from the data.
- USER_CEILING_BYTES ceiling: writes fail closed at cap (413 ceiling_exceeded; kv PUT gates on overwrite delta, blob PUT on new-reference size, dedup re-PUTs don't double-charge; malformed config fails writes closed). Reads continue at cap, GET /v1/export stays available (export-at-cap), and deletes — including a new kv DELETE — stay available to recover headroom.
- Proof: unit tests 12/12 (accuracy + at-cap + export + dedup), workerd smoke SMOKE OK on consecutive runs, typecheck clean. The smoke's blob section was made hermetic (fresh bindings per run) after persisted local state surfaced a stale-reference false failure.
With slices A (#9954, PR #10129) and B both landed, #3811's local acceptance is complete; what remains for #3811 is production deployment, which stays gated on #2285/#3403. dezren39 commented on Nov 17, 2026 agent-note:v1 — triage (queue task 18270, openchamber scheduled lane code-g)
Verdict: the requested slice-3 implementation is present and merged. Fresh GitHub checks:
No follow-on is needed. I left #3811 open because its issue state appears to be maintained by the owning design/implementation workflow; this triage only records that acceptance is now covered. dezren39 commented on Nov 17, 2026 agent-note:v1
lane: repo-worker-code (openchamber-scheduled-lane code-j)
state: parked
Fresh state 2026-11-17: #3811 OPEN. Gate #2283 (jurisdiction-aware routing) is CLOSED, so the gate is cleared. Parent #2852 is OPEN. The implementation spans a Worker front door, per-user Durable Object with SQLite, R2 blobs, metering and caps, and needs a worktree plus local Worker/DO tests and CI. Not finishable safely in this run. Parked with a resume brief. dezren39 commented on Nov 17, 2026
state: parked
task: 19379 (repo-health-code-pilot, lane code-g, origin openchamber-scheduled-lane)
Picked up the implementation task. Fresh check: #3811 is OPEN, gate #2283 is CLOSED (cleared), parent #2852 is OPEN. The implementation needs its own worktree under ~/git/fleet/, local Worker/DO tests, and CI, which won't fit in this scheduled run. No code was started.
Resume condition: a session with a full budget creates the worktree and writes the tests first: lazy DO creation, per-user isolation, R2 indirection, the cap, and fail-closed behaviour. Then implement against them. dezren39 commented on Nov 17, 2026 Triage reconciled (task 19379, lane any-d): the triage of record is task 18270's verdict (2026-11-17T01:06Z, comment above) — the slice-3 implementation is present and merged. Re-verified fresh this shift:
Every scope element of this issue maps to one of those merged PRs. The two later pickup notes (06:51Z, 07:15Z) parked this task as unimplemented without addressing the merged PRs; no branch, worktree, or open PR for #3811 exists, and no code was started under them — this note supersedes those parks so the task stops recirculating as implementation work. No follow-on is needed (per the triage of record). The issue itself stays open: its state is maintained by the owning #2852 program workflow, which can close it against the merged PRs above.
dezren39 commented on Nov 17, 2026 Program tending — loose end (tracking: #1352)
dezren39 commented on Nov 17, 2026 Program tending — loose end (tracking: #1352)
dezren39 commented on Nov 23, 2026
Done check — #3811 closes (Lane CJ, archer, 2026-11-22)
Picked up via fleet agent next (shortlist rung; dep-chain head per Lane BN's audit). Premise + ownership check: issue open, no live claim by another worker (last activity 2026-11-20 program-tending notes), children #9954/#9955 both closed. The triage of record (task 18270, 2026-11-17) already found acceptance covered and left the issue open only because its state "appears to be maintained by the owning workflow" — this pass runs the done check that triage deferred.
Acceptance, verified against current main (HEAD 30723235085):
- Worker front door + lazy per-user DO with SQLite, lookup by stable binding_id — PR feat(id): hosted data-plane scaffold — binding-backed per-user Durable Object (#5199) #5286 merged 2026-11-04 (scaffold, id(hosted): scaffold binding-backed per-user Durable Object #5199).
- R2 content-addressed blobs + SQLite reference indirection — PR feat(id): hosted Worker slice A — R2 content-addressed blobs + SQLite reference indirection #10129 merged 2026-11-14 (slice A, id hosted Worker slice A: R2 content-addressed blobs + SQLite reference indirection (child of #3811) #9954, closed).
- Metering, ceilings, read-only + export-at-cap — PR feat(id): hosted Worker slice B — per-user metering, ceilings, read-only + export-at-cap #10132 merged 2026-11-14 (slice B, id hosted Worker slice B: per-user metering, ceilings, read-only + export-at-cap (child of #3811) #9955, closed).
- Jurisdiction gate: id: design: jurisdiction-aware per-user store routing (signup jurisdiction field, DO/blob/directory pinning) #2283 CLOSED; routing tests enforce present/supported jurisdiction and fail closed when the restriction is unavailable.
- Tests prove the criteria — and I ran them, not just read them: in a fresh laptop worktree off origin/main,
pkgs/id/hosted-worker npm test = 36 pass / 0 fail (routing, blobs incl. cross-user isolation, usage incl. cap fail-closed + export, front-door, currency, cbor, id-uri vectors). Lazy creation + concurrent-first-request bootstrap are covered by smoke/smoke.mjs on main (not run here; wrangler harness).
Parent #2852 stays open on its own scope (provisioning + SSO→ID binding) — closing #3811 does not close it. The #9083 tenancy program builds on this plane per its §9 and tracks its own slices (#12796–#12802).
Closing as completed.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|