[AZ-1074] [AZ-1075] gRPC tile stream tests and shared proto
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

Extract tile_provision.proto into GrpcContracts, add integration
tests and validation hardening for DeliverRouteTiles streaming.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-06-25 10:04:41 +03:00
parent 275ee1b554
commit 7633134a8a
20 changed files with 725 additions and 26 deletions
+10
View File
@@ -236,6 +236,15 @@ Parent-suite team may reorder steps 25 based on consumer priorities; step 1 (
Originally tracked as a separate cycle 8b because AZ-812 is a wire-format rename (mirror of AZ-794) rather than a validator add (mirror of AZ-796). After the /autodev Step 10 ordering decision above, cycle 8b folds into cycle 8 as step 1 of the execution order. Section retained for traceability — the cycle-8b table entry remains the authoritative spec marker for AZ-812.
### Step 9 cycle 9 (gRPC TileStream — AZ-1074 / AZ-1075)
| Task | Depends On | Points | Status |
|------|-----------|--------|--------|
| AZ-1074 gRPC TileStream Service | — | 5 | Todo |
| AZ-1075 gRPC TileStream Integration Tests | AZ-1074 | 3 | Todo |
Execution order: AZ-1074 first (service + proto + unit/happy-path integration), then AZ-1075 (full blackbox suite). Origin: gps-denied-onboard consumer needs progressive tile delivery (blocks AZ-1076).
## Total Effort
Step 6: 6 tasks, 17 story points
@@ -250,6 +259,7 @@ Step 9 cycle 6: 1 task scheduled (AZ-505 = 3 pts) — consumed from cycle-5 defe
Step 9 cycle 7: 3 tasks adopted (AZ-794 = 3 pts rename, AZ-795 = epic with 58 pts shared-infra ship, AZ-796 = 3 pts first per-endpoint child) — total ~1114 pts (over the 25 pts/cycle preference; AZ-795's shared-infra ship is the heavy item). Origin: gps-denied-onboard AZ-777 Phase 1 Jetson probe (2026-05-22). Sibling per-endpoint child tasks under AZ-795 to be added in future cycles as the parent-suite team enumerates the endpoint surface.
Step 9 cycle 8: 5 tasks queued (AZ-812 = 3 pts Region DTO rename, AZ-808 = 3 pts region validator, AZ-809 = 5 pts route, AZ-810 = 5 pts UAV upload metadata, AZ-811 = 2 pts lat/lon GET) — total 18 pts across 4 per-endpoint AZ-795 children + 1 OSM-naming harmonization. Origin: cross-repo request from gps-denied-onboard agent (2026-05-22) for completeness of validation surface after AZ-795/796 landed, plus AZ-777 Phase 2 black-box probe surfacing the Region DTO as the lone OSM hold-out. Ordering: AZ-812 first (per /autodev Step 10 user decision), then AZ-808/809/810/811 (independent of each other modulo AZ-812). AZ-808 and AZ-809 specs amended 2026-05-22 post-probe to add `Id` non-zero-Guid rule + Route AC-10 input/output naming asymmetry advisory.
Step 9 cycle 8b: folded into cycle 8 as step 1 (AZ-812). Section retained in dependency table for traceability.
Step 9 cycle 9: 2 tasks created (AZ-1074 = 5 pts, AZ-1075 = 3 pts) — total 8 pts. gRPC TileStream for route-based progressive tile delivery.
## Coverage Verification
@@ -0,0 +1,60 @@
# gRPC TileStream Service for Route-Based Tile Delivery
**Task**: AZ-1074_grpc_tile_stream_service
**Name**: gRPC TileStream Service
**Description**: Add gRPC streaming endpoint that delivers route tiles as they become available.
**Complexity**: 5 points
**Dependencies**: RouteService, tile storage, Google Maps downloader
**Component**: SatelliteProvider.Api
**Tracker**: AZ-1074
**Epic**: AZ-115
## Problem
Consumers (gps-denied-onboard) can poll REST `POST /api/satellite/route` until `mapsReady`. No streaming transport exists for progressive tile delivery.
## Outcome
- gRPC `StreamTiles(RouteTileRequest) returns (stream TileChunk)` alongside existing REST.
- Reuses `RouteService` and tile download pipeline.
- Proto contract checked into repo.
## Scope
### Included
- `satellite_provider.proto` with route waypoints, region size, zoom, optional geofences.
- Stream messages: tile id, lat/lon, zoom, image bytes or path + checksum, status, terminal summary.
- ASP.NET Core gRPC host on configurable port.
- Happy-path + invalid-request integration test in `SatelliteProvider.IntegrationTests`.
### Excluded
- Mission cache package assembly (COG/manifest/FAISS).
- Removing or changing REST endpoints.
- Imagery source migration off Google Maps.
## Acceptance Criteria
**AC-1: Happy path streams tiles**
Given a valid 2-point route
When a client calls `StreamTiles`
Then at least one `TileChunk` arrives before `StreamComplete`.
**AC-2: Cache reuse**
Given tiles already in DB cache
When the stream runs
Then cached tiles are served without redundant Google Maps download.
**AC-3: Invalid route rejected**
Given zero waypoints or out-of-range coordinates
When the client calls `StreamTiles`
Then gRPC returns `INVALID_ARGUMENT` with details.
**AC-4: Backpressure safe**
Given a slow consumer
When tiles stream
Then tile bytes are not corrupted.
## Constraints
- gRPC is additive; REST remains supported.
- Blocks gps-denied-onboard AZ-1076 consumer.
@@ -0,0 +1,54 @@
# gRPC TileStream Blackbox Integration Tests
**Task**: AZ-1075_grpc_tile_stream_integration_tests
**Name**: gRPC TileStream Integration Tests
**Description**: Blackbox tests for the gRPC tile stream against a running service container.
**Complexity**: 3 points
**Dependencies**: AZ-1074
**Component**: SatelliteProvider.IntegrationTests
**Tracker**: AZ-1075
**Epic**: AZ-284
## Problem
AZ-284 blackbox suite covers HTTP API only. The new gRPC tile stream has no automated coverage.
## Outcome
- Integration tests exercise `StreamTiles` end-to-end in `docker-compose.tests.yml`.
- Failure cases assert correct gRPC status codes.
- Metadata consistency with REST route endpoint verified for same route.
## Scope
### Included
- Fixture: API + Postgres via existing docker-compose.
- Happy path: route → tiles → stream complete.
- Failure cases: empty route, invalid coordinates, zoom out of range.
- Cross-check with `GET /api/satellite/route/{id}` metadata.
### Excluded
- Consumer-side tests (gps-denied-onboard AZ-1076).
- Performance/load testing.
## Acceptance Criteria
**AC-1: Pipeline green**
Given docker-compose test run
When gRPC happy-path test executes
Then it passes with full verbosity (`-v`, no quiet mode).
**AC-2: Failure status codes**
Given each invalid request variant
When the gRPC client calls `StreamTiles`
Then the expected gRPC status code is returned.
**AC-3: REST consistency**
Given the same route submitted via REST and gRPC
When both complete
Then tile metadata is consistent.
## Constraints
- Depends on AZ-1074 landing first.
- Follow existing integration test patterns in `SatelliteProvider.IntegrationTests`.