Pin the subscription handoff contract on rotate_token (DRU-473) - #462
Merged
czpython merged 1 commit intoSep 7, 2026
Conversation
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
deleted the
commonzenpython/dru-473-spike-determine-subscription-token-validity-after-refresh
branch
September 7, 2026 13:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Three tests on the real
rotate_tokenpin the subscription handoff contract of ADR 0030 indruks-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 backendanduv 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.🤖 Generated with Claude Code