Skip to content

Full-build path never clears stale deleted-export advisories on either engine — unlanded fix sitting in an orphaned worktree #2232

Description

@carlos-alm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions