Saltar a contenido

ISSUES-DEFERRED — GatewayQR-MunicVAllende

Findings below the severity gate (BLOCKER / CRITICAL / HIGH). They do not block the QA loop.

code-review, iteration 1 (2026-11-16)

  • MEDIUM — 401 on query/cancel raises no cockpit alert (ChargeLifecycle.java:93). Only create raises MUNI_UNAUTHORIZED; a revoked key leaves in-flight attempts polling silently. Candidate for slice 2 (cockpit alerts).
  • MEDIUM — UNCERTAIN create retried with no bound (PollPlanner.java:21). After a long outage a late retry can create a fresh payable charge for an abandoned sale (removed on the next tick by abandonment cancel). Revisit with the sandbox corpus (R-01).
  • MEDIUM — Unknown municipal estado or unparseable date loops as Unavailable (HttpMunicipalApi.java:138). No alert, no settlement. Revisit with the corpus (R-06).
  • LOW — Emulator idempotency key ignores CUIT (ChargeBook.java:101). Bench-only.
  • LOW — Consulta does two reads plus one write (PosPaymentService.java:75). Efficiency.

judgment-day, round 1 (2026-11-16)

  • THEORETICAL (both judges) — Post-expiry loop with no alert (ChargeLifecycle.java, AC-30 path). If the Muni keeps answering PENDIENTE and the cancel keeps failing, the attempt is queried every poll interval forever with no alert. C5-safe. Slice 2: raise a cockpit alert after N failed post-expiry cancels.
  • THEORETICAL — Cashback rejection takes two writes (PosPaymentService.java:53-61). A crash between them could let a recovery create a real charge. Move ISSUED → REJECTED in one save.
  • THEORETICAL — Missing expira makes an attempt unpollable (PollPlanner.java:27). Revisit with the sandbox corpus (R-06).

judgment-day, round 2 (2026-11-17) — APPROVED, theoretical findings only

Both judges (agree): - THEORETICAL — A POS cancel that throws records no cancel request (PosPaymentService.java:89-99, 136-142). Three version conflicts in a row, or a DB error after the municipal call, leaves no cancelRequestedAt; a payment within 20 s could end a silent PAID. Fix: record the request before rethrowing. Priority: first item of the next hardening pass (money path, C5). - THEORETICAL — recordCancelRequest does not bump version (JdbcAttemptStore.java:129-135). A poller holding a pre-request copy can still save PAID. Fix: version = version + 1 in the same UPDATE. Priority: same pass as above.

One judge: - In-flight entry has no time bound; a hung body read hides an attempt until restart (AttemptPoller.java:72-85, HttpMunicipalApi.java:86). - A dead CREATING claim is not recovered while the POS keeps querying (AttemptPoller.java:91-101). - Deterministic local failures (decrypt, missing merchant) become UNCERTAIN forever (PosPaymentService.java:62-78). - cancelDeferred records EventSource.POLLER even on the POS thread (ChargeLifecycle.java:80). - lastMuniQueryAt stamped before the call; timed-out calls are due again at once (ChargeLifecycle.java:89,132). - qrdata still sent for gateway-initiated cancels (PosResponses.java:55-57). - RejectedExecutionException leaks an in-flight id; stop() does not wait (PollerRunner.java:52-56). - DB outage logs an ERROR every second (PollerRunner.java:42-48).

judgment-day, round 3 (2026-11-17) — APPROVED, theoretical findings only

Both judges (agree): - THEORETICAL — create() Rejected/Unavailable saves do not re-read on conflict (ChargeLifecycle.java:64-67). An Esc recorded during an in-flight create that the Muni rejects turns a definitive REJECTED into UNCERTAIN for one or more polls (C5-safe, converges). Fix: same re-read-and-resave fallback as created(). - SUGGESTION — AttemptStore.recordCancelRequest javadoc says it never changes the version (AttemptStore.java:29-36); both adapters now bump it and the stale-copy protection depends on it.

One judge: - Cashback rejectedLocally save outside the try can now conflict with an Esc (PosPaymentService.java:60) — new trigger of the deferred two-writes item. - recordCancelRequest sets no updated_at and writes no audit event (JdbcAttemptStore.java:128-135). - Missing parentheses on PENDING || UNCERTAIN && idCobro != null (PosPaymentService.java:111-112).

improve, iteration 6 (2026-11-17) — 0 HIGH or above

Do before the cockpit merchant-edit slice (slice 2): - MEDIUM — Environment not pinned to the attempt (JdbcMerchantDirectory.java:46-55). Flipping a merchant SANDBOX↔PRODUCTION mid-flight queries a sandbox idCobro against production (C6). Stamp payment_attempt.environment at claim and refuse mismatches. - MEDIUM — PAID never reconciled against the amount (HttpMunicipalApi.java:137-142). Parse monto; PAGADO with another amount → PAID_UNCONFIRMED + AMOUNT_MISMATCH alert (C1). - MEDIUM — POS API fail-open on bind address (application.yml:48-51). Default server.address: 127.0.0.1; fail the prod profile when unset or 0.0.0.0. RUNBOOK step. - MEDIUM — Permanent municipal refusal (404/403) on query/cancel loops silently (ChargeLifecycle.java:82-85,121-124). After N refusals raise MUNI_STUCK once and slow down. - MEDIUM — wire_log grows unbounded (V1__baseline.sql:122-133). Index created_at, batched purge with configurable retention. - LOW — ABANDON_CANCEL can act on a stale "abandoned" read (AttemptPoller.java:105). Re-read and re-check abandonment before cancelling. - LOW — startPayment does not re-check merchant/branch active (PosPaymentService.java:50-58). - LOW — Stale javadoc on money-path contracts and timing defaults (AttemptStore.java:28-36, Timing.java:6).

judgment-day, final round (2026-11-17) — APPROVED, theoretical findings only

  • THEORETICAL — codigo longer than VARCHAR(200) (V1__baseline.sql:51). The charge can never be stored and the create is re-sent every interval. Widen the column or refuse + alert.
  • THEORETICAL — Rejected.error/mensaje not key-masked (HttpMunicipalApi.java:129-130). If the Muni echoes the API key in an error, it reaches the POS and the append-only event (C2).
  • THEORETICAL — Startup recovery runs after Tomcat serves /api (PollerRunner.java:33-39, AttemptPoller.java:47-55). A live CREATING row is flipped UNCERTAIN and a concurrent duplicate POST /cobro is sent (C4 then depends on Muni idempotency under concurrency).
  • THEORETICAL — POS dies, payer pays within 20 s → silent PAID (ChargeLifecycle.java:188-191). No record that the POS ever read PAGO_APROBADO.
  • SUGGESTION — cancel() boolean flags → CancelIntent enum; stamp lastMuniQueryAt in charged(); note on the PAID_UNCONFIRMED alert when the POS recovered the payment.

Resolved in slice 2a (2026-11-17)

Closed by code in slice 2a (V3/V4, hardening): improve items "environment not pinned", "PAID never reconciled against the amount", "POS API fail-open on bind address", "permanent municipal refusal loops silently", "wire_log grows unbounded", "stale javadoc on recordCancelRequest"; code-review item "401 on query/cancel raises no cockpit alert"; final judgment-day items "codigo longer than VARCHAR(200)", "Rejected.error/mensaje not key-masked", "startup recovery runs after Tomcat". Still open: everything else above.

slice 2a reviews (2026-11-17) — deferred (below gate, efficiency/cleanup)

  • *LOW — Admin revalidation hits the DB on every request; unfiltered COUNT() per attempt page; AdminUserService.view loads all users (AdminSessionFilter.java:39, JdbcAttemptQueries).
  • LOW — Two merchant reads per trxpago (JdbcMerchantDirectory.environmentOf repeats credentialsFor).
  • LOW — Cleanup: dead "unset" branch in ProdBindAddressGuard; hand-built JSON in AdminSecurityHandlers.write; test-only convenience overloads on Observation, MuniCharge, Timing; first adapter→config dependency in TimingController.
  • LOW — A concurrent request can log a user out right after their own password change (AdminSessionFilter.java:39-45). UX only.
  • LOW — Failed logins against a locked/disabled user grow admin_audit without bound (AdminAuthentication.java:95). Rate-limit or audit only the lock transition.
  • LOW — CANCEL_REQUESTED ignores the stuck interval (PollPlanner.java:37-40); at most ~120 calls until expira + grace.

slice 2a final code-review (2026-11-17) — LOW, deferred

  • Failed logins against a locked/disabled user audited without throttle (AdminAuthentication.java:71-74).
  • Re-auth failures share the login lock: five wrong currentPassword from an open session lock the real admin out for 15 min (deliberate trade-off) (AdminAuthentication.java:137-141).
  • enable user has no re-auth, unlike disable (AdminUserService.java:49-51).
  • gqrm.poller.wire-log-purge-seconds, lockoutMinutes, maxFailedAttempts not validated (≥ 1).
  • ProdBindAddressGuard "unset" branch dead/misleading (jar default is 127.0.0.1).
  • WireMasker.keyPattern() recompiles a regex per call — cache per key.
  • AdminRemoteAddressFilter refusals are not logged (one throttled WARN would help diagnosis).

slice 2a closing reviews (2026-11-17) — deferred

  • LOW — A held PENDING attempt with a cancel request re-saves every poll interval (ChargeLifecycle.java merchantChanged, PollPlanner.java:37-39).
  • LOW — credited_amount NULL when the monto is unreadable; keep the raw text in the alert or event.
  • LOW — Cockpit runs on plain HTTP in prod (VPN trust model, SPEC §2). Consider failing prod startup without TLS unless explicitly acknowledged.
  • LOW — The emulator cannot report a different/unreadable monto (FaultInjector): add a MONTO fault so AC-31 can be demonstrated on the bench (slice 3).

slice 2a verification (2026-11-17) — deferred

  • SUGGESTION — No post-close verification: a CLOSED_BY_ADMIN charge that was still payable is never queried again; a low-frequency check for a bounded window could raise PAID_UNCONFIRMED.
  • LOW — muni.allowed-hosts: optionally pin the Muni base URL hosts at startup.
  • LOW — Re-auth pattern repeated in 8 methods; extract a ReauthGuard. Merchant/branch create do not re-authenticate (javadoc says every money-routing write does).
  • LOW — Cancel of CLOSED_BY_ADMIN answers DENIED_OUTCOME_UNKNOWN instead of a final-denial kind.
  • LOW — No INFO log line when an attempt is closed (trxid and admin id only).

slice 2b reviews (2026-11-17) — deferred

  • MEDIUM (maintainability) — Hand-written positional copies of 27–31-argument records (PaymentAttempt withX, AttemptDetail.withCloseRefusal, JdbcAttemptQueries.withTimeline); route through builders and add a reflective test.
  • LOW — No automated headless-browser smoke (CSP + real bundle); covered by a manual browser check and a RUNBOOK step for now.

slice 2b re-review (2026-11-17) — deferred

  • LOW — recordCreateSent is not an optimistic claim (JdbcAttemptStore.java:146): a stale copy can still stamp and send; judges consider it covered by the status guard + version bump. Revisit with the corpus (concurrent idempotency, R-06).
  • LOW — Build needs internet (Node and npm registry) and the packaged-jar console path is only exercised by a manual smoke; add to the RUNBOOK release checklist (S5).

S5 runbook judgment-day (2026-11-18) — fixed in docs, deferred for the ledger

The ledger only treats code/build files as source, so a fix that lives in docs/RUNBOOK.md cannot close a gated finding by itself. Both judges verified these FIXED in RV-75 (commit 32724b0); they are recorded here so the human confirmation closes them. Validate on the CYRE server (elevated run).

  • defers: judgment-day/JD28-prelock-handle-race -- fixed in docs/RUNBOOK.md 32724b0: the install root is created already locked ([IO.Directory]::CreateDirectory with a protected DirectorySecurity, owner Administrators) and refused if it is a link, has another owner, other entries or content; both judges FIXED in RV-75.
  • defers: judgment-day/JD28-sc-qc-label-localized -- fixed in docs/RUNBOOK.md 32724b0: the virtual service account is read through Win32_Service.StartName (not localised) instead of parsing sc.exe qc labels; both judges FIXED in RV-75.

Follow-up (not confirmed by both judges): hash-check the jar and the config template against the release SHA256SUMS when copying them from the staging folder, and keep the staging folder admin-only.

POS E2E evidence judgment-day (2026-11-18) — fixed in docs, deferred for the ledger

The ledger only treats code/build files as source, so these fixes in docs/ cannot close the gated findings by themselves. Both judges verified them fixed in later rounds (JD36, JD38 and JD39 re-checked the 17 binary hashes, the export-ordinal shift and the ship-the-whole-set rule); they are recorded here so the human confirmation closes them.

  • defers: judgment-day/JD35-B-build-hash-wrong-artifact -- fixed in docs/evidence/2026-11-18/pos_build.txt: the build is identified by the SHA-256 and mtime of POS_MAIN.EXE and every POS_*.DLL (change 5 lives in POS_CTOQ.DLL), verified by both judges in JD36 to JD39
  • defers: judgment-day/JD37-ship-two-binaries -- fixed in docs/RUNBOOK.md section 6 and pos_build.txt: ship the whole co.bat output, because change 1 shifts POS_MAIN.EXE export ordinals and the DLLs import by ordinal; never ship the srcs/ baseline binaries; verified by both judges in JD38 and JD39

Follow-up (documentation, from JD39, not gated): RUNBOOK 7.2 step 4 has no cockpit place for a note on a PAID attempt; search by the QR line's amount and the paid time on the detail page; a rebuilt c3ef254 will not match the bench hashes (embedded debug timestamps) and the release set needs an archive location; the CAEA fallback depends on a valid local CAEA; the R-09 window should be measured to the end of the close ("Comienza nuevo Ticket"); the cashier sheet's lead-in and Id:N after a restart. Done on 2026-11-18 (branch docs/runbook-followups): RUNBOOK 7.2 procedure with the cockpit's fields and an incident-log record, RUNBOOK 4.3 "Existing service" in steps with a check by service PID and a smoke test, an 8.1 check of the flag, hashes described as the tested set (a rebuild differs), the CAEA dependency and close tail in R-09, and the cashier sheet. Still open: an archive location for the shipped POS set.