[AZ-240] [AZ-241] [AZ-242] Add native retrieval remediation

Implement the product remediation paths required before greenfield
code testability revision: native VIO backend selection, local
VPR descriptor index retrieval, and computed anchor matching gates.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-05 06:05:10 +03:00
parent 44c19ed117
commit 70f786f2d1
26 changed files with 869 additions and 114 deletions
@@ -0,0 +1,37 @@
# Batch Report
**Batch**: 10
**Tasks**: AZ-240_native_vio_backend_integration, AZ-241_real_satellite_vpr_descriptor_retrieval, AZ-242_real_anchor_feature_matching_ransac
**Date**: 2026-05-05
## Task Results
| Task | Status | Files Modified | Tests | AC Coverage | Issues |
|------|--------|---------------|-------|-------------|--------|
| AZ-240_native_vio_backend_integration | Done | 6 files | 58 passed | 3/3 ACs covered | None |
| AZ-241_real_satellite_vpr_descriptor_retrieval | Done | 6 files | 58 passed | 3/3 ACs covered | None |
| AZ-242_real_anchor_feature_matching_ransac | Done | 6 files | 58 passed | 3/3 ACs covered | None |
## AC Test Coverage: All covered
- AZ-240 AC-1: `test_configured_native_backend_path_emits_vio_state`
- AZ-240 AC-2: `test_native_backend_initialization_failure_sets_failed_health`, `test_native_backend_runtime_failure_sets_failed_health`
- AZ-240 AC-3: `test_timestamp_mismatch_is_explicit_validation_error`, `test_tracking_loss_degrades_health_without_emitting_absolute_position`
- AZ-241 AC-1: `test_valid_local_index_load_reports_ready_status`, `test_local_descriptor_index_package_loads_from_cache_file`
- AZ-241 AC-2: `test_loaded_index_returns_bounded_candidates_with_freshness`
- AZ-241 AC-3: `test_missing_index_degrades_with_explicit_no_candidate_result`, `test_invalid_index_package_degrades_with_explicit_error`
- AZ-242 AC-1: `test_matching_path_computes_evidence_from_frame_and_tile_inputs`
- AZ-242 AC-2: `test_unsafe_candidate_is_rejected_with_reason`, `test_computed_matching_rejects_low_inlier_geometry`
- AZ-242 AC-3: `test_matcher_benchmark_can_run_computed_paths`
## Code Review Verdict: PASS
## Auto-Fix Attempts: 0
## Stuck Agents: None
## Verification
- `python3 -m pytest tests/unit/test_vio_adapter.py tests/unit/test_satellite_service_vpr.py tests/unit/test_anchor_verification.py`: 19 passed.
- `python3 -m pytest`: 58 passed.
- Formatter/linter CLIs declared in `pyproject.toml` were unavailable in this interpreter: `black` and `ruff` modules were not installed.
## Next Batch: All product tasks complete
@@ -0,0 +1,42 @@
# Product Implementation Completeness Report
**Cycle**: 1
**Date**: 2026-05-05
**Outcome**: Product implementation complete
## Summary
All product implementation tasks for cycle 1 are implemented or have explicit runtime prerequisite boundaries. The remediation tasks close the previously identified gaps in native VIO selection, local descriptor/index VPR retrieval, and computed anchor matching/geometry verification.
## Product Task Classifications
| Task | Classification | Evidence |
|------|----------------|----------|
| AZ-219 through AZ-232 | PASS | Prior batch reports 01-09 and cumulative review 01-09 |
| AZ-240 | PASS | `src/vio_adapter/interfaces.py`, `src/vio_adapter/native/__init__.py`, `tests/unit/test_vio_adapter.py` |
| AZ-241 | PASS | `src/satellite_service/interfaces.py`, `src/satellite_service/types.py`, `src/satellite_service/native/__init__.py`, `tests/unit/test_satellite_service_vpr.py` |
| AZ-242 | PASS | `src/anchor_verification/interfaces.py`, `src/anchor_verification/types.py`, `src/anchor_verification/native/__init__.py`, `tests/unit/test_anchor_verification.py` |
## Remediation Evidence
- VIO now exposes `NativeVioBackend` behind the `VioBackend` protocol, fills latency metrics, maps initialization/runtime failures into explicit health/error envelopes, and keeps WGS84 authority out of the adapter.
- Satellite retrieval now loads local descriptor/index packages from cache files, builds a CPU FAISS-compatible descriptor index, requires query descriptors for retrieval, and degrades safely for missing or invalid index data.
- Anchor verification now computes matcher evidence from frame/tile keypoints through `KeypointRansacMatcher`, reports runtime/quality metrics, and routes computed evidence through the existing freshness, provenance, inlier, MRE, and homography gates.
## Marker Scan
Checked changed component source for unresolved implementation markers:
- `src/vio_adapter`: clean
- `src/satellite_service`: clean
- `src/anchor_verification`: clean
## Verification
- `python3 -m pytest tests/unit/test_vio_adapter.py tests/unit/test_satellite_service_vpr.py tests/unit/test_anchor_verification.py`: 19 passed.
- `python3 -m pytest`: 58 passed.
- `black` and `ruff` modules were not installed in the current interpreter, so formatter/linter CLI checks could not run.
## Required Follow-Up
No product remediation tasks remain. Autodev may advance to Step 8, Code Testability Revision.
@@ -2,18 +2,18 @@
**Feature**: Product runtime
**Cycle**: 1
**Date**: 2026-05-04
**Status**: Superseded — remediation pending
**Date**: 2026-05-05
**Status**: Complete
## Summary
Greenfield product implementation completed the initial GPS-denied onboard runtime scaffold and component behavior tasks. Later product verification identified required remediation work before the flow can advance to testability revision.
Greenfield product implementation completed the GPS-denied onboard runtime and the required remediation work for native VIO selection, local descriptor/index VPR retrieval, and computed anchor matching/geometry verification.
- Total tasks completed: 14
- Completed batches: 9
- Total tasks completed: 17
- Completed batches: 10
- Blocked tasks: 0
- Code review verdicts: PASS for all batch reviews and cumulative review
- Final test run: 49 passed
- Final test run: 58 passed
## Completed Tasks
@@ -33,6 +33,9 @@ Greenfield product implementation completed the initial GPS-denied onboard runti
| AZ-230 | satellite_service_vpr_retrieval | 7 | Done |
| AZ-231 | anchor_verification_matching | 8 | Done |
| AZ-232 | safety_anchor_state_machine | 9 | Done |
| AZ-240 | native_vio_backend_integration | 10 | Done |
| AZ-241 | real_satellite_vpr_descriptor_retrieval | 10 | Done |
| AZ-242 | real_anchor_feature_matching_ransac | 10 | Done |
## Batch Outcomes
@@ -47,6 +50,7 @@ Greenfield product implementation completed the initial GPS-denied onboard runti
| 7 | AZ-230_satellite_service_vpr_retrieval | PASS | 42 passed |
| 8 | AZ-231_anchor_verification_matching | PASS | 45 passed |
| 9 | AZ-232_safety_anchor_state_machine | PASS | 49 passed |
| 10 | AZ-240_native_vio_backend_integration, AZ-241_real_satellite_vpr_descriptor_retrieval, AZ-242_real_anchor_feature_matching_ransac | PASS | 58 passed |
## Acceptance Coverage
@@ -54,21 +58,21 @@ All acceptance criteria documented in the product implementation task specs are
- Shared contracts, configuration, errors, telemetry, geometry, and time-sync behavior are validated by shared unit tests.
- Component runtime boundaries for camera ingest, MAVLink/GCS, tile management, FDR, VIO, Satellite Service, anchor verification, and safety/anchor state management are validated by component unit tests.
- Native VIO backend selection, local descriptor/index package loading and retrieval, and computed matcher/RANSAC evidence paths are validated by remediation unit tests.
- Safety-critical behavior for explicit errors, no raw-frame retention, no mid-flight Satellite Service calls, conservative generated-tile writes, rejected unsafe anchors, monotonic blackout degradation, and honest covariance is covered by the current unit suite.
## Review Summary
- Batch reviews: `_docs/03_implementation/reviews/batch_01_review.md` through `_docs/03_implementation/reviews/batch_09_review.md`
- Batch reviews: `_docs/03_implementation/reviews/batch_01_review.md` through `_docs/03_implementation/reviews/batch_10_review.md`
- Cumulative review: `_docs/03_implementation/reviews/cumulative_review_batches_01-09_cycle1_report.md`
- Auto-fix attempts: 0 across all batches
- Stuck agents: none
## Final 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: 49 tests.
- `python3 -m pytest` passed: 58 tests.
- `python3 -m black ...` and `python3 -m ruff ...` could not run because those optional dev tool modules are not installed in the current interpreter.
## Next Step
Autodev should remain at Step 7, Implement, until remediation tasks AZ-240 through AZ-242 are implemented and the Product Implementation Completeness Gate produces `_docs/03_implementation/implementation_completeness_cycle1_report.md` without unresolved `FAIL` classifications.
Autodev may advance to Step 8, Code Testability Revision. Product implementation completeness is recorded in `_docs/03_implementation/implementation_completeness_cycle1_report.md`.
@@ -0,0 +1,31 @@
# Code Review Report
**Batch**: AZ-240_native_vio_backend_integration, AZ-241_real_satellite_vpr_descriptor_retrieval, AZ-242_real_anchor_feature_matching_ransac
**Date**: 2026-05-05
**Verdict**: PASS
## Findings
| # | Severity | Category | File:Line | Title |
|---|----------|----------|-----------|-------|
| - | - | - | - | No findings |
## Review Notes
- AZ-240: `NativeVioBackend` keeps engine-specific setup behind the `VioBackend` protocol, maps initialization/runtime errors to explicit `VioHealthReport` failures, and preserves timestamp mismatch, tracking-quality degradation, and no-WGS84-authority behavior.
- AZ-241: `LocalVprRetriever` now loads local descriptor/index packages from cache files, builds a CPU FAISS-compatible descriptor index, reports readiness with loaded record counts, and returns degraded/no-candidate results for missing or invalid packages without network access.
- AZ-242: `GeometryGatedAnchorVerifier` now has a computed matcher path from frame/tile keypoints through `KeypointRansacMatcher`, while the existing safety gates still reject stale provenance, low inliers, high MRE, and geometry failures.
## AC Coverage
| Task | AC Coverage |
|------|-------------|
| AZ-240 | 3/3 covered by `tests/unit/test_vio_adapter.py` |
| AZ-241 | 3/3 covered by `tests/unit/test_satellite_service_vpr.py` |
| AZ-242 | 3/3 covered by `tests/unit/test_anchor_verification.py` |
## Verification
- `python3 -m pytest tests/unit/test_vio_adapter.py tests/unit/test_satellite_service_vpr.py tests/unit/test_anchor_verification.py` passed: 19 tests.
- `python3 -m pytest` passed: 58 tests.
- `python3 -m black ...` and `python3 -m ruff ...` could not run because those optional dev tools are not installed in the current interpreter.