Deferred from PR #1082 review.
Original reviewer comment: #1082 (comment)
Context:
PR #1082 gates backfillNativeDroppedFiles on result.isFullBuild || result.removedCount > 0 to skip a ~45ms fs walk + DB query overhead on clean incrementals against current binaries (which carry #1070's detect_removed_files filter).
There is a narrow correctness gap: when a user adds a brand-new file with a dropped-language extension (.clj, .jl, .r, .erl, .fs, .gleam) during an incremental pass on a current binary, the orchestrator's narrower file_collector never enumerates the new file. As a result:
removedCount = 0 (nothing was deleted)
isFullBuild = false (this is an incremental)
changedCount = 0 for the dropped-language file (orchestrator's collector skips that extension entirely)
So the gate evaluates to false, backfillNativeDroppedFiles is skipped, and the new file is absent from nodes/file_hashes until the next forced full rebuild.
Workaround (current): Users can run codegraph build --force or modify any code in a Rust-supported extension alongside the new file.
Possible fixes:
- Extend the gate to detect dropped-language additions cheaply — e.g. compare on-disk count of dropped-language files vs
nodes count for those extensions (one query, one fs walk filter).
- Have the orchestrator's narrower file_collector also surface a
droppedExtensionCount for added files in skipped extensions, so JS can gate on it.
- Track dropped-language file additions through the journal (works only in
codegraph watch mode).
Severity is low (rare workflow, recoverable via --force), but the silent gap should be closed for full correctness.
Deferred from PR #1082 review.
Original reviewer comment: #1082 (comment)
Context:
PR #1082 gates
backfillNativeDroppedFilesonresult.isFullBuild || result.removedCount > 0to skip a ~45ms fs walk + DB query overhead on clean incrementals against current binaries (which carry #1070'sdetect_removed_filesfilter).There is a narrow correctness gap: when a user adds a brand-new file with a dropped-language extension (
.clj,.jl,.r,.erl,.fs,.gleam) during an incremental pass on a current binary, the orchestrator's narrowerfile_collectornever enumerates the new file. As a result:removedCount = 0(nothing was deleted)isFullBuild = false(this is an incremental)changedCount = 0for the dropped-language file (orchestrator's collector skips that extension entirely)So the gate evaluates to
false,backfillNativeDroppedFilesis skipped, and the new file is absent fromnodes/file_hashesuntil the next forced full rebuild.Workaround (current): Users can run
codegraph build --forceor modify any code in a Rust-supported extension alongside the new file.Possible fixes:
nodescount for those extensions (one query, one fs walk filter).droppedExtensionCountfor added files in skipped extensions, so JS can gate on it.codegraph watchmode).Severity is low (rare workflow, recoverable via
--force), but the silent gap should be closed for full correctness.