[AZ-220] Add shared runtime contract models

Implement the shared DTO contract surface with validation so runtime components consume one public model set instead of duplicating shapes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-03 13:22:50 +03:00
parent 72a9df6b57
commit 5156453224
8 changed files with 361 additions and 3 deletions
@@ -0,0 +1,24 @@
# Code Review Report
**Batch**: AZ-220_shared_runtime_contracts
**Date**: 2026-05-03
**Verdict**: PASS
## Findings
| # | Severity | Category | File:Line | Title |
|---|----------|----------|-----------|-------|
| - | - | - | - | No findings |
## Review Notes
- AC-1 is satisfied by the public exports in `src/shared/contracts/__init__.py` and the DTO models in `src/shared/contracts/models.py`.
- AC-2 is satisfied by Pydantic validation for missing required fields, raw frame retention, optimistic covariance reporting, and inconsistent anchor decisions.
- The implementation stays inside `shared/contracts` ownership and does not introduce component-specific algorithms.
- Raw frame payloads remain references only; the model rejects retained raw-frame payload flags.
## Verification
- `.venv/bin/python -m black --check src tests e2e/replay` passed.
- `.venv/bin/python -m ruff check src tests e2e/replay` passed.
- `.venv/bin/python -m pytest` passed: 11 tests.