docs: cite AP2 open_mandate_hash v0 conformance vectors#8
Conversation
Add a pointer in the Background section to the 7-vector set seeded by @chopmob-cloud at AP2 discussion #262 — covers the JCS canonicalization edges (object-key order, array order, optional-field presence, currency minor-unit, Unicode NFC-vs-NFD) that catch open_mandate_hash divergence in practice. Vectors are independently reproducible under rfc8785@0.1.4; community-seeded, not AP2-spec-blessed. Also tightens the parenthetical on the existing discussion #262 bullet — the spec-level questions got substantive answers in the thread, so the old "a couple of spec-level questions posted" wording was stale. No public API, wire-shape, or protocol-conformance change — below the AUDIT.md and CHANGELOG.md update thresholds.
|
@amavashev — thanks for the citation, and especially for the careful scoping in both the PR body and the README wording. Calibrated downstream pickup is more valuable than puffery. One small follow-up worth flagging now that the dust has settled on the validation: between the moment you opened this PR (2026-05-19 16:16Z, single-impl Python If you'd like, the README citation could swap Separately filed AP2 #265 as a formal proposal to adopt the v0 set as spec-level conformance fixtures — keeps the question you raised in #262 ("do we have, or plan to publish, conformance vectors for — AlgoVoi (chopmob-cloud) |
Summary
open_mandate_hashdivergence in practice: object-key order, array order, optional-field presence, currency minor-unit, Unicode NFC-vs-NFD.Why
cycles-ap2-pythonconsumesopen_mandate_hashrather than deriving it (the hash arrives on theAP2Mandate), so the canonicalization rule lives upstream — in the AP2 SDK, credential provider, or merchant flow that originates the open mandate. The v0 vectors give those upstream implementers a deterministic target, and they give our docs a precise citation when readers ask "how isopen_mandate_hashsupposed to be derived?"Honest scope (mirrored from the README wording)
rfc8785@0.1.4. AP2 maintainers haven't (yet) folded the vectors into the repo as a conformance fixture.rfc8785@0.1.4. A second canonicaliser implementation (e.g.gowebpki/jcs) producing the same JCS bytes would be the natural next escalation.AUDIT.mdandCHANGELOG.mdupdate thresholds — no entries added.Test plan
expected_open_mandate_hashequals SHA-256 of its declaredexpected_jcs_bytes_b64(7/7).rfc8785@0.1.4on Python 3.14.3, applied to eachmandate_body, reproduces bothexpected_jcs_bytes_b64andexpected_open_mandate_hashbyte-for-byte (7/7).object_key_order(001 ≡ 002),array_order(001 ≠ 003),optional_fields(001 ≠ 004),unicode_normalisation(006a ≠ 006b).code/sdk/schemas/ap2/open_checkout_mandate.jsonexists ingoogle-agentic-commerce/AP2(shae3d9cafa…, 4147 bytes).