You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jinja2 templates (.j2) are invisible to detect — the graph shows generated output but hides its source #3427
.j2 files are not classified by graphify.detect at all — not as code, not as
document. In a codegen-based repo this can be a large share of the editable
surface: in ours it is 71 tracked files, 0 detected, 0 nodes.
Why this is worse than a missing extension
Codegen projects usually carry a hard rule: never edit the generated file — change
the template or the generator, then regenerate. The generated modules are marked DO NOT EDIT MANUALLY and are overwritten on every build.
The graph therefore describes exactly the wrong half of that relationship. Every
generated module has nodes; the templates they come from have none. An agent asking
the graph "where do I change X" is pointed at files that must not be edited, and
cannot see the file that must.
This inverts the graph's purpose for any template-driven project (Jinja, Handlebars,
ERB, Mustache, Liquid): the more of the codebase is generated, the less the graph
describes what a developer or agent is allowed to touch.
.graphifyrc is read only by hooks.py and supports a single key, viz_node_limit.
So there appears to be no supported way to tell graphify to treat an extension as a
document.
Suggestions, smallest first
Classify .j2, .jinja, .jinja2 as documents so the semantic pass reads them
as text. This alone restores the template → generated link, since templates carry
prose, structure and the generator header.
Optionally, strip the outer extension for classification: module.py.j2 → treat
as Python for AST, since template files are usually <real-ext>.j2.
Or reintroduce a minimal type-map in .graphifyrc, e.g. document_extensions=.j2,.jinja2.
Option 1 would be enough for us.
Reproduce
mkdir -p demo/src/build/templates &&cd demo
printf'class {{ name }}:\n pass\n'> src/build/templates/module.py.j2
printf'class Generated:\n pass\n'> src/build/module.py
graphify extract . --code-only
# graphify-out/graph.json contains src/build/module.py and no template node
Note the second effect visible in the same snippet: a source directory named build/ is dropped by _SKIP_DIRS before extraction. That default is right for
most repos, so this is not a bug report — but the two together mean a
template-driven project can lose both its generator sources and its templates
without any warning in the output.
Hey! I've opened a PR to fix this at #3455 by explicitly adding the Jinja extensions to DOC_EXTENSIONS. Tests are included, and the automated reviewer has already marked it safe to merge. Let me know if you need any adjustments!
Activity
nikhilsaxena04 commentedon Sep 9, 2026
Hey! I've opened a PR to fix this at #3455 by explicitly adding the Jinja extensions to
DOC_EXTENSIONS. Tests are included, and the automated reviewer has already marked it safe to merge. Let me know if you need any adjustments!Classify Jinja templates as documents (Graphify-Labs#3427)
fix(detect): classify Jinja templates as documents (Graphify-Labs#3427)
fix(detect): classify Jinja templates as documents (Graphify-Labs#3427)
fix(detect): classify Jinja templates as documents (#3427)
safishamsi commentedon Oct 13, 2026
Fixed in v0.9.90 (
graphifyy 0.9.90on PyPI) via #3455.