Repository navigation
M4: e-stop adversarial demo and race proof - #61
Merged
Merged
Conversation
New demos/demo_estop.py: four asserted beats on the mock rail - revoked before spend (BLOCKED, zero rail calls), e-stop inside authorize (revoked_during_auth, hold voided, reservation released, no escrow), e-stop after authorize (in-flight escrow voided, late delivery refused already_voided), over-authority (over-cap and wrong merchant blocked rail-silent). Ends with audit summary and per-beat ledger chain VERIFIED; exits non-zero if any invariant breaks. New tests/test_estop_race.py (4 tests): the three revocation timings as one claim plus a subprocess pin of the demo. Suite 406 passed, 1 skipped, plain and python -O (402 baseline + 4 new). demo.py and demo_admission.py still VERIFIED; ruff clean.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
M4 (due Oct 30) had every piece in tree but no single judge-runnable adversarial demo tying them together: the e-stop race was proven in scattered tests, the audit view existed, and the over-authority block lived in the gate tests. This PR ships that demo and pins it.
demos/demo_estop.py(offline, mock rail, no credentials): four asserted beats. (1) Revoked before the spend: BLOCKED reason=revoked, zero PayPal calls. (2) E-stop lands insidepaypal.authorize: post-authorize recheck kills the spend (revoked_during_auth), the hold is voided, the cap reservation is released, no escrow is registered so capture is unreachable. (3) E-stop after authorize: in-flight escrow voided, late delivery refused (already_voided), audit summary shows $0 captured. (4) Over-authority: $60 against a $50 cap and a merchant outside the allowlist both BLOCKED at the gate, rail-silent, framed as refused admission, not declined settlement. The demo exits non-zero if any invariant breaks; each beat ledger chain verifies.tests/test_estop_race.py(4 tests): the three revocation timings as one claim on the mock rail, plus a subprocess pin of the demo (exit 0, key reasons present, 4 VERIFIED chain lines).Verification
python -O(402 baseline on main + 4 new). The 1 skip is pre-existing.python demo.py: chain VERIFIED (16 receipts).python demos/demo_admission.py: both chains VERIFIED.python demos/demo_estop.py: all four beats pass, four chains VERIFIED.Honest limits