0002: One framework, pluggable domain graders¶
Status: accepted (v1.0.0).
Context¶
v1.0.0 adds financial crime, document integrity and KYC onboarding to payments authority. Each needs its own judgement (what a correct agent does), its own policy, and its own tools, but should keep everything the payments domain already guarantees: offline determinism, the simulated clock, Inspect epochs and statistics, signed and redactable bundles, the report, connector conformance and confidential content handling.
Options¶
- A separate harness per domain. Simple to start; duplicates the runner, the evidence format and every connector, and lets them drift.
- Domain logic inside the existing scorers. One code path, but the authority scorer would grow a branch per domain and the payments behaviour could change.
- A pluggable grader per domain behind one interface, with tool families bound per scenario.
Decision¶
Option 3. A DomainGrader has expected(scenario, env_state, history) and
judge(trace, expected). The payments implementation wraps the authority grader and its
scorer, unchanged. Scenarios gain optional domain, domain_policy and tools; the
environment offers exactly the scenario's tool families and builds the domain worlds that
serve them. Graders, worlds and domain reference agents are registered by import path, so
the core never imports a later domain. The Inspect authority scorer asks the scenario's
grader, so scorer names, logs and result shapes stay the same.
Consequences¶
- All pre-existing tests passed without modification when the framework landed; only tests that count the shipped packs changed when the packs were added.
- Every connector must bind the tuple of tools it is given, which they already did; the conformance kit now proves it with a fincrime and a KYC scenario.
- A domain's decision logic lives in pure functions shared by its grader and its safe reference agent; a change there changes both, which the pack tests catch.
- Cross-epoch judgements (KYC rating consistency) sit outside
judge, in the runner.