Commit graph

1 commit

Author SHA1 Message Date
Shay
9da61b96a0
feat(ADR-0167/W2-A): audit-to-evidence adapter (#352)
Wave 2, parallel with W2-B/C/D. Implements the type-A→type-B converter
from AuditRow to MathReaderRefusalEvidence per ADR-0167 W2-A brief.

Deliverables:
- teaching/math_contemplation.py:
  - audit_to_evidence(audit_rows): pure deterministic adapter, uses
    SUB_TYPE_FOR_OPERATOR for subtype assignment, skips rows where
    missing_operator is None, leaves claim_signature="" (W2-B will fill)
  - audit_problem_to_evidence(problem_text, case_id): convenience wrapper
    that runs the reader and adapts the output
- tests/test_math_contemplation_adapter.py: 8 tests covering
  determinism, input-order preservation, sub-type mapping
  exhaustiveness, distinct hashes across cases, empty input handling,
  None-operator skip, and round-trip from problem text

Invariants:
- Deterministic across reruns (verified by determinism rerun)
- No I/O in adapter path
- Input order preserved (no internal sort)
- claim_signature == "" for all W2-A records (W2-B coordination)

Validation:
- tests/test_math_contemplation_adapter.py: 8 passed
- tests/test_math_evidence_schema.py: 11 passed (W1-A regression)
- tests/test_brief_11b_audit_artifact.py + step2_lexicon + brief_11_audit:
  45 passed (regression)
- Determinism rerun: identical results
2026-05-27 06:44:46 -07:00