[Roadmap 1/5] Grounding: promote per-rule patches to a declared policy surface

Author: he-yufengCreated Sep 28, 2026Updated Sep 28, 2026

Part of the maintainer roadmap (#1621), item 1.

Problem

agent/src/agent/grounding/ is the most-edited area in the tree, and policies.py grows one regex or role rule per incident (#1588 and #1584 are the same root repeating). Adding a check means editing shared control flow, and the interaction order between rules is getting hard to reason about.

Proposal

Promote the grounding checks to a declared policy surface:

  • One registry entry per check: name, severity (block / warn / log), the predicate, and a fixture pair (one passing answer, one failing answer).
  • The verifier walks the registry; run cards list which checks fired, so the Trust Layer state (#1613, landed in #1618) is inspectable rather than implicit.
  • Migrating the existing rules is mechanical; new incidents then land as one row plus fixtures instead of control-flow edits.

Scope notes

  • No behavior change intended: the registry reproduces the current rules' outcomes on the existing test corpus first (golden pass), then we migrate.
  • This touches the verifier contract that other modules call, so I want maintainer alignment on the registry shape before I start the migration. The issue is the place to sketch it.