graphify icon indicating copy to clipboard operation
graphify copied to clipboard

Add an AST-only mode (--semantic=off): with no Gemini key and no subagents, the parent agent must read every doc inline

Open cdtatarevich opened this issue 3 months ago • 0 comments

Problem

Semantic extraction (Step 3 Part B) has exactly two supported paths: a Gemini key, or the host agent dispatching subagents. When neither is available the skill's own guidance is to have the parent agent read every doc/paper/image inline — which is the slowest and most expensive option, and it scales with corpus size rather than with what the user actually wants.

I hit this on a 116-file repo (74 code / 32 docs / 10 images) with no GEMINI_API_KEY and a host policy that does not permit spawning subagents unless the user explicitly asks. 42 files had to be read inline by the parent agent before Part C could run. The AST pass had already finished in seconds and produced 1191 of the final 1272 nodes — 94% of the graph — from deterministic parsing alone.

Request

A first-class way to say "build the code graph, skip the LLM layer":

graphify update <path> --semantic=off      # or: --no-semantic / --ast-only

Behavior: run Part A, write an empty .graphify_semantic.json (the fast path already documented for code-only corpora), and continue to Part C/4/5 unchanged. Docs, papers and images would still appear as file-level nodes from detection, just without extracted concepts or cross-document edges.

Optionally a middle tier, --semantic=titles, that creates one node per non-code file from its filename/frontmatter/first heading with no model call — cheap, and enough to keep docs visible in the graph and clusterable.

Why it is worth a flag rather than "just don't have docs"

  • The subagent path is unavailable or restricted on several hosts, not just mine (see #2786 for a Codex host that cannot expose usage, #2693 / #2692 for claude-cli path issues).
  • It makes cost predictable: right now the only way to know what a run will spend is to start it and watch.
  • It gives an obvious first step for a large unfamiliar repo — build the structural graph immediately, decide afterwards whether the prose is worth extracting.
  • The pipeline already supports the exact code path (the code-only fast path); this only exposes it as a user choice rather than an automatic consequence of having no docs in the corpus.

Related: #2781 (semantic pass ships document text to LLM backends with no secret redaction) — a documented AST-only mode is also the honest answer for anyone who cannot send document text off-machine at all.

cdtatarevich avatar Aug 16 '26 17:08 cdtatarevich