Saltar a contenido

HANDOFF — GatewayPrismaQR

Read before coding

  1. CONTEXT.md — glossary.
  2. SPEC.md — scope, RouterQR/POS facts (§3.0), compensation (§3.1), quality bar (§3.2), acceptance (§5).
  3. CONSTITUTION.md — invariants (a breach is a BLOCKER).
  4. DOMAIN-MODEL.md — entities.
  5. docs/adr/ADR-001..004 — stack, compensation, plan source modes, POS connection.
  6. ACCEPTANCE.md — 32 confirmed criteria; each closes only with a green test carrying its ID.
  7. docs/SISTEMA.md (rendered: docs/sistema.html) — the system as it is today, in Spanish. Then docs/PLANES-CUOTAS.md (docs/planes-cuotas.html, with a plan simulator), docs/POS-IMPUTACION-QR.md (docs/pos-imputacion-qr.html, the POS-side imputation handover) and docs/emulador-qr.html (POS / gateway / Prisma browser simulator) — plans, surcharges/discounts, worked examples. docs/modelo/README.md holds the TLA+ model of the payment lifecycle: rerun it (and update PaymentLifecycle.tla) when you change code behind a modelled action.
  8. docs/research/ — Prisma v27 digest, GatewayQR and GatewayMP-JH8 reverse engineering.
  9. RISKS.md — open risks and owners.

Then, before touching code: 1) summarize the expected behavior, 2) flag ambiguities or contradictions, 3) propose a file plan and tests. Implement only the SPEC's scope. Do not change contracts outside the SPEC, and do not edit the SPEC to make your implementation look correct.

Hard rules

  • Strict TDD: no money behavior without a failing test first.
  • Never store state that decides money only in memory.
  • Never change the GatewayQR estado strings or make ids non-numeric.
  • Never log secrets or full benefit card numbers.
  • No new dependency without human approval.
  • Integration tests use the isolated local SQL Server database GatewayPrismaQR_IT (credentials from environment variables, never committed); the clean is refused unless the database name ends in _IT.
  • Commits: conventional commits, no AI attribution lines (user rule).

Required evidence per change

  • Tests named with their AC IDs, green.
  • Coverage and mutation thresholds of SPEC §3.2.
  • ArchUnit green.
  • Updated docs/RUNBOOK.md when operation changes.

Pending inputs (owners: human)

  • Export of dM_Banda / dM_TarPl (Becerra copy at C:\Work\AI\DINO_BUILD\BASES) — the PCPOS session was denied by its permission control; the human runs or authorizes it.
  • GatewayQR production traffic.log (R-11).
  • Prisma answers to the questions in docs/PRISMA-PREGUNTAS.md (environments, notification path, 27 s miss behavior, total_amount ≠ original, idempotency).
  • VPN coverage for every branch (R-14).