- rago: exactly-once prepaid settlement (deterministic idempotency, unique partial index + in-tx ON CONFLICT guard) — closes the double-charge risk - mint: double-entry + reserve conservation verified (14 tests) - ledgerline: atomic settlement outbox + partial recovery index (37 tests) - abacus: hard per-agent budget enforcement + kill-switch (54 tests) - vend: crash reaper / in-flight session reconciliation - turnstile/agent-runtime/ranguard/rit/game-economy/context-passport/rithub: core advanced + tests
9 lines
438 B
SQL
9 lines
438 B
SQL
-- Durable correlation to Relay/Mint's signed source settlement. Mint remains
|
|
-- authoritative; Ledgerline stores the exact proof used to accept the event.
|
|
ALTER TABLE margin_events
|
|
ADD COLUMN IF NOT EXISTS source_settlement_receipt TEXT;
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS margin_events_source_receipt_hash
|
|
ON margin_events ((source_settlement_receipt::jsonb ->> 'receipt_hash'))
|
|
WHERE source_settlement_receipt IS NOT NULL;
|