Say what bets and withdrawals actually exclude (B-70)
The flowchart's WITHDRAW node (E1) stated that a withdrawal cannot happen together with a bet in progress. The code only serializes the two *builds* through the per-user lock: a withdrawal is accepted while a bet is still unconfirmed, as long as confirmed, unspent UTXOs cover it. CLAUDE.md makes every node of the diagrams binding, so one of the two had to move, and it is the diagram. The hazard the node was reaching for is the two transactions picking the same UTXO, and that is already excluded twice: app/tx/locks.py keeps the builds from overlapping, and select_utxos skips anything already marked spent_txid. What the node forbade on top of that is spending untouched, confirmed money — so implementing it as written would freeze a user's whole balance for a block after every bet and protect nothing. E1 now describes the real rule, and CLAUDE.md's per-user-lock paragraph states it is the only exclusion between the two. Regenerated the A4/A3 PDFs (gitignored, so not in this commit). The regression test is behavioural, not a wording check: it funds a user with two confirmed UTXOs, bets (taking the larger), and asserts the withdrawal goes through on the other one with the bet still unconfirmed and neither transaction spending the other's input. A second test keeps the diagram from drifting back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,18 +40,6 @@ remains the last prerequisite for running unattended.
|
||||
|
||||
## Low — documentation and consistency drift
|
||||
|
||||
### B-70 — the flowchart's WITHDRAW precondition is not implemented as written
|
||||
|
||||
`flowchart/platform-overview.mmd:39` (node E1) states a withdrawal cannot happen
|
||||
together with a bet in progress. The code only serializes the *builds* through the
|
||||
per-user lock (`app/tx/locks.py`): a withdrawal is accepted while a bet is still
|
||||
unconfirmed, as long as confirmed UTXOs cover it.
|
||||
|
||||
CLAUDE.md declares every node and edge label of the diagrams a behaviour that must
|
||||
be implemented as described, so one of the two has to move — most likely the
|
||||
diagram, since the lock already prevents the actual double-spend hazard, but that
|
||||
is a decision, not a cleanup.
|
||||
|
||||
### B-71 — `.env` points `MASTER_KEY_PATH` at a second copy of the master key
|
||||
|
||||
CLAUDE.md's deployment section prescribes pointing `MASTER_KEY_PATH` at the
|
||||
|
||||
Reference in New Issue
Block a user