# evidence-v2 contract (authored fictional fixtures)

APIs: `contract_cases.load_cases() -> list[dict]`, `case_by_id(id) -> dict`, `model_context(case) -> dict`; `evidence_contract.CONTRACT_VERSION = 'evidence-v2'`, `SCHEMA` (strict JSON schema), `grade(case, answer) -> dict`. `INSTRUCTIONS` is the exact recommended decision-stage prompt and should be used unchanged by the runner. No provider calls occur in these modules.

`model_context` returns only a reviewed case's `context`, with `request`, `scope`, `required_atomic_fields`, `evidence`, `registered_rules`. It excludes `id`, `expected`, family, and source metadata. The two cases retain v1 ordinary_complete / LAB-001 / standard and gift_exception / LAB-005 / gift business facts. Tenant is `merchant-lab`, actor is `customer-lab`; policy is `returns-v3`. All evidence is explicitly scoped to tenant, actor, order_id and policy_version and has authority `trusted`, current `yes`, source_version `returns-v3`.

Output has exactly six required members: `contract_version`, `decision`, `answer`, `citations`, `atomic_claims`, `derived_claims`. Atoms have exactly `id,field,value,evidence_ids`; fields are order_id, order_kind, owner_match, tenant_match, proof_status, policy_version, policy_current. Eligibility is excluded. Derived entries have exactly `id,field,value,rule_id,rule_version,premise_ids,evidence_ids`; field is only eligibility. All values and IDs are strings, with no coercion; proof IDs are nonempty and globally unique. One assignment per field, all seven atoms, and exactly one eligibility derivation are required.

Registered rules in `rules.json` have `id`, `version`, `scope` (tenant/policy_version), `authority`, `current`, `evidence_id`, `premises` (exact field/value pairs), and `conclusion` (field/value). Rules are `standard-return` and `gift-review`, version `1`. Each requires owner_match=yes, tenant_match=yes, relevant order_kind, proof_status=complete, policy_version=returns-v3, policy_current=yes. Conclusions are eligible and manual_review respectively. Both rules are legitimate model input in both cases; they are not expected-answer labels. A separate scoped `policy-rules` record contains the registered rule records and must be cited by the derivation. Every atom evidence ID must directly assert the exact field/value. All evidence referenced by proof must be included in citations, and citations must equal proof-referenced records.

Derivation premise IDs must refer to already valid atomic claims, cover exactly every registered premise once, and include no unrelated atoms or derived IDs. Unknown/self/derived references fail; no recursion is supported. The rule ID/version, scope, freshness, exact policy evidence and conclusion must validate. Final decision must equal the proved eligibility value and the fixture label. Other v1 decision values remain schema-valid but cannot pass these two cases. Neither passing proof nor eligibility authorizes merchant writes.

Grade result: `contract_version`, `hard_pass`, `schema_pass`, `decision_label_match`, `decision_pass`, `evidence_pass`, `atomic_pass`, `derivation_pass`, `claims_pass`, `manual_review_state: pending_human`, `scoreable`, `issues`. `decision_label_match` independently reports whether the raw final decision matches the expected business label, even when its proof fails. `decision_pass` additionally requires a valid derivation and decision-to-proof binding. `claims_pass` is atomic_pass AND derivation_pass. `hard_pass` requires every gate. Prose semantics always remain pending human review. Results are deterministic JSON values.

This is a changed schema/context and an authored repair, not a controlled prompt comparison or a retroactive regrade. The immutable `examples/v1-recorded-trace.jsonl` retains raw attempt 8; the unchanged v1 checker still rejects its unsupported eligibility atom. `examples.py` renders teaching reports with zero paid calls. Full authored repair JSON and deliberate broken variants are saved under examples/. Keep the checker and fixtures unchanged while repairing learner output. Fresh actual v2 output belongs to the separate validation evidence, never the authored example.
