Skip to content

docs backend evidence ev support EE 13

AlexandreZanata edited this page Oct 24, 2026 · 1 revision

EE-13 — EV community projection, conflicts and moderation

Status: LOCAL_DONE Validation: PASS Integration: INTEGRATION_PENDING

Parent: 6abb3479 (maintained dev, EE-12 commit, PR #147 head). Date: 2026-10-22. Depends EE-12, accepted (+ community/trust/moderation source). Rules EV-11/13–15/22; journeys EV-04/05/08/12. Risk: public claim integrity/jobs (critical: vote/report idempotency, hidden/deleted exclusion, expiry without writes, no payment weight).

Before behavior: community observations project with helpfulness tallies, excluding hidden, deleted and expired records (expiry filters by date without writing). Votes converge by client submission ID (replay safe); reports converge by account/observation; duplicates never double-count. Conflicting votes (helpful vs not) coexist as tallies (no auto-resolution); hidden records vanish from projections via moderation-set flags (not votes). No payment weight, automatic certification or live-occupancy claim. Recovery: dated claims only or disable projection, never fake verified price.

Delivered

  • backend/db/migrations/000118_charging_helpfulness_reports.sql: append-only votes (account/observation/choice/submission with live uniqueness), reports (account/observation/reason/status with convergence) and hidden_at on observations (moderation-only, never voter-set).
  • backend/db/queries/charging/storage.sql (+ generated Go): vote, tally, report, hide and projection (place/day-ordered with tallies, hidden/deleted/expired excluded).
  • backend/internal/modules/charging/adapters/prepared/moderation.go: Vote (idempotent replay, choice validation), Report (idempotent, reason validation), Project (visible items with tallies, date-bounded expiry, limit-capped).
  • moderation_integration_test.go: vote convergence, conflicting votes, report convergence, invalid shapes, projection refusal.

Actual checks

From this worktree (2026-10-22, parent 6abb3479):

  • go test -count=1 -tags=integration -run TestModeration ./internal/modules/charging/adapters/prepared/ (loopback PostGIS, fresh DB with migrations) → PASS (0.6 s): helpful/not-helpful tallies, duplicate vote/report convergence, invalid refusal.
  • go test -count=1 ./internal/modules/charging/... → PASS; go vet PASS; GOTOOLCHAIN=go1.27.1 staticcheck PASS; sqlc vet PASS (migration 000118, deterministic generate).
  • git diff --check PASS; bash scripts/scan-secrets.sh PASS.
  • No HTTP, Android, worker or tariff changes; no source activation; no PII/secrets in Git/logs/fixtures.

Limits

  • Projection reads community observations only (official OCM/PBE batches project separately; source separation preserved, never merged). Reported-only until promotion gate (no verified-price claim).
  • Helpfulness tallies compute on read (no tally table, no write amplification); votes/reports converge idempotently; hidden flag requires operator action (not implemented here — lifecycle continues in reads).
  • Expiry is a read filter (date bound), never a deletion. Corrections invalidate by revision (callers re-project).
  • No device, no production, no deploy and no release acceptance is claimed.

Next: EE-14 (tariff/public observation reads) needs EE-09/11/13, now ready; it consumes these tested projections once authorized.

Fuel prices wiki

Source: AlexandreZanata/brazil-fuel-prices @ bbd96568180563ced975b96f8f89f7a3c242522e

Clone this wiki locally