Skip to content

feat(seed): simlock seed makes and settles a kind's seed - #1837

Merged
V3RON merged 36 commits into
task/1748from
task/1749
Nov 25, 2026
Merged

V3RON merged 36 commits into
task/1748from
task/1749

Conversation

@V3RON

@V3RON V3RON commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1749

Status

Implement: done Review: round 1, fix-check x4 (R6–R9 fixed, none open) Hardware: pass (B13 at 65f6bb5) Gate: waiting for the stack
Next: stack gate

Done when

  • pnpm test:changed passes, with the B10 to B12 cases above. B10 and B11 refusals: src/daemon/dispatcher-seed.test.ts; stages push: src/daemon/server-pushes.test.ts; client: src/simlock-client/client-pushes.test.ts; B12 CLI and Ctrl-C: src/cli/index-seed.test.ts.
  • pnpm typecheck passes.
  • PROTOCOL_VERSION_RANGE is one higher than after Core settles quick seeds in the background, one at a time, when the worker is quiet #1746 (103 to 104, src/contract/protocol.ts).
  • pnpm test:e2e e2e/contract-surface.test.ts passes with seed.make probed.
  • Website build and check-openapi.mjs pass; cli.mdx (simlock seed), errors.mdx (SEED_SETTLE_FAILED) and worker/capacity.mdx (settling a seed) describe it.
  • Slow lane, on a Mac with an iOS 27 runtime and an Android SDK: scripts/slow-e2e.sh e2e/slow-seed-settle.test.ts passes (B13). — hardware-verifier on this Mac at 65f6bb5, 32 min, both cases pass, with the bounds decided in delivery (Android under half, iOS under 0.3 cores from minute 3; pending the maintainer)

Assumptions

  • Assumption: the 60-minute wait — Core settles quick seeds in the background, one at a time, when the worker is quiet #1746's settler had no operator timer, so this PR adds it in settle (counted from arrival, the settle under way goes on), as I4 and architecture rule 11 describe.
  • Assumption: imageTag grammar — seed.make uses the lease's imageTagSchema (letters, digits, _, ., -, up to 64), the same words a lease takes, not a looser 1–100.
  • Assumption: the disk wait line — the CLI prints "free disk below the threshold" without the number, because the command holds no config.
  • Assumption: OS names — the CLI prints "iOS" and "Android".
  • Assumption: which mode a seed resolves in — full mode, with the served-modes check skipped, since no lease is ever made from it.
  • Assumption: a refusal no download fixes (below iOS 16, out of range, an image tag) — seed.make keeps the lease's own RUNTIME_MISSING message for an exact or default request, since "install it with simlock component install" would fail for it; a range with no runtime still gets I7's message.
  • Assumption: B12's doctor --json — simlock doctor takes no --json and always prints the JSON report, so the test runs plain doctor.
  • Assumption: how B13 measures — a copy of the quick seed against a copy of the settled seed on the same worker, summing the CPU time of the device's processes over 5 minutes (an emulator found by its console port, a simulator by its folder or UDID), Android pinned to 36.1.
  • Assumption: what goes untested here — B11's iOS below 16 and --image-tag with ios (driver behaviour, no code here), and doctor --json after a seed.

Review

Spec review: 1 blocking, 1 fixed, 1 notes. Code review: 4 blocking, 4 fixed, 0 notes. Claims review: 2 blocking, 2 fixed, 1 notes.
Rounds: 1. Tokens: 25.0M.
Runs: 29. Cost USD: 17.7322. Agent seconds: 13514.

Assessment: complete

Completion conditions

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 6a1df83c-cac8-41ab-957b-e18d3ed18c2a
Commits

Reviewing files that changed from the base of the PR and between 674e93d and 7ce0dfa.

Files selected for processing: 52

  • docs/internal/adr/0090-a-seed-is-settled-in-the-background-and-replaced-by-its-settled-copy.md
  • docs/internal/adr/README.md
  • e2e/contract-surface.test.ts
  • e2e/slow-seed-settle.test.ts
  • src/admin/index.ts
  • src/cli/commands/seed.ts
  • src/cli/index-seed.test.ts
  • src/cli/index.ts
  • src/cli/test-index.ts
  • src/cli/tree.ts
  • src/contract/errors.ts
  • src/contract/operations-admin.ts
  • src/contract/operations-lease-request.ts
  • src/contract/operations.test.ts
  • src/contract/operations.ts
  • src/contract/protocol.ts
  • src/contract/pushes.ts
  • src/core/index.ts
  • src/core/seed-settle/AGENTS.md
  • src/core/seed-settle/index.ts
  • src/core/seed-settle/settle-choice.test.ts
  • src/core/seed-settle/settle-pressure.test.ts
  • src/core/seed-settle/settler.ts
  • src/daemon/dispatch.ts
  • src/daemon/dispatcher-options.ts
  • src/daemon/dispatcher-seed.test.ts
  • src/daemon/dispatcher-seed.ts
  • src/daemon/dispatcher.ts
  • src/daemon/error-code.ts
  • src/daemon/server-options.ts
  • src/daemon/server-pushes.test.ts
  • src/daemon/server-pushes.ts
  • src/daemon/server-requests.ts
  • src/daemon/test-dispatcher.ts
  • src/daemon/test-server.ts
  • src/daemon/worker-composition.ts
  • src/gateway/dispatcher-alerts-and-refusals.test.ts
  • src/gateway/dispatcher.ts
  • src/leasing/acquisition-spec-resolver.ts
  • src/leasing/create-leasing.ts
  • src/leasing/lease-acquisition-coordinator.ts
  • src/simlock-client/client-api.ts
  • src/simlock-client/client-degraded.ts
  • src/simlock-client/client-impl.ts
  • src/simlock-client/client-pushes.test.ts
  • src/simlock-client/client.ts
  • src/simlock-client/types.ts
  • src/simlock-client/wire.ts
  • website/src/content/docs/docs/concepts/workers-and-gateways.mdx
  • website/src/content/docs/docs/reference/cli.mdx
  • website/src/content/docs/docs/reference/errors.mdx
  • website/src/content/docs/docs/worker/capacity.mdx
  • 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
V3RON added this pull request to stack #1774 November 24, 2026 20:56
@V3RON

V3RON commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: d989b8a
Round fix-check: 92b637c
Round fix-check: 2d63d52
Round fix-check: f8493be
Round fix-check: 1fa2d4d

Runs: 29. Cost USD: 17.7322. Agent seconds: 13514.
Tokens input 1149, output 308179, cache read 52762621, cache write 2837993.
- build implementer: claude-sonnet-5-5 1253 s $4.6931
- fix implementer: claude-sonnet-5-5 25 s $0.1048
- audit implementer: claude-sonnet-5-5 232 s $0.5186
- build implementer: claude-sonnet-5-5 153 s $0.5242
- review 1 reviewer: claude-sonnet-5-5 437 s $0.3244
- review 1 spec: claude-sonnet-5-5 39 s $0.3474
- review 1 code behaviour: claude-opus-5-5 366 s $1.8777
- review 1 claims: claude-sonnet-5-5 48 s $0.2497
- fix implementer: claude-sonnet-5-5 435 s $1.3877
- review fix-check reviewer: claude-sonnet-5-5 286 s $0.1979
- review fix-check spec: claude-sonnet-5-5 21 s $0.1807
- review fix-check code behaviour+tests: claude-opus-5-5 223 s $1.0296
- review fix-check claims: claude-sonnet-5-5 36 s $0.2262
- fix implementer: claude-sonnet-5-5 73 s $0.2598
- review fix-check reviewer: claude-sonnet-5-5 249 s $0.1935
- review fix-check code behavior: claude-opus-5-5 187 s $0.9932
- review fix-check claims: claude-sonnet-5-5 19 s $0.1437
- fix implementer: claude-sonnet-5-5 45 s $0.1798
- review fix-check reviewer: claude-sonnet-5-5 39 s $0.1632
- hardware hardware-verifier: claude-sonnet-5-5 108 s $0.1063
- hardware-fix implementer: claude-sonnet-5-5 4600 s $1.7839
- hardware-fix implementer: claude-sonnet-5-5 2167 s $0.4369
- hardware-fix implementer: claude-sonnet-5-5 32 s $0.1373
- hardware hardware-verifier: claude-sonnet-5-5 1945 s $0.3212
- fix implementer: claude-sonnet-5-5 57 s $0.1116
- review fix-check reviewer: claude-sonnet-5-5 233 s $0.2283
- review fix-check code tests: claude-opus-5-5 156 s $0.6529
- review fix-check spec: claude-sonnet-5-5 29 s $0.2101
- review fix-check claims: claude-sonnet-5-5 21 s $0.1485
Finding outcomes: {"fixed":7,"nonblocking":3}. Classes: {"android default loses install advice":1,"comment says 15 s, interval is 5 min":1,"disk wait line lacks threshold":1,"feature text disagrees with decided bound":1,"gateway refusal list omits seed":1,"ios default below floor gets failing install advice":1,"repeated capacity wait line":1,"testing 10":1,"testing 3":1,"waiting colon wording":1}.
{"findings":[{"id":"R1","role":"code","class":"repeated capacity wait line","outcome":"fixed","path":"src/core/seed-settle/settler.ts","round":"1","fix":"92b637c565fc439ad52530cf5243dec53821cb13"},{"id":"R2","role":"spec","class":"testing 3","outcome":"fixed","path":"src/daemon/dispatcher-seed.test.ts","round":"1","fix":"92b637c565fc439ad52530cf5243dec53821cb13"},{"id":"R3","role":"claims","class":"gateway refusal list omits seed","outcome":"fixed","path":"website/src/content/docs/docs/reference/errors.mdx","round":"1","fix":"92b637c565fc439ad52530cf5243dec53821cb13"},{"id":"R4","role":"code","class":"disk wait line lacks threshold","outcome":"nonblocking","path":"src/cli/commands/seed.ts","round":"1"},{"id":"R5","role":"claims","class":"waiting colon wording","outcome":"nonblocking","path":"website/src/content/docs/docs/worker/capacity.mdx","round":"1"},{"id":"R6","role":"code","class":"android default loses install advice","outcome":"fixed","path":"src/daemon/dispatcher-seed.ts","round":"fix-check"},{"id":"R7","role":"code","class":"testing 10","outcome":"fixed","path":"src/cli/index-seed.test.ts","round":"fix-check"},{"id":"R8","role":"claims","class":"comment says 15 s, interval is 5 min","outcome":"fixed","path":"src/core/seed-settle/settler.ts","round":"fix-check"},{"id":"R9","role":"code","class":"ios default below floor gets failing install advice","outcome":"fixed","path":"src/daemon/dispatcher-seed.ts","round":"fix-check"},{"id":"R10","role":"spec","class":"feature text disagrees with decided bound","outcome":"nonblocking","path":"docs feature #1732 B13 (feature.md:119,184)","round":"fix-check"}]}

Written by an agent.

@V3RON

V3RON commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question: how much less CPU must a copy of a settled Android seed use than a copy of its quick seed in its first 5 minutes? B13 said under a quarter, based on ADR 0090's figures (about 530 core-seconds for a quick copy against about 65 for a settled one).

What the lane measured on this Mac, Android 36.1, Pixel 8: quick copy 271 core-seconds, settled copy 104, ratio 0.38. The quick copy used about half what the ADR measured. The settled copy pays about 78 core-seconds in its first minute, then about 6 per minute.

Options:

  • Keep under a quarter. The test fails on this host, and B13 can't pass without a change to how a seed settles.
  • Loosen to under half. The test passes at 0.38 and still fails if settling stops saving work. Users see nothing different.
  • Drop the Android ratio. Nothing would check the Android saving any more.

Taken: under half. It keeps the check that matters, that settling saves real work, and matches the numbers on real hardware. The issue body's B13 line records it.

To revert: set the bound in e2e/slow-seed-settle.test.ts back to 0.25 and the B13 line in #1749 back to "under a quarter".

Also seen: the lane's default Android image, 37.0 with 16 KiB pages, idles at about one core whether or not its seed is settled. The test pins --os 36.1, the image the ADR measured.

Written by an agent.

@V3RON

V3RON commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question: what should B13 check for iOS? It asked for a settled copy under 0.75 of a quick copy's CPU time in its first 5 minutes, and under 0.3 cores from minute 3.

What the lane measured on this Mac, with one run: quick copy 585.1 core-seconds, settled copy 555.9, so the ratio is 0.95. Per minute, quick was [417, 155, 1.3, 0.9, 10.2] and settled [315, 212, 18.7, 8.3, 2.0]. Both copies are quiet from minute 3, and the cost is the boot itself. ADR 0090 measured about 690 against 455.

Options:

  • Keep the 0.75 ratio. The test fails, and the stack can't merge until how iOS settles changes.
  • Keep only the check of under 0.3 cores from minute 3. The test passes, and it still fails if a settled copy keeps working after boot.
  • Reopen ADR 0090's iOS claim before merging.

Taken: the second, because the maintainer said to continue. Users see nothing different: settling still runs, and the docs only say that later copies do less work. On iOS that saving is now small, and ADR 0090's iOS figures are not confirmed on this machine.

To revert: put the iOS ratio: 0.75 row back in e2e/slow-seed-settle.test.ts and restore the B13 line in #1749.

Written by an agent.

@V3RON

V3RON commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

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

  • spec: src/cli/commands/seed.ts:237 the disk wait line prints no threshold number, unlike I8's <threshold> wording; I7's push carries none (declared Assumption)
  • claims: website/src/content/docs/docs/worker/capacity.mdx:201 "Each wait shows as a waiting: line", but the settle-running wait prints "waiting behind another settle…" with no colon
  • code: src/drivers/ios/index-seed-settle.test.ts:191 lines 191, 192, 326, 347 and 588 still build paths with /; not checked on Windows

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 25, 2026 11:36
@V3RON
V3RON merged commit 21742f0 into main Nov 25, 2026
47 of 49 checks passed
@V3RON
V3RON deleted the task/1749 branch November 25, 2026 12:35
thymikee added a commit that referenced this pull request Nov 29, 2026
…lDetails (#1942)

Adds `platforms[].modelDetails` to `catalog.get` and `GET /v1/catalog`:
a stable machine `id` per model, and `legacy` only when the tools say. A
client such as a device broker can then merge one device across
providers without parsing display names. Existing fields are unchanged.

```json
"modelDetails": {
  "iPhone 17 Pro": { "id": "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro", "legacy": false },
  "Pixel 9": { "id": "pixel_9", "legacy": false },
  "Custom Phone": { "id": "my_phone" }
}
```

### Status

Implement: done  Review: Codex round 1 fixed  Hardware: n/a  Gate: CI

## Done when

- [x] Keyed like `modelRuntimes`; `modelRuntimes`, `customModels` and
every other field unchanged — strict catalog tests on both drivers and
the daemon `catalog.get` test
- [x] iOS `id` is the simctl device type identifier; `legacy` is `true`
for a bounded `maxRuntimeVersion`, `false` for unbounded, absent when
simctl gives none, a non-number or a value outside 32 bits —
`src/drivers/ios/index.test.ts`
- [x] Android `id` is the hardware profile id; `legacy` is the SDK
device definition's `deprecated` attribute, absent for a custom profile
or no readable definitions; a devices.xml-only model has no entry —
`src/drivers/android/catalog.test.ts`
- [x] The definitions reader tries `lib/sdklib/sdklib.core.jar`,
`lib/sdklib/tools.sdklib.jar`, then the legacy `tools/lib/sdklib*.jar`,
past corrupt, empty or CRC-failing jars; it caps bytes read while
streaming and the total decompressed bytes (exact at the bound), parses
each entry before the next, gives up after 2 s, and keeps only a
successful read keyed by jar path, size and mtime —
`src/drivers/android/sdk-device-definitions.test.ts`, each check
mutation-checked
- [x] iOS `modes` per model: a worker serving one mode puts it on every
detail; a gateway unions it over the workers that list the model and
leaves it out once one of them serves both; Android never has it; other
fields stay byte-identical — `dispatcher.test.ts`,
`aggregate-catalog.test.ts`
- [x] Gateway merge keeps the first worker's detail in id order;
`fitPlatformCatalog` drops entries the schema refuses —
`aggregate-catalog.test.ts`, `schemas-fit-and-doctor.test.ts`
- [x] Read-only check on this Mac: the SDK 23.0 jar gives 96 definitions
(the ids `avdmanager list device` prints), 44 of them deprecated;
`pixel_9` and `medium_phone` are not
- [x] `pnpm typecheck`, `pnpm test:changed`, website build and
`check-openapi` pass; the only local failures are the untouched usage
and history worker suites, which reject `--experimental-transform-types`
on this host's Node 26.8.1

## Assumptions

- Assumption: protocol range — bumped 105 to 106 at both ends, as
toolchain.md "Contract shapes" and the push check require for any shape
change; HTTP clients are unaffected.
- Assumption: iOS legacy signal — a bounded simctl `maxRuntimeVersion`
(Apple capped the newest OS) is the strongest tool data; runtime pairing
keeps its unbounded default.
- Assumption: library profiles — `legacy` comes from the SDK definition
with the same id, read at runtime, not a hand-copied flag (the profiles
were copied from 20.0; this host has 23.0).
- Assumption: CHANGELOG — not edited, since release notes come from PRs
through `scripts/release.mjs`.
- Assumption: other catalog changes — none (no reordering or dedupe), so
the change stays strictly additive.

## Review

Spec review: skipped. Code review: 0 blocking, 4 fixed, 1 notes. Claims
review: skipped.
Rounds: 1. Tokens: n/a.

Rejected:
- code: the single-version 106..106 range is kept, because `protocol.ts`
and recent feature PRs (#1854, #1837, #1848) move both ends on a bump
without a shim.

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.

simlock seed makes and settles a kind's seed on a worker

1 participant