Tags: runcycles/cycles-ap2-python
Tags
Release v0.3.0 — wire-shape fix for production cycles-server compatib…
…ility
This is the first version of runcycles-ap2 verified to work against a
production cycles-server (v0.1.25.x). The v0.1/0.2 placement of AP2
routing context on `Action.policy_keys` followed the
`cycles-action-kinds-v0.1.26.yaml` extension, but production servers
do not yet implement that extension and rejected the field with
`400 Malformed request body`.
Changed (wire shape only):
- AP2 routing context (`host`, `currency`, `payment_protocol`) moved
from `Action.policy_keys` to `Subject.dimensions["payee_website"
/ "payment_currency" / "payment_protocol"]`. These values live on
the base protocol's Subject schema, so the wrapper now works
against current production servers.
Unchanged:
- Public Python API surface (`cycles_guard_payment`,
`cycles_guard_payment_async`, all exception classes, all class
attributes, `AP2Mandate`, `RuntimeAuthorityReceipt`).
- Exception contract.
- Idempotency-key derivation
(`ap2:open_mandate:{...}` / `ap2:tx:{...}`).
- All v0.2.0 features (async, commit-uncertainty handling,
cancellation handling).
- Client-side `RuntimeAuthorityReceipt.policy_keys` still carries
the canonical shape — dashboards / dispute evidence pipelines
are unaffected.
Tests:
- 148 unit tests + 5 live integration tests against
cycles-server v0.1.25.18, all green.
- 99.21% line coverage. ruff + mypy strict clean.
Still planned for v0.4+:
- Multi-currency
- `payment.refund` convenience helper
- Opt-in flag to re-emit `Action.policy_keys` once the
v0.1.26 extension lands server-side
- Server-verifiable runtime-authority receipt
Release v0.2.0 AsyncGuardedPayment + cycles_guard_payment_async — asyncio variant of the v0.1.0 sync guard. Same exception contract plus one async-only condition (asyncio.CancelledError mid-commit → AP2GuardCommitUncertain with error_code=COMMIT_CANCELLED). See CHANGELOG.md for the full v0.2.0 entry.