docs release evidence p10 t02 community read cache - AlexandreZanata/Abastevo GitHub Wiki
P10-T02 — Community read ports and local cache
Status: LOCAL_DONE on codex/phase-10-functional-integration (phase PR
#54 pending, second task push). Issue: #46 (slice 2 of 8 local;
P10-T09 pilot stays deferred until G18/G09 and is not part of G10-LOCAL).
No ANP path touched, no legacy enum rename, no backend change.
Slice acceptance (frozen before coding)
- T02 (this commit) — backend reads without removing ANP offline paths:
domain
BackendPriceGroups(wireGASOLINE_ADDITIVED, community stays null until P04, exact milli money) +BackendPriceHttpGateway/BackendPriceCacheRepositoryports + 60sBackendPriceCacheRule(matchesCache-Control: public, max-age=60) +CommunityReadsConfigdefault OFF; applicationGetCommunityPriceGroupsUseCase(Disabled / Fresh+save / StaleCache-explicit / Unavailable); data Roombackend_price_cache(keystation|fuel, source/version/expiry) with explicit MIGRATION_4_5, OkHttpBackendStationPriceHttpClient, Room+HTTP impls,CommunityReadsFlagStoredefault OFF, preview base URL.invalid(P13 precedent, never resolves).
What changed
domain/.../model/BackendPriceGroups.kt— official/group/groups with UUID + 7-value wire + milli validation.domain/.../repository/BackendPricePorts.kt— network-only vs cache-only ports.domain/.../rule/BackendPriceCacheRule.kt— TTL 60s, stale/fresh.domain/.../feature/CommunityReadsConfig.kt— DISABLED default.application/.../port/CommunityReadsFlagProvider.kt+usecase/community/GetCommunityPriceGroupsUseCase.kt.data/.../entity/BackendPriceCacheEntity.kt+dao/BackendPriceCacheDao.kt.AnpFuelDatabasev4→v5,MIGRATION_4_5,DatabaseModule,5.json.data/.../remote/BackendPriceGroupsJsonCodec.kt(null-community refused) +BackendStationPriceHttpClient.kt(network-only).data/.../repository/BackendPriceRepositories.kt+preferences/CommunityReadsFlagStore.kt.RepositoryModulebinds,CommunityModulepreview URL,UseCaseModulewiring.- Tests: 5 domain-model + 3 rule + 5 use-case (disabled/fresh/down-no-cache/down-stale/blank) + 3 codec + 2 HTTP (path/filter, down/empty) + 3 cache-repo + 1 migration-unit + 1 androidTest V4→V5 (vehicles/history preserved).
RED → GREEN
- RED proven by new symbols before implementation (same pattern as
P10-T01):
BackendPriceHttpGateway,BackendPriceCacheRule,GetCommunityPriceGroupsUseCase,BackendPriceCacheDao,BackendStationPriceHttpClientdid not exist; new tests referenced them. GREEN after adding bounded adapters only.
Validation (exact commands, this host)
./gradlew :domain:test :application:test :data:testDebugUnitTest --no-daemon --rerun-tasks
./gradlew :app:testDebugUnitTest :app:assembleDebug --no-daemon
bash scripts/check-mobile.sh --static-only
git diff --check
bash scripts/scan-secrets.sh
Outcome: :domain:test + :application:test + :data:testDebugUnitTest
green (incl. 22 new unit suites listed above); :app:testDebugUnitTest
assembleDebugBUILD SUCCESSFUL (ANP screens unchanged);check-mobile --static-onlyok;diff --check/secrets clean. Limits::data:connectedDebugAndroidTestNOT run locally (no emulator); V4→V5 device migration test added for CI/phase exit. No backend change; no production URL invented.