fix(builder): purge function_complexity on full rebuild#239
Conversation
`--no-incremental` full rebuilds didn't clear the `function_complexity` table, causing orphaned rows to accumulate across rebuilds as node IDs get reassigned. Add `DELETE FROM function_complexity` to the full-rebuild purge sequence alongside the existing node_metrics/edges/nodes deletions. Fixes #173 Impact: 1 functions changed, 11 affected
|
Claude finished @carlos-alm's task —— View job PR Review - Analysis CompleteReviewing PR #239: fix(builder): purge function_complexity on full rebuild Todo List:
Phase 1 Analysis ✅Problem Being Solved: During Evidence: Author reports table growth from 2160→2879→3599 rows across 3 rebuilds while only ~720 should be valid. Solution Approach: Add Phase 2 Analysis ✅Configuration Changes: ✅ NONE - No configuration, linting, test thresholds, or build settings modified. Phase 3 Analysis ✅Test Integrity: ✅ GOOD
Phase 4 Analysis ✅Code Quality: ✅ EXCELLENT
Technical Verification:
Root Cause AnalysisProblem Being Solved: Legitimate data consistency bug - orphaned complexity rows accumulate on full rebuilds due to node ID reassignment. Why This Approach: Correctly follows existing architectural pattern. Incremental builds already handle this per-file; full builds simply needed the same global cleanup. Risk Assessment: MINIMAL - Single line addition to proven deletion pattern, maintains referential integrity order. Critical ConcernsNone. This is a clean, minimal fix addressing a real data consistency issue. Final Recommendation
|
Greptile SummaryFixes unbounded Changes:
Why this was needed: Safety:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 453e81a |
* docs: add dogfood report for v2.5.35-dev.26434e2 * docs: move dogfood report to correct path * docs: remove report from incorrect worktree path * docs: move v2.5.0 dogfood report to generated/dogfood/ * fix: incremental build verification, complexity warnings, and dev build docs - Add node/edge count drift detection after incremental builds (>20% warns to use --no-incremental), persisting counts in build_meta - Improve complexity command: when data is missing but graph exists, suggest --no-incremental instead of implying no graph exists - Add @huggingface/transformers as devDependency so embedding benchmarks work out of the box - Document dev build tarball installation in README (npm install <url> fails for optional platform deps) Impact: 3 functions changed, 5 affected * fix: configurable drift threshold, drift logging, and lock file sync - Add build.driftThreshold to config defaults (0.2) so the 20% incremental build drift threshold is user-configurable - Include actual drift percentages and threshold in warning message for easier debugging - Regenerate package-lock.json to include @huggingface/transformers devDependency (fixes License Compliance Scan CI failure) Impact: 1 functions changed, 1 affected * fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version - filter directory nodes from reverse-deps query to prevent EISDIR (#235) - load unchanged barrel files into reexportMap so barrel-resolved edges aren't dropped during incremental rebuilds (#236) - add --strip flag to sync-native-versions.js removing platform optionalDependencies in dev builds, fixing npm install failures (#237) - sync Cargo.toml version with package.json and automate via version script - add barrel-project fixture and incremental-parity test Impact: 4 functions changed, 1 affected * docs: update 2.6.0 changelog with merged PRs #233 #239 #240 #241
Summary
--no-incrementalfull rebuilds now clear thefunction_complexitytable before inserting new dataDELETE FROM function_complexity;to the full-rebuild purge sequence inbuilder.jsTest plan
npm test— all integration/unit tests pass (no regressions)npm run lint— cleannode src/cli.js build . --no-incrementaltwice, verifySELECT COUNT(*) FROM function_complexitystays constant