GeezerVison is showing github.com — impl(pm-stack): PM tenant store — schema + migrations (component A slice 1, from #9079) · Issue #12825 · developing-today/code
impl(pm-stack): PM tenant store — schema + migrations (component A slice 1, from #9079) #12825DescriptionDesign: doc/2026-11-23T03-22-03Z_design_pm-service-workers-edition/2026-11-23T03-22-03Z_design_pm-service-workers-edition.md (PR #12823, merged) — component A of epic #9078, under #9079.
Slice 1 — PM tenant store: schema + migrations
Per design §3: one schema in the tenant's Turso DB (component E tenant plane) holding the PM store — board registry rows (#9060 BoardDef shape, stored as data), the merged item pool, hierarchy/link records (#9060 §11 shape: relation, status, provenance), Metadata copies (#9060 §12), roadmap rows, release-milestone snapshots (#9060 §4), reconcile findings, and the writer-of-record lease row (§5 of the design).
Acceptance
- Migrations create the full PM store schema in a tenant Turso DB; schema version recorded.
- Registry/pool/link-record shapes match pm stack: multi-board hierarchy + full task genealogy #9060 exactly (conformance-checked against laptop collector output shapes).
- No PM content in the central tenancy DB; no tokens/keys in any table (E §2.3).
Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026 Pickup (xaltha lane): starting slice 1 — PM tenant store schema + migrations, per the merged design (PR #12823) §3/§5. Branch xaltha/12825-tenant-store pushed from current main. Scope strictly #12825; siblings #12796/#12803 untouched. Will post one progress note with evidence when the PR is up. dezren39 commented on Nov 23, 2026 Progress (xaltha lane): slice 1 landed as PR #13054 — #13054 (OPEN, MERGEABLE, 13 files, +1237/−0, head 3d8f9d086).
What was built — new package pm-stack/pm-service (component A's home), src/tenant-store/:
migrations/0001_pm_tenant_store.sql: the full PM store schema for one tenant Turso DB — pm_boards (pm stack: multi-board hierarchy + full task genealogy #9060 §1 BoardDef as data), pm_snapshots, pm_items (merged pool; full collector JSON + extracted keys, the §15 pattern), pm_links (§11 relation/status/provenance, historical⇒until+reason and removed⇒reason fenced by CHECKs), pm_item_metadata (§12 copies), pm_roadmap_rows, pm_milestones + pm_release_snapshots (§4 two kinds + close-out accounting), pm_reconcile_findings, pm_writer_leases (design §5 row: board_id, writer laptop|hosted, epoch, heartbeat_at).
migrate.ts: version-ordered runner, one transaction per migration, recorded in pm_schema_migrations (schema-version record); recorded-name drift fails loudly.
schema.ts: wire shapes + validators mirrored field-for-field from pm stack: multi-board hierarchy + full task genealogy #9060 and the collector's landed types (aggregator model.ts/board-registry.ts).
Evidence
bun test (pm-stack/pm-service, sandbox, bun:sqlite): 15 pass / 0 fail / 45 assertions — migration idempotence + drift, landed board registry round-trip, pool-item byte-faithful JSON, §11/§12 conformance fixtures, lease fencing, §4 accounting checks, and the E §2.3 guard (no token/key/secret/credential column in any table).
bun run typecheck: clean.
- Suite wired into nightly
pm-stack-tests.yml (assert-exists style, as decision-events-worker) and registered in .github/test-suite-registry.json as pm-service.tenant-store.
Sequencing: no dependency on #12796 (E1) — that is the central tenancy DB, a different plane; these migrations target a per-tenant DB only and neither read nor write the tenancy DB. Siblings #12796/#12803 untouched. PR says Closes #12825 (the slice is the issue's whole scope).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|