6.2 KiB
Batch Report
Batch: 20
Tasks: AZ-373 (C20 — clarify or drop MapsVersion field; option (a) selected)
Date: 2026-05-11
Run: 03-code-quality-refactoring
Cycle: 1
Task Results
| Task | Status | Files Modified | Tests | AC Coverage | Issues |
|---|---|---|---|---|---|
| AZ-373_refactor_clarify_mapsversion | Done | 7 src/test + 3 doc + 1 task = 11 files | 174 unit + 5 smoke pass | 3/3 covered | None |
Decision Recorded
Option (a) — drop MapsVersion from new writes. tiles.maps_version column retained (coderule.mdc forbids unprompted column drops). Pre-existing rows keep their "downloaded_YYYY-MM-DD" labels for forensic lookup; new rows write NULL. The field is removed from the API contract (DownloadTileResponse) and the internal DTO (TileMetadata) so it no longer appears in JSON responses.
Rationale for picking (a) over (b): the recommended default in the task spec; MapsVersion carries no operational signal — the value was a creation-date label, which is already redundant with CreatedAt. Removing it eliminates the dual-source confusion called out by C20.
Changes
Modified production code
SatelliteProvider.Services.TileDownloader/TileService.csBuildTileEntity: replacedMapsVersion = $"downloaded_{now:yyyy-MM-dd}"withMapsVersion = null.MapToMetadata: removedMapsVersion = entity.MapsVersionprojection (the DTO no longer carries that property).
SatelliteProvider.Common/DTO/DownloadTileResponse.cs—MapsVersionproperty removed.SatelliteProvider.Common/DTO/TileMetadata.cs—MapsVersionproperty removed.SatelliteProvider.Api/Program.cs— removed theMapsVersion = tile.MapsVersionline in theDownloadTileResponseconstructor insideGetTileByLatLon.
Unchanged (deliberate)
SatelliteProvider.DataAccess/Models/TileEntity.cs—MapsVersionproperty retained because the column still exists; Dapper maps both directions.SatelliteProvider.DataAccess/Repositories/TileRepository.cs—maps_version as MapsVersionin all four SELECTs and@MapsVersionin INSERT/UPDATE kept; binds tonullfor new rows.SatelliteProvider.DataAccess/Migrations/001_CreateTilesTable.sql—maps_version VARCHAR(50)(nullable) untouched.
Modified tests
SatelliteProvider.Tests/TileServiceTests.cs— 3 new tests:BuildTileEntity_DoesNotPopulateMapsVersion_AZ373_AC1— captures the persistedTileEntityand assertsMapsVersion == null.DownloadTileResponse_DoesNotExposeMapsVersion_AZ373_AC2— reflection check that the property is absent.TileMetadata_DoesNotExposeMapsVersion_AZ373_AC1— reflection check.
SatelliteProvider.IntegrationTests/Models.cs—MapsVersionremoved from the local wire-shape record.SatelliteProvider.IntegrationTests/TileTests.cs— removed theConsole.WriteLine($" Maps Version: …")line.
Modified docs
_docs/02_document/modules/common_dtos.md—TileMetadatabullet now listsVersion (int?), FilePath (string)(noMapsVersion)._docs/02_document/modules/services_tile_service.md— Internal Logic andDownloadAndStoreTilesAsyncdescription refreshed for AZ-357 + AZ-371 + AZ-373 (adjacent hygiene within the same file)._docs/02_document/data_model.md—maps_versioncolumn comment now reads "Legacy free-form provider tag; post-AZ-373 new rows write NULL".
Wire-shape impact
- JSON for
/api/satellite/tiles/latlonno longer contains themapsVersionproperty. Tolerant JSON consumers are unaffected. Strict consumers were already aware of the upcoming change via AZ-357's release notes; the integration test that previously printed the field has been updated. - OpenAPI schema regenerates automatically from the DTO (Swashbuckle) — no manual spec edit required.
AC Test Coverage
| AC | Covered by |
|---|---|
| AC-1 (semantics explicit — option a: no new writes) | BuildTileEntity_DoesNotPopulateMapsVersion_AZ373_AC1, TileMetadata_DoesNotExposeMapsVersion_AZ373_AC1 |
| AC-2 (HTTP shape decision recorded — field removed) | DownloadTileResponse_DoesNotExposeMapsVersion_AZ373_AC2 |
| AC-3 (tests stay green) | scripts/run-tests.sh --smoke reports 174 unit + 5 smoke. |
Test Run
| Suite | Result | Count |
|---|---|---|
Unit (SatelliteProvider.Tests) |
All passed | 174 (was 171; +3 new tests for AC-1 / AC-2) |
| Smoke integration (Docker) | All passed | 5 scenarios |
Code Review Verdict: PASS
Inline review covered:
- Architecture: No layer violations. DTO change confined to
Common/DTO; persistence layer untouched aside from the implicitnullwrite;WebApiupdated as the direct consumer. Module-layout ownership respected. - Behavior preservation: DB column kept and nullable; existing rows untouched; SQL binds
@MapsVersiontonullfor new rows. Single observable JSON wire change:mapsVersionfield is gone from/api/satellite/tiles/latlonresponses (intentional per AC-2). - AC coverage: 3/3, all wired to dedicated tests.
- Code quality: SRP preserved; no narrative comments; A/A/A test pattern; no suppressed errors; argument validation unaffected.
- Cross-batch consistency: extends the AZ-357 (drop
Versionconcept) theme; AZ-370 (enums, batch 19), AZ-371 (config, batch 18), AZ-364/AZ-360 (RouteProcessingService decomposition, batch 17), and AZ-367 (TileGridStitcher, batch 16) are untouched and still healthy.
Findings: None.
Auto-Fix Attempts: 0
Stuck Agents: None
Next Batch
Auto-chain to next batch per /implement Step 14. Cumulative K=3 review fires after batch 21 (covering batches 19–21). Phase 4 continues with the remaining 8 tasks in todo/:
AZ-374— C21 typed HttpClient for Google Maps (2 SP)AZ-375— C22 O(N) existing-tile lookup (2 SP, needs AZ-371 ✓)AZ-376— C23 delete unused FindExistingTileAsync (1 SP)AZ-377— C24 consolidate Earth-geometry constants (2 SP, needs AZ-371 ✓)AZ-378— C25 repo_loggerfields (1 SP)AZ-379— C26 repo SELECT column-list constants (2 SP)AZ-380— C27 deleteCalculatePolygonDiagonalDistance(1 SP)AZ-372— C19 dotnet format + analyzers + Coverlet (3 SP)