Objective
invoice exception event
-> gather ledger/vendor/policy evidence
-> propose resolution
-> validate invariants
-> authorize and stage
-> approve exact proposal digest
-> reauthorize and commit idempotently
-> reconcile any effect-unknown timeout
-> read back ledger state
-> completed receipt | compensation + incident
Architecture
flowchart LR
E["Exception event"] --> W["Durable workflow"]
W --> R["Read tools"]
R --> O["Invoice ontology"]
O --> M["Resolution proposal"]
M --> V["Schema + invariant validation"]
V --> P["Policy decision point"]
P --> S["Stage resolution"]
S --> A["AP approver"]
A --> C["Commit resolution"]
C --> B["Ledger readback"]
B --> Q["Effect receipt"]
Artifact map
Execute
npm test
Effect invariants
resolution_commits(tenant_id, business_operation_id) <= 1runtime.release_digest == admitted_solution_release.digestbefore reads and effectscommit.invoice_revision == current_invoice_revisioncommit.proposal_digest == approval.proposal_digestcommit.policy_revision == current_policy_revisioncaller.tenant_id == invoice.tenant_idcurrent_caller_scopesandcurrent_policy_revisionare checked at each data/effect boundarycommitted == trueonly after source-of-truth readbackeffect_unknownis reconciled before retry or completioncompleted == trueonly after trusted receipt and readback-attestation verificationsteps,wall_time, andcoststay within the declared runtime budgetmodel_access(credentials) == false
Scope of the example
This example demonstrates the controlled-write core: exact release admission, contracts, current policy and identity checks, approval binding, duplicate-safe execution, effect-unknown recovery, signed service evidence, source-of-truth verification, runtime budgets, adversarial cases, and privacy-minimized trace evidence.
Its workflow charter contains illustrative values. The solution release remains review, capability manifests remain candidate, signatures and registry records use non-production example identities, and evaluations run in an ordinary host process rather than an isolated production sandbox. It does not claim field observation, authenticated production provenance, customer adoption, realized business value, deployment approval, or a completed customer handoff; use the FDE playbooks for those engagement and operating artifacts.