Skip to content

chore: raise runcycles dependency floor to >=0.5.0 - #11

Merged
amavashev merged 1 commit into
mainfrom
chore/runcycles-0.5.0
Jul 27, 2026
Merged

chore: raise runcycles dependency floor to >=0.5.0#11
amavashev merged 1 commit into
mainfrom
chore/runcycles-0.5.0

Conversation

@amavashev

Copy link
Copy Markdown
Contributor

What

Raises the runcycles dependency floor in pyproject.toml from >=0.4.1 to >=0.5.0.

Why

runcycles 0.5.0 (live on PyPI) ships durable commit retries (runcycles/cycles-client-python#89):

  • an on-disk commit journal with replay across process restarts,
  • a POST /v1/events fallback for commits that land after reservation expiry,
  • 429/auth commit handling that never releases already-spent budget.

Scope

Floor bump only — no guard code changes. GuardedPayment / AsyncGuardedPayment call client.commit_reservation(...) directly (sync guard.py _handle_commit, async sibling), and the SDK's new retry engine engages via its lifecycle/streaming layers, so this package's documented commit-uncertainty doctrine is untouched: transport/5xx/terminal-status commit outcomes still raise AP2GuardCommitUncertain (no auto-release), unrecognized 4xx still releases and raises AP2GuardCommitFailed.

Recommended follow-up (not in this PR): evaluate adopting CommitRetryEngine/AsyncCommitRetryEngine for the guard's two commit sites, mirroring runcycles.lifecycle._handle_commit classification (429 with Retry-After passthrough; 401/403 journal-never-release; 410/RESERVATION_EXPIRED to the /v1/events fallback; codeless 4xx journaled). This is deliberately not bundled here: for a payments guard it changes the meaning of the exception contract — transient failures would become "journaled, will settle in the background" rather than "uncertain, caller MUST reconcile" — so the AP2GuardCommitUncertain mapping and its docs need an honest redesign in a dedicated PR.

Verification

  • pytest --cov=runcycles_ap2 against runcycles==0.5.0: 148 passed, 5 skipped (live-server integration tests, skipped by design without CYCLES_BASE_URL), 99.21% coverage (gate fail_under = 95).
  • AUDIT.md and CHANGELOG.md updated.

runcycles 0.5.0 ships durable commit retries: an on-disk journal with
replay, a POST /v1/events fallback for commits that land after
reservation expiry, and 429/auth commit handling that never releases
spent budget (runcycles/cycles-client-python#89).

Floor bump only — no guard code changes. The guard calls
commit_reservation directly, so the documented commit-uncertainty
exception contract (AP2GuardCommitUncertain / AP2GuardCommitFailed)
is unchanged. Adopting the SDK's commit retry engine is a candidate
follow-up; it would shift transient commit failures from "uncertain,
caller reconciles" to "journaled, will settle" and needs its own
reviewed change to the exception mapping and docs.

Verified against runcycles==0.5.0: 148 tests passed (5 integration
tests skipped without a live server), 99.21% coverage (gate 95%).
@amavashev
amavashev merged commit acdb54a into main Jul 27, 2026
6 checks passed
@amavashev
amavashev deleted the chore/runcycles-0.5.0 branch July 27, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant