Conversation
…ing, cumulative budget, hash binding indicator - Raise policyHashSchema minimum from 6 to 12 hex chars (Full Profile SHOULD use SHA-256 / 64 chars) - Add SPA nonce field (auto-generated UUID on createSignedPaymentAuthorization) - Add PolicyGrant signing: createSignedPolicyGrant / verifyPolicyGrantSignature; verifier enforces signature when MPCP_POLICY_GRANT_SIGNING_PUBLIC_KEY_PEM is set (opt-in, backward compatible) - Expose cumulativeSpentMinor in SettlementVerificationContext; thread through pipeline so verifier can enforce alreadySpent + currentPayment <= maxAmountMinor - Add hashBindingChecked to VerificationReport and pipeline output; CLI shows "Hash binding: CHECKED" / "NOT CHECKED (Lite Profile)" accordingly - Flag synthesized PaymentPolicyDecision (_synthesized: true) with console.warn + CLI warning - Update all test policyHash fixtures to 12-char minimum; add new tests for all new features - Update docs/reference/sdk.md with createSignedPolicyGrant, cumulative budget note, new env vars Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
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.
Summary
nonce?: string);createSignedPaymentAuthorization()auto-generates a UUID nonce for one-time-use replay trackingsrc/protocol/policyGrant.tswithcreateSignedPolicyGrant()/verifyPolicyGrantSignature(); verifier enforces signature whenMPCP_POLICY_GRANT_SIGNING_PUBLIC_KEY_PEMis set (opt-in, backward compatible)cumulativeSpentMinor?: stringadded toSettlementVerificationContext; budget check becomesalreadySpent + current > maxAmountMinorwhen providedhashBindingChecked?: booleanonVerificationReport; CLI outputsHash binding: CHECKED(Full Profile) orNOT CHECKED (Lite Profile — intentHash absent)decisionFromSpa()marks result_synthesized: true;bundleToContext()warns; CLI shows⚠ Policy decision: SYNTHESIZED FROM SPAcreateSignedPolicyGrant, cumulative budget usage, 3 new env var rowsNew env vars
MPCP_POLICY_GRANT_SIGNING_PRIVATE_KEY_PEMMPCP_POLICY_GRANT_SIGNING_PUBLIC_KEY_PEMMPCP_POLICY_GRANT_SIGNING_KEY_IDmpcp-policy-grant-signing-key-1)Test plan
npm run build— cleannpm test— 180 tests, 21 files, all passtest/protocol/policyGrant.test.ts— 9 tests covering sign/verify/tamper/enforcementtest/protocol/sba.test.tshashBindingCheckedtests intest/verify/verify.test.tstest/cli/formatReport.test.tswith hash binding and synthesized decision tests🤖 Generated with Claude Code