Saltar a contenido

POS end-to-end evidence, 2026-11-18

These files close AC-29 and AC-33; see the exception at the top of ACCEPTANCE.md.

Setup

  • POS: every run used the real CYRE POS under DOSBox-X (POSKIT_S4).
  • Gateway: ran locally, against the muni-emulator on 127.0.0.1:9191. It was built from this branch. The last commit that touches gateway or emulator code is e979399; git log --oneline e979399..HEAD -- gateway muni-emulator lists nothing.

POS build

pos_build.txt records the build: the mtime and SHA-256 of every binary, where each POS change lives, and the source hash.

  • The whole co.bat output, shipped together: POS_MAIN.EXE and every POS_*.DLL, all rebuilt between 12:56:02 and 12:57:58.
  • Change 1 adds two exports to the EXE, which shifts its export ordinals.
  • The DLLs import from the EXE by ordinal, so binaries from different builds must never be mixed.
  • The QR render is in the EXE (pos_scre.cpp, QRENC.C). The PAGOQR flow, including changes 4 and 5, is in POS_CTOQ.DLL (pos_ctoq.cpp).
  • Same build in every run: no binary was written after 12:57:58, and run2 booted at 13:00:30.
  • Which commit: the pos_ctoq.cpp used for the build is byte-identical to c3ef254's, and the review found every other source file and build script identical too. The binaries committed under srcs/ in the S4 repository are the old baseline: never ship them.
  • Every run shows the trxpago wait ending at about 11 s.
  • In case L the POS prints the cap itself ("[10 de 10 seg]").
  • The previous commit, b3afb55, capped the wait at 15 s.

How the POS was connected

  • Through the proxy. The POS called a logging proxy on port 8089 (slirp 10.0.2.2), which forwarded to the gateway on 8080.
  • The proxy can drop an answer. A dropped answer is logged as [drop_after].
  • While the gateway was down, the proxy still accepted the POS's connection. The POS therefore saw an answer timeout, not a failed connect.
  • Run4 case G. The POS called the gateway on 8080 directly.

Profile keys

pos_profile_dumps.txt holds keys 493 to 498, 543 and 564 from every POS boot from 13:00 on. They were taken from the POS's day log (LG261118.LOG in POSKIT_S4). The POS prints key 564 with the name ?, so the run3 log excerpt, which was filtered on PAGOQR names, does not show it.

Boot Run Key 564 Port (key 495)
13:00 run2 3 8089
13:30 run3 3 8089
13:54 run4 case L 2 8089
13:57 run4, aborted try before case G 2 8080
14:01 run4 case G 2 8080

Keys 543 = 1, 496 = 240, 497 = 10 and 498 = 5 in all of them.

Clocks

  • Two clocks. POS times (the POS logs) run behind host times (proxy, gateway and emulator logs). The gap changes with each POS boot:
  • about 1.2 s in run2 and run3;
  • about 0.3 s in run4 case L;
  • about 1.0 s in run4 case G.

The timelines below say which clock each time comes from. - POS time format. Times are hh:mm:ss:cc. The last field is hundredths of a second, written as three digits (000 to 099).

Cases

Run trxid Case Result
run2 17 Lost answer, before the emulator URL was configured Rejected by the gateway (a setup error, kept so the log is complete)
run2 18 Lost answer: the proxy drops the trxpago answer First query at +11.2 s carries qrdata, then PAID
run2 19 Normal sale PAID
run2 20 Gateway stopped behind the proxy when trxpago is sent Resend after the restart, QR, PAID
run3 21, 22 Esc while waiting trxanulacion approved, charge ANULADO, attempt CANCELLED
run3 23 Gateway stopped behind the proxy when trxpago is sent Resend, QR, PAID
run4 24 Case L: lost answer, key 564 = 2 First query at +11.2 s carries qrdata, then PAID
run4 25 Case G: gateway stopped, no proxy See below

Resend trigger

The POS resends after 2 queries with no QR on screen. A query that timed out counts, and so does one answered PAGO_ENVIADO without qrdata.

  • run2/20 and run3/23: one query timed out and one was answered.
  • Case G: both queries were answered.

The failed trxpago connect itself is not a query. The run2 and run3 resend bodies are identical to the first trxpago.

Run4 case G (trxid 25)

  1. Gateway process G2 issues trxid 25 at 14:04:35 (host). G2 is then stopped.
  2. The POS's trxpago connect fails after about 7 s, at 14:05:00 (POS).
  3. Gateway process G3 starts; Tomcat is up at 14:05:07 (host).
  4. The next two queries get no QR. The POS day log (run4/pos_daylog_1354_1407.txt) records both answers as {"id":25,"estado":"PAGO_ENVIADO","mediodepago":"MUNICIPAL"}, with no qrdata. The attempt was still ISSUED until CREATING at 17:05:16 UTC.
  5. The POS resends at 14:05:15 (POS). The QR appears and the attempt ends PAID.

The charge was created after the resend. The CREATING event is at 17:05:16 UTC (14:05:16 host) in gateway_attempt25_detail_G.json. The emulator's expira for 55-1-25 is 14:07:16, which is creation plus the 120 s charge lifetime.

Case G ticket. The ticket history is in run4/pos_daylog_1354_1407.txt, the POS day log from 13:54:11 to its last line at 14:06:18.

  • Line endings are normalized: CRLF becomes LF, and the CR CR LF inside HTTP blocks becomes an extra blank line.
  • Left out: the POS profile records.
  • Redacted: CUITs, the Ingresos Brutos number, the cashier's name and the cashier number.
  • Kept: the merchant's name and address, which print on every receipt; the client is named throughout these docs. Paths like C:\PCPOS\... are the POS's own install paths.

Case L's ticket did not close.

  • Ticket 317131 opened at 13:54:45 for case L. On this bench the ticket number repeated after POS boots: 317131 was also the number of the ticket whose close ran at 13:36 (its invoice printed) before the 13:53 boot.
  • Its fiscal close started at 13:56:31. The CAE request failed at 13:56:41, and the POS went on to ConsultarComprobante, which was still running at 13:56:49, the last line before the restart.
  • The POS was then restarted, with the next boot at 13:57:03. The log shows only the gap, not who stopped it.
  • The restored ticket kept its item but lost the paid PAGO QR line (RISKS R-09).

The aborted try added a second item. After the 13:57 boot a second item was scanned (13:58:31) and a PAGO QR line was entered (13:58:54). A further PAGO QR entry was refused at 13:59:23 with "solo permitido ingreso PAGOQR una vez". The POS was restarted again.

Case G ran on that same ticket.

  1. After the 14:00:52 boot, a third item was scanned (14:02:03). Case G's PAGO QR line (3000) was entered at 14:02:26 on a 9000 total, and EFECTIVO paid the remaining 6000 at 14:03:24.
  2. Two trxid requests failed to connect while no gateway was running (14:03:39 and 14:03:59, 11 s each). The third issued trxid 25.
  3. run4/shots/G_paid.png shows the 9000 total and the two payment lines.
  4. The fiscal close started at 14:05:57 with 3 items. Its CAE request failed again at 14:06:08, and the log ends at 14:06:18, still inside the close, when the bench was stopped.

Observation: this payment sent nroticketfiscal "0". Attempts 14 and 15 (run3 file) also sent "0". The POS takes the value from its CAEA invoice counter.

Charges

Each emulator file has exactly one charge per referenciaExterna (55-1-{trxid}). The emulator returns the existing charge for a repeated reference, so these files alone cannot show a second create. "Never a second charge" rests on the gateway's AC-06 tests.

Not exercised

The 3-resend limit. Each resend case resent once.

Files

POS and proxy logs

  • proxy_*.log: every POS request and gateway answer, with timestamps (host clock).
  • pos_log_*filtered.txt: the POS's own log, cut to the payment window.
  • Verificando lines, which show the poll pause, appear in run2's log only.
  • TxRx ObtenerCAE ERROR after a paid sale in run2 is normal on the bench, which has no fiscal service.

Gateway and emulator state

  • gateway_attempts*.json: the gateway's attempts at the end of the run.
  • run2's file is a subset keyed by trxid.
  • The run3 and run4 files are the cockpit API's paged list, older attempts included. run3's attempts are 21 to 23; run4's are 24 and 25.
  • run4/gateway_attempt25_detail_G.json: attempt 25 with its events. pagadoPorLegajo and the merchant CUIT were removed.
  • emulator_charges*.json: the muni-emulator's charges at the end of the run.
  • run3/timing.json and run4/timing.json: the gateway timing in effect, abandonAfterSeconds: 20.
  • The run4 file comes from the process that ran case L.
  • run2 was not captured. It ran with the defaults in application.yml.

Gateway runs

  • gateway_cmd*.txt: how the gateway was started, with the master key shown as a placeholder.
  • run4/gateway_cmd_G.txt: the role of each case G process (G, G2, G3).
  • run4/gateway*.log and run4/emulator.log: startup logs, with the OS user and local paths replaced by placeholders.

Screenshots

The screenshots are in shots/ and run4/shots/.

  • Redaction. In shots/, the top header bar is blacked out where it shows the cashier's name. The run4/shots/ captures render no header text.
  • A_q4.png: context only. It shows a QR from an earlier run on S4 a64a178 and is not used for closure.
  • D_*: run2, lost answer.
  • T1_*: run3, Esc.
  • T2_qr_resend2.png: run3, resend. The POS log shows one resend; "2" is only part of the capture name.
  • run4/shots/L_*: case L.
  • run4/shots/G_*: case G.