Uh oh!
There was an error while loading. Please reload this page.
refactor(forges): bind account-scoped adapter operations via getAccountAdapter - #3266
Merged
Merged
Conversation
MemberAuthor
What do you think of these ergonomics @setchy? I'm a bit on the fence with the naming. Chained, |
setchy
commented
Sep 4, 2026
Member
let me soak on this PR for a moment 🧽 |
Replace recursive runtime binding and mapped signatures with explicit typed operations, preserving the generic followUrl contract. Cover same-forge account isolation and bound Gitea requests, failures, and response types.
afonsojramos
commented
Sep 5, 2026
MemberAuthor
@setchy just replaced the recursive binder and mapped types with explicit typed bindings. The account-bound API now stays the same, and followUrl preserves its generic contract throughout. |
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 freeto 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.



Summary
ForgeAdapterkeeps the forge-wide members (login flows, token validation, display helpers), and a newForgeAccountAdaptercarries the account-scoped operations with no account parameter.accountOps, still taking the account explicitly; the shape is derived fromForgeAccountAdapterby a mappedWithAccounttype so the two cannot drift.getAccountAdapter(account)in the registry binds them, so call sites readgetAccountAdapter(account).listNotifications()instead ofgetAdapter(account).listNotifications(account).adapter.accountOps.*, and adds registry tests for the binding (argument forwarding, nested capability bundles, optional bundles, call-time member lookup).Follows up on the double-passing pattern raised in #3255 (comment).
Notes
ForgeAccountAdapter.followUrl<T>stays generic on the bound side; on the implementation side the type parameter erases tounknown, matching the trust boundary that existed before.