Repository navigation
Make AppClient public only under test-support (#2782 step 7 PR 3) - #3268
Merged
Merged
Conversation
Hosts reach accounts through MarmotAppRuntime. `AppClient` and `MarmotApp::client` are now public only under `test-support`, and `wn sync` runs its one pass through the new `MarmotApp::sync_account`, which keeps an open failure (`AppError`) apart from a pass failure (`SyncFailure` with its partial summary). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 34 minutes. View limit details
|
This was referenced Nov 10, 2026
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.
Problem
AppClient, the directly owned per-account client, is still part ofmarmot-app's public API, so a host can bypassMarmotAppRuntimeand open an account's engine session itself. No host does today:wn syncis the onlyproduction caller, and it opens one only to run one sync pass. Nobody outside the codebase feels this yet.
Fix
AppClientandMarmotApp::clientare now public only undertest-support, asmarmot-session's session has beensince step 5.
wn synccalls a newMarmotApp::sync_account, which opens the same client, runs the same pass andkeeps the two failures apart: an open failure stays an
AppError, and a pass failure stays aSyncFailurewith itspartial summary.
wn syncoutput and exit codes do not change.Verification
cargo fmt --all;cargo clippy --workspace --locked -- -D warnings, then with--all-targets --all-featurescargo nextest run -p marmot-app --features test-policy-overrideson the six sync binaries (12/12), the44
wn-cliintegration tests that runwn sync, the 4commands::syncunit tests, and-p marmot-app --lib(2205/2205)
just binding-docs-gate,just naming-gate;just c-headerleavesmarmot.hbyte-identicalPart of #2782 (step 7 PR 3).
Notes
test-support, it loses theAppClientstruct, its 82public methods and
MarmotApp::client, and gainsMarmotApp::sync_account. Withtest-supportor--all-features, onlysync_accountis new. Rustdoc warnings are unchanged.marmot-uniffiandmarmot-careuntouched, so the bindings and
marmot.hare unchanged.marmot-applists the same 2433 tests with default features. Withtest-policy-overridesitlists one more, the new
sync_accounttest. A self dev-dependency enablestest-support, so-p marmot-apprunsstill build every integration test.
cargo tree:wn-cli,marmot-uniffi,marmot-candagent-connectorenabletest-supportonly through devedges. Since Recovery runner owns account history by default (#2660 phase 4) #2950 the conformance simulator depends on
marmot-appwithtest-supportas a normal dependency,and incident-replay and the campaign runner inherit it from the simulator. None of the three uses
AppClient.AppClientmethods that only tests call carry#[cfg_attr(not(feature = "test-support"), allow(dead_code))].11 of them have no caller in any build. Deleting them is left as a follow-up so the
test-supportsurface staysunchanged here.
sync_accountboxes the pass: one more future layer otherwise exceeded the compiler's layout query depth when itcomputed
wn's command future.marmot-app#2782 PR 1). A trial merge with each is clean.🤖 Generated with Claude Code