The mint seam takes a grant, not two callables - #290
Merged
Conversation
czpython
force-pushed
the
oauth-grant-seam
branch
3 times, most recently
from
August 19, 2026 14:45
d046d10 to
262c6d2
Compare
mint_access_token(key=..., grant=...) now takes one object carrying the two grant verbs: load_refresh_token() and save_refresh_token(rotated). The engine's real dependency is a grant it can read fresh under the refresh lock and rotate durably; two loose callables atomized that noun and let a loader for one row pair silently with a saver for another. The lock and commit contracts now live on the grant parameter's documentation. McpOauthGrant carries the two verbs itself; the MCP mint wrapper passes the row. Redis keys, lock and cache semantics, and all observable MCP behavior are unchanged. The engine tests use small grant stubs, keep every behavioral assertion, and add one the seam now affords: an error raised by a grant's own verb surfaces unmasked.
czpython
force-pushed
the
oauth-grant-seam
branch
from
August 19, 2026 15:01
262c6d2 to
39b9633
Compare
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.
OauthClient.mint_access_tokennow takeskey=andgrant=— one object carrying the two grant verbs — instead of theload_refresh_token=/save_refresh_token=callable pair from #285.The engine's real dependency is a grant: something it can read fresh under the refresh lock and rotate durably. Two loose callables atomized that noun — nothing in the signature said they refer to the same grant, and the lock/commit contracts attached to two disconnected parameters. The verbs are now:
grant.load_refresh_token() -> str— runs under the refresh lock; must observe rotations other processes committed (read past the identity map).grant.save_refresh_token(rotated)— must have committed before returning; the provider already invalidated the old token. The cache fills only after it returns.The shape is duck-typed and documented on the parameter — no Protocol, no base class, no runtime registration.
McpOauthGrantcarries the two verbs itself and the MCP mint wrapper passes the row. Redis keys, lock/cache semantics, and all observable MCP behavior are unchanged; the MCP tests pass untouched. The extension-author docs show the verbs as methods on the author's own grant row.The engine tests pass small grant stubs, keep every behavioral assertion, and add one the seam affords: an error raised by a grant's own verb surfaces unmasked.
The callable kwargs are removed outright — they are days old with no external consumers.
Verification: ruff check + format clean, editable proof-extension install, full backend suite green (1277 passed).
🤖 Generated with Claude Code