Skip to content

ADFA-4128 (6/11): quickbuild:core — deploy and reload - #1718

Open
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-05-core-detectionfrom
feature/ADFA-4128-qb-06-core-deploy
Open

ADFA-4128 (6/11): quickbuild:core — deploy and reload#1718
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-05-core-detectionfrom
feature/ADFA-4128-qb-06-core-deploy

Conversation

@fryanpan

@fryanpan fryanpan commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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

Gets a finished build into the running app by the fastest route that is still correct, and keeps a record of where the time went.

flowchart LR
    route["a classified route<br/>(detection, PR 5)"] --> orch
    subgraph s6["<b>This PR: core slice 2 — deploy and reload</b>"]
        orch["LiveReloadOrchestrator (domain/reload)<br/>one build in flight, supersede,<br/>generations forward-only<br/><i>LiveReloadOrchestrator.kt</i>"] --> pol["DeployPolicy<br/>hot reload vs component restart;<br/>restart rule + logsender exemption<br/><i>DeployPolicy.kt</i>"]
        pol --> ch["DeployChannel + ProxyAppConnections<br/>(service/deploy)<br/>uid-checked binder, payloads as fds<br/><i>DeployChannel.kt</i>"]
        pol --> ln["ProxyAppLauncher<br/>relaunch + retry<br/><i>ProxyAppLauncher.kt</i>"]
        tel["telemetry (domain + service)<br/>stage timings, metrics ports"]
    end
    ch -- "AIDL (runtime's .aidl, PR 4)" --> rt["proxy app runtime"]
    sess["session state machine (PR 8)<br/>drives and observes"] -.-> orch
    classDef thisPrBox fill:#dbeafe,stroke:#93c5fd,color:#1e3a5f
    classDef inPr fill:#ffffff,stroke:#64748b,color:#000
    class s6 thisPrBox
    class orch,pol,ch,ln,tel inPr
Loading

What to review

  • DeployPolicy.kt — restart rule; the logsender exemption saves +477 ms per save. Line-by-line.
  • LiveReloadOrchestrator.kt — one build in flight; a newer edit supersedes the older.
  • DeployChannel.kt — payloads as read-only fds over uid-checked binder; generation-matched reports.
  • ProxyAppLauncher.kt — relaunch and retry; rides here because deploy owns relaunch.
  • Fakes.kt — test fixture grows across PRs 6-8; no production code moves.
  • John's C12 and C3's deploy-policy half folded in as fixes.

How this PR Was Tested

  • 21 test files, including SaveCoalescingE2eTest, a JVM end-to-end over fakes.
  • [verified 2026-08-21] At this cut: :quickbuild:core:test — runs slices 1-2's tests (the module's compiled-so-far set): 36 suites, 472 tests per variant across all 6 variants, 0 failures, 0 errors. Coverage 95.6% line / 90.3% branch.

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

Package Line Branch Note
…quickbuild.data 100.0% 87.5%
…quickbuild.domain.reload 98.7% 92.1%
…quickbuild.domain.session 100.0% no branches
…quickbuild.domain.telemetry 97.1% 98.6%
…quickbuild.service.deploy 92.0% 83.8% binder-side paths, device-tested
…quickbuild.service.provision interface only, no executable lines
…quickbuild.service.telemetry 91.7% 100.0%
NON-UI TOTAL 95.6% 90.3% 1,028 lines, 544 branches

22 source files in the diff, all 22 measured. The service.provision row is ProxyAppLauncher.kt alone, an interface for which JaCoCo emits no counter.

Slice 2 of 4 — next: provisioning (PR 7).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W

@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-06-core-deploy branch from 7b2269e to d5ac48d Compare August 22, 2026 06:41
fryanpan and others added 2 commits August 21, 2026 23:56
…icy, the binder deploy channel, stage-cost telemetry

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
…icity, deploy teardown

- Swallowed linkToDeath failure -> a binder dead at connect is reported as an
  instant death and never registered, so deploys fail fast as NotConnected
  instead of timing out with the freezer hold kept on a dead package (tests:
  "a binder that is dead at connect is not left registered", "a dead binder's
  stale connect retry does not clobber a live registration").
- Non-atomic connect watch/registration -> registration and death watch are one
  @synchronized step, and death delivery shares the lock, so the watched binder
  and the registered target can never disagree and a death cannot slip between
  link and registration (test: "a death delivered while connect is registering
  still clears the target"; wiring: "a reconnect moves the watch, and firing it
  clears the registration").
- Restart payload retained with hot-swap metadata -> a confirmed restart deploy
  clears the retained set instead of retaining it, so a reconnect catch-up can
  never hot-swap over the live restart-sensitive component and falls back to
  the forced rebuild (test: "a confirmed restart deploy clears the retained
  payload instead of retaining it").
- endSession leaving an in-flight deploy to time out -> endSession routes
  through onDisconnected, whose Disconnected report answers the waiter
  deterministically (test: "ending the session answers a deploy awaiting its
  verdict as Disconnected").
- Adjacent minor: disconnect() now unlinks the death watch, so no stale
  recipient outlives a graceful disconnect (test: "a graceful disconnect
  unlinks the death watch").

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-06-core-deploy branch from d5ac48d to df57d58 Compare August 22, 2026 07:05
@fryanpan
fryanpan marked this pull request as ready for review August 23, 2026 02:31

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

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