Skip to content

M4: e-stop adversarial demo and race proof - #61

Merged
FetchDoge merged 1 commit into
mainfrom
m4/estop-adversarial-demo
Oct 22, 2026
Merged

FetchDoge merged 1 commit into
mainfrom
m4/estop-adversarial-demo

Conversation

@FetchDoge

Copy link
Copy Markdown
Owner

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 inside paypal.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).
  • README: one line added to the demo list.

Verification

  • Full suite: 406 passed, 1 skipped, plain and 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.
  • Ruff clean on the two new files.

Honest limits

  • Beats 1-3 exercise behavior already proven in test_authority_layer.py (P1-1) and test_estop_ledger_order.py; the new value is the unified demo, the three-timings claim in one file, and the demo pin. The demo-path test is the test that fails without this PR.
  • Mock rail only, like demo_admission.py. No sandbox or live-wire claim is made.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T14:38:36.870093Z 3b7da0a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@FetchDoge
FetchDoge merged commit 6bd49ce into main Oct 22, 2026
9 checks passed
@FetchDoge
FetchDoge deleted the m4/estop-adversarial-demo branch October 22, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant