Saltar a contenido

RISKS — GatewayPrismaQR

ID Risk Level Owner Mitigation
R-01 Go-live depends on Prisma homologation (environment, URLs, apikeys, test wallets), which v27 does not document and we do not control. HIGH Human (commercial contact with Prisma) Send the Prisma questions now; build and test against our own emulator so only the homologation run waits on Prisma.
R-02 Closed 2026-10-02: the 15-day pilot date was dropped. — — —
R-03 v27 states services are "subject to modification" (p.5). MEDIUM Agent Prisma adapter isolated behind a port; contract tests per payload.
R-04 The DINO POS silently drops a positive importe_recdesc (surcharge): PagoQR_ImputarDescuento returns 0, the caller ignores it, and the sale is recorded at the original amount while the wallet charged more (inferred from code, not run). Almacor/Becerra have no QR imputation at all. HIGH Human (POS team) Interest-free pilot (recdesc always 0); explicit failure + reversal before enabling surcharges; CONSTITUTION candidate. See docs/PLANES-CUOTAS.md §10.3.
R-05 Fiscal printer: the QR discount command was never validated and a surcharge command does not exist. Becerra has no fiscal printer; Almacor unknown. HIGH (for adjustments) Human (POS/fiscal) Validate before enabling adjustments.
R-06 Tax treatment of a financing surcharge (VAT, percepciones) is undefined; POS code already flags percepciones as wrong for surcharges. MEDIUM Human (merchant's tax advisor) Decide before enabling surcharges. Status 2026-11-01: for discounts with a percepción the decision (Q2, 2026-10-31) is made and implemented on feat/qr-imputation of tipre/POS_ALMACOR; still open for surcharges.
R-07 Surcharges and discounts require a new Almacor/Becerra POS release: the post-payment imputation of the surcharge/discount and repeating trxanulacion. The release no longer needs to send promotions in trxpago (Mode A removed 2026-10-28; a promos list is ignored). With the full scope it is a dependency, not a fallback. Status 2026-11-15: the Almacor port (feat/qr-imputation) is merged to main of tipre/POS_ALMACOR (PR #1), reviewed and kit-tested; deployment still needs fiscal-printer validation, profiles 564-567 and a QR load dialog with Rec/Desc. HIGH Human (POS team) Plan the POS work in parallel; the gateway is tested against the emulator and a POS simulator meanwhile.
R-09 Customer charged with no sale: wallet approves after the POS timed out, cancelled, or was told "denied". GatewayQR drops such late approvals (504); GatewayMP compensates but from an in-memory, retry-forever queue. HIGH Agent Durable automatic compensation (SPEC §3.1); policy for the POS timeout is Q4.
R-10 Compensating with a forced refund does not return cashback (v27 v0.14), leaving the customer short if no cash was handed over. MEDIUM Agent Prefer forced annulment; confirm the annulment window with Prisma (P/Q5).
R-11 No real POS ↔ gateway traffic corpus yet (GatewayQR traffic.log owed by the human, 2026-10-02). Without it, the POS v1 contract is validated only against GatewayQR run locally. MEDIUM Human Not blocking: characterize GatewayQR locally (uscha-characterize) for the golden; add production traffic.log before the pilot to catch real POS payload variants. Card tables requested from the PCPOS DINO session.
R-12 RouterQR has only two hardcoded gateway slots and no per-merchant routing. Resolved for the pilot (human, 2026-10-02): there is one RouterQR per merchant chain (e.g. one for all Almacor branches), so plugging in is the config change server.routerqr.prisma.url → GatewayPrismaQR. Almacor has no QR today (human, 2026-10-02), so no slot conflict. LOW Human Confirm the same for Becerra.
R-13 Timeout chain POS 80 s → RouterQR timeout-pago (dev 60 s, prod unknown) → gateway: if the gateway waits longer than RouterQR, its "denied/cancelled" answer is lost and RouterQR's sweeper fires the annulment instead. MEDIUM Agent Gateway wait below RouterQR's read timeout: implemented (gateway.pos.wait.*, validated at startup, CONVENTIONS section 9 rule 14); verify production RouterQR and POS profile values and set caller-read-timeout (D-83).
R-14 To verify (human, 2026-10-02): the POS reaches the central gateway through a VPN. The DOS POS has no TLS and no auth header, so the VPN is the only protection: if it is missing for a branch, or the POS port is exposed to the internet, anyone who reaches it can call trxanulacion and trigger a forced annulment (pay, take the goods, annul from outside). HIGH until verified Human Verify VPN coverage for every pilot branch; POS listener bound to the VPN side only, Prisma callbacks on a separate public listener; per-merchant source-IP allowlist inside the VPN; alerts on unusual annulments.
R-15 The Prisma callbacks need a public hostname and TLS certificate on the GatewayQR server; not defined yet. Needed before switching from the emulator to the real Prisma. MEDIUM Human QA and homologation: Cloudflare Tunnel exposing only /prisma/v1/** with a public certificate and no inbound port (RUNBOOK section 13). Production: decide the hostname and certificate (same pattern or a public address with a reverse proxy).
R-16 D-134 (found by the formal model, docs/modelo/): a reversal the compensation job gave up on could still be completed by Prisma later and annul a sale the POS heard as approved. The window is closed since PR #7 (9c5f619): JdbcPosApprovals.recordApprovalIntent refuses the intent while the sale has a reversal the job gave up on (SaleReversal.GAVE_UP) and no intent is recorded yet; with the intent already recorded the POS keeps hearing what it heard, because that reversal can only be the cashier's. Residual: D-136, nothing queries a given-up reversal again. LOW Agent D-136 (deferred): a low-frequency leased sweep that only queries Prisma for given-up reversals and settles what is resolved, never re-sending. The COMPENSATION_FAILED alert already reaches a person.
R-17 D-135: the approved answer is lost and no alert line is logged (PosApprovalMarkerFilter); the no-crash variant of D-124. Also found by the formal model. MEDIUM Agent Deferred (D-135).
R-08 POS card ranges longer than 8 digits cannot be decided from Prisma's BIN; PAN length (iDigmin/iDigmax) is not available. LOW Agent Survey real Almacor/Becerra dM_Banda; log undecidable ranges.
R-18 POS boot fault that depends on memory size: Phar Lap Fatal error 286.3360 in the first DosLoadModule on the DOSBox-X kit, in 4 MB memsize windows that move with the image layout; the shipped 20261003 binaries fail too. Cause not identified. It was never produced on a copy of the production VirtualBox image (no NIC, two network TSRs removed; booted at 27 RAM sizes from 24 MB to 1 GB), which lowers the risk without closing it. MEDIUM Human (POS team) Boot probe (POS BUILD.md) with the final binaries at the deployment memory; boot and hold test on the production VirtualBox image with a real network and on the physical POS, for the RAM sizes in stores, before go-live.
R-19 DGROUP of POS_MAIN.EXE ends 164 bytes below 64 KB and POS_MPPO_TEXT / POS_PROM_TEXT are within 1.9 KB of it; the linker does not warn when a segment wraps. LOW Human (POS team) Check POS_MAIN.MAP (_BSSEND, segments) after every change; every new string as static char _far.
R-20 POS freeze seen once (test t12): the POS froze after the 50 s trxpago timeout with the wallet charged and the gateway APPROVED. Cause unknown. HIGH Human (POS team) Open: reproduce and find the cause; the hold test on both platforms is a go-live requirement.
R-21 POS TCP library clock (TITCP, LIBSP/WATTCPE/titcp.cpp, outside both repos): set_timeout/chk_timeout build deadlines from the wall clock read as HHMMSS, so after local midnight a connection close that depends on a deadline waits about 30 minutes (set_timeout(3000) in sock_close, meant as 3 s). Confirmed in the DOSBox-X kit on 2026-11-14: released at 30:00, then 28:27 across an hour boundary; the kit DLL md5 equals the source tree DLL. Compatible with R-20 (boot 23:30, freeze 00:08) but not confirmed as its cause. MEDIUM Human (POS team, library owner) Restart the POS before 00:00. Real fix in the library: elapsed time from seconds since midnight with day-wrap handling, and 3000 → 3.
R-22 A late payment of an intention cancelled or superseded before the complete intention has no terminal, trace or ticket, so the forced annulment cannot be built (ForcedReversalRequest) and the payment ends COMPENSATION_FAILED: customer charged with no sale, to be settled by hand. What the real notification carries is PRISMA-PREGUNTAS question 24. MEDIUM Agent / Human (Prisma answer) COMPENSATION_FAILED alert and manual handling (RUNBOOK section 3); ask Prisma (question 24); the emulator and test s4_theLatePaymentOfAnIntentionThatNeverGotItsPlansHasNoNumbersToCarry pin the current behaviour.