From 527e138b8334fffa8088c412f6c630bfdfd7de97 Mon Sep 17 00:00:00 2001 From: nfel Date: Sun, 30 Aug 2026 19:57:11 +0330 Subject: [PATCH] docs: record deterministic transaction lock ordering --- REFACTORING-AUDIT.md | 1 + REFACTORING-TODO.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/REFACTORING-AUDIT.md b/REFACTORING-AUDIT.md index 50816c8..d63f9a7 100644 --- a/REFACTORING-AUDIT.md +++ b/REFACTORING-AUDIT.md @@ -427,6 +427,7 @@ Migration order implied by the map: isolate shared infrastructure constructors ( - Redeem completion status/hash/error updates now use the shared `application/transaction.CompletionUpdate` policy; repository update and transfer error orchestration remain at the service boundary. Focused Wallet tests pass in `af880c5`. - Transaction-list balance-change classification now uses the shared `application/transaction.BalanceChange` policy with focused coverage for increases, decreases, and non-balance transaction types. Full Wallet tests pass in `ca7ae43`. - Internal transfer and sell insufficient-balance transitions now use the shared `application/transaction.FailureUpdate` policy; atomic wallet/transaction persistence and rollback behavior remain unchanged. Focused Wallet tests pass in `d10ff42`. +- Internal transaction consumers now acquire distinct sender/recipient wallet locks through deterministic `application/transaction.LockUserIDs` ordering, preventing reverse-transfer lock-order deadlocks. Focused Wallet tests pass in `a43a758`. - Transaction persistence atomically enqueues ledger and transaction-event outbox records; deterministic idempotency keys, duplicate/conflict handling, retry claims, and dead-letter behavior are implemented and covered by infrastructure/application tests. Remaining W006 work is balance coordination and business-level failure/refund orchestration in deposit, withdrawal, transfer, and redeem flows. ### `W007` — market boundary checkpoint diff --git a/REFACTORING-TODO.md b/REFACTORING-TODO.md index 9319fd1..a4f56ca 100644 --- a/REFACTORING-TODO.md +++ b/REFACTORING-TODO.md @@ -325,6 +325,6 @@ Append one row whenever a task changes status. Existing rows are never rewritten | 2026-08-30 | A009 | `TODO` | `DONE` | Removed Auth's commented/dead wallet federation client; Auth tests pass with writable cache in `508a239`. | | 2026-08-30 | W013 | `TODO` | `STARTED` | Removed automatic federation creation and federation lookup from wallet initialization; new wallet records no longer receive a federation assignment; full Wallet tests pass in `97dd9d9`. Remaining schema/API/transaction-field cleanup is pending. | | 2026-08-30 | W013 | `STARTED` | `DONE` | Removed federation persistence/model code, wallet and transaction federation fields, federation protobuf messages, stale API route/docs, and remaining runtime references; regenerated Wallet contracts for Wallet/Auth/API; Wallet, Auth, and API tests pass. Wallet `a38501d`/`7ae90cc`, Auth `446e875`, API `c450264`/`c2c076c`. | -| 2026-08-30 | W006 | `TODO` | `STARTED` | Added `application/withdrawal`, `application/deposit`, `application/transfer`, and `application/transaction`; routed IRT reconciliation, IPG conversion/settlement/payer identity, transfer validation, transaction construction/completion, balance-change display policy, insufficient-balance failure policy, Stellar status updates, and transaction-event support through application boundaries; focused Wallet tests pass in `d10ff42`. Balance coordination and business failure/refund orchestration remain. | +| 2026-08-30 | W006 | `TODO` | `STARTED` | Added `application/withdrawal`, `application/deposit`, `application/transfer`, and `application/transaction`; routed IRT reconciliation, IPG conversion/settlement/payer identity, transfer validation, transaction construction/completion, balance-change display policy, deterministic wallet-lock ordering, insufficient-balance failure policy, Stellar status updates, and transaction-event support through application boundaries; focused Wallet tests pass in `a43a758`. Business failure/refund orchestration remains. | | 2026-08-30 | W007 | `TODO` | `STARTED` | Added typed `application/market` policies for agreement tolerance, available amount, raw conversion, positive order inputs, ICO publisher validation, order status codes, and market pricing calculation; market ICO/order validation and calculation delegate through compatibility mapping. Focused market tests pass in `4ea1f5a`. Order lifecycle, settlement, contract generation, and adapter extraction remain. | | 2026-08-30 | W008 | `TODO` | `STARTED` | Added `application/alert` level/source label and subject policies with focused mapping tests; alert delivery keeps existing asynchronous email/SMS retry behavior. Focused Wallet tests pass in `be29c11`. Delivery, retry, persistence, and adapter extraction remain. |