Skip to content

fix: reduce generic context entry noise#356

Open
bohe76 wants to merge 3 commits into
colbymchenry:mainfrom
bohe76:fix-context-generic-term-noise
Open

fix: reduce generic context entry noise#356
bohe76 wants to merge 3 commits into
colbymchenry:mainfrom
bohe76:fix-context-generic-term-noise

Conversation

@bohe76
Copy link
Copy Markdown

@bohe76 bohe76 commented May 23, 2026

Summary

  • Suppress generic split-token entry points such as get, getDb, and testCases when a query already has a specific exact compound symbol match.
  • Keep generic results when they are in the exact-match files, so focused symbol queries still retain local helpers.
  • Reduce default context code blocks from 10 to 2, while keeping --max-code available for callers that need more code.
  • Avoid emitting full bodies for related classes that are not entry points; their locations remain in Related Symbols instead.
  • Skip tiny delegating wrappers when the same symbol has a more useful implementation block.
  • Add a compact focused snippet when non-root query terms co-locate with an entry symbol, so queries like getFileDependents affected tests include the CLI connection point without needing a separate query call.
  • Add regression coverage for getFileDependents affected tests and method-focused context that should not include related class bodies.

Validation

  • npm run build
  • npx vitest run __tests__/context.test.ts (20 passed)
  • node dist\\bin\\codegraph.js context "getFileDependents affected tests" --path .
  • Token measurement for repo_get_file_dependents_investigation: CodeGraph output 2,512 -> 639 approx tokens, changing from +120.0% vs manual to -51.6%.
  • Expanded combined local branch test with the related affected/class fixes: 14/14 smoke accuracy, 38,135 manual approx tokens vs 8,976 CodeGraph approx tokens, 76.5% total reduction.

Note: full npm test was also run locally before this update; it hit unrelated Windows temp-directory EBUSY cleanup failures in MCP process tests (mcp-initialize, mcp-roots).

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.

1 participant