Skip to content

Improve duplicate output #103

Merged
lzehrung merged 17 commits into
mainfrom
test-perf
May 23, 2026
Merged

Improve duplicate output #103
lzehrung merged 17 commits into
mainfrom
test-perf

Conversation

@lzehrung
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors duplicated helper logic across the codebase and updates the duplicates detector/CLI to emit grouped duplicate findings by default, with optional access to raw unit-pair suggestions.

Changes:

  • Change duplicate detection output from flat suggestions to grouped groups (with --raw-pairs / includeRawPairs to optionally include raw pairs).
  • Extract repeated helper utilities (Git test helpers, symlink availability checks, agent session counting, resolution candidate lookup, SQL lookup helpers, edge helpers, CLI project-file validation).
  • Update docs, tests, and package scripts to match the new duplicates output and adjusted npm test behavior.

Reviewed changes

Copilot reviewed 64 out of 64 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/review.test.ts Uses shared runGit test helper instead of inline Git spawning.
tests/project-file-discovery.test.ts Uses shared isSymlinkUnavailable helper.
tests/package-metadata.test.ts Adds coverage asserting npm test points at fast suite and bench remains opt-in.
tests/mcp-server.test.ts Reuses shared agent and filesystem helpers.
tests/impact-streaming.test.ts Switches to shared Git helper.
tests/impact-git-provider.test.ts Switches to shared Git helper.
tests/impact-cli.test.ts Switches to shared Git helper; removes spawnSync usage.
tests/helpers/git.ts New shared Git helper for tests (spawn + consistent author/committer env).
tests/helpers/filesystem.ts New shared symlink-unavailable detection helper.
tests/helpers/agent.ts New shared counting AgentSession wrapper for tests.
tests/graph-delta.test.ts Switches to shared Git helper.
tests/git-diff-semantics.test.ts Switches to shared Git helper.
tests/duplicates.test.ts Updates expectations to grouped duplicates output; adds new grouping/flag behavior tests.
tests/cli-regressions.test.ts Switches to shared Git helper.
tests/cache-invalidation.test.ts Switches to shared Git helper.
tests/artifact-build.test.ts Reuses shared agent/filesystem helpers.
tests/agent-search.test.ts Reuses shared agent/filesystem helpers.
tests/agent-explain.test.ts Switches to shared Git helper.
src/util/workspace.ts Refactors fileExists/directoryExists to a shared cached-stat helper.
src/util/resolutionCandidates.ts Exports getResolutionExtensions for reuse.
src/util/resolution/phpComposer.ts Uses shared findFirstExistingResolutionCandidate helper.
src/util/resolution/php.ts Uses shared findFirstExistingResolutionCandidate helper.
src/util/resolution/node.ts Uses shared findFirstExistingResolutionCandidate helper.
src/util/resolution/findFirstExisting.ts New shared “first existing resolution candidate” helper.
src/util/resolution.ts Uses shared getResolutionExtensions + shared “first existing candidate” helper.
src/util/projectFiles/parsers.ts Uses shared isPlainRecord; factors assigned-string name parsing.
src/util/guards.ts New shared isPlainRecord guard.
src/util/graphEdges.ts New shared edge key/sort/relative conversion helpers.
src/sql/sourceGraph.ts Uses shared SQL lookup push helper.
src/sql/review.ts Uses shared SQL object lookup key helper.
src/sql/navigation.ts Uses shared SQL lookup push helper.
src/sql/lookup.ts New shared SQL object lookup key + Map-push helper.
src/sql/extractFacts.ts Uses shared SQL object lookup key helper.
src/review/report.ts Uses shared graph edge helpers instead of local duplicates.
src/review/deleted.ts Uses shared graph edge helpers; removes local duplicates.
src/presets.ts Uses shared isPlainRecord guard instead of local helper.
src/native/execution.ts Consolidates “native unavailable” fallback construction.
src/languages/types.ts Reuses JS fallback types (JsPoint/JsSyntaxNode) for Syntax*Like types.
src/languages/definitions/cpp.ts Factors shared C-family declarator/query logic into shared module.
src/languages/definitions/cFamily.ts New shared helpers for C/C++ definition logic.
src/languages/definitions/c.ts Factors shared C-family declarator/query logic into shared module.
src/indexer/shared.ts Re-exports shared graph edge helpers from util/graphEdges.
src/indexer/imports/languageSpecific.ts Factors Java/Kotlin JVM import binding handling into shared helper.
src/index.ts Exports new DuplicateGroup type from public API surface.
src/impact/reportShared.ts New shared mapping helpers for full vs compact impact report projections.
src/impact/reportFull.ts Uses shared mapping helpers to reduce duplication.
src/impact/reportCompact.ts Uses shared mapping helpers to reduce duplication.
src/graphs/traversal.ts Factors shared dependency traversal logic between forward and reverse walks.
src/duplicates.ts Introduces grouped duplicate results, overlap clustering, and includeRawPairs.
src/cli/projectFile.ts New shared CLI helper for project-root confined file args and error output.
src/cli/options.ts Refactors integer option parsing to shared internal helpers.
src/cli/navigation.ts Uses shared CLI project-file helper.
src/cli/help.ts Updates duplicates help to describe grouped output + --raw-pairs.
src/cli/graphQueries.ts Uses shared CLI project-file helper.
src/cli/duplicates.ts Adds --raw-pairs flag plumbing to duplicate detection options.
src/cli/doctor.ts Uses shared isPlainRecord guard.
src/agent/artifact.ts Uses shared isPlainRecord guard; removes local record guard.
src/agent-tools.ts Factors common dependency listing logic between deps/rdeps tools.
README.md Updates duplicates workflow description and test command guidance.
package.json Changes npm test to run the fast suite by default.
docs/superpowers/plans/2026-05-22-duplicate-refactor-checklist.md Adds planning/checklist doc capturing the refactor + grouping goals.
docs/library-api.md Updates library API docs to show grouped duplicates and includeRawPairs.
docs/cli.md Updates CLI docs for grouped duplicates output and --raw-pairs.
codegraph-skill/codegraph/SKILL.md Updates skill guidance to reflect grouped duplicates + --raw-pairs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/duplicates.ts Outdated
Comment thread src/duplicates.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 64 out of 64 changed files in this pull request and generated 1 comment.

Comment thread src/duplicates.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 64 out of 64 changed files in this pull request and generated no new comments.

@lzehrung lzehrung merged commit 5ac2297 into main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants