fix: recover branch-compare, index.js export guard, registry prune --dry-run#167
fix: recover branch-compare, index.js export guard, registry prune --dry-run#167carlos-alm merged 6 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
|
Claude finished @carlos-alm's task —— View job PR Review: fix(cli): remove branch-compare references to non-existent moduleTodo List:
Root Cause AnalysisProblem Being Solved: CLI crashes and programmatic API is completely broken due to missing Why This Approach: Removing dead code references is the correct approach since:
Risk Assessment: MINIMAL - This is pure dead code removal with no functional impact. Critical Concerns✅ No configuration changes detected Code Quality AnalysisPositive aspects:
Technical correctness:
Test verification (from PR description):
Security & SafetyNo security concerns. This is pure dead code removal with no:
Final AssessmentThis is a high-quality emergency fix that correctly addresses a ship-stopping bug discovered during dogfooding. The approach is surgical, well-tested, and properly documented. |
Greptile SummaryThis PR fixes a critical bug where the programmatic API was completely unusable due to missing implementation file. The Changes:
Verification:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 2823dcc |
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
|
Claude finished @carlos-alm's task —— View job PR Review: fix(cli): remove branch-compare references to non-existent moduleTodo List:
Phase 1: Root Cause Analysis ✅Problem Being Solved: Originally, this PR was fixing a critical bug where Why This Approach: The author recovered lost implementation files from git objects and is now providing the complete Risk Assessment: MEDIUM - This is now a significant feature addition (568 lines + tests) disguised as a bug fix. The scope change from the original PR title/description is concerning. Critical Issue: PR TITLE AND DESCRIPTION ARE MISLEADING - They describe removing dead references, but the PR now adds full implementation. This violates transparency expectations. Phase 2: Configuration Change Detection ✅✅ No high-risk configuration changes detected:
The 3 changed files are purely implementation additions (branch-compare.js, test, dogfood report). Phase 3: Test Integrity Check ✅Test Analysis:
Red Flag Check: ❌ No issues found Phase 4: Code Quality Review ✅Security Analysis:
Architecture & Design:
Performance & Efficiency:
Code Quality:
Test Quality:
Final AssessmentConditions for approval:
This is high-quality implementation work that solves a real problem, but the presentation and change management could be improved. |
…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.
|
Claude finished @carlos-alm's task —— View job PR Review: fix: recover branch-compare implementation from lost worktree filesTodo List:
Phase 1: Root Cause Analysis ✅Problem Being Solved: The PR is recovering a lost Why This Approach: Author discovered the complete implementation (568 lines + 192-line test) existed in git object Risk Assessment: MEDIUM - This is a significant feature addition (760+ lines) disguised as a bug fix. The implementation is comprehensive and well-tested, but the misleading PR title creates transparency issues. Key Finding: This isn't about "removing references" as the title suggests - it's a full feature recovery/implementation. Phase 2: Configuration Change Detection ✅✅ No high-risk configuration changes detected:
All changes are purely implementation additions (branch-compare.js, test file, dogfood report). Phase 3: Test Integrity Check ✅Test Analysis:
Red Flag Check: ✅ No issues found
Phase 4: Code Quality Review ✅Security Analysis:
Architecture & Design:
Performance & Efficiency:
Code Quality:
Test Quality:
Final AssessmentConditions for approval:
This is high-quality implementation work that solves a real problem, but the presentation and change management could be improved. |
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.
|
Claude finished @carlos-alm's task —— View job Claude reviewing pull request —— View job PR Review: fix: recover branch-compare implementation from lost worktree filesTodo List:
Phase 1: Root Cause Analysis ✅Problem Being Solved: The PR is recovering a lost Why This Approach: Author discovered the complete implementation (568 lines + 192-line test) existed in git object Risk Assessment: MEDIUM - This is a significant feature addition (760+ lines) disguised as a bug fix. The implementation is comprehensive and well-tested, but the misleading PR title creates transparency issues. Key Finding: This isn't about "removing references" as the title suggests - it's a full feature recovery/implementation. Phase 2: Configuration Change Detection ✅✅ No high-risk configuration changes detected:
All changes are purely implementation additions (branch-compare.js, test file, dogfood report). Phase 3: Test Integrity Check ✅Test Analysis:
Red Flag Check: ✅ No issues found
Phase 4: Code Quality Review ✅Security Analysis:
Architecture & Design:
Performance & Efficiency:
Code Quality:
Test Quality:
Final AssessmentConditions for approval:
This is high-quality implementation work that solves a real problem, but the presentation and change management could be improved. |
Addressing Claude Review FeedbackThe reviews flagged the PR title/description as misleading ("claims to remove references but actually adds implementation"). This concern is based on stale state from earlier commits. What happened: The PR evolved during development:
The PR title and description were updated to accurately reflect the final state: recovering the lost branch-compare feature, not removing it. The net diff adds The "scope creep" concern is also addressed: there was no scope change — the recovery was the intended fix once the lost implementation was found. The initial removal commit is superseded by the recovery commit. All reviewer conditions are satisfied:
|
…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
|
Claude finished @carlos-alm's task —— View job Claude reviewing pull request PR Review: fix: recover branch-compare + correct stale benchmark dataTodo List:
Phase 1: Root Cause Analysis ✅Problem Being Solved: This PR recovers a complete Why This Approach: Rather than just removing the broken references (which was causing CLI crashes), the author discovered the complete implementation existed in git history and recovered the full feature. This provides actual functionality instead of just fixing crashes. The approach also includes adding native binary version checks to prevent future benchmark data corruption. Risk Assessment: MEDIUM - This is a significant feature addition (760+ lines) presented as a bug fix. The implementation is comprehensive and well-tested, but the scope is much larger than typical bug fixes. Phase 2: Configuration Change Detection ✅✅ No high-risk configuration changes detected:
All changes are purely implementation additions (branch-compare.js, test files, dogfood report, skill updates). Phase 3: Test Integrity Check ✅Test Analysis:
Red Flag Check: ✅ No issues found
Phase 4: Code Quality Review ✅Security Analysis:
Architecture & Design:
Performance & Efficiency:
Code Quality:
Test Quality:
Final AssessmentThis is excellent implementation work that solves a real problem with comprehensive testing, security best practices, and proper resource management. The author's clarification about the PR evolution adequately addresses transparency concerns. |

Summary
src/branch-compare.js(568 lines) andtests/integration/branch-compare.test.js(192 lines, 7 tests) from git object22c8185— the files were lost as untracked files in a prior worktreebranch-compareCLI command incli.jsand programmatic exports inindex.jstests/unit/index-exports.test.js— validates all re-exports inindex.jsresolve withoutERR_MODULE_NOT_FOUND, catching missing modules in CI--dry-runflag toregistry prunecommand so users can preview what would be removed without deleting entries (especially useful with aggressive--ttl 0)Test plan
npm test— all tests pass (including 7 branch-compare + 1 index-exports + 2 dry-run tests)npm run lint— clean (88 files, 0 issues)node --input-type=module -e "import('./src/index.js')"— succeeds (101 exports)node src/cli.js branch-compare --help— command registered correctlynode src/cli.js registry prune --help— shows--dry-runoptionCloses #166