Repository navigation
Description
Part of #1732.
Scope
An iOS worker settles its quick seeds in the background: after a kind's first lease, once the worker is quiet, the seed is replaced by a settled copy, and later iOS leases boot about a third quieter. doctor --json shows each iOS seed's settled and leases.
If this goes wrong, a user would notice an iOS lease handed a device that still names another simulator's folders, a seed missing after a restart mid-settle, or an orphan simulator left in the sources set.
Technical spec
Commit fb42676.
Rows
- Behaviours: B14, B15, B16, B17
- Stored state: S1, S2
- Interfaces: I1, I2, I3, I10, I11 (implements or uses)
- Existing code: X1, X2, X3, X4, X5, X6, X7
Facts
| # | Fact | Source |
|---|---|---|
| F1 | ios_source_data's state CHECK allows making and ready only, and the schema owner is at version 4 |
src/drivers/ios/source-data.ts:17, :45 |
| F2 | One ready seed per spec_key is a partial unique index |
src/drivers/ios/source-data.ts:30-31 |
| F3 | #swapLineage reads filesOf(seed.sourceId) after the clone's turn |
src/drivers/ios/seeds.ts:508-516; fixed by #1731 |
| F4 | A boot is simctl boot, bootstatus -b, then listapps polled every 1 s on one deadline |
src/drivers/ios/simulator-boot.ts:33-45, :88-90 |
Modules touched
Searches: ios_source_data, findReadySeed, makingRowsOfKindBefore, makingRowsNotMadeBy, #swapLineage, destroySeedsOf, listSources, bootAndWait. Files: src/drivers/ios/seeds.ts, source-data.ts, index.ts, the driver's AGENTS.md, and the iOS create options in src/daemon/driver-discovery.ts (the processTable #1746 adds to the context).
Rules in play
- ios manual "Seeds (ADR 0061)": the settle copy goes through the same mark, LaunchServices drop and lineage swap as a provision; the new seed is recorded after flushing its WALs.
- ADR 0076 §1: no source boots; the copy boots. §2: the new seed's lineage is
[copy UDID, ...seed lineage]. - ADR 0090 §3: the swap is one transaction; the old seed is deleted in its turn.
- ADR 0048: under
deviceSet: defaultthe copy is marked and its clipboard sync turned off, as a throwaway is. - drivers manual "A driver imports only core and ports": readings go through the
ProcessTableport.
Tests
Driven through IosSimctlDriver with the fake simctl harness, modelled on src/drivers/ios/index-seed-provision.test.ts and index-save-source-lifecycle.test.ts.
- B14: a plain lease adds one to its seed's lease count: plain provision; a baseline copy; a clone that fails; a seed from before this feature; a first lease of a new kind
- B15:
settleSeedreplaces a quick seed with its settled copy: idle at 181 s; idle only at 900 s; busy at 900 s; boot times out; aborted mid-reading; not a ready quick seed; a clone of the old seed in flight;deviceSet: default; a process-table read that fails is skipped and the 900 s cap still ends the wait (decided in delivery, pending the maintainer); the quick seed's delete fails after the swap committed:settleSeedanswers the new seed, logs the failure, and the retired row and its simulator stay for the next start's sweep (decided in delivery, pending the maintainer) - B16: a restart's leftovers of a settle are swept: another process's settle row; a retired quick seed's row; a make of the kind during this process's settle;
removeComponentof a runtime ends its settle row and its retired quick seed's row (X5; decided in delivery, pending the maintainer) - B17:
ensureSeed: fresh; stale; none; two calls at once
Done when
pnpm test:changedpasses, with the B14 to B17 cases above.pnpm typecheckpasses.- The iOS driver manual's Seeds rules say what a settle does.
- On a Mac,
scripts/slow-e2e.sh e2e/slow-ios-source-isolation.test.tspasses (copies still name only their own folders).
Out of scope
- Core's scheduling (Core settles quick seeds in the background, one at a time, when the worker is quiet #1746);
simlock seed(simlock seed makes and settles a kind's seed on a worker #1749).
Depends on
- Core settles quick seeds in the background, one at a time, when the worker is quiet #1746
- iOS clone can skip its lineage swap when its seed is deleted between clone and swap #1731
Written by an agent.
Activity
test: a settle whose boot times out leaves the quick seed and deletes…
feat(ios): a settle that ends early gives back its copy and its row (#…
test: a settle that is aborted, or asked of a source that is no ready…
feat(ios): a settle stops when aborted and refuses a source that is n…
test: a settle ends at the first idle reading, or at 900 s busy, and …
test: a settle under deviceSet default marks its copy and turns its c…
feat(ios): a settle under deviceSet default turns its copy's clipboar…
test: a plain lease adds one to its seed's lease count (#1747)
feat(ios): a plain lease counts on its seed and listSources reports s…
test: a make within the process never sweeps a settle, and a restart …
8 remaining items
refactor(ios): plantSource marks a seed's settled flag and lease coun…
test(ios): a failed process-table read is skipped and a runtime's rem…
chore(ports): drop the stale failNext suppression (#1747)
fix(ios): a settle keeps a making row for every simulator it could no…
docs(ios): the settle rule says what a failed delete leaves, within t…
refactor(ios): the settle's give-back and retire steps leave settleSe…
github-actions commentedon Nov 23, 2026
Claim released: no activity for 3 days. The label is unchanged; the next agent starts from the branch and the last handoff.
docs(ios): the iOS manual fits its size cap after the merge (#1747)
fix(test): the settle test scripts the clipboard read-back a boot now…
fix(test): the settle tests spell the launchd_sim folder as the drive…
fix(test): the settle tests spell the sources set and simlock home as…
feat(core): core settles quick seeds in the background, one at a time…
feat(ios): an iOS worker settles its quick seeds in the background (#…