Skip to content

feat(warm-pool): a daemon stop cancels the Android seed the warm pool is making - #1970

Merged
V3RON merged 43 commits into
mainfrom
task/1968
Nov 30, 2026
Merged

V3RON merged 43 commits into
mainfrom
task/1968

Conversation

@V3RON

@V3RON V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1968

Status

Implement: hardware-fix done Review: fix-check at b1efd89, passed Hardware: pass Gate: not run
Next: finish the PR body, then the gate
Ledger:

  • This check verified previous..head (f37d261..b1efd89), which touches four files: AGENTS.md, console-ports.ts (export only), index.ts and index.test.ts. Its impacts are behavior, test-logic and claims. The change makes #emulatorAttached report an emulator only when one of its console ports is open, so an adb-listed offline emulator whose process is gone no longer keeps the server. No new findings. R1-R7, R9 and R10 stay fixed as the prior ledger records. R8 stays open (code, seeds.ts:565) with its prior disposition and no Fix line from this check.
  • Code lens evidence:
  • Dropping the probe fails only the offline row (expected [] to deeply equal [ { pid: 4242, signal: 'SIGTERM' } ]).
  • Never reporting attached fails only the attached row.
  • The unchanged test file passes 30 tests.
  • tcpProbe is a required option, injected at every AndroidDriver.create site read.
  • NodeTcpProbe.isListening never rejects and is capped at 250 ms, and the probes run inside the existing catch, so a failure falls back to reaping.
  • The other adb devices callers (allocator, adb-tools.ts:84, seeds.ts:445) do not use this decision.
  • Claims lens: the AGENTS.md dispose line, the #emulatorAttached doc comment, the new test comment and the consolePortsInUse export are all true of the code.
    State: {"issue":1968,"branch":"task/1968","pr":1970,"last":"d404f9b0af42","done":"review","mode":"hardware-fix","built":11,"audited":true,"assessment":"complete","hardware":"the Done when line for the new Android case in e2e/slow-warm-pool.test.ts","rounds":["1:3313c78617e253e24e892f1f8e9028c2d4c20208","2:934778913b10dbbea67993a23c5888395319c204","fix-check:review:96fe18219d236bd4cc3e12d14ade179422485ae6","fix-check:review:004bf6c914e7c45585737a7c0cb249b09a1cb745","fix-check:review:180c5798fbfb31cf73daced6e67a5848a6cf5969","fix-check:review:2b8549fb0a1404ea7a598fece741382b0e4e70e9","fix-check:review:2b8549fb0a1404ea7a598fece741382b0e4e70e9","fix-check:review:56d0f6a7d8f6df1dfacd118eb13be1e6f7d15300","fix-check:review:8c967d49206b9b9327d148b61414753ccfba45ee","fix-check:review:f37d26199992809867bd695bc03c7c3304b847dc","fix-check:hardware:b1efd890d4829a854ba4be51391d14acc1516f28"],"round":"fix-check","commit":"b1efd890d4829a854ba4be51391d14acc1516f28","checkedBase":"096519b1bc240bf6f9cda038387d3089b2d249a9","reviewBase":"096519b1bc240bf6f9cda038387d3089b2d249a9","lenses":4,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-1970.muYUbW/findings.json","lane":{"runs":2,"fails":1,"fixes":0,"ok":true,"known":[]},"hw":{"kind":"hardware","pr":1970,"result":"pass","detail":"| fail | busy () | unavailable ()","ran":"e2e/slow-warm-pool.test.ts, 12 min, log /var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T//simlock-slow-e2e-20261130-164804.log, load 13.6 on 12 cores before the run","lines":"the Done when line for the new Android case in e2e/slow-warm-pool.test.ts: pass","evidence":["load warmPool.enabled false, a released simulator and a released emulator are both deleted, and the next lease creates and boots a new one of each: release failed UNKNOWN_LEASE (load 168 on 12 cores during the run); the rerun alone at the head passed (log /var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T//simlock-slow-e2e-20261130-165643.log, exit 0)","RUN path and commit, as you asked:","Worktree: /Users/szymon.chmal/Projects/pitlane/.claude/worktrees/task-1968, branch task/1968, at b1efd890d. Both runs used this worktree, not the session checkout.","Test file: it has 4 tests.","Full run: 3 passed and 1 failed. The failing test is the "warmPool.enabled false" case, which covers both the simulator and the emulator.","Rerun: that test passed when run alone.","Load: it was around 70 to 110 on the rerun too, so the machine stayed heavily loaded. Treat this as a pass on a loaded machine, not a clean one.","Bail flag: I passed --bail=0 on the full run."]}}

Done when

  • pnpm test:changed and pnpm typecheck pass. — CI at b1efd89: unit tests (Linux, Windows) and Quality green
  • Slow lane, real emulator: a new Android case in e2e/slow-warm-pool.test.ts, with no kept seeds and one Android target, runs simlock daemon stop while the seed's emulator boots: the command exits 0, daemon.log has the I4 line, no emulator of this daemon runs, sources/ holds no folder, and nothing listens on the daemon's adb port; a start after it ends with the target's device ready. — lane run 2 at b1efd89: passed
  • src/core/warm-pool/AGENTS.md, src/leasing/AGENTS.md, docs/internal/flows/startup.md and website/src/content/docs/docs/worker/daemon.mdx say what X19 says. — claims reviews
  • A daemon stop sent while the warm pool makes an Android seed nobody else waits for ends without the make finishing, and no emulator of that seed runs after it. — lane run 2, B1 and B6 tests
  • The same daemon started again makes the seed and fills its target. — lane run 2
  • A lease request whose own creation waits for the pool's make still gets its device's creation finished, as today. — B8 tests

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 7 blocking, 6 fixed, 1 notes. Claims review: 3 blocking, 3 fixed, 0 notes.
Rounds: 2. Tokens: 15.0M.
Runs: 54. Cost USD: 21.2949. Agent seconds: 11956.

Rejected:

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

V3RON added 19 commits November 30, 2026 12:17
…s the reservation back; the creation stop test fails on its assertion, not its timeout (#1968)
@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Three questions the audit raised. All concern test coverage or redundant internal checks; none is meant to change what a user sees.

  1. Is the end of a no-signal call pinned (B8)? Options: leave I5's decrement untested, or add a case. Taken: add a case where a finished no-signal call no longer keeps a later aborted make running. Revert: delete the case.
  2. What about abort checks no test makes fail (B6)? Options: keep all untested, remove all, or keep those I5/I6 name and remove the redundant rest. Taken: the last. A named check that scripted processes can reach gets a case; a named one they cannot reach stays and is listed. Revert: restore the removed checks.
  3. Is "the cancel wakes no queue" (I3) pinned? Options: rely on stopCreations() hiding it, or assert it in the pool harness. Taken: assert it. Revert: delete the assertion.

Issue #1968's Tests lines B2, B6 and B8 carry these, marked pending the maintainer.

Written by an agent.

…one after it; the pause between boot probes ends on the abort; a cancelled creation wakes no queue (#1968)
@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Round 1 ran twice on 3313c78: the first run was incomplete. The second run is complete, but did not repeat seven items of the first.

Question: fix only the second run's three findings, or the first run's too? Users would see one of them: an abort during emulator -version or the avdmanager device lookup is counted and logged as a failed creation.

Taken: fix both. The seven items are passed to the fix run as decision: lines, not as review findings, so round 2 stays the next check. They are listed under ## Handoff on #1968: R1, R2's line 705, R3, R4's exit wait, R5, R6, R7. Round 2 should check them, since the resolution ledger does not carry them.

Reverting: revert the commits of that fix run that name them.

Written by an agent.

@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Correction to the decision above: the fix run at 9347789 built none of the seven carried items. They go to an explicit --fix run after round 2, checked by a fix-check.

Written by an agent.

@V3RON

V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 3313c78
Round 2: 9347789
Round fix-check: 96fe182 review
Round fix-check: 004bf6c review
Round fix-check: 180c579 review
Round fix-check: 2b8549f review
Round fix-check: 2b8549f review
Round fix-check: 56d0f6a review
Round fix-check: 8c967d4 review
Round fix-check: f37d261 review
Round fix-check: b1efd89 hardware
extension: 7

Runs: 54. Cost USD: 21.2949. Agent seconds: 11956.
Tokens input 1426, output 487125, cache read 42863167, cache write 3004462.
- build implementer: claude-sonnet-5-5 514 s $1.3505
- build implementer: claude-sonnet-5-5 848 s $1.9724
- audit implementer: claude-sonnet-5-5 696 s $0.6156
- fix implementer: claude-sonnet-5-5 588 s $1.0473
- review 1 reviewer: claude-sonnet-5-5 383 s $0.1691
- review 1 spec: claude-opus-5-5 102 s $0.9945
- review 1 code behaviour: claude-opus-5-5 312 s $1.8646
- review 1 claims: claude-sonnet-5-5 330 s $0.2147
- review 1 reviewer: claude-sonnet-5-5 370 s $0.093
- review 1 spec: claude-sonnet-5-5 51 s $0.3529
- review 1 code behaviour: claude-opus-5-5 274 s $1.761
- review 1 claims: claude-sonnet-5-5 121 s $0.2896
- fix 1 implementer: claude-sonnet-5-5 233 s $0.5239
- review 2 reviewer: claude-sonnet-5-5 184 s $0.0799
- review 2 code tests: claude-opus-5-5 120 s $0.5118
- review 2 claims: claude-sonnet-5-5 45 s $0.1553
- fix 2 implementer: claude-sonnet-5-5 609 s $1.0046
- fix 2 implementer: claude-sonnet-5-5 109 s $0.3572
- review fix-check reviewer: claude-sonnet-5-5 448 s $0.1988
- review fix-check code behaviour: claude-opus-5-5 299 s $0.802
- review fix-check claims: claude-sonnet-5-5 27 s $0.0925
- review fix-check spec: claude-sonnet-5-5 13 s $0.0635
- fix fix-check implementer: claude-sonnet-5-5 70 s $0.1253
- review fix-check reviewer: claude-sonnet-5-5 210 s $0.0902
- review fix-check code behaviour: claude-opus-5-5 101 s $0.5762
- fix fix-check implementer: claude-sonnet-5-5 335 s $0.3537
- fix fix-check implementer: claude-sonnet-5-5 125 s $0.2695
- review fix-check reviewer: claude-sonnet-5-5 216 s $0.1059
- review fix-check code behaviour: claude-opus-5-5 151 s $0.8425
- review fix-check claims: claude-sonnet-5-5 28 s $0.0896
- fix fix-check implementer: claude-sonnet-5-5 194 s $0.388
- fix fix-check implementer: claude-sonnet-5-5 76 s $0.1912
- fix fix-check implementer: claude-sonnet-5-5 72 s $0.176
- review fix-check reviewer: claude-sonnet-5-5 82 s $0.1302
- review fix-check reviewer: claude-sonnet-5-5 253 s $0.1657
- review fix-check code behaviour: claude-opus-5-5 158 s $0.6625
- review fix-check claims: claude-sonnet-5-5 24 s $0.0901
- fix fix-check implementer: claude-sonnet-5-5 38 s $0.0743
- review fix-check reviewer: claude-sonnet-5-5 47 s $0.0834
- review fix-check claims: claude-sonnet-5-5 12 s $0.0508
- hardware hardware-verifier: claude-sonnet-5-5 57 s $0.0667
- fix fix-check implementer: claude-sonnet-5-5 33 s $0.0649
- review fix-check reviewer: claude-sonnet-5-5 114 s $0.069
- review fix-check code tests: claude-opus-5-5 57 s $0.3954
- fix fix-check implementer: claude-sonnet-5-5 67 s $0.0758
- review fix-check reviewer: claude-sonnet-5-5 170 s $0.0846
- review fix-check code behaviour: claude-opus-5-5 80 s $0.3746
- hardware hardware-verifier: claude-sonnet-5-5 81 s $0.0559
- hardware hardware-verifier: claude-sonnet-5-5 1210 s $0.1089
- hardware-fix implementer: claude-sonnet-5-5 250 s $0.3144
- hardware hardware-verifier: claude-sonnet-5-5 779 s $0.0842
- review fix-check reviewer: claude-sonnet-5-5 116 s $0.1084
- review fix-check code behaviour: claude-opus-5-5 63 s $0.4613
- review fix-check claims: claude-sonnet-5-5 11 s $0.051
Finding outcomes: {"fixed":9,"intentional":1}. Classes: {"command starts after stop abort":4,"comment says stop ends shutdown with reason":1,"doc claim false for aborted signal":2,"testing 3":2,"testing 5":1}.
{"findings":[{"id":"R1","role":"code","class":"testing 3","outcome":"fixed","path":"src/drivers/android/seeds.ts:748","round":"1","fix":"934778913","detail":"untested abort check"},{"id":"R2","role":"code","class":"testing 3","outcome":"fixed","path":"src/drivers/android/emulator.ts:346","round":"1","fix":"934778913","detail":"untested required wait"},{"id":"R3","role":"claims","class":"doc claim false for aborted signal","outcome":"fixed","path":"src/drivers/android/adb-tools.ts:142","round":"1","fix":"934778913"},{"id":"R4","role":"code","class":"command starts after stop abort","outcome":"fixed","path":"src/drivers/android/seeds.ts:890","round":"fix-check","fix":"004bf6c91"},{"id":"R5","role":"code","class":"command starts after stop abort","outcome":"fixed","path":"src/drivers/android/emulator.ts:292","round":"fix-check","fix":"180c5798f"},{"id":"R6","role":"code","class":"command starts after stop abort","outcome":"fixed","path":"src/drivers/android/seeds.ts:974","round":"fix-check","fix":"2b8549fb0"},{"id":"R7","role":"claims","class":"doc claim false for aborted signal","outcome":"fixed","path":"src/drivers/android/emulator.ts:375","round":"fix-check","fix":"2b8549fb0"},{"id":"R8","role":"code","class":"command starts after stop abort","outcome":"intentional","path":"src/drivers/android/seeds.ts:565","round":"fix-check","reason":"a seed settle stops as today, out of scope on #1968; the maintainer was told it merges that way and answered 'go to the end'"},{"id":"R9","role":"claims","class":"comment says stop ends shutdown with reason","outcome":"fixed","path":"src/drivers/android/emulator.ts:395","round":"fix-check","fix":"56d0f6a7d"},{"id":"R10","role":"code","class":"testing 5","outcome":"fixed","path":"e2e/slow-warm-pool.test.ts:116","round":"fix-check","fix":"f37d26199","detail":"false skip symlinked dirs"}]}

Written by an agent.

@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question (R8): should #settleCopy pass its signal to the port reservation and to shutdown?

  • Yes: a stop during a settle starts no further adb devices or ownership probe there. A stop in that window could discard a settle whose snapshot is already saved.
  • No: a settle stops as today.

Taken: no, out of scope. The maintainer was shown this recommendation and answered "Continue", which is not an explicit ruling, so #1968 marks the line pending. Reverting: remove that line; the change is then its own issue.

The fix-check at 2b8549f ran no lens on high-risk semantic hunks. It runs again over the same range with its lenses; the script has no path for this, so its prompt is the printed one plus decision: lines.

Written by an agent.

@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: e2e/slow-warm-pool.test.ts:116 a self-looped link, or a link into an unreadable folder, now makes the lane skip

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 30, 2026 16:05
@V3RON
V3RON merged commit 13afddf into main Nov 30, 2026
102 checks passed
@V3RON
V3RON deleted the task/1968 branch November 30, 2026 16:06
V3RON added a commit that referenced this pull request Dec 1, 2026
…ded, and a design is proven and read afresh before its tasks (#2017)

## Why

Handoffs per merged PR rose from 0.5 (Nov 9 to 28) to 1.4 (Nov 30 to Dec
1). Of 23 stops, 8 were the review cap with no real choice to make, 5 a
design resting on something untrue, 3 a review that did not finish, 2 a
delivery script that lost its state.

## What

- `deliver-step.mjs`: an incomplete check keeps its findings and runs
once more for what it left out; `--fix` never replaces an owed check by
a lighter one; a build with no cycle is a decision first, a park the
second time.
- The cap: up to three more fix-checks while no finding stays open from
one check to the next, two more for claims only. `--restart` starts the
count again.
- A second site of one mechanism is marked `sibling of R<n>` and fixed
in one place.
- Specs: what a design rests on about another tool is run; a test state
no test reaches is reached once; one new checker reads the whole design
after the rechecks.

## Not verified

- The reviewer's `missing:` and `sibling of` instructions in a live
delivery; this PR's own review used both.
- The throwaway-test rule: the checker alone missed #1154's case in 2 of
2 runs.

## Proof

```
cap replayed on the review reports of 263 PRs: parks 11 -> 2 (#1988 R23 open twice, #1970 after the lane)
  "while the count falls" instead: 8
real reports through the script: #1968 6 parks -> 1, #1154 park -> decide, #1990 no lost state
38 mutations of the new rules, each fails a test; 104 tests in src/deliver-step.test.ts
spec checker, #1895's approved design: "cites no run" on agent-device 2 of 2 runs (old text 0 of 1)
fresh check of five approved designs, blocking: #1895 12 and 13, #1894 7, #1964 0, #1634 0, #1151 0 and 0
  $1.7 to $4.6 each; two of #1894's read in the code, both true
fix run on #1968's R5, 4 reachable sites: old brief 4,3,4; "one place" 4,4,4 (one run saw another's script)
Haiku search for siblings: 67% found at $0.04, not adopted: checking costs $0.40 a finding, and given
  the list 2 of 3 fix runs changed code the spec puts out of scope
```

## Review

Spec review: skipped. Code review: 8 blocking, 8 fixed, 0 notes. Claims
review: 2 blocking, 2 fixed, 0 notes.
Rounds: 4. Tokens: 1.9M.
Rejected:
- code: R7 a claims finding open twice goes on past the cap
[intentional] — REVIEW.md was wrong and is corrected
Assessment: complete

*Written by an agent.*
V3RON added a commit that referenced this pull request Dec 1, 2026
…ild that counts no cycles can be stuck (#2018)

## Why

Of 334 past fix-checks 202 started no lens, 116 of them over changed
code or test lines; several say REVIEW.md asked for one. Six of those
replayed with the code lens had 13 findings; the coordinators alone had
recorded 3. A build report with no `cycles: <b>/<t>` never counted as
stuck.

## What

- `report-guard.mjs` sends back a fix-check whose fix changed a code or
test line, or whose fix nothing shows, and whose run started no code
lens. `semantic-lines.mjs` reads the fix from git. Merges that keep both
sides, moves, comments, docs, and the number in a timeout, retry or
protocol value need no lens.
- REVIEW.md: a rename is no longer mechanical. A `missing:` rerun over
changed code owes the code lens too.
- A build that lists `remaining` lines must count its cycles;
`deliver-step.mjs` takes one that does not as moving on only when it
lists fewer lines than before.

## Not verified

- A live delivery. The guard ran on one real reviewer run, below.
- Text in a template string or heredoc that starts with a comment's mark
counts as a comment (none of 279 past fixes changed only such lines).

## Proof

```
new guard over the transcripts of 334 real fix-checks: 138 sent back, 0 that had a code lens:
  116 whose fix changed code or test lines, 22 whose fix nothing readable shows (commits gone since)
since 2026-11-29: 8 sent back of 64
replayed with the lens, findings: #1988 2, #1970 2, #1779 2, #1766 4, #1893 2, #1961 1; $0.43 to $0.77 each
  5 of the 13 checked on main, 5 true: 4 by mutation (#1970, #1779, #1766 twice), #1766's unused timeoutMs by reading
live: a reviewer told the fix was mechanical reported no lens, was sent back, ran it: 2 blocking (#1988)
live: a second reviewer ran its lenses unasked: 0 blocking (#1970, where the lens replay had 2)
builds with no cycles count: 6 of 237; 3 listed remaining lines, each incomplete (the guard lets those stop,
  deliver-step.mjs counts their lines)
mutations of every new rule fail a test, but the ones that change nothing
```

## Review

Spec review: skipped. Code review: 9 blocking, 8 fixed, 1 notes. Claims
review: 1 blocking, 1 fixed, 0 notes.
Rounds: 5. Tokens: 2.5M.
Rejected:
- code: R6 a comment in extensionless shell, HTML or an unstarred block
counts as code [intentional] — errs toward one lens, and the header says
so
Assessment: complete

*Written by an agent.*
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.

The warm pool's seed make is cancelled by a daemon stop

1 participant