feat: start a pending lineage reconstruction (v0.88.0) - #183
Conversation
Operators empty a run-bearing analysis-run registry only after an unrevoked analysis_run_retention_grant and analysis_run_retention_admin membership (ADR 0020). PUBLIC cannot execute the definer function. Repeated citation chips and close buttons use named design tokens and a Storybook catalog on Node 24. ADR 0019 stays the R&R catalog-id bind. Do not reuse that number. Co-authored-by: Seongho Bae <[email protected]>
After POST /api/analysis-runs the list refetch must include the new Pending row so the buyer-facing "has not started yet" next action is visible. The previous stub kept only the seed rows. Co-authored-by: Seongho Bae <[email protected]>
After #148 the next-action phrase is pinned to registered kinds and shown on both the created list row and the selected detail. Assert both copies so getByText does not fail on the duplicate. Co-authored-by: Seongho Bae <[email protected]>
Operators can open a Pending Demo Corp row and start ThreadWeave on the frozen cutoff bag (ADR 0021). TEPP start stays 422 so this path cannot invent a theta. A granted purge now also deletes reconstruction and snapshot-member rows. Confirm the designed A-100 fork, then hover the Result digest prefix. Does not steal ADR 0019 or 0020. Prefer this head over #142 and #152. Co-authored-by: Seongho Bae <[email protected]>
#74 already contains ADR 0021 / v0.88.0. Keep that start path and follow with a purge-aware 0023 so a granted empty still works after edges exist. Co-authored-by: Seongho Bae <[email protected]>
After ADR 0021 start, a granted purge hit foreign keys on analysis_run_reconstruction and analysis_source_snapshot_member. Migration 0023 (ADR 0022) deletes those rows first, then the 0018 registry tables. Authorization stays conjunctive. Next action: start a Pending lineage run, then empty the registry with the documented grant + admin + phrase path. Co-authored-by: Seongho Bae <[email protected]>
There was a problem hiding this comment.
Review — #183 is the purge-after-start fix (v0.88.1)
Start reconstruction already landed on #74 as 1cf0bd7 (ADR 0021 / v0.88.0). This PR is no longer a start successor. It now adds migration 0023 / ADR 0022 / v0.88.1 so a granted purge still works after edges exist.
The 0020 function deleted only 0018 registry tables. After start, analysis_run_reconstruction and analysis_source_snapshot_member block that delete. 0023 keeps the same conjunctive lock (unrevoked grant + admin + published phrase, REVOKE ALL … FROM PUBLIC) and deletes reconstruction/members first.
Prefer this head over another start PR (#142 / #152 stay superseded). Do not steal ADR 0021. Do not invent a theta. Do not merge before #74. Do not merge #74 onto protected main.
Local verification: registry/start/hygiene static contracts passed (11 passed, live Postgres skipped).
Next operator action: mark this PR ready, review 0023, then merge onto feat/role-responsibility-agent-ontology after Checks go green.
Sent by Cursor Automation: Fix Issues
#186 already claims 0.88.1 for the seeded period-report home row. This purge-after-start fix stays ADR 0022 / migration 0023. Co-authored-by: Seongho Bae <[email protected]>


Buyer impact
After #125 an operator could record a Pending lineage run, then could not start reconstruction. Seed still owned the only Succeeded Demo Corp tree.
Open the Pending Demo Corp row, click Start reconstruction, hover the Result digest prefix, and confirm the designed A-100 fork (revised quote and delivery question under the pricing follow-up).
Why this PR
Canonical successor to dirty #142 / draft #152 after #145 landed ADR 0020 / v0.87.0 on
feat/role-responsibility-agent-ontology.This head takes ADR 0021 / v0.88.0. Migrations are 0021 (reconstruction + purge-aware deletes) then 0022 (snapshot members). It does not steal ADR 0019 or 0020.
Base must be
feat/role-responsibility-agent-ontology. Do not merge onto protectedmain. Do not merge before #74.What shipped
POST /api/analysis-runs/{id}/startruns ThreadWeave on the frozenanalysis_source_snapshot_memberbaganalysis_run_reconstruction+analysis_run_lineage_edge(3NF, immutable, two-or-more-word names)Does not close #79. Prefer this head over #142 and #152. Do not open another start successor.
Verification
python3 -m pytest tests/test_documentation_hygiene.py tests/test_analysis_run_start.py tests/test_analysis_run_reconstruction_schema.py tests/test_analysis_run_registry_schema.py— 9 passed, live Postgres skippedcd frontend && pnpm run lint && pnpm run test && pnpm run build— 60 tests, production build