Skip to content

fix(android): quote a 4 s boot for a device with a matching clean baseline - #978

Merged
V3RON merged 8 commits into
mainfrom
bug/778
Oct 24, 2026
Merged

V3RON merged 8 commits into
mainfrom
bug/778

Conversation

@V3RON

@V3RON V3RON commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #778

Status

Implement: done Review: round 2 clean at 83f93a4 Hardware: n/a (no slow-lane lines) Gate: running
Next: gate

Done when

  • A prepare boot of a device with a matching persisted clean baseline is quoted at 4,000 ms after a driver restart; unknown, recovery, cold, mismatched-baseline-hash, wipe-pending (needsWipe) and physical-spec boots stay at 70,000 ms (test: "quotes a 4 s prepare boot ...", src/drivers/android/index.test.ts; audit mutations of the hash match and needsWipe checks go red)
  • The lease boot progress and boot timing pass the device and purpose (src/leasing/lease-acquisition-coordinator.ts; src/leasing/create-leasing.test.ts asserts the grant's estimatedBootMs and the booting progress ETA, red when the device is dropped from either call)

Assumptions

  • Assumption: only the lease boot progress and boot timing pass the device; the provisioner's boot progress follows a fresh provision, which has no baseline, so it stays cold.
  • Assumption: a boot estimate that rejects falls back to the cold device-less figure instead of failing the waiter, so an advisory quote never strands a claim or destroys a healthy device (test: "grants a shut-down device with the cold boot figure when its own boot estimate rejects").
  • Assumption: the Android estimate stays 70,000 ms for a mismatched baseline hash, a wipe-pending device and a physical spec; doctor's stalled-transition threshold is unchanged (decided in delivery, pending the maintainer; see the ## Decision comment on Android quotes a 70 s boot for a 4 s snapshot restore #778).

Review

Spec review: 1 blocking, 1 fixed, 1 notes. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 9.1M.
Runs: 12. Cost USD: 3.5356. Agent seconds: 1558.
Assessment: complete

Written by an agent.

@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

1. What does Android quote for a boot that cannot use the clean baseline?

  • A: 70,000 ms for a mismatched baseline hash, a wipe-pending device and a physical spec; 4,000 ms only for a prepare boot from a matching baseline. A user sees the cold quote whenever the fast path is not certain.
  • B: leave these cases unpinned. A later change could quote 4 s for a boot that takes 70 s, and no test would notice.

Taken: A. It is what the triage report proposed ("retain 70,000 for unknown, cold, invalidated, wipe and recovery boots") and what the code does today; the fix run only adds rows to the existing test. Reverting: drop the rows.

2. Should doctor's stalled-transition threshold use the snapshot estimate?

  • A: leave it. src/core/doctor.ts prices only provisioning devices, which have no baseline, so it keeps the 70 s figure. A stuck snapshot boot is still flagged on the cold threshold.
  • B: pass device context to doctor too. More code in core for a symptom the triage could not confirm.

Taken: A, the conservative option and the triage report's advice ("do not lower its thresholds globally"). Reverting: a follow-up issue that passes the device to doctor's estimate.

Recorded on #778 as a ## Decision comment.

Written by an agent.

@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 962fd06
Round 2: 83f93a4

Runs: 12. Cost USD: 3.5356. Agent seconds: 1558.
Tokens input 356, output 91577, cache read 6584904, cache write 515528.
- build implementer: claude-sonnet-5-5 246 s $0.3742
- audit implementer: claude-sonnet-5-5 164 s $0.2818
- fix implementer: claude-sonnet-5-5 177 s $0.3144
- review 1 reviewer: claude-sonnet-5-5 248 s $0.263
- review 1 code both: claude-opus-5-5 171 s $0.8118
- review 1 spec: claude-sonnet-5-5 27 s $0.1241
- review 1 claims: claude-sonnet-5-5 15 s $0.0832
- fix 1 implementer: claude-sonnet-5-5 200 s $0.3566
- review 2 reviewer: claude-sonnet-5-5 168 s $0.2148
- review 2 code-reviewer both: claude-opus-5-5 104 s $0.5318
- review 2 spec-reviewer: claude-sonnet-5-5 14 s $0.0792
- review 2 claims-reviewer: claude-sonnet-5-5 24 s $0.1007
Finding outcomes: {"fixed":2,"nonblocking":1}. Classes: {"architecture 10 one place per decision":1,"failure path must release held claims":1,"unrequested behaviour":1}.
{
 "findings": [
  {
   "id": "R1",
   "role": "code",
   "class": "failure path must release held claims",
   "outcome": "fixed",
   "path": "src/leasing/lease-acquisition-coordinator.ts",
   "round": "1",
   "fix": "bc13bff08"
  },
  {
   "id": "R2",
   "role": "spec",
   "class": "architecture 10 one place per decision",
   "outcome": "fixed",
   "path": "src/drivers/android/index.ts",
   "round": "1",
   "fix": "83f93a4e0"
  },
  {
   "id": "R3",
   "role": "spec",
   "class": "unrequested behaviour",
   "outcome": "nonblocking",
   "path": "src/drivers/android/index.ts",
   "round": "1"
  }
 ]
}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 24, 2026 19:42
@V3RON
V3RON merged commit f648a6b into main Oct 24, 2026
72 checks passed
@V3RON
V3RON deleted the bug/778 branch October 24, 2026 19:49
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.

Android quotes a 70 s boot for a 4 s snapshot restore

1 participant