Commit 76af048
committed
markets/: round three — dispute economics, session revocation, real takedown
Five adversarial critics, third pass. The findings that mattered:
Disputing was still a free refund option on any lost bet, and the
winner paid for it (measured by the security reviewer on a live server:
loser 0.00, winner -67.33). Three things were wrong at once -- the bond
came back on any void, only the FIRST disputer paid one because the
status latched, and an unadjudicated dispute defaulted to void. Now
every holder posts their own bond, it scales with the position, it
returns only when an operator sustains the dispute, and silence falls
through to the oracle's resolution instead of cancelling the market.
Added a re-resolve verb too: voiding an incorrect resolution refunds the
loser and wipes out whoever was actually right.
Journal rotation plus the store's own printed recovery advice was a
silent total ledger wipe -- rotation retires the live journal, so
"delete the snapshot to rebuild from journal.jsonl" rebuilt from an
empty file into a brand-new zero-balance ledger. Replay now spans every
segment, and so does the operator's agent-history query, which was
returning a confidently empty answer to "what happened to my account".
Sessions could not be revoked: sign-out cleared the cookie but the token
is self-verifying, so a captured copy worked for the full 12 hours.
Tokens now carry an epoch that sign-out, freeze and revoke bump.
Also: the oracle could void its way out of a dispute it was losing, and
could cancel a live market's open bets; admin.adjust accepted 1e303 and
turned a balance into Infinity that the journal replayed as null
forever; idempotency keys had no request fingerprint, so a reused key
swallowed a different trade and reported success; the WebSocket origin
check was claimed in round one and never actually existed; boot replay
was quadratic; hide left the withdrawn market's text served at its URL.
UI: the wrong-outcome cash-out bug survived on the detail page (the
handler ignored the index it rendered); the pick leaked across markets
so a 12-outcome selection could render a ticket on "undefined"; a
transient 429 ejected the user mid-bet-slip and looked like a logout;
the WS pagination guard was inverted. Plus the disclosures that were
simply absent -- the dispute bond is now stated before it is taken, the
credits are labelled play money, markets carry rules and a visible
oracle, and Void takes a typed confirmation like Resolve.
62 plugin tests, 39 compose tests.1 parent 1c0c756 commit 76af048
6 files changed
Lines changed: 396 additions & 120 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
163 | | - | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | 100 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
| |||
0 commit comments