Skip to content

feat(graph): index Bash scripts with the bundled grammar (#354) - #793

Merged
shhdwi merged 1 commit into
mainfrom
land/pr-354
Nov 9, 2026
Merged

shhdwi merged 1 commit into
mainfrom
land/pr-354

Conversation

@shhdwi

@shhdwi shhdwi commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Re-lands #354 by @cookerpapa. The contributor's fork couldn't take a merge from main, so this branch applies their diff on current main with the conflicts resolved. Authorship is kept on the commit.

.sh and .bash files are indexed in the breadth tier with the Bash grammar that already ships in tree-sitter-wasms. Both f() {} and function f {} become function symbols. There are no call edges yet, and extensionless scripts are still skipped.

Adapted lines

  • src/graph/generic.ts: main added gleam and powershell rows after this PR was opened. The bash row goes after them, unchanged.
  • README.md: main reworded the language list. The PR's two Bash lines go under main's breadth-tier line, and the total now reads "Twenty-five languages, plus Vue single-file components" (main says twenty-four; the PR said "Twenty-four languages in total").
  • Note: feat(graph): index GLSL files in the breadth tier (#293) #358 (GLSL) is re-landed separately and edits the same two spots. Whichever merges second needs a one-line rebase (row order and the count).

Checked

  • File list matches the original PR; every added line is present except the README count line above.
  • npm run build passes.
  • New tests in test/graph-bash.test.ts: 2/2 fail with main's src/ and 2/2 pass here.
  • 47 test files that use graph/generic, buildGraph or source-files: 580/580 pass with an empty HOME.
  • Security read of the full diff: one registry row, a README edit and a test. No new dependency (the grammar is already in tree-sitter-wasms), no install scripts, no I/O changes. Shell scripts are parsed, never run. Function definitions only, so no new edges. None found.

Closes #354.

🤖 Generated with Claude Code

@trailhq-graft

trailhq-graft Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

1 area changed → 9 areas can be affected. 18 dependent symbols, depth 2.
Tag: Daniel JB Clark — 7 of 10 areas · @anirudhkumar-nanonets — Command Line Interface · @Faeeth — 3 of 10 areas

flowchart TB
  A0(("Graph Processing<br/>9 symbols"))
  A1(("Command Line Interface<br/>2 symbols"))
  A2(("Build Context<br/>1 symbol"))
  A3(("Edit Overlap<br/>1 symbol"))
  A4(("LSP Enrichment<br/>1 symbol"))
  AX(("4 smaller areas<br/>4 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3,A4 reached;
  classDef tail fill:#EEF2F3,stroke:#9AA4A9,stroke-width:1px,color:#3A4247;
  class AX tail;
Loading
Can be affected Symbols Nearest hop Reached from
Graph Processing 9 src/graph/build.ts:L1-L493 build.ts — imports, depth 1 Generic Graph
Command Line Interface 2 src/cli.ts:L1-L3449 cli.ts — imports, depth 2 Generic Graph
Build Context 1 src/context/build.ts:L1-L613 build.ts — imports, depth 2 Generic Graph
Edit Overlap 1 src/notes/edit-overlap.ts:L1-L244 edit-overlap.ts — imports, depth 1 Generic Graph
LSP Enrichment 1 src/graph/lsp/enrich.ts:L1-L148 enrich.ts — imports, depth 1 Generic Graph
Ignored Code 1 src/search/ignored-code.ts:L1-L68 ignored-code.ts — imports, depth 2 Generic Graph
3 smaller areas 3 Cloud Onboarding, Review Process, tools.ts see below
Who knows this code — 7 people across 10 areas
Area Who knows it
Generic Graph · changed Milhouse — 1 commit, last today · @Frankie-Xu — 1 commit, last today
Graph Processing · affected Kunal Roy Choudhury — 2 commits, last today
Command Line Interface · affected @anirudhkumar-nanonets — 3 commits, last yesterday
Build Context · affected @qoole — 1 commit, last today · Daniel JB Clark — 1 commit, last yesterday
Edit Overlap · affected @Faeeth — 1 commit, last yesterday · Daniel JB Clark — 1 commit, last yesterday
LSP Enrichment · affected Daniel JB Clark — 1 commit, last yesterday
Ignored Code · affected @Faeeth — 1 commit, last yesterday · Daniel JB Clark — 1 commit, last yesterday
Cloud Onboarding · affected @Faeeth — 1 commit, last yesterday · Daniel JB Clark — 1 commit, last yesterday
…2 further areas

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 18 dependent symbols, grouped by area

Graph Processing — 9 symbols in 9 files

  • src/graph/build.ts:L1-L493 — build.ts (imports, depth 1)
  • src/graph/check.ts:L1-L216 — check.ts (imports, depth 1)
  • src/graph/container.ts:L1-L270 — container.ts (imports, depth 1)
  • src/graph/resolve.ts:L1-L832 — resolve.ts (imports, depth 1)
  • src/graph/source-files.ts:L1-L130 — source-files.ts (imports, depth 1)
  • src/graph/fingerprint.ts:L1-L201 — fingerprint.ts (imports, depth 2)
  • src/graph/refresh-run.ts:L1-L33 — refresh-run.ts (imports, depth 2)
  • src/graph/refresh.ts:L1-L394 — refresh.ts (imports, depth 2)
  • src/graph/workspace.ts:L1-L726 — workspace.ts (imports, depth 2)

Command Line Interface — 2 symbols in 2 files

  • src/cli.ts:L1-L3449 — cli.ts (imports, depth 2)
  • src/engine.ts:L1-L194 — engine.ts (imports, depth 2)

Build Context — 1 symbol in 1 file

  • src/context/build.ts:L1-L613 — build.ts (imports, depth 2)

Edit Overlap — 1 symbol in 1 file

  • src/notes/edit-overlap.ts:L1-L244 — edit-overlap.ts (imports, depth 1)

LSP Enrichment — 1 symbol in 1 file

  • src/graph/lsp/enrich.ts:L1-L148 — enrich.ts (imports, depth 1)

Ignored Code — 1 symbol in 1 file

  • src/search/ignored-code.ts:L1-L68 — ignored-code.ts (imports, depth 2)

Cloud Onboarding — 1 symbol in 1 file

  • src/cloud/onboarding.ts:L1-L722 — onboarding.ts (imports, depth 2)

Review Process — 1 symbol in 1 file

  • src/app/review.ts:L1-L174 — review.ts (imports, depth 2)

tools.ts — 1 symbol in 1 file

  • src/mcp/tools.ts:L1-L352 — tools.ts (imports, depth 2)
Test signal per changed area — 1 –

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.

  • – Generic Graph — 1 test file changed here: test/graph-bash.test.ts
58 test suites also reference this code

58 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/claude-hooks.test.ts
  • test/claude-prompt-private.test.ts
  • test/container-extract.test.ts
  • test/context-only-dir.test.ts
  • test/context.test.ts
  • test/covers.test.ts
  • test/depth-parity.ts
  • test/generic-extract.test.ts
  • test/generic-node24-probe.ts
  • test/graph-cross-language.test.ts
  • test/graph-elixir.test.ts
  • test/graph-enrich-pending.test.ts
  • test/graph-extensions.test.ts
  • test/graph-go.test.ts
  • test/graph-incremental.test.ts
  • test/graph-invariants.test.ts
  • test/graph-java.test.ts
  • test/graph-jsx.test.ts
  • …38 more

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

graft blast · refs/graft/base...HEAD · depth 2 · 3 changed files

Open the interactive graph → — click an area to see the code that changed, and the line that reaches it.

github-actions Bot added a commit that referenced this pull request Nov 9, 2026
github-actions Bot added a commit that referenced this pull request Nov 9, 2026
Re-landed from #354 with the conflicts against main resolved; the contributor's fork couldn't take the merge commit.

Co-Authored-By: Shrish Dwivedi <shrish@trailhq.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shhdwi
shhdwi merged commit a2e2413 into main Nov 9, 2026
5 of 6 checks passed
@shhdwi
shhdwi deleted the land/pr-354 branch November 9, 2026 16:25
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