feat(checkout): mandate-evaluation extension for AP2 TTL at admission (resolves #512)#540
Conversation
|
@aeoess — good catch, and it deserves to be pinned explicitly so two implementers can't diverge.
Why the mandate ref is the one that binds: the admission decision answers "was this grant live at the point of use," so the evidentiary anchor has to be the mandate being evaluated — To remove the ambiguity, I'll tighten §5.1/§5.3 in
This and the compact-vs-detached JWS pinning (§6.1) are exactly the two implementer footguns worth nailing before the fields freeze — thanks for flagging both. |
|
That resolves it. Using The §5.1 / §5.3 wording you laid out, with Pinning compact versus detached JWS per representation in §6.1 closes the other one. Those were the two places where two conformant implementers could have diverged on the same logical receipt. Both are pinned now. Thanks for tightening the text. |
Description
Adds a vendor-namespace Checkout capability extension,
com.merchantstamp.mandate-evaluation(
docs/specification/mandate-evaluation.md), defining when AP2 mandate liveness is evaluatedrelative to the UCP Checkout state machine and how that admission decision is made auditable.
Resolves the
complete_in_progressTTL ambiguity reported in #512, landing the design converged in#512 / #515 with @aeoess, @chopmob-cloud and @GarethCOliver.
Normative model
complete_in_progress; MUST run toterminal; later expiry MUST NOT abort or shorten the settlement window.
complete_in_progress; terminatescanceledwith theexisting
mandate_expirederror.mandate_expiredis admission-time only — it MUST NOT fire once incomplete_in_progress(the normative fix for [Bug]: Undefined behavior when AP2 mandate TTL expires during complete_in_progress #512).
Compose on AP2, don't fork. No new lifecycle status, error code, receipt envelope, signature
algorithm, or key-discovery mechanism. The outcome is an AP2-aligned terminal receipt (
Success,or
Error+mandate_expired); admission evidence rides as a namespaced extension field(
evaluated_at,reference,checkout_id,mandate_exp,result) on that receipt.evaluated_atand
mandate_expare Unix epoch integer seconds, consistent with AP2 core.Binding by content — recomputable tuple
{reference, checkout_id, evaluated_at}; no forwardreceipt_id. Digest rules kept in two separate cases (SHA-256 over the exact signedserialization for the artifact handle, with compact-vs-detached JWS pinned per representation;
JCS-then-SHA-256 for unsigned recomputable content). Signing reuses the existing UCP/AP2
Message Signatures profile (ES256 required, ES384/512 optional, JCS,
signing_keys[]).Scope. Point-of-use admission + post-admission lifecycle only. Pre-TTL withdrawal / revocation /
status propagation — including the closed-enum
EXPIREDcancellation receipt — is out of scope andlives on a separate track.
Category (Required)
Related Issues
Resolves #512
Refs #515
Checklist
!for breaking changes).Notes
Working-Draft vendor extension; conformance tests to follow in
Universal-Commerce-Protocol/conformance. Open items tracked in §7 of the doc (receipt-addressingconformance vectors, validity-window commitment, receipt delivery placement, FIDO push-down of
evaluated_at, DCQL/OpenID4VP capability-query alignment).cc @GarethCOliver @aeoess @chopmob-cloud — opening as text to iterate on, per
#515 (comment).