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]>
|
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 
6 possible issues to check · High impact
The change adds a Shopify-theme Liquid extractor for template, asset, and translation references.
6 possible issues we couldn't confirm
- Liquid theme files are counted as supported code even if no Liquid extractor is registered, which hides them from the unsupported-file warni ·
graphify/detect.py:48 - Liquid-file imports and references skip the cross-language guard, so bare names can bind to other-language nodes ·
graphify/build.py:2308 - Calls from inline
<script>blocks in Liquid theme files to theme JavaScript are dropped by the newliquidfamily mapping ·graphify/extract.py:4892 - +3 more in Graphify
They don't change the score.
What this review covered
- We didn't review 8 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.
- 8 of 8 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 7527 functions depend on this change
- 3 functions became more coupled.
extract()(1398 callers),build_from_json()(347 callers),extract_liquid()(10 callers). - Gate, test list and every flagged function: in the Graphify check.
Reviewed 45963e8 · 3 earlier findings not re-checked
… 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]>
…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! |
What does this PR do?
Adds a deterministic regex extractor for Shopify theme
.liquidfiles, sographify affected snippets/card.liquidfollowsrender,sectionandcontent_foredges, and a brokenrender 'missing'becomes visible. Closes #5552. Part 1 of 2; the theme JSON extractor follows in a stacked PR.Type of change
Implementation
graphify/extractors/liquid.py: a regex extractor in the style of the Blade and EJS ones. Deterministic, no LLM, no new dependency. Registered inLANGUAGE_EXTRACTORSand the.liquiddispatch.docs/how-it-works.mdis updated..liquidfile is read for references only when an ancestor (at most 3 levels up) holdslayout/theme.liquid. Jekyll and Eleventy also use.liquid; outside a theme only the file node is emitted.render,include,section,sections,content_for 'block'and block types in{% schema %}->importsedge to the target file, soaffectedfollows them.'x' | asset_urland'a.b' | t->referencesedge to the asset or the locale key.AMBIGUOUSedge (score 0.2) to a node withunresolved: trueandref_kind(snippet,section,block,asset,t). Dynamic names (render some_var), names containing/,\or.., and absolute asset names get no edge.font.eot?#iefix) resolves the part before?or#.Verification & Invariants
AMBIGUOUSedge to anunresolved: truenode, never a guessed target..liquidfiles are unaffected.Commands run on the PR head:
tests/test_liquid_extractor.pyuses a synthetic theme fixture (generic names only). One strictxfaildocuments the limit below.v8: the same 30 failures as an unmodifiedv8checkout in the same environment, none new (tests/test_serve_reload_off_loop.pyskipped:anyionot installed locally).graphify update, no API key set, in 5 to 8 seconds each. Two runs per theme gave identical nodes and edges.graphify affected snippets/icon.liquidlists the sections, blocks and snippets that render it.Limitations
xfail, documented in the module docstring).{% stylesheet %}/{% javascript %}, the{% block %}/{% partial %}preview tags, app blocks and section-local blocks are not read.content_for 'blocks'(the placeholder form) produces no edge.How was this tested?
Graphify-specific checklist
Co-Authored-By:trailer).uv run python -m tools.skillgen --checkpasses.AI disclosure
Written with Claude Code. I reviewed the code and ran the commands above myself.