You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: make ADR32 M2 evidence/receipt parity opt-in
The M2 fold commit (2763a1c) ran the legacy-vs-typed parity comparison on the
default production path: build_run_evidence_bundle_from_events assembled both the
folded and legacy bundles plus two to_dict() serializations every call, and
build_run_receipt rendered the receipt twice for a shadow gate. That doubled
evidence work on the hot path and let a mismatch silently revert the M6 typed
source-of-truth cutover.
Make parity diagnostics opt-in without weakening the guarantee:
- build_run_evidence_bundle_from_events(..., verify_parity=False) folds once by
default; parity/gap comparison only when verify_parity=True;
- build_run_receipt(..., shadow_parity=False) renders once by default; the
receipt_event_derived_mismatch shadow warning only when shadow_parity=True;
- ADR32-M2 parity tests now pass the flags explicitly so the guarantee still
holds where it belongs (tests, not runtime);
- add a regression guard asserting the default fold assembles once and
verify_parity adds exactly one more assembly.
Action: G-P2-8
Roadmap-Status: unchanged
Constraint: behavior-preserving refactor of ADR32-M2 fold; default evidence/receipt output unchanged; parity still proven in tests; no fixture retirement; no roadmap holds touched
Tested: ruff format/check; mypy teaagent/run_evidence.py teaagent/run_receipt.py teaagent/runner/ --explicit-package-bases; pytest across evidence/receipt/model-route/goal-record/skill-activation/event-stream/conversation-ux/five-minute-proof/adversarial/evidence-completeness (150 passed); scripts/validate_wiring.py; scripts/validate_docs_consistency.py (29/29 risk, 21/21 ticket); docs-inventory --check
Not-tested: full acceptance/nightly suite, live/paid providers
Confidence: high
Synthetic fixtures that construct receipt test data from hardcoded audit event dicts mask real-path gaps. Once the event stream can produce byte-equivalent evidence, those fixtures become liabilities — they test a path that no longer matches production. M2-T003 eliminates this gap.
12
12
13
13
**2026-07-22 execution note:** the safe local implementation added
0 commit comments