docs release evidence p27 t01 signed intake - AlexandreZanata/Abastevo GitHub Wiki
P27-T01 — Signed station suggestions and private status
Status: LOCAL_DONE on codex/phase-27-station-intake. Task: P27-T01.
Binds B-BR-D07–D10 and BUC-D03/D04. Signed intake with owner-only
status; anonymous proof alone insufficient; CNPJ knowledge grants
nothing.
Behavior (TDD, critical-first)
- Migration
000034_station_suggestions.sql(append-only): private rows keyed(account_id, client_submission_id); states pending/cancelled (+approved/rejected for T02); owner index. sqlcregistry.sqlextended (create/get/get-by-key/list/count/ cancel);sqlc vet+generateclean. (LIMIT @varneeds::intcasts — caught by vet, fixed.) - Application
IntakeService+ParseProposal(moved domain→application: domain stays stdlib-only perTestDomainStdlibOnly, caught by test): structured validation (display/IBGE/UF, kernel CNPJ text, bounded coords with null-island refusal, 256-char evidence ref), 20/day quota[CALIBRATE], idempotent submit (same key+body replays; same key+changed body conflicts — compared semantically because JSONB normalizes bytes, caught by integration), owner-only cancel/status/list (foreign → not-found, no oracle; double-cancel → closed). - HTTP
adapters/intake: session-first on every route (invalid → 401, suspended/deleted → 403 via composition-mappedErrAuthorForbidden); private routes use POST with the session in the JSON body, never the URL (mirrors account bindings);no-storeon all responses; missing/foreign share 404. - OpenAPI: 4 intake paths +
StationSuggestion/Proposalschemas (vacuumPASS after adding the missing cancel path-param);apicontract+check-compat.shPASS. cmd/apiwiring with the account-session closure (modules never cross-read); fullgo build ./...PASS.
Validation
- Unit (
-race): proposal rules, service idempotency/conflict/quota/ owner-isolation, handler submit/replay/conflict/session/input/ foreign/cancel/mine/no-store — all PASS. - Integration (real PostGIS,
-race): idempotent replay, parallel same-station proposals stay two private rows, foreign read/cancel fail, cancel-then-read shows cancelled, CNPJ preserved in stored proposal. Fresh disposable DB (migrations incl. 000034). - Regression: full
directory/...unit + integration PASS (10 pkgs);go vetclean; account suites untouched (session contract reused). git diff --checkPASS;scan-secrets.shPASS (no PII/secrets; synthetic CNPJs).
Limits and next
- Decisions (approved/rejected), exact-match automation and reviewed locations are T02; Android visibility is T03–T04.
- Next: P27-T02 verified decisions, corrections and reviewed locations.