Add scoped duplicate leads to review output#110
Conversation
There was a problem hiding this comment.
Pull request overview
Adds scoped, high-confidence duplicate leads to the human-readable output paths (impact --pretty and review --summary/--pretty) without touching the existing JSON contracts. A new --duplicates off|changed|impacted|all option lets users tune the scope, and full grouped duplicate data continues to live under codegraph duplicates. Docs, the bundled skill, and the implementation plan are updated, and regression tests cover the new pretty/summary paths.
Changes:
- New
src/duplicatesLeads.tshelper that runsfindDuplicates()on a scoped index and filters to high-confidenceexact/renamedclones with omission counts. impactandreviewCLI paths collect and append duplicate leads only for human output;--duplicatesis registered as a value option and parsed with defaultschanged(impact) andimpacted(review).- Documentation, README CLI examples, agent workflow notes, skill guidance, and the refinement plan are updated; tests added for pretty/summary duplicate output and an omitted-counts-only summary.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/duplicatesLeads.ts | New helper: scope type, lead/summary types, scope parser, lead collector, and prose appender. |
| src/cli/impact.ts | Refactors pretty impact to a string builder and wires in scoped duplicate-lead collection (default changed), reusing the existing project index. |
| src/cli/review.ts | Adds scoped/all duplicate-lead collection (default impacted) for --summary/--pretty; builds a fresh index for the duplicate pass. |
| src/cli/options.ts | Registers --duplicates as a value-bearing CLI option. |
| src/cli/help.ts | Adds a --duplicates off example to the impact help block. |
| README.md | Adds a "CLI examples" section with impact pretty, review summary, duplicates, and orient samples. |
| docs/cli.md | Documents --duplicates flag, defaults, and that JSON contracts are unchanged. |
| docs/library-api.md | Notes that duplicate leads in human summaries are presentation-only; programmatic callers should use findDuplicates(). |
| docs/agent-workflows.md | Describes the new duplicate-lead defaults and scoping options. |
| docs/how-it-works.md | Mentions the scoped duplicate-lead pass for pretty/summary output. |
| docs/scenario-catalog.md | Prettier reflow of existing tables (no semantic change). |
| docs/superpowers/plans/2026-05-28-docs-output-refinement.md | Marks the plan's checklist items as done. |
| codegraph-skill/codegraph/SKILL.md | Adds skill guidance about default duplicate leads and the --duplicates flag. |
| tests/duplicates.test.ts | Adds a unit test for appendDuplicateLeadSummary() retaining omission counts when no lead survives filters. |
| tests/impact-cli.test.ts | Adds pretty impact duplicate-lead test (incl. --duplicates off) and a review summary duplicate-lead test; converts existing tests to the it(name, fn, timeout) form. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Other Observations (not in diff)Issues found in unchanged code or design decisions worth noting:
Files Reviewed (12 files)
Reviewed by kimi-k2.6 · 2,856,059 tokens |
--duplicates off|changed|impacted|allfor human-summary duplicate scope.codegraph duplicates.Verification:
npm run buildnpm run lintnpm testnpm run test:integrationnpx prettier --check README.md docs\installation.md docs\cli.md docs\library-api.md docs\agent-workflows.md docs\how-it-works.md docs\language-parity.md docs\scenario-catalog.md codegraph-skill\codegraph\SKILL.md docs\superpowers\plans\2026-05-28-docs-output-refinement.md src\duplicatesLeads.ts src\cli\impact.ts src\cli\review.ts src\cli\help.ts src\cli\options.ts tests\duplicates.test.ts tests\impact-cli.test.tsgit diff --check