Wakeless

Failure handling

Ten failure rows, each held by a test with this title in pnpm test (packages/facilitator/test/failures-1.test.ts, packages/facilitator/test/failures-2.test.ts). Status read as "facilitator / vendor": the facilitator answers a verdict with 200 and the spec's own shape plus {error, code, retryable}; the vendor answers the buyer with 402 and never the resource.

RowFailureCodeBehaviourTest
1Voucher exceeds the depositinvalid_batch_settlement_svm_cumulative_exceeds_depositCorrective 402 with extra.channelState, the buyer's own extra.voucherState, and extra.minDeposit set so one top-up makes the voucher fit; nothing moves"voucher exceeds deposit: corrective 402 carries minDeposit"
2Voucher total not above the last acceptedinvalid_batch_settlement_svm_cumulative_amount_mismatchRejected with the snapshot so the buyer resynchronises; the highest watermark is kept"voucher not above last accepted is rejected"
3Bad signature or wrong channelinvalid_batch_settlement_svm_voucher_signature, invalid_batch_settlement_svm_channel_id_mismatchRejected before the record is read; no snapshot travels; nothing stored"bad signature or wrong channel is rejected and nothing stored"
4Facilitator unreachable or times outshielded_facilitator_unavailable, retryable: trueThe vendor fails closed: 402 with empty accepts[], no resource, nothing to deposit into"facilitator unreachable: vendor fails closed"
5Redemption transaction fails or is unconfirmedsettlement_pending (carries the signature)The amount stays owed; the worker asks the rail about the signature before any resend, then the escrow's balance; the vendor reads it under pending[] of its receipts"redemption failure keeps the amount owed and returns settlement_pending with signature"
6Buyer starts a close before redemptioninvalid_batch_settlement_svm_channel_closingDuring the grace (withdrawDelay) the vendor's latest voucher is accepted; after it the vendor is paid its watermark and deposit − settled returns to the buyer's private balance"close before redemption: vendor voucher accepted during grace"
7Buyer disappearsn/a (lifecycle)At maxIdleSecs without activity the channel is idle-closed: settled to the vendor at the accepted watermark, the rest refunded"buyer disappears: idle close settles at the accepted watermark"
8Duplicate request retryduplicate_settlementThe same /settle envelope answers the stored result with extra.replayed: true and moves nothing; a buyer resending a header is served once"duplicate retry returns the stored result"
9Private transfer rejected at PER ingress or UNSUPPORTED_TRANSFER_ROUTEshielded_binding_rejectedTerminal: alerted with the rail's code, never retried, never public; the amount stays owed; the vendor reads it under rejected[]"PER rejection is terminal, alerted, never public"
10TEE attestation failsshielded_attestation_failedThe binding does not exist; /supported answers kinds: [], every other route 503; nothing is verified, settled or simulated"attestation failure gives an empty /supported"