Repository navigation
docs(replay): say what replay re-checks for a revoked permit - #469
PetrefiedThunder wants to merge 1 commit into
Conversation
The replay contract in failure-semantics.md said replay access re-validates the permit, wallet and key binding "so a revoked permit or a different key cannot read the stored receipt". The revoked-permit half is false: validate_replay_access checks the wallet, the key binding and the signature, and by design not revocation, expiry or remaining budget. A call made before a revoke replays its stored result and receipt. Replace the sentence with the text proposed in issue #434 part 2, and add a test that pins it: after a successful governed upstream call and a revoke, the same request with the same key returns the stored result and the same receipt_id with no new dispatch or charge, and a new idempotency key is refused with permit_revoked. Refs #434 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GyhDYGi5fpiBGFHez9fhbH Signed-off-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Generated by Claude Code |
Codex Review Summary: ✅ CompletedThis 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. |
|
READY FOR QA f58d650 This is a readiness marker, not a QA verdict. I post no verdict. Head: What it changes: part 2 of #434. The patch has 2 files:
No product code changes. The new test pins behavior that is already on main; it is not a regression test for a code fix. CI on this head: as read at 11:46 UTC on 2026-12-05, 34 check runs are complete: 26 success, 4 skipped, 1 neutral, 3 failure. Local check on this head, Python 3.12, SQLite:
Bots and reviews: Cursor Bugbot and the Not tested: replay after expiry or after the budget is spent. The new text states those cases by reading Related: this PR says I merge nothing. Generated by Claude Code |
Summary
Part 2 of #434. The replay contract in
gateway/docs/failure-semantics.mdsaid:The revoked-permit half is false.
validate_replay_access(gateway/app/services/permits.py) checks that the permit belongs to the wallet, the key binding and the signature. By design (its docstring) it does not check revocation, expiry or remaining budget. A call made before a revoke replays its stored result and receipt.The sentence is replaced with the text proposed in #434:
One test is added to pin the documented behavior, because #434 found no test that replays a completed call after revocation.
test_governed_upstream_replay_after_revocation_returns_stored_receipt:receipt_id, with no new dispatch and no new charge;permit_revoked.The key-bound case is already covered by
test_governed_upstream_replay_remains_bound_to_permit_api_key.No product code changes.
Related issues
Refs #434. Part 1 is in #468, which is not merged, so this PR does not close the issue.
Area and license
spec/,verifier/,sdk/python/,sdk/typescript/,integrations/, andexamples/are Apache-2.0.gateway/contributions are under FSL-1.1-ALv2 (Fair Source).Spec changes
gateway/docs/, notspec/)Validation
gateway/as CI runs them (Python 3.12, pytest 9.2.0):pytest -q --ignore=tests/judge_e2e -m "not production_trust" -n auto --timeout 300: 6726 passed, 105 skipped, 1 xfailed.TRUST_MODE_ENABLED=true ALLOW_LEGACY_UNPERMITTED_MCP=false ENABLE_PROOF_SURFACES=false pytest -q --ignore=tests/judge_e2e -m production_trust --timeout 300: 12 passed.failure-semantics.md, plustests/test_mcp_upstream_governed.py: 215 passed.checkandformat --checkclean on the touched test file.Risk and compatibility
Documentation and one test only. Not tested: replay after expiry or after the budget is spent. The new text states those by reading
validate_replay_access.Contributor checklist
Generated by Claude Code
Note
Low Risk
Documentation-only correction plus a regression test; no runtime or auth logic changes in the diff.
Overview
Fixes the replay contract in
failure-semantics.md, which previously claimed that a revoked permit could not read a stored receipt on replay. The doc now matchesvalidate_replay_access: replay re-checks wallet ownership, key binding, and permit signature only; revocation, expiry, and remaining budget are not re-checked, so a successful call made before revoke can still replay the same result andreceipt_idwithout a second dispatch or charge.Adds
test_governed_upstream_replay_after_revocation_returns_stored_receiptto lock that behavior: revoke after success → same idempotency key still replays; a new key after revoke getspermit_revokedand still does not redispatch.No gateway product code changes in this PR.
Reviewed by Cursor Bugbot for commit f58d650. Bugbot is set up for automated code reviews on this repo. Configure here.