Context: #1938 (closed) fixed the deleted-export-advisory persistence gap for scoped/incremental builds. clearDeletedExportAdvisories (TS) / clear_deleted_export_advisories (Rust) is called from handleScopedBuild/handleIncrementalBuild on both engines on current main.
The gap: neither engine calls it from the full-build path:
- TS:
handleFullBuild in src/domain/graph/builder/stages/detect-changes.ts — only calls clearAllGraphData, never clearDeletedExportAdvisories.
- Rust:
save_and_purge_changed's is_full_build branch in crates/codegraph-core/src/domain/graph/builder/pipeline.rs — only calls clear_all_graph_data, never clear_deleted_export_advisories.
Effect: a full rebuild re-parses every file currently on disk, so none of them are "deleted" from the full build's point of view. If a file was previously deleted (capturing a deleted-export advisory), later reappeared with fewer/no exports, and is then deleted again, the stale advisory from the first deletion resurfaces instead of a fresh (or absent) one — misattributing a violation.
A complete fix for both engines already exists, uncommitted, in a leftover worktree from the original #1938/#2103 work (agent-ac57882f8d84a8eb3, branch fix/persist-deleted-export-advisories) — it adds the missing call to both handleFullBuild and the Rust is_full_build branch, plus a regression test (tests/integration/issue-1938-deleted-export-advisory-persistence.test.ts) and a check.test.ts addition. It also drops an apparently-unused content_hash/tgt_hash field from a couple of Rust struct literals — worth double-checking that removal is still correct against current main before reusing the diff verbatim.
Found while auditing worktrees during /housekeep; the worktree was about to be garbage-collected, which would have silently discarded this fix. Filing so the work isn't lost — someone should pull that diff into a fresh branch, verify it against current main, and open a PR.
Context: #1938 (closed) fixed the deleted-export-advisory persistence gap for scoped/incremental builds.
clearDeletedExportAdvisories(TS) /clear_deleted_export_advisories(Rust) is called fromhandleScopedBuild/handleIncrementalBuildon both engines on currentmain.The gap: neither engine calls it from the full-build path:
handleFullBuildinsrc/domain/graph/builder/stages/detect-changes.ts— only callsclearAllGraphData, neverclearDeletedExportAdvisories.save_and_purge_changed'sis_full_buildbranch incrates/codegraph-core/src/domain/graph/builder/pipeline.rs— only callsclear_all_graph_data, neverclear_deleted_export_advisories.Effect: a full rebuild re-parses every file currently on disk, so none of them are "deleted" from the full build's point of view. If a file was previously deleted (capturing a deleted-export advisory), later reappeared with fewer/no exports, and is then deleted again, the stale advisory from the first deletion resurfaces instead of a fresh (or absent) one — misattributing a violation.
A complete fix for both engines already exists, uncommitted, in a leftover worktree from the original #1938/#2103 work (
agent-ac57882f8d84a8eb3, branchfix/persist-deleted-export-advisories) — it adds the missing call to bothhandleFullBuildand the Rustis_full_buildbranch, plus a regression test (tests/integration/issue-1938-deleted-export-advisory-persistence.test.ts) and acheck.test.tsaddition. It also drops an apparently-unusedcontent_hash/tgt_hashfield from a couple of Rust struct literals — worth double-checking that removal is still correct against currentmainbefore reusing the diff verbatim.Found while auditing worktrees during
/housekeep; the worktree was about to be garbage-collected, which would have silently discarded this fix. Filing so the work isn't lost — someone should pull that diff into a fresh branch, verify it against currentmain, and open a PR.