feat(graph): index HTML files so templates are findable by name (#150) - #196
Frankie-Xu wants to merge 1 commit into
Conversation
b4d5c3d to
2b333dc
Compare
|
Rebased onto current
|
🌱 graft blast radius1 area changed → 6 areas can be affected. 15 dependent symbols, depth 2. flowchart TB
A0(("Graph Processing<br/>8 symbols"))
A1(("Review Workflow<br/>2 symbols"))
A2(("Command Line Interface<br/>2 symbols"))
A3(("Build Context<br/>1 symbol"))
A4(("Language Server Protocol<br/>1 symbol"))
AX(("1 smaller area<br/>1 symbol"))
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;
Who knows this code — 6 people across 7 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 All 15 dependent symbols, grouped by areaGraph Processing — 8 symbols in 8 files
Review Workflow — 2 symbols in 2 files
Command Line Interface — 2 symbols in 2 files
Build Context — 1 symbol in 1 file
Language Server Protocol — 1 symbol in 1 file
tools.ts — 1 symbol in 1 file
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.
37 test suites also reference this code37 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see the code that changed, and the line that reaches it. |
…lhq#150) Co-authored-by: Cursor <cursoragent@cursor.com>
|
Rebased onto current main. Conflict resolution kept the current language list (PHP/Kotlin/Swift stay full-fidelity; Nix stays in the broad list) and added HTML as a file-node-only breadth language. Waiting on CI before marking ready. |
2b333dc to
be8284f
Compare
|
CI is green on current main. Ready for review. |
- 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 <noreply@anthropic.com>
Summary
.html/.htm) on the breadth tier so template files get akind: "file"graph node and show up inask/grepby name — Django users no longer have to walk View class →template_nameto find the template (Support HTML files #150).tree-sitter-wasmalready shipstree-sitter-html.wasm, so this is oneGENERIC_LANGSrow (same path as Clojure/Dart). Notags.scm: HTML has no definition-shaped nodes, and the node-kind walker correctly yields a file node only (ocaml/zig precedent).Closes #150
Route tradeoff
graft build -e, and banner labeling all fall out of the existing registry.fs.ts/build.ts@definition)render/template_name→ HTML file edgesTest plan
npm run build && npm test— 868 pass, 0 failtest/generic-extract.test.ts—.html/.htmrouting; extract is file-node-only; Django-styletemplates/index.html+views.pybuild: grep hits template content,resolveSymbol("index.html")andask("index.html")hit the file nodetest/supported-extensions.test.ts—.html/.htmin the-esupported settemplates/index.html+ DjangoTemplateView):Follow-up
render("…")/template_name = "…"string literals onto the matching HTML file node. That is the "go to the template from the View" direction; this PR is the "find the template by name" direction.Made with Cursor