GeezerVison is showing github.com — CF-5c (#14945): pm-service serving substrate — async tenant store + Worker entry · Issue #14969 · developing-today/code
CF-5c (#14945): pm-service serving substrate — async tenant store + Worker entry #14969DescriptionCF-5c — pm-service serving substrate: async tenant store + Worker entry (child of #14945, programme #14866). Blocks CF-5d.
Why this exists (premise evidence: #14945 comment 7157705797): pm-service's read API (#12828, createReadApiHandler) exists only as a handler factory over the synchronous SqlDb interface (exec/run/all/transaction in pm-stack/pm-service/src/tenant-store/migrate.ts), whose only adapter is bun:sqlite for tests. There is no wrangler config and no Worker entry. The tenant plane is Turso/libSQL (async HTTP), which a synchronous interface cannot drive — so no M5 surface can serve hosted until this lands.
Scope:
- An async store layer for the read path (read-api store functions over a libSQL/Turso HTTP adapter), keeping the pm stack: multi-board hierarchy + full task genealogy #9060 §6 response shapes byte-identical; the synchronous tenant-store stays as-is for migrations/tests unless the async rework proves it should be shared.
- A Worker entry + wrangler config for pm-service mounting the read API, with credentials by name only (tenant DB URL/token as Worker secrets; no token read or persisted on the read path itself, per the read API's existing invariant).
- Versions deploy per design §4: versions upload stamped with the commit SHA, commit-stamped health gate, versions deploy, rollback by version promotion; a deploy workflow following the decision-events/pm-console-edge pattern.
Acceptance: the four existing read routes (projects/item/roadmap/releases) serve from a deployed pm-service Worker against the real tenant DB; parity evidence = the existing read-api test suite passing against the async adapter (run remotely) + a live read of each route recorded on this issue; deploy/rollback record on this issue.
Design of record: doc/2026-11-25_design_cloudflare-first-migration.md (PR #14940). Owned paths: pm-stack/pm-service/.
{
"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-25T08:58:46Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": "/home/hatch",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/hatch",
"repo": "developing-today/code",
"branch": "main",
"sha": "c11f41086f57d626be7eb582763b721f8f557408"
},
"auth_subject": "felix",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Acceptance criteria
- An async store layer drives the pm-service read path over the Turso/libSQL tenant plane (no synchronous SqlDb interface on the hosted path), with the existing read API handler served from a real Worker entry with wrangler config.
- Read-path behaviour matches the existing bun:sqlite test expectations, re-proven against the async layer.
- This slice unblocks CF-5d: a hosted M5 surface can call the serving substrate end to end.
Activitydeveloping-today commented on Nov 25, 2026 developing-today-fleet commented on Nov 25, 2026 ContributorAuthor More actions agent-note:v1
Agent: item-work-319 (Archer item lane, Muse seat)
State: claimed — CF-5c implementation slice
Premise check (fresh reads, 2026-11-25): issue OPEN, no live claim, no implementing PR. Premise verified against origin/main: the read API (#12828, closed) exists at pm-stack/pm-service/src/read-api/api.ts as a handler factory over the synchronous SqlDb; the only adapter is bun:sqlite (tenant-store/sqlite.ts); pm-service has no wrangler config and no Worker entry. Scope as written in the issue: async store layer for the read path over a libSQL/Turso HTTP adapter (response shapes byte-identical), Worker entry + wrangler config, versions deploy workflow per design §4. The synchronous tenant-store stays as-is for migrations/tests.
Working in a laptop worktree off origin/main; PR + record to follow here. developing-today-fleet commented on Nov 25, 2026 ContributorAuthor More actions agent-note:v1
Agent: item-work-319 (Archer item lane, Muse seat)
State: slice landed — async substrate merged; live deploy in flight; tenant secrets remain
What landed
PR #15043 — MERGED c75c37aaf4b6 (CF-5c substrate):
src/tenant-store/libsql-http.ts — AsyncSqlDb + libsqlHttpDb (Hrana v3 pipeline over fetch; credentials only in the adapter closure, from Worker secrets).
src/read-api/async-store.ts + async-api.ts — the four loads and four routes awaited. All SQL and row→shape mappings are shared with the synchronous store (extracted registryFromRows / poolFromRows / boardSummaryFromRow / roadmapRowsFromRows / releaseSnapshotsFromRows), so the §6 shapes cannot drift; the sync tenant-store is behaviourally untouched.
src/worker.ts + wrangler.toml — Worker entry; /health reports the VERSION stamp; API routes answer a structured 503 until the tenant secrets exist (honest state, no invented data).
.github/workflows/pm-service-deploy.yml — design §4 versions standard (upload SHA-stamped → preview health gate → promote → post-check; rollback_version dispatch input promotes a previous version back).
workers.json gains the pm-service entry (state: not deployed); README documents the slice.
Verification: bun test 63 pass / 0 fail (new test/read-api-async.test.ts: 13 tests — every route's status+body byte-identical async vs sync over the seeded §8 fixture; Hrana request/encoding/decoding pinned against a stub fetch); bun run typecheck clean; wrangler deploy --dry-run bundles (21.56 KiB). Route: laptop worktree (the suite is bun-local by design; the workflow re-runs it in Actions pre-upload).
PR #15052 — MERGED 672bf65d51cf (first-deploy fix): the first deploy run (45602454798) failed at upload — wrangler versions upload refuses a Worker that does not exist yet. The workflow now stands the Worker up with a plain VERSION-stamped deploy when the Workers API reports the script 404 (the pm-console-edge stand-up shape); later deploys take the versions path.
What remains (issue stays open)
- First deploy run 45603345016 (at
672bf65d51cf) — queued behind an estate-wide Actions runner backlog at record time (every recent run on the repo is queued). When it runs: stand-up deploy → health re-check must report the merge SHA. If it fails, its log is the next step.
- Tenant secrets: provision
PM_TENANT_DB_URL / PM_TENANT_DB_TOKEN Worker secrets from the tenant plane (checked 2026-11-25: no pm-tenant Turso credential exists in the secrets broker under that name). Until then the deployed Worker serves /health and honest 503s.
- Then: live reads of the four routes + the deploy/rollback record complete this issue's acceptance, and CF-5d (CF-5d (#14945): M5 read waves over tenant-DB projections #14970) is unblocked on the substrate (it was blocked on CF-5c).
developing-today-fleet commented on Nov 25, 2026 ContributorAuthor More actions agent-note:v1 — addendum (item-work-319): first deploy completed green after the record above was posted.
- Deploy run 45603345016 at
672bf65d51cf: success. The stand-up step deployed the Worker (upload/promote correctly skipped on first deploy); the final health gate passed.
- Live read-back (independent, from outside):
GET https://pm-service.developing-today.workers.dev/health → {"ok":true,"service":"pm-service","version":"672bf65d51cfc302f19544f3211405096ad0a122"} — the exact merge SHA. GET /api/projects.json → HTTP 503 {"error":"pm-service tenant store is not configured"} — the designed honest state until the tenant secrets are provisioned.
Remaining for acceptance is unchanged: provision PM_TENANT_DB_URL / PM_TENANT_DB_TOKEN, then the four routes' live reads + a rollback record. The workers.json entry's state is being corrected to "in service" in a follow-up PR (its merge also exercises the versions upload → gate → promote path for the first time). developing-today-fleet commented on Nov 25, 2026 ContributorAuthor More actions Intake review
Related: parent issue #14945, programme issue #14866; read API from issue #12828. Blocks CF-5d.
Notes: Issue verified still open and live at intake (no merged PR found in the body evidence resolving it; the body scope stands). Acceptance criteria appended to the body by the fleet monitor (original body preserved verbatim above the new section); labels normalised per the taxonomy.
Risks: Scope creep beyond the slice as written; dependencies named in the body (parent/design/gate issues) may gate the start. For claimed slices, the holding lane's own plan governs sequencing.
Suggested approach: Work the slice exactly as scoped in the body, prove each acceptance bullet with a test, drill record or live read-back as its wording requires, and post the evidence on the issue before closing.
🤖 Agent note · filed
- Agent: fleet monitor
- Session / ID: repo-fleet-monitor run 2026-11-25 05:14 CST
- Found via: monitor reconciliation (intake enrichment, protocol §5)
- Task: intake pass — acceptance criteria, label normalisation, related links
- Expectation: enriched item is ready for triage/queue routing
- Links: this issue
dezren39 commented on Nov 26, 2026 CF-5c refresh (2026-11-26, OpenChamber lane any-o): the substrate and versions deploy work remains merged and deployed (PRs #15043, #15052, #15060, #15065; prior issue notes record the remote test/deploy health-gate evidence). Fresh production probe at 2026-11-26 09:57 UTC: /health returned 200 with version 8729aed0519951c42b30a529f6542c274492bbb5; /api/projects.json returned 503 pm-service tenant store is not configured. fleet secrets list contains no PM tenant DB URL/token names; the tenant-specific DB endpoint and scoped credential are not provisioned in the Fleet secret broker. I am not substituting the fleet-platform ledger DB: design of record requires the PM data to live in the tenant Turso DB. Therefore the four live data reads and rollback-by-promotion against that tenant DB remain incomplete; keep this issue open for that resource prerequisite. Existing code/deploy acceptance evidence is preserved above; no code was changed in this pickup. dezren39 commented on Nov 26, 2026
Completed by repo-worker-code (outcome: done). CF-5c substrate complete: async tenant-store adapter, Worker entry, and versions deployment are merged and verified in PRs #15043/#15052/#15060/#15065; current production health is green. The issue remains open for the separately documented tenant DB provisioning prerequisite: fresh four-route read probe still returns 503 because PM_TENANT_DB_URL/TOKEN are absent. Do not claim live tenant reads or rollback against a tenant DB.
Disposition: verdict merged_verified, checked_at 2026-11-26T10:11:03Z -- the record below passed the broker's offline disposition gate at completion time.
{
"checked_at": "2026-11-26T10:11:03Z",
"source": "fleet gh readback",
"issue": {
"number": 14969,
"state": "open",
"state_reason": null,
"closed_at": null,
"closed_by": null
},
"pulls": [
{
"number": 15060,
"state": "merged",
"is_draft": false,
"merged_at": "2026-11-25T11:30:54Z"
},
{
"number": 15065,
"state": "merged",
"is_draft": false,
"merged_at": "2026-11-25T11:38:15Z"
},
{
"number": 15052,
"state": "merged",
"is_draft": false,
"merged_at": "2026-11-25T11:19:17Z"
},
{
"number": 15043,
"state": "merged",
"is_draft": false,
"merged_at": "2026-11-25T11:13:38Z"
}
],
"verdict": "merged_verified",
"follow_up": null
}
dezren39 commented on Nov 26, 2026 agent-note:v1
task: 23746
issue: #14969
lane: agent-next-23-local
worker: agent-next-23-local
state: blocked
Fresh verification agrees with the prior CF-5c handoff: PRs #15043/#15052/#15060/#15065 are merged and the deployed Worker health route is green, but the tenant read route returns 503 because PM_TENANT_DB_URL and PM_TENANT_DB_TOKEN are not provisioned. The Fleet secret registry has no names for those tenant credentials. The queue task is blocked on the tenant-plane endpoint and scoped token being provisioned to the pm-service Worker. Resume by reading all four routes from the real tenant DB and recording rollback-by-promotion. Do not substitute the fleet-platform ledger database or invent data. No code changed in this pickup. developing-today-fleet commented on Nov 26, 2026 ContributorAuthor More actions agent-note:v1 — ruling impact (recorded by a CF-5 lane, 2026-11-26): the owner ruling on #14866 (comment 7189808145) supersedes design §2's data placements. For this slice that means the async store layer's target is no longer only the tenant Turso plane: D1 is now the programme's store target, so the async adapter work here should be scoped against D1 (and the per-tenant D1 shape settled by #15482/#15494) rather than a libSQL-only adapter, or the slice should record explicitly why its read path still lands on Turso as an interim. State unchanged: still status/blocked as recorded; this note only retargets the design input. Refs #14866 ruling; sibling record on #14968 (D1 ledger retarget, PR #15544). developing-today-fleet commented on Nov 27, 2026 ContributorAuthor More actions
Decided: Make the next #14969 PM read-path slice consume a D1 binding; treat the merged Turso adapter as transitional and do not make the missing Turso URL/token a prerequisite for hosted reads.
Why: The current programme direction recorded on #14866 comment 7189808145 retargets PM board data to D1. #14969's live read requirement remains unmet because its old Turso store is unconfigured and returns 503.
Undo: If a later recorded direction restores Turso for PM reads, switch the selected adapter back and migrate data under that direction.
By: agent-next-27-local
Next slice: after the D1 adapter PR, the pm-service worker tests show that a D1 binding serves the same async read API while the absence of either store continues to return an honest 503. developing-today-fleet commented on Nov 27, 2026 ContributorAuthor More actions CF-5c progress — D1 read adapter
Following the D1 direction recorded in the decision above, PR #16120 is merged as dd5d39c93bb012035ffdf103666bf065f60dc707. It adds a D1 binding adapter for the existing async read path; the D1 binding takes precedence when configured, while the old Turso adapter remains only for the data-copy transition. No D1 binding was deployed in this slice, so an empty database cannot replace the current read source.
Evidence:
- Before implementation, the new D1 worker test received the expected 503 (17 passed, 1 failed).
- After implementation,
bun test test/read-api-async.test.ts test/d1-store.test.ts passed (20 passed, 0 failed); bun run typecheck and git diff --check passed.
- Main deploy run 45989491349 succeeded. Live
/health reports merge dd5d39c93bb012035ffdf103666bf065f60dc707 and a deployment age. This does not prove live tenant reads; /api/projects.json remains unverified against D1.
The former blocker on a Turso endpoint/token is superseded by the D1 decision. Next: provision the PM D1 database, apply the schema, copy and verify the current data, then bind it and verify all four live read routes plus rollback-by-promotion. This issue remains open until those checks pass. developing-today-fleet commented on Nov 27, 2026 ContributorAuthor More actions code-g CF-5c verify 15:35Z (task 23746, attempt 5): D1 pm-service (62ba1f0d) readback — schema migrations v1+v2 applied 2026-11-27T11:35:14Z, all 16 tables present, but every data table is empty (0 items, 0 snapshots, 0 boards, 0 releases). So schema is done; the blocking step is still snapshot sourcing/loading per the 11:12Z D1 decision, then binding + versions deploy. Live: unauthenticated /health and /api/projects.json both 302 to Access login, so authed read state still unverifiable without an owner session. Note: pm-console-edge-deploy failed twice on main today (14:57Z/15:04Z), so the versions-standard deploy path is currently red. Re-parking.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|