docs(rfc): preserve payment grants through 402 challenges - #215
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@AlvaroAlonso-0, I would appreciate your review of this proposal. The final revision passes the full build and repository checks: https://github.com/aadopii/ack/actions/runs/34476191309 |
AlvaroAlonso-0
left a comment
There was a problem hiding this comment.
Besides the leaked private keys it looks good to me.
| runs-on: ubuntu-latest | ||
| env: | ||
| ANTHROPIC_API_KEY: secret | ||
| ISSUER_PRIVATE_KEY: "0xa45f5c566918ef954e8c200a96b14092cabcd69cb8a1a132804a2b8cbb8489a1" |
A seller may authenticate an agent before returning a
402 Payment Requiredchallenge. If that first check redeems a single-use payment grant, the paid retry is rejected even though the purchase has not started. This proposal clarifies the boundary between checking permission and consuming it.Related to #179. This PR targets
ack-id-core-rfcso the diff contains only the proposed v2 changes. It addresses an ambiguity in the draft, not a demonstrated defect in a shipped v2 SDK.Proposed behavior
iss,jti) before settlement submission or the protected operation begins.The change adds ACK-Pay §4.1 and a cross-reference in ACK-ID §8. There are no new token types or headers. Nine Vitest lifecycle examples are wired into the docs workspace's test command. A path-scoped RFC workflow runs the existing build/check commands for this work, including PRs targeting the RFC branch; the existing Check workflow targets only
main.Validation and limits
The full
pnpm run buildandpnpm run checkpassed on the final revision in GitHub Actions. Local installation hit a disk-space limit, so validation ran in the fork. The new examples cover challenge/retry ordering, invalid inputs, changed authorization, concurrent requests, uncertain outcomes, completed operations, and issuer-scoped grant IDs.The examples model ordering with explicit validation results and a single-process in-memory claim. They do not implement cryptographic verification, distributed storage, or live settlement. Production adapters still need durable shared state and rail-specific recovery. A crash after claiming a grant can leave an operation incomplete; this proposal does not promise exactly-once settlement or delivery.
This is separate from the existing review points about record retention through clock skew and receipt reissuance after payment. No published SDK behavior or dependency versions change.
AI assistance: I used Claude Code, Hermes, and Codex for source review and proposal development. Codex prepared the RFC edits, executable examples, and validation workflow, and ran the checks.