Skip to content

fix(graph): honor and preserve extension filters - #610

Open
Bortlesboat wants to merge 1 commit into
trailhq:mainfrom
Bortlesboat:fix/graph-extension-filter
Open

Bortlesboat wants to merge 1 commit into
trailhq:mainfrom
Bortlesboat:fix/graph-extension-filter

Conversation

@Bortlesboat

Copy link
Copy Markdown

graft build --extensions .go now limits structural indexing to Go files. Previously the CLI accepted the option but indexed every supported extension. Selections accept dotted, undotted, and mixed-case forms and apply to workspace children as well as single repositories.

The selection is saved in graph metadata so checks, query refresh, and Claude background sync retain it across extractor upgrades. Workspace sync preserves each child's own selection, discovers new children, and keeps a parent output override out of child builds. An explicit build without --extensions restores all supported languages. Go module metadata remains available for import resolution.

MCP responses disclose active extension selections, including zero-hit results and mixed workspace scopes, so an agent can search excluded files directly.

Fixes #568.

Validation:

  • Regression tests fail before the fix, including actual CLI indexing, extractor invalidation, background sync, workspace overrides/new children, and MCP scope disclosure.
  • npm run build passes.
  • npm test: 1,406 passed, zero failed, 10 existing platform skips. Temporary fixtures ran outside an enclosing Git repository.
  • Compiled CLI and background-sync integration pass; git diff --check passes.

@trailhq-graft

trailhq-graft Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

4 areas changed → 4 areas can be affected. 12 dependent symbols, depth 2.
Tests: no test reaches CLI Engine, Claude Build Sync; 2 areas updated their tests.
Tag: @anirudhkumar-nanonets — 5 of 8 areas · @shhdwi — 7 of 8 areas · Buseong Kim — Workspace Federation

flowchart TB
  A0(("Pull Request Review<br/>8 symbols"))
  A1(("Workspace Federation<br/>2 symbols"))
  A2(("Viewer Build<br/>1 symbol"))
  A3(("MCP Server<br/>1 symbol"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Pull Request Review 8 src/app/brain-build.ts:L251-L358 readRepository — calls, depth 1 Graph Building
Workspace Federation 2 src/graph/workspace.ts:L710-L723 splitWorkspace — calls, depth 1 CLI Engine, Graph Building
Viewer Build 1 scripts/build-viewer.mjs:L1-L45 build-viewer.mjs — calls, depth 2 Graph Building
MCP Server 1 src/mcp/server.ts:L73-L155 startMcpServer — calls, depth 1 Graph Building, MCP Tools
Who knows this code — 4 people across 8 areas
Area Who knows it
Graph Building · changed @anirudhkumar-nanonets — 26 commits, last 2d ago · @shhdwi — 13 commits, last yesterday
MCP Tools · changed @shhdwi — 15 commits, last yesterday · @anirudhkumar-nanonets — 9 commits, last 2d ago
CLI Engine · changed @anirudhkumar-nanonets — 56 commits, last yesterday · @shhdwi — 26 commits, last yesterday
Claude Build Sync · changed @shhdwi — 3 commits, last 3mo ago · @bhavesh-gupta-investis — 1 commit, last 2mo ago
Pull Request Review · affected @anirudhkumar-nanonets — 12 commits, last 1mo ago
Workspace Federation · affected @shhdwi — 7 commits, last yesterday · Buseong Kim — 2 commits, last 2mo ago
Viewer Build · affected @shhdwi — 2 commits, last 2mo ago
MCP Server · affected @anirudhkumar-nanonets — 6 commits, last 2d ago · @shhdwi — 2 commits, last 3mo ago

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 12 dependent symbols, grouped by area

Pull Request Review — 8 symbols in 6 files

  • src/app/brain-build.ts:L251-L358 — readRepository (calls, depth 1)
    258: // four things in a trench coat — the clone, the graph build, the
  • src/app/review.ts:L45-L99 — reviewPullRequest (calls, depth 1)
    55: await buildGraph(checkout.dir);
  • src/app/brain-build-worker.ts:L1-L83 — brain-build-worker.ts (calls, depth 2)
    12: import { readRepository, type BrainBuildJob, type RepoReadAuth } from "./brain-build.js";
  • src/app/brain-build-worker.ts:L29-L32 — DoneMessage (references, depth 2)
  • src/app/brain-build.ts:L237-L239 — buildRepoIntoBrain (calls, depth 2)
  • src/app/review-process.ts:L180-L184 — childReviewer (references, depth 2)
  • src/app/review-worker.ts:L67-L87 — run (calls, depth 2)
  • src/app/server.ts:L34-L46 — AppSeams (references, depth 2)

Workspace Federation — 2 symbols in 1 file

  • src/graph/workspace.ts:L710-L723 — splitWorkspace (calls, depth 1)
    713: buildChild: (childDir: string, childName: string) => Promise<void>,
  • src/graph/workspace.ts:L631-L656 — federateCheck (calls, depth 1)
    639: const g = await checkGraph(join(root, child));

Viewer Build — 1 symbol in 1 file

  • scripts/build-viewer.mjs:L1-L45 — build-viewer.mjs (calls, depth 2)
    32: // (which ships `dist` only) can load them. generic.ts resolves dist/graph/queries

MCP Server — 1 symbol in 1 file

  • src/mcp/server.ts:L73-L155 — startMcpServer (calls, depth 1)
    111: instructions: upkeep.length ? `${upkeep.join('\n')}\n\n${mcpInstructions()}` : mcpInstructions(),
Test signal per changed area — 2 ✓ · 2 ✗

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ✓ Graph Building — 4 of 9 reached · 2 test files changed here: test/claude-hooks.test.ts, test/graph-extensions.test.ts
    • not reached: writeFingerprint, normalizeExtensions, listSourceFiles, listSourceStats, buildChild
  • ✓ MCP Tools — 2 of 3 reached · 1 test file changed here: test/graph-extensions.test.ts
    • not reached: extensionScopeNote
  • ✗ CLI Engine — 0 of 1 reached · no test file reaches it
    • not reached: graph
  • ✗ Claude Build Sync — 0 of 1 reached · no test file reaches it
    • not reached: realBuild
40 test suites also reference this code

48 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/ask-index.test.ts
  • test/ask.test.ts
  • test/container-extract.test.ts
  • test/context-only-dir.test.ts
  • test/context.test.ts
  • test/covers.test.ts
  • test/generic-extract.test.ts
  • test/graph-follow-nested-repos.test.ts
  • test/graph-follow-submodules.test.ts
  • test/graph-go.test.ts
  • test/graph-include-dir.test.ts
  • test/graph-incremental.test.ts
  • test/graph-invariants.test.ts
  • test/graph-java.test.ts
  • test/graph-languages.test.ts
  • test/graph-load.test.ts
  • test/graph-native-fallback.test.ts
  • test/graph-only-dir.test.ts
  • test/graph-php.test.ts
  • test/graph-posix-paths.test.ts
  • …20 more

⚠️ 1 changed file not in the graph (README.md) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 15 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 15, 2026

This branch has not been deployed

No deployments
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.

--extensions has no effect: all files indexed regardless of filter

1 participant