Skip to content

feat(graph): add Zig tags.scm — call edges for the breadth tier - #201

Open
Frankie-Xu wants to merge 6 commits into
trailhq:mainfrom
Frankie-Xu:feat/zig-tags-scm
Open

Frankie-Xu wants to merge 6 commits into
trailhq:mainfrom
Frankie-Xu:feat/zig-tags-scm

Conversation

@Frankie-Xu

@Frankie-Xu Frankie-Xu commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Zig breadth-tier tags for functions, const structs, named tests, and bare/member call expressions. Nested functions retain their own scope inside structs, and escaped test labels retain the complete inner source spelling instead of being truncated at the first string fragment.

Fixes #197.

Validation

  • Before/after exact-source probes demonstrate the original missing nested functions and truncated escaped labels, then the corrected behavior.
  • Regression coverage: nested functions and method-call ownership; complete escaped test labels and test-call source; original named/unnamed test distinction.
  • Normal merge of current upstream main (fe30ead39d5e6f0c921018d364da2bdbc9d4b3ad) preserves current language registry and existing tests.
  • Node 24.18.1 focused Zig regression tests: 3 pass, 0 fail. Own Node24 build passed after independent matching-lock dependency copy; the affected 11-file language suite passed 129/129.
  • Official CI is green on head fcd416c: full Ubuntu/Windows suites and prepare/build, Node 24 WASM regression, CodeQL analyze/result, blast, and publish.
  • Align CodeQL init/analyze to v4.38.1, reusing the single-line CI repair verified on fix(llm): recover bare arrays and truncated JSON from gateway content (#253) #269.

Scope

Enum/union definitions and unnamed tests remain outside this query. Escaped test labels use their source spelling. Member calls use the existing name resolver and do not add receiver typing.

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🌱 graft blast radius

1 area changed → 1 area can be affected. 2 dependent symbols, depth 2.
Tests: no test reaches Graph Scope Definition.
Tag: @shhdwi — Graph Scope Definition, Graph Build And Check · @anirudhkumar-nanonets — Graph Build And Check

flowchart TB
  A0(("Graph Build And Check<br/>2 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Graph Build And Check 2 src/graph/build.ts:L151-L410 buildGraph — calls, depth 2 Graph Scope Definition
Who knows this code — 2 people across 2 areas
Area Who knows it
Graph Scope Definition · changed @shhdwi — 7 commits, last 2mo ago
Graph Build And Check · affected @anirudhkumar-nanonets — 18 commits, last 1mo ago · @shhdwi — 7 commits, last 2mo 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 2 dependent symbols, grouped by area

Graph Build And Check — 2 symbols in 2 files

  • src/graph/build.ts:L151-L410 — buildGraph (calls, depth 2)
  • src/graph/check.ts:L58-L164 — checkGraph (calls, 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.

  • ✗ Graph Scope Definition — 0 of 2 reached · no test file reaches it
    • not reached: tagsExtract, defScope
1 test suite also references this code

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

  • test/generic-node24-probe.ts

⚠️ 2 changed files not in the graph (.github/workflows/codeql.yml, src/graph/queries/zig.scm) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 4 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 Aug 25, 2026
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
@Frankie-Xu
Frankie-Xu marked this pull request as draft August 26, 2026 09:49
@Frankie-Xu

Copy link
Copy Markdown
Contributor Author

Rebased onto current main. Kept the existing PHP wasm / throwing-grammar tests and layered the Zig tags.scm fixture on top. Waiting on CI before marking ready.

The tracking issue is trailhq#198; the previous commit message still names trailhq#197.

Co-authored-by: Cursor <[email protected]>
github-actions Bot added a commit that referenced this pull request Sep 11, 2026
@Frankie-Xu
Frankie-Xu marked this pull request as ready for review September 11, 2026 12:57
@Frankie-Xu

Copy link
Copy Markdown
Contributor Author

Rebased onto current main. CI is green. Ready for review.

Ercaner1988 added a commit to Ercaner1988/Graft that referenced this pull request Sep 12, 2026
- generic-extract.test.ts: the union merge of trailhq#196, trailhq#200 and trailhq#201 spliced
  their appended tests into one another and left the file unterminated.
  Rebuilt as trailhq#196's file plus trailhq#200's and trailhq#201's appended blocks verbatim.
- The trailhq#139 test asserted that a cached parse failure is replayed without a
  re-parse; trailhq#317 (fixes trailhq#312) deliberately re-parses it instead and did not
  update the test. It now asserts the re-parse and that the error still
  comes back.
- The trailhq#319 symlink test (trailhq#328) needed symlink privilege on Windows. Directory
  links are junctions there, as test/graph-root and test/ingest-fs already
  do, and the file-link case is skipped with a diagnostic when it cannot be
  created.

Co-Authored-By: Claude Opus 5 <[email protected]>
github-actions Bot added a commit that referenced this pull request Oct 7, 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.

ocaml/zig: no tags.scm — symbols come from the node-kind walker fallback, call edges are absent

1 participant