GeezerVison is showing github.com — feat(pm-service): PM tenant store schema + migrations (component A slice 1, #12825) by dezren39 · Pull Request #13054 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Component A slice 1 (design §8 item 1, under #9079): the PM tenant store — schema + migrations for the hosted PM service.
What lands
New package pm-stack/pm-service (PM service, Workers edition) with src/tenant-store/:
migrations/0001_pm_tenant_store.sql — one schema in the tenant's Turso DB (component E tenant plane) holding the full PM store per design §3: board registry rows (pm stack: multi-board hierarchy + full task genealogy #9060 §1 BoardDef, stored as data), collector snapshots, the merged item pool, hierarchy/link records (pm stack: multi-board hierarchy + full task genealogy #9060 §11: relation, status, provenance), Metadata copies (pm stack: multi-board hierarchy + full task genealogy #9060 §12), roadmap rows, milestones + release-milestone close-out snapshots (pm stack: multi-board hierarchy + full task genealogy #9060 §4), reconcile findings, and the writer-of-record lease row (design §5: {board_id, writer, epoch, heartbeat_at}).
migrate.ts — version-ordered migration runner; each migration applies in a transaction and is recorded in pm_schema_migrations (the schema-version record); a recorded name that drifts from the file on disk fails loudly. Runtime-agnostic over a minimal SqlDb surface.
schema.ts — the wire shapes the store holds (BoardDef, LinkRecord, PmMetadataBlock, WriterLease) + validators, mirrored field-for-field from pm stack: multi-board hierarchy + full task genealogy #9060 and the laptop collector's landed output types (pm-stack/aggregator/src/model.ts, board-registry.ts).
sqlite.ts — bun:sqlite adapter for tests/local tooling (a tenant DB is SQLite-shaped wherever it lives; Turso/libSQL speaks the same dialect).
Acceptance mapping (#12825)
- Migrations create the full PM store schema in a tenant Turso DB; schema version recorded — migration 0001 creates all 10 store tables + the bookkeeping table; the suite asserts the recorded version and idempotent re-runs.
- Registry/pool/link-record shapes match pm stack: multi-board hierarchy + full task genealogy #9060 exactly (conformance-checked against laptop collector output shapes) — the suite's fixtures are the collector's landed shapes: the three
PROJECT_BOARDS registry entries round-trip as rows, a ProjectPoolItem stores byte-faithful JSON with extracted keys, §11 historical/removed fencing (until + reason) is enforced by both validator and CHECK constraints, and the §12 worked-example Metadata block validates and round-trips.
- No PM content in the central tenancy DB; no tokens/keys in any table (E §2.3) — these migrations target a per-tenant DB only; the suite scans every table's columns and fails if any names a token, secret, password, credential, or key.
Sequencing note
No dependency on E1 (#12796): that issue is the central tenancy DB schema — a different plane. This slice neither reads nor writes the tenancy DB; siblings #12796/#12803 are untouched.
Evidence
bun test in pm-stack/pm-service: 15 pass, 0 fail, 45 assertions (run locally in the sandbox against bun:sqlite; the suite's venue is CI — see below).
bun run typecheck: clean.
- Suite wired into the nightly
pm-stack-tests.yml in the same assert-exists style as the decision-events-worker suite, and registered in .github/test-suite-registry.json as pm-service.tenant-store.
Closes #12825

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…ice 1, #12825)
New pm-stack/pm-service package (PM service, Workers edition —
component A of #9078, design §8 slice 1). The tenant store is one
schema in the tenant's Turso DB (component E tenant plane):
- migrations/0001_pm_tenant_store.sql: board registry rows (#9060
§1 BoardDef as data), collector snapshots, the merged item pool,
hierarchy/link records (#9060 §11), Metadata copies (#9060 §12),
roadmap rows, milestones + release close-out snapshots (#9060
§4), reconcile findings, and the writer-of-record lease row
(design §5).
- migrate.ts: version-ordered runner; each migration applies in a
transaction and is recorded in pm_schema_migrations (the schema
version record); recorded-name drift fails loudly.
- schema.ts: the wire shapes + validators the store holds, mirrored
field-for-field from #9060 and the laptop collector's landed
output types (aggregator model.ts / board-registry.ts).
- test/tenant-store.test.ts: 15 conformance tests (45 assertions)
against bun:sqlite — migration idempotence + drift, the landed
board registry round-trip, pool-item byte-faithful JSON with
extracted keys, §11 until/reason fencing, the §12 example block,
lease fencing, §4 accounting checks, and the E §2.3 guard: no
token/key/secret/credential column in any table.
Suite wired into pm-stack-tests.yml (nightly) in the same
assert-exists style as the decision-events-worker suite, and
registered in .github/test-suite-registry.json.
No dependency on E1 (#12796): that is the central tenancy DB
schema, a different plane — these migrations target a per-tenant
DB only and neither read nor write the tenancy DB.
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 17 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:
84ace95d-a671-40c7-9e83-3d2a4a576486
Commits
-
Reviewing files that changed from the base of the PR and between f93acb4 and 3d8f9d0.
Files ignored due to path filters: 1
-
pm-stack/pm-service/bun.lock is excluded by !**/*.lock
Files selected for processing: 12
-
.github/test-suite-registry.json
.github/workflows/pm-stack-tests.yml
pm-stack/pm-service/README.md
pm-stack/pm-service/package.json
pm-stack/pm-service/src/bun.d.ts
pm-stack/pm-service/src/tenant-store/load.ts
pm-stack/pm-service/src/tenant-store/migrate.ts
pm-stack/pm-service/src/tenant-store/migrations/0001_pm_tenant_store.sql
pm-stack/pm-service/src/tenant-store/schema.ts
pm-stack/pm-service/src/tenant-store/sqlite.ts
pm-stack/pm-service/test/tenant-store.test.ts
pm-stack/pm-service/tsconfig.json
- 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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T07:40:40.095700Z |
3d8f9d0 |
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
dezren39
added a commit
that referenced
this pull request
Nov 23, 2026
…st + IngestDO (component A slice 2, #12826)
Stacked on slice 1 (PR #13054): the collector imports the tenant
store's SqlDb surface and lands rows in the tables slice 1's
migration defines (pm_boards registry in, pm_snapshots/pm_items/
pm_item_metadata/pm_reconcile_findings out); pm-stack/pm-service
does not exist on main yet, so this branch bases on
xaltha/12825-tenant-store and the PR retargets to main when #13054
merges.
Per design §3 (doc/2026-11-23T03-22-03Z_design_pm-service-workers-edition):
- pool.ts: the SAME GraphQL pool query the laptop collector runs
(fields, views, parent, blockedBy/blocking, labels, milestones,
subIssuesSummary), parameterized by board node id, plus the
parser mapping it to the ProjectPoolItem/ProjectAudit shapes
slice 1 pinned. A port, not an import — pm-service deploys as
one Worker bundle; slice 8's conformance suite pins parity.
- fetch.ts: one board's paginated snapshot fetch; the stored ETag
rides page 1 as If-None-Match and a 304 ends the run with no
page fetches and no writes; rate-budget headers captured.
- ingest-do.ts: IngestDO, one per board — serializes the board's
runs and holds its cursors (ETag/last-snapshot watermark) and
GitHub rate-budget state. Derived state only (invariant 6).
- store.ts: registry reads (validated BoardDefs), snapshot landing
(per-board pool replacement, so a failed board keeps its prior
pool), §12 Metadata-copy upserts, ingest findings.
- collector.ts: runHostedCollector — per board, a per-org App
installation token is minted through the injected tenancy seam,
used for that board's fetch, and dropped; epic/spawn ancestry
resolves over the MERGED pool so cross-board chains resolve;
snapshots land with writer='hosted' + lease epoch provenance.
Acceptance (test/collector.test.ts, 9 tests): a run ingests every
registry board; a forced failure on one board leaves the other
boards' pools intact and records an ingest-failure finding;
cursors make a second run incremental (one conditional request
per board, no writes); no token value persists in any tenant-DB
table, DO state, or the run report (E §2.3, test-pinned). Plus
cross-board epic resolution, Metadata copies, rate-budget
deferral, and IngestDO serialization.
Suite registered as pm-service.collector and the pm-stack-tests
step renamed to cover both pm-service suites. Full package:
24 tests pass (15 slice-1 + 9 new), tsc --noEmit clean, both run
in the sandbox with bun.
This was referenced Nov 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|