refactor(walletsolana): keyless Source construction; export RPC caller seam#1
Draft
sigma wants to merge 1 commit into
Draft
refactor(walletsolana): keyless Source construction; export RPC caller seam#1sigma wants to merge 1 commit into
sigma wants to merge 1 commit into
Conversation
…r seam Source's SessionKey is only used by the read path (Snapshot/VerifyNow/ Refresh, which watch one session's accounts); the write and dashboard methods (Build*, SubmitSigned, the local signers, SessionsByOwner) take the session per call. New no longer requires a SessionKey: it is validated only when present (a malformed key still fails fast), and the read methods return errNoSession when it is absent. This drops the placeholder zero key 'mosey web' fabricated for the multi-session dashboard, and the unused SessionKey the CLI signing path passed. Export the RPC injection point as Caller / Options.Call (was the unexported Options.call) so the risky account-layout wiring (PDA derivation, message compilation, getProgramAccounts decode) is testable from outside the package; add black-box tests exercising it. dialWS stays unexported (read-path push, out of scope). Candidate #6 from the architecture review, scoped down: no struct split — the consumer role interfaces (sessionLister, governor) already give callers small surfaces. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sigma
pushed a commit
that referenced
this pull request
Jul 18, 2026
…llet seam (candidate #5, ungrilled)" description="Hoist resolveCaps + the co-owner rule (rootIsOwner && caps==AllCaps, auth/wallet.go:235) and Fold orchestration behind the wallet seam. NOT yet grilled. Must build on the unified caps type -> depends on Epic #1."
This was referenced Jul 18, 2026
Draft
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
Candidate #6 from the architecture review ("Split walletsolana.Source's four roles"), scoped down after a grilling session. No struct split — the consumer role interfaces (
sessionLister,governorincmd/mosey) already give read/governance callers small surfaces. Instead this fixes the two real defects the review surfaced:Keyless construction.
Source.SessionKeyis a read-path input (it selects which session's on-chain accountsRefreshwatches). The write/dashboard methods —Build*,SubmitSigned, the local signersGrant/TransferOwnership/BumpEpoch, andSessionsByOwner— take the session per call and never read it.Newno longer requires it:Snapshot/VerifyNow/Refreshreturn a newerrNoSessionwhen it's absent.mosey webfabricated for the multi-session dashboard (web.go), and the unusedSessionKeythe CLI signing path passed (session.go).Exported RPC seam. The JSON-RPC injection point is now the exported
Callertype +Options.Call(was the unexportedOptions.call), so the risky account-layout wiring — PDA derivation, message compilation,getProgramAccountsdecode — is testable from outside the package.dialWSstays unexported (read-path WS push, out of scope).Tests
call:test sites toCall:.walletsolana/external_test.go(package walletsolana_test) proving both capabilities from outside the package: keyless construction +errNoSession, malformed-key fail-fast, and drivingSessionsByOwnerthrough the exportedCallseam.go build ./...,go test ./walletsolana/... ./cmd/..., andgo vetall pass.Not doing
No
SnapshotSource/Signer/TxBuilder/Directorysplit, no facade, nodialWSexport. NoCONTEXT.mdchange (Calleris a technical seam, not domain vocabulary) and no ADR (the constructor change is trivially reversible and unsurprising).🤖 Generated with Claude Code