100%

Section 03 — batch-analysis

Goal

Per-batch analysis: graph-answerable rules via /query-intel, graph hints (never gates) for the rest, LLM own-scan, inline-fix-then-handoff.

Implementation Sketch

Each batch runs ONE subagent over its categories. For graph-answerable rules, query the intel graph directly; for the rest, the graph supplies file/symbol HINTS and the LLM does its own scanning + identification. Every finding is fixed inline immediately after the batch’s checks; only then does the script hand off the next step. Graph-down degrades to LLM-only, never drops a rule.

Spec References

intelligence.md §Graph-First Mandate (graph-first, manual second); CLAUDE.md §Scope Expansion (fix everything found incl. unrelated); SSOT-25 inline-not-bug.

Work Items

  • Build the per-batch rule router: graph-answerable vs graph-hint vs llm-only, per rule
  • Compose the per-batch subagent prompt (categories + rules + graph hints) and the inline-fix-then-handoff contract
  • Graph-down degradation: every rule still gets LLM coverage; pytest the router + degradation

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “impl-hygiene-rewrite-v3/s-53b910d8” }, “generated_at”: “2026-06-23T03:25:19.448828+00:00”, “graph_state”: { “head_sha”: “ddf60faa”, “last_code_import_at”: “2026-06-23T03:25:08.871Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:impl-hygiene-rewrite-v3/s-53b910d8] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/impl-hygiene-rewrite-v3” } } }

(full dossier: batch-analysis—s-53b910d8.intel.json)

HISTORY

  • 2026-06-23 — sc-0008 re-scoped (criteria de-duplication): sc-0008 originally demanded the end-to-end “running a batch on a real diff surfaces+fixes findings” — the integrated /impl-hygiene-review run, which is the plan-wide functional criterion sc-0001 (gated at plan_terminus, demonstrated after the §06 skill-rewrite wires the rails+router). §03’s three work_items deliver the router + per-batch prompt composer + graph-down degradation (the machinery), not a runnable end-to-end batch. sc-0008 re-scoped to §03’s genuine per-section acceptance (router classifies every rule; compose_batch_prompt carries categories + tiered rules + inline-fix-then-handoff contract; graph-down all-LLM, zero dropped). The integrated-run acceptance is PRESERVED at plan-wide sc-0001 (not weakened — de-duplicated). Proven by test_rule_router.py (15 tests; 460/460 routed, graph-down all-LLM).