GeezerVison is showing github.com — slice(#14866): deploy the fleet queue on D1 — create + bind QUEUE_D1, real-D1 parity, versions deploy · Issue #14870 · developing-today/code
slice(#14866): deploy the fleet queue on D1 — create + bind QUEUE_D1, real-D1 parity, versions deploy #14870DescriptionChild of #14866 (fleet queues → Workers + D1). Follow-on to PR #14868, which landed D1QueueStore in pkgs/fleet/hosted-worker (the queue backend over a D1 binding, parity-proven against the documented D1 API shape over a local SQLite engine) with buildDeps selecting it when the QUEUE_D1 binding is present. Nothing is deployed or bound yet.
Work
- Create the
fleet-queue D1 database (Cloudflare account of record for the fleet doors) and record its database_id in pkgs/fleet/hosted-worker/wrangler.toml's [[d1_databases]] stanza (the stanza landed with PR feat(hosted-worker): D1QueueStore — the fleet queue over Cloudflare D1 (#14866 slice) #14868, id intentionally blank).
- Provision the schema: the shared
LIBSQL_QUEUE_SCHEMA DDL from src/libsql-queue-store.ts (the store also applies it lazily, IF NOT EXISTS — provisioning explicitly makes the deploy reviewable).
- Run the parity suite against the real D1 database (a wrangler/miniflare-local D1 at minimum; the deployed database before cutover):
test/d1-queue-parity.test.ts gains a real-D1 gated suite beside the Hrana suite's wire pattern, or a recorded manual run with its output on this issue.
- Bind
QUEUE_D1 in the deployed shape of the hosted door and deploy via Cloudflare versions (build/publish, then versions deploy — the program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866 deploy rule), with the Turso/Hrana backend as the rollback: unbinding QUEUE_D1 restores the previous backend with no code change (state the data-migration direction for in-flight tasks explicitly before cutover — export/import over the shared schema, never translation).
- Record on program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866: what moved, the deploy/rollback path as exercised, and the post-cutover health evidence (queue health verb reporting
backend: "d1").
Acceptance
Refs #14866, PR #14868.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-25T05:40:08Z",
"session_id": null,
"lane": null,
"host": "amd",
"worktree": "/home/user/wt-lane-iw280-14866",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/wt-lane-iw280-14866",
"repo": "developing-today/code",
"branch": null,
"sha": "9e7e592ce791c745d507f8f980d768d7d5cd2336"
},
"auth_subject": "agent-next-20-local",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Acceptance criteria
- A real-D1 parity run is recorded on this issue (suite output or a gated real-D1 suite green).
- The hosted door serves the queue verbs with
describe() reporting backend d1 in the deployed shape, with QUEUE_D1 bound and the database_id recorded in wrangler.toml.
- Rollback to the Turso/Hrana backend is demonstrated or rehearsed and recorded (unbinding
QUEUE_D1 restores it with no code change), and the data-migration direction for in-flight tasks is stated before cutover.
- Issue program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866 is updated with the slice record: what moved, the deploy/rollback path as exercised, and post-cutover queue-health evidence reporting backend
d1.
Activitydeveloping-today commented on Nov 25, 2026 added effort/lLarge: multi-day or open-ended; expect staged check-ins app/fleetpkgs/fleet multicall binary + platform crates meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Nov 25, 2026developing-today-fleet commented on Nov 25, 2026 Intake review
Fleet monitor intake pass (protocol §5), 2026-11-25.
- Related: parent program issue program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866; predecessor PR feat(hosted-worker): D1QueueStore — the fleet queue over Cloudflare D1 (#14866 slice) #14868 (merged, landed
D1QueueStore).
- Still live: verified open this run; merged-PR search returned no PR that explicitly resolves this issue (see notes).
- Notes: The body already carries an 'Acceptance' checklist; this appended section restates it under the standard 'Acceptance criteria' heading so the fleet's intake check recognises it. Nothing is deployed or bound yet per the body.
- Risks: Medium: real-D1 behaviour can differ from the local SQLite parity shape; the explicit provisioning + gated real-D1 suite is the mitigation named in the body.
- Suggested approach: Create/bind the D1 database, provision the shared schema explicitly, run real-D1 parity, deploy via Cloudflare versions, rehears rollback, record on issue program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866.
🤖 Agent note · filed
developing-today-fleet commented on Nov 25, 2026 agent-note:v1
event: picked-up
by: ITEM-WORK-287 (archer seat item lane; dry-queue fallback — drawn directly as a workable open issue after fleet agent next returned empty on all rungs, 2026-11-25 ~00:30 CST)
Claiming #14870. Premise check: issue open, no live claim (only the Kaneo bot link and the fleet monitor's intake review), PR #14868 merged (9e7e592ce791) with the [[d1_databases]] stanza's database_id intentionally blank, nothing deployed or bound yet.
Plan: create the fleet-queue D1 database with the sanctioned tooling, record its database_id in pkgs/fleet/hosted-worker/wrangler.toml, provision the shared schema explicitly, and record a real-D1 parity run. The bind + versions-deploy cutover follows in this lane if the deploy path verifies cleanly; otherwise the remainder is checkpointed here with exact state. Data-migration direction for in-flight tasks will be stated on this issue before any cutover. developing-today-fleet commented on Nov 25, 2026 agent-note:v1
event: data-migration direction — stated before any cutover (per this issue's step 4)
by: ITEM-WORK-287 (archer seat item lane)
Data-migration direction for in-flight tasks, stated before cutover:
- The
fleet-queue D1 database starts empty. This deploy moves no live data: the production queue keeps being served by the native broker over the existing Turso DB, untouched by this slice. The hosted door being deployed is a new peer door, not a cutover of the live broker.
- When a later slice moves live traffic to the hosted door, in-flight task rows move by export/import over the shared schema (
LIBSQL_QUEUE_SCHEMA — one schema for the embedded, Hrana, and D1 stores; the cross-store interop parity tests prove rows written through one store read back identically through another). Never by translation, never by a second schema.
- Rollback is a config act, not a data act: unbinding
QUEUE_D1 (deploying a version without the binding) makes buildDeps fall back to the Turso/Hrana backend with no code change. Rows written to D1 while it was bound export back over the same shared schema the same way.
developing-today-fleet commented on Nov 25, 2026 agent-note:v1
event: done — slice landed, deployed, rollback rehearsed
by: ITEM-WORK-287 (archer seat item lane)
What landed
PR #14898 (merged 3c0bfef15c5) — wrangler.toml records the database_id, enables the workers.dev address, retires the local-only posture for the queue door; the gated real-D1 parity suite is added to test/d1-queue-parity.test.ts. PR #14914 (merged 7b3bbe51d1) — the platform registry (pm-stack/platform/workers.json) now records fleet-hosted as in service at its address.
The database (steps 1–2)
- The
fleet-queue D1 database pre-existed in the fleet account of record (234b866b99ce2b142d7963d8d139cbfa): created 2026-11-25T03:14:57Z, empty (num_tables: 0, only _cf_KV). No record of its creation exists on program: move PM Stack, queues, and all unblocked services to Workers + D1 (Cloudflare-first) #14866 or here; this slice adopted it — a second database of the same name cannot exist in the account — and recorded its id (c17186b0-e27f-4b0b-9429-54c1ecf2f4fb) in wrangler.toml.
- Schema provisioned explicitly from the store module's own
LIBSQL_QUEUE_SCHEMA (byte-identical by construction): 12 statements → tables checkpoints, events, lanes, leases, repo_task_lane_ledger, tasks, workers, 9 indexes.
Real-D1 parity (step 3) — recorded run
Gated suite (HOSTED_WORKER_D1_DATABASE_ID / CLOUDFLARE_ACCOUNT_ID / CLOUDFLARE_API_TOKEN), run on the laptop against the deployed database:
✔ real D1: two doors over the production binding adapter enqueue, claim and complete on the deployed database (35850ms)
ℹ tests 7, pass 7, fail 0 (test/d1-queue-parity.test.ts, gated run)
Door A via openD1QueueStore, door B via buildDeps — both over the production D1DatabaseClient, statements travelling the D1 HTTP API. The queue health verb in the same run reported backend: "d1". Read-back from the database itself: task id 1, queue d1-parity-smoke, status done — left in place as the run's record. Full package suite ungated: 255 tests, 252 pass, 0 fail, 3 skipped; tsc --noEmit clean.
Deploy (step 4) — Cloudflare versions
- First deployment of
fleet-hosted (the registry listed it "not deployed" until this slice): wrangler deploy from merged main created the worker and version 9f2165f6-3cf6-4ec3-a7f1-3142886231de at 100% (wrangler requires a plain deploy before versions exist; every later change goes through versions upload + deploy). Bindings on the active version, verified by wrangler versions view: env.QUEUE_D1 (c17186b0-…) D1 Database, env.BRIDGE (message-bridge), env.RP_AUDIENCE.
- Live: https://fleet-hosted.developing-today.workers.dev —
GET /health → {"status":"ok","service":"fleet-hosted",…,"doors":["stamping","query","queue","ingestion","sync","bridge"],"auth":{"rp_configured":false,"tenancy_configured":false}}. The queue route refuses unauthenticated calls (403).
- Rollback rehearsed at the versions layer: a second version 75a11fcb-baf6-40bf-ad06-aeab2e6772f4 — same code, config identical except the
[[d1_databases]] stanza removed — was uploaded and deployed at 100%; /health answered ok on it; the D1 version was then re-deployed at 100% and verified again. Unbinding QUEUE_D1 is a config-only act: buildDeps falls back to the Turso/Hrana backend with no code change (selection proven in-process by the wiring test and the gated suite, which drive buildDeps both ways). The rehearsal did not bind the production Turso token onto the public endpoint — with no RP configured every queue route refuses callers anyway, and the token's exposure isn't needed for the evidence.
- Data-migration direction was stated on this issue before the deploy (comment 7154932412): no live data moved — the native broker over Turso is untouched; rows move between backends by export/import over the shared schema, never by translation.
The one honest gap
An authenticated queue-verb call against the live workers.dev endpoint still needs an RP credential for this door, and none exists yet: /health reports rp_configured: false — the RP issuer and tenancy wiring for the hosted door is owned elsewhere (the #9077 provider stand-up / #9074 tenancy DB) and those doors fail closed until it lands. The verb-level backend: "d1" proof above is therefore through the production adapter + buildDeps against the real database in the deployed bundle's exact configuration, not through a credentialed HTTPS call. That dependency is named on #14866 with this slice's record.
Closing #14870 as completed on this evidence. developing-today-fleet commented on Nov 25, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|