Skip to content

ADFA-4128 (8/11): quickbuild:core — session orchestration - #1720

Draft
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-07-core-provisioningfrom
feature/ADFA-4128-qb-08-core-orchestration
Draft

ADFA-4128 (8/11): quickbuild:core — session orchestration#1720
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-07-core-provisioningfrom
feature/ADFA-4128-qb-08-core-orchestration

Conversation

@fryanpan

@fryanpan fryanpan commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Part 8/11 of the stacked split of #1669 (requested by Akash). Base: feature/ADFA-4128-qb-07-core-provisioning. Stack overview + review mechanics: PR 1 (#1713). Terms are defined in quickbuild/README.md (lands in PR 1).

Ties the pieces into a single session the user can follow: one thing happening at a time, every stage narrated, and stale work never applied late.

flowchart LR
    subgraph s8["<b>This PR: core slice 4 — session orchestration</b>"]
        red["SessionReducer (domain/session)<br/>total reducer; one session thread<br/><i>SessionReducer.kt</i>"] --> mgr["QuickBuildSessionManager<br/>(service/session)<br/>wires watcher, classifier,<br/>orchestrator, daemon, deploys<br/><i>QuickBuildSessionManager.kt</i>"]
        mgr --> runner["ProxyAppBuildRunner<br/>(service/provision)<br/>rebaseline + relaunch<br/><i>ProxyAppBuildRunner.kt</i>"]
    end
    det["detection (PR 5)"] --> mgr
    mgr --> dep["deploy + reload (PR 6)"]
    mgr --> prov["provisioning + daemon client (PR 7)"]
    app[":app ports via Koin (PR 11)"] -.-> mgr
    classDef thisPrBox fill:#dbeafe,stroke:#93c5fd,color:#1e3a5f
    classDef inPr fill:#ffffff,stroke:#64748b,color:#000
    class s8 thisPrBox
    class red,mgr,runner inPr
Loading

What to review

  • SessionReducer.kt — the total state machine; unhandled pairs are no-ops. Line-by-line.
  • QuickBuildSessionManager.kt — epoch guards discard stale daemon and build results.
  • ProxyAppBuildRunner.kt — rebaseline now relaunches the reinstalled app; not yet device-verified.
  • A tap supersedes the build it replaces and is then consumed.
  • John's session findings (C1, C4, C5) folded in as fixes.
  • Fakes.kt — completes with FakeQuickBuildHistoryStore.

How this PR Was Tested

  • 14 test files, including QuickBuildSessionManagerTest and PayloadDeployerEdgeTest.
  • [verified 2026-08-21] At this cut: :quickbuild:core:test — the full core suite, all four slices: 65 test files (63 suites; RoomAppFixture and Fakes are fixtures, not suites), 1,102 tests per variant across all 6 variants, 0 failures, 0 errors [measured on mac]. Coverage 97.7% line / 90.3% branch.

Coverage (JaCoCo at the stack tip, single run):

Package Line Branch Note
…quickbuild.domain.session 99.8% 98.6%
…quickbuild.service.provision 97.5% 83.0% Gradle-invocation branches
…quickbuild.service.session 96.8% 87.8% cancellation races
NON-UI TOTAL 97.7% 90.3% 1,400 lines, 722 branches

11 source files in the diff, all 11 measured.

Slice 4 of 4 — the core module is complete at this cut.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W

@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-08-core-orchestration branch from b04677c to 8b4431e Compare August 22, 2026 06:41
fryanpan and others added 2 commits August 21, 2026 23:58
…ate machine tying the slices together; every transition narrated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
…ploy-throw containment

Stale cancel flag: the Prebuilding stop latches proxyAppBuildCancelIssued with no teardown to clear it, so a later "Restart session" skipped the Gradle cancel -> clear the flag whenever an effect launches new session work (StartProvisioning / StartProxyAppPrebuild / RunProxyAppRebuild); covered by "a session started after a prebuild-stop still gets its Gradle build cancelled on restart".

Unguarded provision-success tail: retention clear, generation adoption and watcher.start ran unguarded on a scope with no CoroutineExceptionHandler -> wrap the tail in the same try/catch -> ProvisioningFailed boundary the rebuild arm already uses; covered by "a watcher-start throw in provisioning's success tail fails the session instead of escaping".

Collector-killing deploy throw: resendRetainedPayload called deploy.deploy() bare inside the init-launched reconnect collector, so one throw disabled catch-up for the process -> contain non-cancellation throwables as a failed re-send (return false, fall back to the catch-up build); covered by "a throwing re-send is contained - catch-up falls back now and stays alive for later reconnects".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-08-core-orchestration branch from 8b4431e to c502024 Compare August 22, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant