100%

Per-cell prompt: anchor file + one batch, cross-file reading encouraged

Goal

Deliver the cell-prompt piece of the file x rule-batch matrix walk for /impl-hygiene-review.

Implementation Sketch

Per the matrix-walk topology: the runtime (scripts/impl_hygiene_review_runtime/) owns the loop; the LLM gets ONE (anchor_file, rule_batch) cell per dispatch. The anchor file is the finding subject; the cell agent reads cross-file context freely (encouraged). Rule content renders from the JSON SSOT generator; per-cell findings flow through the shared finding_emit._classify_finding drop-unless-verified gate into both emission sinks (plan/bug §NN.R.H + raw-context report).

Spec References

  • .claude/rules/workflow-ownership.md §1 — the script owns the loop; one bounded cell per LLM dispatch.
  • .claude/rules/script-first.md §1 — orchestration lives in scripts/<skill>_runtime/.
  • scripts/impl_hygiene_rules_runtime/ — the JSON SSOT generator + category_tokens() (rule content for each batch).
  • Predecessor: plans/completed/impl-hygiene-rules-as-data (JSON SSOT + 5-batch decomposition + raw-context report sink).

Work Items

  • Compose the per-cell batch prompt scoped to ONE anchor file + ONE batch’s rule_categories (from the JSON SSOT generator)
  • Anchor-not-sandbox: the prompt names the anchor file as finding subject but EXPLICITLY encourages cross-file reads (callers, callees, similar code, the SSOT, the boundary’s other side, the intel graph)
  • Fix the ‘against the listed files ONLY’ wording that wrongly sandboxes the cell agent
  • Attribute findings to the anchor file and name any cross-file counterpart

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “impl-hygiene-review-matrix-walk/s-13ed21b5” }, “generated_at”: “2026-06-21T14:54:54.679168+00:00”, “graph_state”: { “head_sha”: “45796766”, “last_code_import_at”: “2026-06-21T14:53:58.303Z”, “embedding_stale”: true, “insights_stale”: true, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:impl-hygiene-review-matrix-walk/s-13ed21b5] 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-review-matrix-walk” } } }

(full dossier: cell-prompt—s-13ed21b5.intel.json)