Skip to content

Pin the subscription handoff contract on rotate_token (DRU-473) - #462

Merged
czpython merged 1 commit into
mainfrom
commonzenpython/dru-473-spike-determine-subscription-token-validity-after-refresh
Sep 7, 2026
Merged

Pin the subscription handoff contract on rotate_token (DRU-473)#462
czpython merged 1 commit into
mainfrom
commonzenpython/dru-473-spike-determine-subscription-token-validity-after-refresh

Conversation

@czpython

@czpython czpython commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What changed

Three tests on the real rotate_token pin the subscription handoff contract of ADR 0030 in druks-adrs: two mints inside the margin rotate once and read the same token, a failed refresh keeps a live token to serve, and a failed refresh of an expired token leaves nothing to serve.

The record holds the evidence. Anthropic revokes the previous access token at the refresh, at once. OpenAI keeps it valid. Both were measured on the production host on 2026-09-07. The contract: Druks rotates only while the subscription is idle or the token is urgent, then orders a refresh for every live grant through the exchange endpoint that drukbox added in czpython/drukbox#46. DRU-474 and DRU-476 carry the contract.

Fixes DRU-473.

Risk

Tests only. No production behavior, API contract, migration, or documentation change in this repository.

Verification

  • uv run ruff check backend and uv run ruff format --check backend — passed.
  • uv run pytest backend/ after the proof app install — see the checks on this PR for the full suite; the touched file's tests pass locally.
  • Frontend gates were not run; the frontend is unchanged.

🤖 Generated with Claude Code

Two mints inside the margin rotate once and read the same token. A failed
refresh keeps a live token to serve. A failed refresh of an expired token
leaves nothing to serve. The record is ADR 0030 in druks-adrs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@czpython
czpython merged commit e583fba into main Sep 7, 2026
2 checks passed
@czpython
czpython deleted the commonzenpython/dru-473-spike-determine-subscription-token-validity-after-refresh branch September 7, 2026 13:31
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