MEGAINFRA-WEBAPP/docs/audits/2026-10-01-delivery-processing-preview.md
DEls ed69b517e8 Integrate agent work and add dashboard attention indicators
Remove repeated Plant, Financial and Workforce shortcut cards. Add site-scoped Plant and Financial sidebar attention status with automatic refresh.

Include accumulated delivery processing, purchase order recovery, supplier reconciliation, plant data and user management changes and audit records.
2026-10-04 21:53:32 +02:00

5.8 KiB

Processing preview pilot results

The preview UI and API are implemented locally. The optional PocketBase field dn_batch_notes.reconciliation_preview was added with a schema backup and read-back verification. No receipt corrections or financial posting were made.

Vula VCINV074079

Read-only replay of candidate 2x71gsd21gobas8, excluding its own posted receipt from the supplied prior-delivery context. MiniMax-M3 correctly proposed 11 pipes at 2.5 m = 27.5 m and R43,560.55 net, preserving 36 explicitly zero-priced rubber rings with no additional value or paid pipe quantity. The grouped supplier rules were supplied directly from the existing supplier record.

The initial call exposed a harmless output-label mismatch: the model sometimes labels an accessory's raw count as a direct quantity. Code now preserves the source count while assigning no PO-product quantity to an explicitly free, unlinked accessory. This has a regression test. One direct-mode replay raised an unnecessary possible-duplicate question about different invoice references; the prompt now explicitly excludes similar quantities or shared scan batches as grounds for that claim. Duplicate interpretation remains a proposal.

Avidan IO019079

The browser ran the full API on candidate cgcpg2nu2uhn3dz in batch 7gwegnav3ij1202, using PO MEGCPO9256 (zr44xtb5u567npw). Its saved result contains all 10 source lines in 8 allocations:

  • 160 mm stub and priced back ring grouped once: R708 net.
  • 250 mm stub and priced back ring grouped once: R1,214 net.
  • Four six-metre 160 mm lengths described as 24 m; six 250 mm lengths as 36 m.
  • Printed values retained for bolts and washers. Proposed net subtotal R31,957.52.

PO units are blank, so PO quantities remain unresolved pending confirmation. Washer links point at the 80 mm gasket-set PO line and warrant review. Bolt/set ratios need confirmation. These are human review proposals, not approved item allocations. An offline replay incorrectly suggested priced washers were free; server validation rejected that inclusion treatment. The browser result retained the priced washers correctly. The prompt now explicitly forbids treating any positive printed amount as included at zero cost and clarifies kit grouping and quantity comparisons across units. AI proposals therefore still require review; these pilots do not establish unattended posting accuracy.

Read-back verification confirmed: saved preview present, fingerprint current, 10 source lines, 8 allocations, both kit values above, one processing_preview audit event, and unchanged candidate status blocked / stage needs_review. The result reloads from PocketBase rather than being only browser state.

Provider and verification

The user explicitly approved the MiniMax destination and pilot payload. Initial extended reasoning requests timed out at 90/180 seconds or exhausted a small completion budget before producing complete JSON. The final preview uses the provider's documented direct response mode for MiniMax-M3, with a 16,000-token completion budget and a 180-second timeout. An optional DN_RECONCILIATION_THINKING=adaptive enables slower adaptive mode. See MiniMax's OpenAI-compatible API documentation.

531 delivery pipeline/API/UI regression tests passed before the final prompt adjustments; the final 23 focused preview tests and TypeScript checks passed. New modules pass lint. The existing detail-view image viewer has an unrelated pre-existing lint error and two warnings. Source data and supplier rules were not modified by the pilot. Temporary diagnostic snapshots are in /private/tmp and are not a durable evidence archive.

Next: confirmed ledger amounts and per-line approval/partial posting. Historical receipt values remain estimates at PO rates, clearly labelled in this preview.

Builders 1230399 / MEGCPO9317

The live saved context contains 200 cement bags and five pallets, with the same quantities already received. Their cumulative quantities exactly match the PO's 400 each and 10 each. The AI validator incorrectly compared EA and each literally; it now uses the existing closed unit aliases. The prompt now requests PO-rate estimates for clearly matched goods without printed values, rather than asking for an invoice just to estimate a delivery.

The delivery-service line is manually pinned to the pallet item. Both preview calculators now reject borrowing a goods item's rate for an explicit delivery service. Unmatched PO-level lines retain their raw counts without requiring a product match. The operator's saved pin remains unchanged and must be reviewed. The correct known subtotal is R16,938.35 net, comprising R15,634 cement and R1,304.35 pallets. With prior goods receipts this reaches the PO's R33,876.70 net. The service amount is unknown, so the complete monetary comparison stays open.

The local browser confirms the corrected booking subtotal and the unresolved service. A processing revision in the fingerprint marks old AI results stale. 376 pipeline/preview/metrics tests, TypeScript and affected-module lint passed; two additional quantity/cumulative regression tests subsequently passed with the preview UI tests. The external Builders rerun was rejected by automatic approval review because the prior explicit MiniMax approval covered Vula and Avidan only; specific approval was requested and received. The approved MiniMax-M3 rerun then returned two proposed goods lines with quantities 200 each / 5 each and values R15,634 / R1,304.35 net. Only the delivery service remains in review for its unknown amount and conflicting manual pallet pin. The result was saved under a batch lease with source-fingerprint verification and a processing_preview audit event. Read-back verified the preview is current and the candidate source data is unchanged. No receipts were posted or amended.