cedulon_audit
Reconcile payment receipts against a rail extract or internal ledger to confirm every settlement has a matching receipt. Returns balanced audit or findings naming the account, rail, and window.
Instructions
Reconcile the in-process receipt chain and checkpoint against the rail extract: this server's own ledger, or a signed extract you present. Returns audit: balanced or findings, names the account, rail and window it was computed over (scope) when an extract declared one, and counts the class every receipt and row landed in (counts).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trust | No | Rail key you hold out of band: { publicKeyPem, accountId?, railId?, windowStartMs?, windowEndMs? } | |
| extract | No | A signed rail extract you were presented with: { body: { accountId, railId, windowStartMs, windowEndMs, settlements: [{ ref, amount, currency, timestampMs }], clockSkewMs? }, signature, publicKeyPem }. Present, it is the settlement side of the audit: this server's in-process settlement rows are not consulted, rows added through extraSettlements are refused beside it (an empty list adds nothing and is accepted), and the result carries scope. The receipt side is still this server's own receipt chain and checkpoints, so an extract for an account or rail this server did not settle on reports this server's receipts as unmatched; that is the correct reading of that pairing, not a defect. A body the library would refuse to sign (malformed window, amount outside the grammar, negative clock skew), an empty account, rail or signature, or a key that is not a PEM is refused as extract: ... before anything is reconciled. Absent, the audit runs over this server's own ledger and declares no scope. | |
| manifest | No | A Trade Manifest you were presented with. Omit for a no-manifest deployment. Present without manifestTrust is unauthenticated-manifest. | |
| payeeTrust | No | Payee keys you hold out of band, keyed by payee: { "payee-1": publicKeyPem } | |
| issuerTrust | No | Issuer key(s) you hold out of band: { publicKeyPem: string | string[] }. Without it the audit checks this server's records against this server's own key. | |
| witnessTrust | No | Transparency log key you hold out of band: { publicKeyPem: string | string[] } | |
| manifestTrust | No | Manifest publisher key(s) you hold out of band: { publicKeyPem: string | string[] } | |
| extraSettlements | No | Optional extra extract rows, used to inject a bypass settlement in tests |