Skip to content

fix(blade): link a view to the layout it @extends - #3907

Closed
rajatnagda45 wants to merge 1 commit into
Graphify-Labs:v8from
rajatnagda45:fix/blade-extends
Closed

rajatnagda45 wants to merge 1 commit into
Graphify-Labs:v8from
rajatnagda45:fix/blade-extends

Conversation

@rajatnagda45

Copy link
Copy Markdown
Contributor

What does this PR do?

The Blade extractor recognised @include, <livewire:> components, and wire:click bindings — but not @extends. Template inheritance is the primary structural relationship in a Blade view: most page templates render inside a layout via @extends('layouts.app'). Without it, every child view was left with no edge to the layout it lives in, so the most important "who renders inside what" relationship in a Blade app was missing from the graph.

@extends('layouts.app')
@section('content')
    @include('partials.nav')
@endsection

Before: only partials.nav (via @include). After: an extends edge to layouts.app as well.

Type of change

  • Bug fix

Verification & Invariants

Invariant protected: extraction completeness — a real, source-backed structural directive must not be silently dropped. The change mirrors the existing @include handling exactly (dotted view name → path, deduped node, EXTRACTED confidence), so it introduces no new resolution heuristic and no ambient/nondeterministic state. This also adds the first test coverage for the Blade extractor.

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test (fails before the fix, passes after).
  • Kept the PR description synchronized with the final implementation.
  • Documented limitations: only string-literal @extends('...') is linked (dynamic @extends($var) is unresolvable and intentionally skipped, matching @include).

How was this tested?

python -m pytest tests/test_blade_extractor.py -q         # 1 passed (fails on pre-fix tree)
python -m pytest tests/ -q \
  --deselect tests/test_security.py \
  --deselect "tests/test_install_references.py::test_built_wheel_ships_the_full_skill_payload"
# 6037 passed, 15 skipped
ruff check graphify/extractors/blade.py tests/test_blade_extractor.py   # clean
pyright graphify/extractors/blade.py                                    # 0 errors

Graphify-specific checklist

  • No generated skill artifacts touched.
  • Confirmed extraction remains deterministic (pure regex over file text, no ambient state).
  • Reviewed for security implications (no shell/Python interpolation of template text).
  • No API keys or local graph data included.

The Blade extractor recognised @include, <livewire:> components, and
wire:click bindings, but not @extends. Template inheritance is the primary
structural relationship in a Blade view — most page templates render inside
a layout via @extends('layouts.app') — so the child was left with no edge
to its parent layout in the graph.

Emit an 'extends' edge from the view to the named layout, mirroring the
existing @include handling (dotted view name -> path). Adds the first test
coverage for the Blade extractor.
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @rajatnagda45. 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.10 and 3.13, and that the change keeps extraction deterministic.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

Adds @extends recognition to extract_blade, emitting an extends edge from a Blade view to its parent layout (creating the layout node if absent) so page templates are no longer left disconnected from the layout they inherit. Existing @include, livewire, and wire:click extraction is unchanged. Adds test_blade_extends_links_view_to_its_layout covering the new edge alongside preserved @include behaviour.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 8 functions depend on the 8 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 8 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 8 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

305 of 305 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_blade_extractor.py — impact, changed-test, full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cobol_extractor.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • tests/test_cross_extension_reexport_self_cycle.py — full-run-safety
  • tests/test_cross_language_call_resolution.py — full-run-safety
  • tests/test_cross_repo_external_call_guards.py — full-run-safety
  • … and 255 more

changed code file(s) with no mapped test (graphify/extractors/blade.py) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

safishamsi added a commit that referenced this pull request Sep 29, 2026
…ction

HTML node-info field fix (#3918), Kotlin annotated-inferred-property
crash (#3915/#3899), SQL DDL-before-DO (#3900), Razor @functions (#3908),
Blade @extends (#3907), and imported-module resolution (#3898).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.72 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @rajatnagda45! Blade views link to the layout they @extends.

Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.72

@safishamsi safishamsi closed this Sep 29, 2026
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.

2 participants