fix: recover branch-compare, dogfood fixes, foundation reframe#170
fix: recover branch-compare, dogfood fixes, foundation reframe#170carlos-alm merged 7 commits intomainfrom
Conversation
The branch-compare command was registered in cli.js and its exports
added to index.js, but the implementation file src/branch-compare.js
was never created. This caused two issues:
1. `codegraph branch-compare` crashed with ERR_MODULE_NOT_FOUND
2. `import('@optave/codegraph')` crashed entirely because index.js
has a top-level re-export from the missing file, making the
programmatic API completely unusable
Remove the dead references until an implementation exists.
Closes #166
The branch-compare command was registered in cli.js and index.js but src/branch-compare.js was never committed — it was lost as untracked files in the fix/complexity-sql-sanitize worktree. Recovered the full implementation (568 lines) and integration test (192 lines, 7 tests) from git object 22c8185. This restores the cli.js command and index.js exports that were removed in 746aa65, now that the implementation file exists. Updated the dogfood report to reflect the recovery (no bugs found, rating 8.5/10). Closes #166 Impact: 13 functions changed, 4 affected
…nary The dogfood report showed native complexity at 270.9ms (2.2x slower than WASM) because the benchmark ran with a stale v2.4.0 native binary that lacked Rust-side complexity computation, forcing a WASM fallback. With the correct v2.5.0 binary, native complexity is 5.1ms (47x faster than WASM's 240.7ms) and overall build is 241ms vs 1,009ms (4.2x faster). Replaced all phase-level benchmark numbers with the official v2.5.0 data from BUILD-BENCHMARKS.md.
The v2.5.0 dogfood report contained incorrect benchmark data because the benchmarks ran with a stale v2.4.0 native binary. The complexity phase silently fell back to WASM, making native appear 2.2x slower than WASM when it's actually 47x faster. Add a pre-flight verification step to Phase 4b that checks the native binary version matches the release being tested, and a sanity-check that flags native complexityMs > WASM complexityMs as a stale binary.
…une --dry-run
- Restore src/branch-compare.js from git history — was referenced by
both index.js and cli.js but missing from the tree, breaking
`import('./src/index.js')`.
- Add tests/unit/index-exports.test.js that validates all re-exports
in index.js resolve without ERR_MODULE_NOT_FOUND.
- Add --dry-run flag to `registry prune` so users can preview what
would be removed without actually deleting entries (especially
useful with aggressive --ttl 0).
- Add dryRun parameter to pruneRegistry() with two new tests.
Impact: 14 functions changed, 5 affected
The "embeddable first, CLI second" framing didn't match how codegraph is actually used. The CLI and MCP server are the primary interfaces; the programmatic API is an additional capability, not the core identity.
|
Claude finished @carlos-alm's task —— View job PR Review AnalysisReviewing PR #170: "fix: recover branch-compare, dogfood fixes, foundation reframe" Todo List
Root Cause AnalysisProblem Being Solved: This PR addresses four legitimate issues:
Why This Approach: All changes are justified fixes for real issues, not symptom suppression. Risk Assessment: LOW - No configuration relaxations, robust testing, secure implementation. Critical ConcernsNone identified. This is a well-executed recovery and cleanup PR. Code Quality Assessment ⭐⭐⭐⭐Security Analysis ✅ SECURE
Implementation Quality ✅ EXCELLENTbranch-compare.js (568 lines):
Test Coverage ✅ COMPREHENSIVE
Performance Considerations ✅ GOOD
Minor Observations
Final Recommendation
Why not 5 stars? Minor complexity in the main function, but this doesn't impact functionality or maintainability significantly. This PR demonstrates solid engineering practices and should be merged. |
Greptile SummaryThis PR successfully recovers the lost Key changes:
All changes are well-tested with 7 new integration tests for Confidence Score: 5/5
Important Files Changed
Last reviewed commit: c50f7f5 |
Summary
branch-compare.js— restores the lost implementation from a previous worktree, with full integration testsregistry prune --dry-run, addindex.jsexport testTest plan
npm testpasses (new tests:branch-compare.test.js,index-exports.test.js,registry.test.js)node src/cli.js branch-compareruns without errorsnode src/cli.js registry prune --dry-runlists entries without deleting