Repository navigation
Conversation
Extract .liquid files of a Shopify theme (gated on a layout/theme.liquid ancestor). render/include/section/sections/content_for and schema blocks become 'imports' edges to the file they name, so 'graphify affected' on a snippet lists the sections rendering it. asset_url and the t filter become 'references' edges (asset file, or key of the single default locale). Relation 'includes' is avoided because affected does not follow it. Dynamic names, comment/doc/raw regions and path-traversal names emit nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A statically named render/include/section/sections/content_for target, asset or translation key that does not exist becomes an AMBIGUOUS edge (score 0.2) to a node flagged unresolved with id ref_liquid_<kind>_<name>, instead of being dropped. Documents how to list them from graph.json and adds Liquid to the built-in parsers list. The incremental cache keeps the stale edge of an unchanged citing file after the target appears; pinned by a strict xfail, a full rebuild clears it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A literal such as 'font.eot?#iefix' piped into asset_url named a file that cannot exist. Resolve the part before ? or # instead of reporting a broken reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… to JS siblings Shopify default locales start with a // header, so json.loads failed and every | t edge was lost; strip // and /* */ outside strings. A .liquid -> .js reference was dropped by the cross-language guard in build, and the references target was not salted with the colliding id when x.css and x.js share a stem. Co-Authored-By: Claude <[email protected]>
Templates and section groups of a Shopify theme place sections and blocks in JSON, which were skipped as data JSON. Route them by path (gated on a theme root) before the generic .json dispatch, link each placed section and existing theme block, and link t: schema keys to the default schema locale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Templates place top-level blocks with section type _blocks, which Shopify provides; it never has a sections/ file, so it must not be reported as a broken reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iles Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
…schemas Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
…ce rubric Co-Authored-By: Claude <[email protected]>
|
Thanks for the pull request, @dalexhd. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
1 bug · 8 possible issues to check · High impact
The changes add Shopify theme-aware extraction for Liquid files and selected theme JSON files, linking placements, assets, translations, and related references.
Adding a missing theme file leaves its reference unresolved ·
liquid.py:208
8 possible issues we couldn't confirm
- Theme settings_data.json over 1 MB gets no section placement links, while settings_schema.json is always read in full ·
graphify/extractors/shopify_theme_json.py:131 - Liquid templates now get their own language family, which blocks cross-file calls from Liquid into JavaScript and TypeScript files ·
graphify/extract.py:4896 - Liquid templates bypass the cross-language import guard for every target, so unverified references can bind to same-named nodes in other lan ·
graphify/build.py:2308 - +5 more in Graphify
They don't change the score.
What this review covered
- We didn't review 9 files that aren't source code, such as docs, config, images, or generated or third-party code.
- Some lookups asked for files or lines that do not exist; the review was told and carried on.
- Some findings could not be double-checked.
- 10 of 10 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 7582 functions depend on this change
- 6 functions became more coupled. Largest:
extract()(1400 callers),build_from_json()(349 callers),_get_extractor()(47 callers). - 644 of 644 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 6c1acdd
| if state == "out": | ||
| return | ||
| if state == "missing": | ||
| self._unresolved(relation, kind, name, target.relative_to(self.root).as_posix(), line) |
There was a problem hiding this comment.
Adding a missing theme file leaves its reference unresolved
After a missing snippet is added, an incremental update can still show the Liquid file pointing to an unresolved reference instead of the new snippet.
Re-resolve cached AMBIGUOUS edges when a target file is added.
Evidence · checked against the code
Expected: The reference edge resolves to the added target file.
Actually: The citing file can retain its cached AMBIGUOUS edge to the unresolved node.
- Independent source review: Checked the full-rebuild behavior described in the extractor documentation and the strict-xfail incremental test. A full rebuild clears the stale edge, but it does not resolve the incremental-update case.
Prompt to fix with AI
In graphify/extractors/liquid.py, _Collector.file_edge (lines 205-208):
Problem: Adding a missing theme file leaves its reference unresolved
Expected: The reference edge resolves to the added target file.
Actually: The citing file can retain its cached AMBIGUOUS edge to the unresolved node.
Fix it at the cause, and add a test that fails without the fix.
Graphify · Checked against the code · View in Graphify
…5557) Squashed landing of @dalexhd's four-PR Liquid/Shopify-theme extractor stack: a Liquid extractor (.liquid), theme-JSON template→section/block linking, CSS classes, settings, custom elements and metafields. Pure-stdlib scanners, no new dependencies; all new extraction is gated to a theme root (layout/ theme.liquid) so non-theme .css/.json files are unaffected. Verified by adversarial review: zero node/edge diff on Python and a 20-language corpus (no existing-language regression), new extraction works, broken themes degrade gracefully. Schema bump is consolidated with the rest of this release's extraction-output changes in a following commit. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ema 58 Collapse the Shopify stack's internal 58/59/60 bumps and the TS/C++/Markdown bumps into a single 57->58 bump with one combined entry (TS #5525/#5529, C++ #5550/#5551, Markdown #5480, Shopify #5553/#5554/#5555/#5557), chaining to the shipped-57 (0.9.121) entry. Fixes the stack's schema-history mislabel that had carried the shipped-57 Rust text as 58. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Shipped in v0.9.122 as the Shopify/Liquid theme extractor. The four-PR stack landed as a single squashed commit authored to you (@dalexhd) so it keeps your authorship. Adversarial review confirmed zero regression to existing-language extraction (zero node/edge diff on Python + a 20-language corpus), no new dependencies, and graceful handling of broken themes. Thanks for a substantial feature! |
Part 3 of #5552, stacked on #5554 (theme JSON) and #5553 (Liquid). Until those merge, this diff also shows their commits.
What does this PR do?
It covers the remaining Shopify theme constructs that create a dependency between files. I measured them on three production themes, one of them Horizon 3.5.1. One commit per construct, so any of them can be dropped on its own.
'x' | inline_asset_contentreferencesto the asset{% schema %}presets[].blocks(list, dict, nested)importstoblocks/<type>.liquidwhen the file existsenabled_on/disabled_on(templates,groups)referencestotemplates/<x>.jsonor the section group'x' | asset_img_urlreferencesto the assetconfig/settings_data.jsonsections and blocks bytypeimportsto their.liquid{% content_for 'blocks' %}in a section whose schema accepts@themeimports, confidenceINFERRED, to every publicblocks/*.liquid(no_prefix)Implementation notes
AMBIGUOUSedge to anunresolved: truenode (ref_kindtemplateorsection_group)."*"and dynamic names create nothing.enabled_on.groupslooks forsections/<g>-group.json, thensections/<g>.json. Templates accept.jsonor.liquid.content_for 'blocks'is the one inferred relation. Any theme block may be placed there at runtime, so the edge is honest but broad. In Horizon it is 17 % of all edges, from 28 sections. It is the last commit, so it is easy to drop if you prefer to keep it out.Not covered (impossible statically)
App blocks (
@app,shopify://apps/...),render some_var, and| ton a non-literal key.How was this tested?
Full suite: the same failures as an unmodified
v8checkout in the same environment, none new. Horizon was rebuilt withgraphify update --no-cluster, no API key set.AI disclosure
Written with Claude Code. I reviewed the code and ran the commands above myself.