docs release evidence p10 t04 capture ocr - AlexandreZanata/Abastevo GitHub Wiki
P10-T04 — Capture and local OCR
Status: LOCAL_DONE on codex/phase-10-functional-integration (phase PR
#54 pending, fourth task push). Issue: #48 (slice 4 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)
- T04 (this commit) — Capture/crop/compress + confirm extracted price:
portable
PortablePriceOcr(exact milli-BRL core viaPortableMoney, tolerantR$/RS/BRL/$marker +./,2..3 decimals, 0.90 marked / 0.50 bare confidence, 0.60 manual bar, max 10 in text order, nomin(), no product/condition fields) +CaptureOcrConfigdefault OFF; applicationConfirmPriceCaptureUseCase(Disabled / PermissionDenied / Cancelled / NeedsHumanChoice,confirm()only with explicit approval + pickedFuelProduct, no upload); dataCaptureOcrFlagStoredefault OFFLocalRegexPriceOcr(OcrPort) +CaptureModulewith dependency rationale (system camera intent +PhotoFlowbudgets, no CameraX bundled; Play-services ML Kittext-recognitionplugs behind the same port at P10-T08 device pass); appCameraPermissionHandler+CaptureOcrViewModel/CaptureScreen+Routes.CAPTURE,CAMERApermission (required=false), ANP screens unchanged.
What changed
domain/.../feature/CaptureOcrConfig.kt— DISABLED default.domain/.../portable/PortablePriceOcr.kt— pure parse/order/confidence rules (nojava.*).application/.../port/CaptureOcrFlagProvider.kt+port/OcrPort.kt.application/.../usecase/capture/ConfirmPriceCaptureUseCase.kt+ outcomes (no HTTP dependency).data/.../preferences/CaptureOcrFlagStore.kt— default OFF.data/.../local/ocr/LocalRegexPriceOcr.kt— JVM-testable adapter.data/.../di/CaptureModule.kt— rationale, no base URL.RepositoryModule/UseCaseModulebindings.app/.../capture/CameraPermissionHandler.kt+CaptureOcrViewModel.ktCaptureScreen.kt;Routes.CAPTURE; nav entry; manifest CAMERA.
- Tests: 6 portable (single/dot/multi-order/bare-low/skip/bound) + 6 use-case (disabled-no-OCR/denied-no-OCR/cancel-no-partial/multi-no-pick/ low-confirm-gate/condition-never-auto) + 3 data adapter + 2 permission + 3 viewmodel + 1 androidTest device replay (CI).
RED → GREEN
- RED proven by new symbols before implementation (same pattern as
P10-T01/T02/T03):
PortablePriceOcr,CaptureOcrFlagProvider,OcrPort,ConfirmPriceCaptureUseCase,LocalRegexPriceOcr,CameraPermissionHandlerdid not exist; new tests referenced them. GREEN after adding bounded adapters/screens only.
Validation (exact commands, this host)
./gradlew :domain:test --no-daemon --rerun-tasks
./gradlew :application:test --no-daemon --rerun-tasks
./gradlew :data:testDebugUnitTest --no-daemon --rerun-tasks
./gradlew :app:testDebugUnitTest :app:assembleDebug --no-daemon --rerun-tasks
bash scripts/check-mobile.sh --static-only
git diff --check
bash scripts/scan-secrets.sh
Outcome: :domain:test + :application:test + :data:testDebugUnitTest
green (incl. 15 new unit suites listed above); :app:testDebugUnitTest
assembleDebugBUILD SUCCESSFUL (ANP screens unchanged);check-mobile --static-onlyok;diff --check/secrets clean. Limits::data:connectedDebugAndroidTest+:app:connectedDebugAndroidTestNOT run locally (no emulator);CaptureOcrDeviceTestadded for CI/phase exit. No backend change; no production URL invented. B-BR-010/011/015/016: no public evidence, no unvalidated photo counted, no upload from capture.