Replies: 1 comment
-
|
@timaxorum — this is genuinely open in the spec text, but it's been operationally answered a few different ways in production. Sharing what AlgoVoi landed on after hitting the same problem with our APM (Agentic Payment Mandates) work, plus how it compares to the other patterns surfacing in the AP2 thread. The short answerCumulative state lives wherever a single party sits on the path of every settlement. Of your 5 candidate layers, only one of them actually has that property in a given deployment, and the answer changes by deployment topology — which is why the spec is correctly silent on this. For AlgoVoi specifically: we sit on the path because we pay the merchant on-chain from our hot wallet and bill the human via a prepaid GBP balance. The cumulative counter lives in a single Postgres row keyed on Operational walkthrough — AlgoVoi APMWe hit your exact $200/week scenario (with £ rather than $ because UK regulator). What we landed on after working through the same 5 candidates you list: Three orthogonal cumulative caps, enforced atomically on every balance-increase path:
Worst-case human exposure: £300. Worst-case per-mandate exposure: £100. Cumulative across 7-day window: tracked in TOCTOU protection is the critical bit your 5-candidates question implicitly raises. Every payment-decision path holds an advisory lock on Lazy period reset: when the period boundary is crossed (weekly window in your example), the next pay call resets Comparing to your 5 candidate layersYour candidates fail (in our deployment) for specific reasons worth surfacing:
The 6th candidate (which we landed on): whichever single party is on the path of every settlement. For AlgoVoi that's the gateway. For @hilarl's RIVR proposal in #255, it's the on-chain token contract. For a Stripe-equivalent deployment, it would be the merchant-side payment processor. The pattern that emerges is: cumulative state is a property of the topology, not a property of AP2. AP2 correctly stays silent on where, because the right answer depends on the deployment shape. What AP2 COULD codify (non-normatively) is the rule "cumulative-state custodian MUST be on the settlement path; if no single party is, the deployment cannot enforce cumulative constraints". Cross-pattern comparisonThe interesting design split surfacing in the AP2 thread is:
@Ectsang touched on this in #207 (cross-merchant budget enforcement for IntentMandates) — same problem at a different cell of the matrix. The 7-day-window example in your post and the cross-merchant example in #207 are the same underlying cumulative-state question framed at different cardinalities (time vs space). Join-key question (your #3)Yes, For cross-platform reconciliation (e.g. RIVR's on-chain counter + AlgoVoi's platform ledger both seeing the same mandate), the join key should be Where this could land in AP2 spec textProbably not as normative requirement (since the deployment topology determines where the counter goes), but possibly as informative pattern documentation: enumerate the 4 cumulative-state patterns (platform-side ledger / on-chain authority / network-mediated / separate downstream), the topology each requires, and the join-key convention. Implementers reading the spec would then have a checklist: "which of these 4 patterns does my deployment fit, and what's my join-key story?" Happy to draft this as a follow-on note to AP2 sample docs if there's appetite, since the same content directly extends the regulatory worked example from x402-foundation/x402#2322 §3 and aligns with the cross-rail composition discussion at #255. cc @hilarl for the RIVR cross-pattern reference; cc @Ectsang re #207 cross-merchant variant. Useful discussion — the silence-in-spec is right but the silence-in-docs is the gap worth filling. AlgoVoi (chopmob-cloud) -- Acquisition enquiries: https://docs.algovoi.co.uk/acquisition |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Reading through the v0.2 spec and samples, I've been trying to map how state evolves across the mandate lifecycle when a single Intent Mandate authorizes multiple fulfillments over time. I think there's a design question worth surfacing — possibly already settled and I missed it, possibly genuinely open. Posting here rather than as an Issue because it feels more like "where does this concept live" than "something is broken."
The scenario I keep coming back to:
A user signs an Intent Mandate authorizing their agent to spend up to $200 on groceries over the next 7 days. The agent fulfills three carts during that window — $80 Monday, $60 Wednesday, $90 Friday. Each individual Cart Mandate, taken in isolation, is consistent with the Intent. Cumulatively, the third transaction breaches what the user authorized.
Each fulfillment produces its own Cart and Payment Mandate, properly signed and chain-valid. The verifier checking the third payment sees a well-formed mandate chain. The breach is only visible if the verifier knows about the prior two fulfillments — which means somebody is maintaining cumulative state against the Intent Mandate ID across the lifecycle.
The spec is (correctly, I think) silent on where this happens. But the silence creates a question:
Is cumulative-constraint enforcement considered in scope for AP2 itself, or is it explicitly downstream of the protocol — something every implementer is expected to build into their merchant-side, agent-side, or network-side infrastructure independently?
If it's downstream, is there a canonical place for it to live? Candidates I can think of:
If multiple parties end up tracking partial views, what's the reconciliation story? Is there an expectation that the Intent Mandate ID becomes a join key across systems that currently don't share state?
The reason I'm chewing on this: the same Intent Mandate ID that proves authorization upstream becomes the natural causation key for whatever system records what actually happened downstream. Whether that downstream system is part of AP2's scope or pointedly outside it shapes a lot of design choices for anyone building near this protocol.
Curious whether this has come up in design discussions, whether there's a documented stance, or whether it's deliberately left to implementers. Either answer is useful — I just want to understand the intended boundary before assuming.
— Tim
Beta Was this translation helpful? Give feedback.
All reactions