[AZ-231] Add anchor verification gates

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-03 19:02:13 +03:00
parent 07fb9535a9
commit 7819ae7a38
8 changed files with 336 additions and 6 deletions
@@ -0,0 +1,35 @@
# Batch Report
**Batch**: 8
**Tasks**: AZ-231_anchor_verification_matching
**Date**: 2026-05-03
## Task Results
| Task | Status | Files Modified | Tests | AC Coverage | Issues |
|------|--------|----------------|-------|-------------|--------|
| AZ-231_anchor_verification_matching | Done | 4 files | Pass | 3/3 ACs covered | None |
## AC Test Coverage: All covered
| AC Ref | Coverage |
|--------|----------|
| AZ-231 AC-1 | `test_candidate_verification_emits_acceptance_evidence` verifies accepted decisions include MRE, inliers, homography, and reason metadata. |
| AZ-231 AC-2 | `test_unsafe_candidate_is_rejected_with_reason` verifies unsafe/stale candidates are rejected without estimated pose. |
| AZ-231 AC-3 | `test_matcher_benchmark_reports_profile_runtime_and_quality_metrics` verifies matcher profile runtime and quality metrics are reportable. |
## Code Review Verdict: PASS
Review report: `_docs/03_implementation/reviews/batch_08_review.md`
## Auto-Fix Attempts: 0
## Stuck Agents: None
## 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: 45 tests.
## Next Batch: AZ-232_safety_anchor_state_machine
@@ -0,0 +1,53 @@
# Code Review Report
**Batch**: AZ-231_anchor_verification_matching
**Date**: 2026-05-03
**Verdict**: PASS
## Findings
No findings.
## Review Scope
- Task spec:
- `_docs/02_tasks/todo/AZ-231_anchor_verification_matching.md`
- Changed files:
- `src/anchor_verification/__init__.py`
- `src/anchor_verification/interfaces.py`
- `src/anchor_verification/types.py`
- `tests/unit/test_anchor_verification.py`
## Phase Notes
### Spec Compliance
- AZ-231 AC-1 is covered by `test_candidate_verification_emits_acceptance_evidence`.
- AZ-231 AC-2 is covered by `test_unsafe_candidate_is_rejected_with_reason`.
- AZ-231 AC-3 is covered by `test_matcher_benchmark_reports_profile_runtime_and_quality_metrics`.
### Code Quality
The implementation keeps evidence/result models in `types.py`, gate behavior in `interfaces.py`, and public exports in `__init__.py`. The benchmark path computes each verification result once and reports runtime/quality metrics per matcher profile.
### Security Quick-Scan
No network calls, shell execution, dynamic code execution, hardcoded secrets, or credential logging were introduced.
### Performance Scan
Anchor verification is request/trigger oriented and does not add a per-frame learned matcher loop. Benchmark reporting is bounded by the provided evidence tuple.
### Cross-Task Consistency
The verifier consumes `VprCandidate` outputs from Satellite Service and emits shared `AnchorDecision` DTOs for the later safety wrapper task.
### Architecture Compliance
Imports respect `_docs/02_document/module-layout.md`: Anchor Verification imports shared contracts only and does not reach into Satellite Service or Tile Manager internals.
## Verification
- `.venv/bin/python -m black --check src tests e2e/replay`
- `.venv/bin/python -m ruff check src tests e2e/replay`
- `.venv/bin/python -m pytest`