agent gate · 2026-05-26

Invoice agents fail when the workflow state is wrong, even if the document looks clean

Replay the event path before an AP agent clears payment

duplicatesame invoice appears twice
receiptpayment before goods receipt
holdpayment while invoice remains blocked
gateallow / review / block before execution
storeidempotency · checkpoint · recovery
01 · runningPurchase-to-pay agent traces

PO, goods receipt, invoice, hold, release, approval, payment

02 · failureA final answer can look acceptable while the state path is unsafe

Duplicate invoices, wrong vendor, missing receipt, missing approval, active block

03 · fixReplay the case against a policy oracle

Seed a defect, run the oracle, compare expected violation codes

12clean traces
48seeded scenarios
36/36critical caught
66tests
Flow coverage
  • 2-wayinvoice to payment without goods receipt requirement
  • 3-wayPO, receipt, invoice, approval, payment
  • invoice-before-GRblock, receipt, release, approval, payment
  • consignmentgoods movement without PO-level invoice
Failure queue
  • DUPLICATE_INVOICE
  • VENDOR_MISMATCH
  • PAYMENT_BEFORE_GR
  • PAYMENT_BEFORE_APPROVAL
  • PAYMENT_WHILE_BLOCKED
Result panel

Fixture v0 scorecard

synthetic replay evidence
critical catch1.000
duplicate recall1.000
audit coverage0.950
critical catch

Seeded critical rows where every expected violation code was emitted

duplicate recall

Duplicate invoice scenarios caught by the duplicate rule

false holds

Clean traces where the oracle emitted an unnecessary hold finding

audit coverage

Runs containing the events needed to inspect the policy decision

Agent action gate

Proposed actions are replayed before execution

2026-05-25
inputclear_payment · C004
decisionblock
codePAYMENT_BEFORE_APPROVAL
reportagent_action_gate_sample.json
Operational replay checks

The replay path now exposes retry, ordering, schema, and parallel consistency checks

v0.6.0
idempotency0 duplicate event_id rows
ordering0 input inversions
schema51 / 51 events versioned
consistencyserial = 4-worker replay
Persistent replay store

SQLite-backed replay adds bounded ingest, partition checkpoints, and interruption recovery

v0.6.0
attempted appends255
duplicate retries204
checkpoints2 → 4
statusrecovered
External log path

CSV, XES, and BPIC2019 traces can enter the same audit surface

v0.6.0
importstream CSV/XES → JSONL
smokeBPIC2019 1,000 cases
audittrace-level report
releasev0.6.0
Why state replay matters

Three examples that text extraction alone would not settle

event order
before receiptpayment first

The invoice exists, but goods receipt is still missing

while blockedhold active

The payment event arrives before invoice release

consignmentinvoice leak

A PO-level invoice appears in a flow that should not receive one

Built surface
CLIimport-csv · import-xes · audit · gate-action · ops-report · store-replay
outputscorecard JSON · ops readiness JSON · store replay JSON
docsPages dashboard
CI3.10 · 3.11 · 3.12
Boundary

Synthetic fixture plus 1,000-case BPIC2019 smoke summary; raw benchmark data is not committed; production storage, queue semantics, monitoring, rollback, and ERP-specific mapping review are outside this artifact