[AZ-662] [AZ-669] Archive batch 19; defer test gate

Batch 19 (movement_detector ego-motion + semantic_analyzer primitive
graph) is committed at db844db. This archival commit:

- Writes _docs/03_implementation/batch_19_cycle1_report.md with a
  lightweight inline code review (PASS_WITH_WARNINGS; 5 low/medium
  findings — see F1-F5 in the report).
- Transitions AZ-662 and AZ-669 In Progress -> In Testing in Jira
  (transition id 32 -> status id 10036) per implement/SKILL.md Step 12.
- Logs _docs/_process_leftovers/2026-05-20_batch19_opencv_test_gate.md
  explaining why `cargo test --workspace` could not be run this session
  (macOS dev box has no native OpenCV; brew install failed with ENOSPC;
  Jetson host is the CI infra box, not a dev sandbox). Replay options
  documented in the leftover.
- Updates _docs/_autodev_state.md sub_step to between-batches-blocked:
  batch 20 selection MUST NOT auto-chain until the test gate is closed.

Cargo.lock picks up the `bytes` dev-dep entries for movement_detector
and semantic_analyzer (mechanical lockfile sync; no version bumps).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-20 21:27:52 +03:00
parent db844db232
commit 202b2cb192
4 changed files with 185 additions and 8 deletions
@@ -0,0 +1,49 @@
# Leftover — Batch 19 OpenCV test gate
- **Timestamp**: 2026-05-20T20:35:00+03:00
- **Source**: autodev batch-19 close-out session
- **Origin**: commit `db844db [AZ-662] [AZ-669] Implement ego-motion estimator and primitive graph`
- **Blocked operation**: `cargo test --workspace` (specifically the `movement_detector` and `semantic_analyzer` crates that newly depend on the `opencv = "0.98"` workspace dep)
## Why it is blocked
The crate uses the Rust `opencv` 0.98 binding, which pulls in the native OpenCV 4 system library at link time.
1. **macOS dev box**: no `libopencv*` installed. `brew install opencv pkg-config` failed with `ENOSPC` — data-partition free space ≤ 1.1 GiB; opencv + transitive deps (proj, ffmpeg, qt, vtk, openblas, ceres-solver, ...) need ~3-5 GiB.
2. **Jetson (`jetson-e2e`)**: state file recorded `ssh jetson-e2e && cargo test --workspace` as the authoritative test path, but the host is configured as the CI infra box (Gitea + Woodpecker via `~/ci/docker-compose.ci.yml`). It has neither the autopilot source checkout nor `cargo` at any standard path. The recorded plan is not directly executable.
3. **Dockerfile**: `apt-get install -y --no-install-recommends ca-certificates libssl3` in the `runtime` stage only — the `rust:1.82-bookworm` builder image does NOT install `libopencv-dev`. A vanilla `docker build` will also fail.
## Test design (already in source, not yet executed)
| Crate | Test | Maps to AC |
|-------|------|------------|
| `movement_detector` | `internal::ego_motion::tests::ac1_pure_pan_residual_near_zero` | AZ-662 AC-1 |
| `movement_detector` | `internal::ego_motion::tests::ac2_skew_above_zoom_out_tolerance_dropped` | AZ-662 AC-2 |
| `movement_detector` | `internal::ego_motion::tests::ac3_degenerate_white_frame` | AZ-662 AC-3 |
| `movement_detector` | `internal::zoom_bands::tests::*` (3 tests) | tolerance-table coverage |
| `movement_detector` | `internal::telemetry_sync::tests::*` (3 tests) | skew-gate edge cases |
| `semantic_analyzer` | `internal::primitive_graph::builder::tests::ac1_node_counts_per_class` | AZ-669 AC-1 |
| `semantic_analyzer` | `internal::scoring::freshness::tests::ac2_freshness_score_bounded` | AZ-669 AC-2 |
| `semantic_analyzer` | `internal::primitive_graph::builder::tests::ac3_disconnected_path_graph_flagged` | AZ-669 AC-3 |
## Replay options (any one closes the gate)
1. **macOS local — preferred**: free ≥ 5 GiB on the data partition (`df -h /System/Volumes/Data`), then `brew install opencv pkg-config && cargo test --workspace`. This matches the pattern used for `ffmpeg-next` in batches 17/18.
2. **Jetson via CI**: push the `dev` branch to Gitea, configure the Woodpecker pipeline to run `cargo test --workspace` inside a `rust:1.82-bookworm` container with `apt-get install -y libopencv-dev clang libclang-dev` in a prep step.
3. **Docker local**: extend the workspace `Dockerfile` (build stage) with `apt-get install -y libopencv-dev clang libclang-dev pkg-config` BEFORE the `cargo build` line, then `docker build -t autopilot-test --target build .` and `docker run --rm autopilot-test cargo test --workspace`.
4. **Jetson as dev box**: clone the repo to `~/autopilot` on `jetson-e2e`, install rustup + cargo, install `libopencv-dev`, then run tests there. (Most setup effort; only worth it if Jetson will keep being used as the dev sandbox.)
## Acceptance for closing this leftover
- All tests listed above run successfully.
- The full `cargo test --workspace` produces the same pre-existing flake summary as the batches-16-18 cumulative review (`mission_executor` `ac3_bounded_retry_then_success` / `ac1_multirotor_happy_path_reaches_done` may flake — tracked in `2026-05-20_mission_executor_ac3_flake.md`; not blocking).
- Append the run output to `batch_19_cycle1_report.md` under a "Test Run — DONE" section and remove the "Test Gate — DEFERRED" caveat.
- Delete this leftover file.
## Why no Jira write deferral
AZ-662 + AZ-669 have already been transitioned to `In Testing` per implement-skill Step 12 semantics ("dev work done, tests should now run"). The test gate itself is not a Jira write — it is a CI / local-build action. No tracker replay required when this leftover closes.
## Why this blocks batch 20
Batch 20 candidates (`AZ-663`, `AZ-664`, `AZ-670`, `AZ-671`, ...) depend on `movement_detector::ego_motion` and `semantic_analyzer::primitive_graph` per `_docs/02_tasks/_dependencies_table.md`. Building batch 20 on unverified `db844db` risks compounding bugs across two cycles before any test ever runs.