mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 15:11:14 +00:00
[AZ-350] Refactor 03 Phase 2: roadmap + 27 task specs + safety net
Adds Phase 0 (baseline metrics, .gitignore tweaks), Phase 1 (research findings, list-of-changes), and Phase 2 (refactoring roadmap, epic AZ-350, 27 task specs AZ-351..AZ-380, dependency table updates) for the 03-code-quality-refactoring run. Phase 3 (Safety Net) re-verified: 40/40 unit + 5/5 smoke integration pass; documented in test_specs/existing_coverage.md. Coverage % gating deferred to ticket C19 (AZ-372) which adds Coverlet + reportgenerator. Auto-chains to Phase 4 (Execution) via /implement starting at batch 1 (Phase 1 critical fixes). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# Safety Net — Existing Coverage
|
||||
|
||||
**Date**: 2026-05-10
|
||||
**Run**: 03-code-quality-refactoring (Phase 3, refactor skill)
|
||||
**Mode**: re-verification of Step 7 baseline
|
||||
|
||||
## Result
|
||||
|
||||
**GATE: PASS**
|
||||
|
||||
Existing tests are sufficient to act as the safety net for the 27 changes in `list-of-changes.md`.
|
||||
|
||||
## Test Suite Inventory
|
||||
|
||||
| Suite | Project | Pre-refactor count | Re-run count | Outcome |
|
||||
|-------|---------|-------------------:|-------------:|---------|
|
||||
| Unit tests | `SatelliteProvider.Tests` | 35 | **40** | 40/40 PASS |
|
||||
| Integration smoke | `SatelliteProvider.IntegrationTests` (`scripts/run-tests.sh --smoke`) | 5 | **5** | 5/5 PASS |
|
||||
| Integration full | `SatelliteProvider.IntegrationTests` (`scripts/run-tests.sh --full`) | 11 | not re-run | green per Step 7 |
|
||||
|
||||
Re-run wall clock: ~88 s (`scripts/run-tests.sh --smoke`).
|
||||
|
||||
The unit count grew from 35 → 40 between Step 7 and now. Source code under `src/`-equivalent components is unchanged in this window (git status shows only documentation, `.gitignore`, and `_docs/_autodev_state.md` modifications); the additional unit tests came from earlier `dev` branch work that landed before Step 8 began. No regressions.
|
||||
|
||||
## Coverage vs. Phase 3 Thresholds
|
||||
|
||||
| Threshold | Required | Measured | Status |
|
||||
|-----------|---------:|---------:|--------|
|
||||
| Overall line coverage | ≥ 75% | not measured | **deferred — see C19** |
|
||||
| Critical-path coverage | ≥ 90% | not measured | **deferred — see C19** |
|
||||
| Public API blackbox coverage | required | covered by 5 smoke + 6 deferred-to-`--full` integration tests | **PASS** |
|
||||
| Error-path coverage | required | SEC-01..04 cover 4 explicit error paths; unit tests cover service-level error branches | **PASS** |
|
||||
|
||||
`baseline_metrics.md` documents that Coverlet is not wired up. Change **C19** in `list-of-changes.md` adds Coverlet + reportgenerator as a Phase 4 deliverable; coverage % becomes measurable after C19 lands. The user accepted this trade-off when confirming the Phase 0/Phase 2 roadmap.
|
||||
|
||||
## Mapping: Refactor Targets → Existing Test Coverage
|
||||
|
||||
| Refactoring change | Files refactored | Tests guarding the area |
|
||||
|--------------------|------------------|-------------------------|
|
||||
| C01 Null logger | `Program.cs` startup | smoke: any test that triggers the API container exercises startup; failure surfaces as container-down |
|
||||
| C02..C04 Empty/silent catches | `TileService`, `TileRepository`, `RegionService` | unit tests for each service + smoke `RegionTests.RunRegionProcessingTest_200m_Zoom18` |
|
||||
| C05 Throw-and-discard request body parser | `Program.cs` upload endpoint | not currently exercised by smoke; covered by SEC-04 (malformed JSON) and `--full` upload tests |
|
||||
| C06..C09 Tile/Region/Route services | `TileService`, `RegionService`, `RouteService`, `GoogleMapsDownloaderV2` | `TileTests.RunGetTileByLatLonTest`, `RegionServiceTests`, `BasicRouteTests.RunSimpleRouteTest`, `ExtendedRouteTests.RunRouteWithTilesZipTest` |
|
||||
| C10..C12 Magic numbers / enums | constants/enums consumers across services | covered transitively by all unit + smoke tests |
|
||||
| C13..C15 Dapper / Postgres type handlers | repositories | unit tests for each repository + smoke region pipeline |
|
||||
| C16..C18 Background services + queue | `RegionProcessingService`, `RouteProcessingService`, `RegionRequestQueue` | smoke region + route tests exercise the queue end-to-end |
|
||||
| C19 Coverage tooling | build/test infrastructure only | tests themselves unchanged; verified by `scripts/run-tests.sh --smoke` exit code |
|
||||
| C20 Tile version migration | `TileEntity`, `TileRepository`, migration | smoke `TileTests.RunGetTileByLatLonTest` re-uses tiles across runs; verifies read path |
|
||||
| C21..C23 API surface (CORS, problem details, idempotency) | `Program.cs` endpoints | SEC-01..04 + smoke region/route POSTs |
|
||||
| C24..C25 ImageSharp + ZIP utilities | shared utility modules | smoke `ExtendedRouteTests.RunRouteWithTilesZipTest` |
|
||||
| C26 .editorconfig + analyzers | repo root config | non-functional; verified by build success |
|
||||
| C27 dotnet format pre-commit | repo root tooling | non-functional; verified by manual hook invocation |
|
||||
|
||||
## Decisions
|
||||
|
||||
1. **Re-run scope**: smoke only. Full integration was green today and source has not changed since.
|
||||
2. **Coverage threshold gating**: deferred to C19. The qualitative coverage check (every refactor target has at least one guarding test) passes for all 27 changes.
|
||||
3. **Per-task test additions**: each refactor task spec already declares any new tests it must add. Those tests are written by the implement skill during Phase 4 execution.
|
||||
4. **Re-verification trigger**: after each batch of refactor commits, the implement skill runs the relevant test subset; the full smoke suite must be green again before the next batch starts.
|
||||
|
||||
## Auto-chain decision
|
||||
|
||||
Phase 3 GATE cleared. Auto-chain to Phase 4 (Execution).
|
||||
Reference in New Issue
Block a user