Skip to content

fix(compile): reconcile shared pages after source deletion - #171

Closed
TigerOfCountryYao wants to merge 3 commits into
atomicstrata:mainfrom
TigerOfCountryYao:codex/upstream-shared-source-reconciliation
Closed

fix(compile): reconcile shared pages after source deletion#171
TigerOfCountryYao wants to merge 3 commits into
atomicstrata:mainfrom
TigerOfCountryYao:codex/upstream-shared-source-reconciliation

Conversation

@TigerOfCountryYao

Copy link
Copy Markdown

Rebuilds shared pages through a fixed-point owner closure after source deletion, filters non-surviving citations during clean rebuilds, and orphans ownerless frozen slugs. Covers deletion chains, multiple deleted owners, late-discovered owners, unknown citations, ownerless pages, and survivor extraction failure. This branch is stacked on #169 and #170; the intended incremental review is commit 160e2af. Verification: 96 targeted tests, TypeScript, build, changed-scope checks, and diff checks pass.

@ethanj

ethanj commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Hi @TigerOfCountryYao did you mean for these to be draft, or do y ou want to submit them as ready for review?

ethanj added a commit that referenced this pull request Aug 26, 2026
Pages that share a deleted source are now rebuilt from the owners that survive, instead of being frozen with the removed source's content forever.

`rm` recorded each kept slug in `state.frozenSlugs`, the same marker compile sets when it notices a deleted source, and that marker was terminal. The page kept the removed source's prose and its citations, `lint` reported broken-citation at error severity, and no command could repair it. Deleting the page to force a rebuild lost it for good.

Frozen and needs-reconciling are now separate states sharing one field. A slug frozen because this run's extraction failed is still skipped and preserved. A slug carried in persisted state is a reconciliation marker: the page is rebuilt from whatever owners remain, and a page no live source owns is orphaned rather than held.

Review before merge found four defects, each fixed with its own regression test: a marker retired despite its replacement failing validation, a partial extraction failure dropping surviving owners' claims, a scoped run scheduling a deleted source its filter excluded (in two separate closure sites), and stale documentation describing the old behaviour.

Original implementation by Kai Yao (@TigerOfCountryYao), from #171.

Fixes #194.
@ethanj

ethanj commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Landed on main in #199 as 19631a49, with your work credited in the merge commit.

Thank you for this. The distinction at the centre of it, that a persisted frozen slug is a reconciliation marker rather than a permanent skip, is what made the fix work, and your test suites passed against current main unchanged after six merges of drift.

What was added before merging: coverage for the rm route, which writes to that same persisted field, and fixes for four defects that came up in review. Only 160e2af7 was cherry-picked, since its parents landed separately as #198 and #195, and replaying the whole stack would have brought back implementations we had already replaced.

Closing as superseded by #199.

@ethanj ethanj closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants