Repository navigation
feat(primitives): let patches look up and assign company members - #449
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. Spec
Standards: 0 blockers. Spec: 1 blocker, the public-patch directory access contract. |
Opus reviewReviewed 1. Member column defaults skip the candidate check on backfill. The issue didn't ask for them, and they add a query to every insert. (correctness + YAGNI)
2.
|
|
Addressed the Astra and Opus reviews. Fixed
Kept as-is
Verification
Latest head Final feedback sweep found no additional conversation feedback, review bodies or inline comments; no Grok review was present. The PR remains open and unmerged against Implemented with GPT-6 Astra via omp. |
Opus re-reviewReviewed Resolved
The new public-directory path
CI is green on d85010e. Reviewed by Claude Opus 5.5 via Claude Code. |
e528ba8 to
fc5197d
Compare
d85010e to
5a3f3e8
Compare
…y before launch (#503) Before launch (#416) no database we need to keep exists, yet the platform record carried 15 migrations, and several tests and code paths existed only to upgrade databases built by older steps (decision O1 from the test audit). This squashes each capability into one baseline that builds exactly today's schema, and deletes the upgrade-only code and tests with it. - **One baseline per capability**, ids 1–8 in foreign-key order: companies, auth, patches, company_database, runtime, integrations, limits, execution. The names drop `_baseline`, so an old ledger can never match the new history by name. - **Faithfulness proof** (run outside the repo, `/tmp/lane-e-proof`): databases built from main's record and from this record have identical `pg_dump --schema-only`, identical data apart from the ledger, and an identical catalog listing (columns, defaults, constraints, indexes, functions, triggers, grants). That holds for the platform database, a Postgres company inventory and a PGlite company directory. - **The ledger guard** (`packages/sql`): `migrate` now refuses a ledger whose history differs from the record's, up to the lower of the two highest ids. The Migrator only applies ids above the ledger's highest, so a pre-squash database would otherwise silently skip the baselines and every future migration with an id up to 15. Ids above the record's highest still pass, so an older build can start after a newer one migrated (the rollback in OPERATIONS.md). The dev runner now writes the refusal to `dev.log`. - **Removed upgrade paths:** `Inventory.upgrade` and its calls in both `ensureReady`s, the mutation-key lookup's missing-table retry (added in #432 for databases created before mutation keys), and the upgrade-only tests: `runtime` and `patches` `migrations.test.ts`, the directory migration block, two inventory-upgrade tests, and an orphan-sweep case for retained inventories. Docs: DEVELOPMENT.md, `packages/sql` README and CONTEXT (new **Baseline** term), ADR-0003/0009/0012, product.md, API.md. **After this merges:** - Every existing local dev instance, in every worktree, needs `pnpm dev reset`, which wipes its local data. An instance that isn't reset refuses to start and says why in `dev.log`. - The disposable tier 2 spike database needs recreating before its next deploy. - `patchy dev` data in patch repos made by a CLI older than #449 needs `patchy dev reset`. Upgrade tests start again with the first migration that has to keep retained state. Made by Claude Opus 5.5 via Claude Code --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Patches need to look up company members and store member assignments without losing historical references when someone becomes inactive.
Adds a declared member directory for tier 1 clients and all tier 2 handler kinds. Candidate searches return active members, while resolution retains inactive members. New or changed assignments require active members; unchanged assignments remain valid. Committed directory changes refresh subscriptions. Includes CLI generation, local dev identities, documentation, and the member skill.
This PR is stacked on
tier2/409-staged-uploadsand targets that branch. The diff contains only the member-directory implementation.Closes #410.
Verification
pnpm test: 1,553 tests passed across 137 files.pnpm typecheckandpnpm lintpassed.Implemented with
openai-codex/gpt-6-astrausing the omp harness.