{"id":"all-monetary-operations-maintain-double-entry-invariant","text":"All monetary operations maintain the double-entry invariant under concurrency: payment ledgers create balanced debit-credit pairs for every movement, and wallet transfers are deadlock-free with frozen-check inside the lock — unless the non-atomic balance check allows concurrent payments to create valid double-entry pairs for overdrafted amounts, producing an internally consistent but financially incorrect ledger.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["payment-double-entry-guarantees-balance-integrity","wallet-transfers-are-safe-under-concurrency"],"outlist":["payment-balance-check-not-atomic"],"label":"Payment + wallet achieve structural safety independently, but the payment system's TOCTOU on balance check undermines the combined end-to-end guarantee"}],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"all-monetary-operations-maintain-double-entry-invariant","truth_value":"IN","reason":"SL justification valid","antecedents":["payment-double-entry-guarantees-balance-integrity","wallet-transfers-are-safe-under-concurrency"],"label":"Payment + wallet achieve structural safety independently, but the payment system's TOCTOU on balance check undermines the combined end-to-end guarantee","outlist":["payment-balance-check-not-atomic"]},{"node":"payment-double-entry-guarantees-balance-integrity","truth_value":"IN","reason":"SL justification valid","antecedents":["double-entry-invariant","balance-derived-from-ledger"],"label":"Double-entry provides an audit invariant, but TOCTOU in the overdraft check can create entries that individually balance but collectively overdraw","outlist":["payment-overdraft-not-atomic"]},{"node":"double-entry-invariant","truth_value":"IN","reason":"premise"},{"node":"balance-derived-from-ledger","truth_value":"IN","reason":"premise"},{"node":"wallet-transfers-are-safe-under-concurrency","truth_value":"IN","reason":"SL justification valid","antecedents":["wallet-deadlock-free-concurrent-transfers"],"label":"sorted lock ordering prevents deadlock and frozen-check prevents TOCTOU, but `create_wallet` silently replacing an existing wallet could reset balance and lose in-flight transaction state for any concurrent transfer holding a lock on that wallet","outlist":["wallet-creation-silently-overwrites"]},{"node":"wallet-deadlock-free-concurrent-transfers","truth_value":"IN","reason":"SL justification valid","antecedents":["wallet-lock-ordering-prevents-deadlock","wallet-frozen-check-inside-lock","wallet-two-tier-locking"],"label":"Three complementary locking disciplines compose into a deadlock-free, race-free concurrency model"},{"node":"wallet-lock-ordering-prevents-deadlock","truth_value":"IN","reason":"premise"},{"node":"wallet-frozen-check-inside-lock","truth_value":"IN","reason":"premise"},{"node":"wallet-two-tier-locking","truth_value":"IN","reason":"premise"}]}}