Skip to content

Blade (.blade.php) files not covered by code discovery gate / indexer #258

@gaia

Description

@gaia

Summary

The cbm-code-discovery-gate hook blocks Read/Grep on Blade templates (*.blade.php) and directs the agent to use search_graph, trace_call_path, get_code_snippet, etc. first — but the indexer/graph does not appear to cover Blade files, so those tools return nothing for Blade content. This leaves the agent stuck: the gate refuses text access, and the structured tools have no data to serve.

Environment

  • Project type: Laravel (PHP + Blade)
  • Files affected: resources/views/**/*.blade.php, resources/views/components/**/*.blade.php, resources/views/layouts/*.blade.php
  • Hook: ~/.claude/hooks/cbm-code-discovery-gate

Reproduction

  1. Open a Laravel project with Blade views.
  2. Ask the agent to modify an auth view (e.g. resources/views/auth/login.blade.php).
  3. Agent attempts Read on the Blade file.
  4. Hook blocks with: BLOCKED: For code discovery, use codebase-memory-mcp tools first: search_graph(name_pattern) ... If you need Grep, retry.
  5. Retrying Grep / Read yields the same block indefinitely.
  6. search_graph / get_code_snippet return no results for the Blade symbol (component, view, slot, directive).

Expected

Either:

  • The indexer should parse Blade files and expose their symbols (components <x-...>, @include/@extends targets, $slot/prop definitions, section names, route references) via the graph, or
  • The discovery gate should exempt file extensions the indexer does not cover (at minimum *.blade.php, and likely other template/config/markup files) so plain Read/Grep are allowed as a fallback.

Impact

Currently the agent has to route edits through Bash (sed, python3, cat) to bypass the gate, which is slower, riskier (no diff preview), and defeats the purpose of the Edit tool's read-before-write safety check.

Suggested fix

Short-term: add *.blade.php (and probably *.twig, *.vue, *.svelte, *.astro, *.erb, *.hbs) to the gate's ignore list so text tools work for unsupported file types.

Long-term: add a Blade parser to the indexer that extracts:

  • Component usage and definitions
  • @extends / @include / @yield / @section relationships
  • Route name references (route('...'))
  • Prop and slot declarations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions