Repository navigation
Description
Request: #1244
Problem
In the reporter's words: "A lease can only choose slim or full, and the slim categories are fixed per host in ios.slim.categories. So a test that needs one slimmed capability has to take a full simulator, and on our farm that costs a great deal." Their PassKit tests take a full lease only for Wallet, at 5.7 GB, 4.5× one of their slim leases.
Also, MobAI-App/simslim#66 (merged, in simslim v0.14.0) adds a mdm category and moves com.apple.accessibility.axassetsd and com.apple.ClipServices.clipserviced into other. Simlock's category list is still at v0.13.0.
Who it is for
An agent or CI job that leases iOS simulators from a slim farm and needs one slimmed capability, such as Wallet/PassKit, running. Also the operator of that farm, who wants such leases to cost close to a slim one and does not want more kinds of warm devices.
Outcome
- A slim lease can name categories to keep running. It gets a slim simulator with those categories on, and is told which categories it kept.
- A client that asks for categories a worker cannot keep gets a clear refusal, never a device that is not as asked.
- Through a gateway, such a lease goes only to a worker that can serve it.
- Through the agent-device front, the same choice is made with
deviceExcept. - Simlock's category list matches simslim v0.14.0, with
mdm.
How it works for the user
sequenceDiagram
participant C as Client
participant S as Simlock worker
participant D as Simulator
C->>S: lease --mode slim --except store,other
alt a name is unknown, or not in the worker's slim set
S-->>C: BAD_REQUEST
else
S->>D: pick a slim device (warm: shut it down)
S->>D: write the slim list without store, other; boot
S->>D: read back: store, other enabled?
alt yes
S-->>C: granted, mode slim, except [store, other]
else no, or the boot failed
S->>D: delete it, try once more
S-->>C: PROVISION_FAILED (after the second failure)
end
end
Before:
$ simlock lease --platform ios --mode slim --except store,other
error: unknown option '--except'
After: the lease's JSON reply carries "mode": "slim", "except": ["store", "other"] on its device. A refusal prints the BAD_REQUEST message; the exact messages are fixed in #1330.
Examples
| Request | Worker | Today | After |
|---|---|---|---|
--mode slim --except store,other |
slim set unset (every category) | unknown option | granted slim, except store, other |
--except store (no --mode) |
ios.defaultMode: slim |
unknown option | granted slim, except store |
--except store (no --mode) |
ios.defaultMode: full |
unknown option | BAD_REQUEST |
--baseline b --except store, baseline slim, no --mode |
ios.defaultMode: full |
unknown option | granted slim, except store (the baseline's mode wins) |
--mode full --except store |
any | unknown option | BAD_REQUEST |
--mode slim --except wallet |
any | unknown option | BAD_REQUEST (unknown name) |
--mode slim --except mdm |
ios.slim.categories: [store] |
unknown option | BAD_REQUEST (not in the worker's slim set) |
--mode slim --except store,store |
any | unknown option | BAD_REQUEST (a name twice) |
--mode slim --except Store |
any | unknown option | BAD_REQUEST (not a-z0-9-) |
--mode slim --except store on iOS 18.4 |
any | unknown option | granted full, no except (everything runs) |
--baseline b --except store, baseline full |
any | unknown option | BAD_REQUEST |
--physical --except store |
any | unknown option | BAD_REQUEST |
Android --except store |
any | unknown option | BAD_REQUEST |
--mode slim |
slim set unset | slims 15 categories | slims 16 (with mdm) |
gateway, --except store, no --mode |
worker A default full, worker B default slim | unknown option | granted on B |
What could go wrong
- A kept category is reported kept but one of its services is off. The readback after the boot checks every kept label is enabled before the grant, so this is unlikely.
- A lease with
--exceptgranted a warm device takes one reboot longer, about 9 s on an idle Mac. - Slimming
mdmon hosts that leaveios.slim.categoriesunset turns off device-management services a test may need. Such a test can pass--except mdm.
Words used
- category: a named group of iOS background services Simlock can turn off on a slim simulator, from simslim's list, e.g.
store(App Store, StoreKit) orother(Wallet, App Clips, business services). - slim set: the categories a worker turns off,
ios.slim.categories, every category when unset. - except list: the categories a slim lease asks to keep running, e.g.
--except store,other. - smaller list: the slim set minus the except list, written into the device's launchd overrides file before its boot.
Non-goals
- Android. Android has no slim categories.
- Keeping single services (labels). Only whole categories.
- Different warm devices per except list. Every slim device serves every except list.
- Turning categories on or off live, without a boot.
- Turning categories off on a
fulldevice. - The agent-device side of
--device-except(callstack/agent-device); this feature reads the key once agent-device sends it.
Completion conditions
- On a Mac with an iOS 18.5 runtime, and again with the newest 26.x: a lease with
--mode slim --except store,otheris granted slim withexcept[store, other], andlaunchctl print-disabled systemon it shows everystoreandotherlabel enabled (slow lane, one lease per runtime). - On a Mac with the newest 26.x runtime: a lease excepting each category in turn is granted with every label of that category enabled (slow lane).
- A warm slim device serves a lease with
--except: it is shut down, booted with the smaller list and granted (slow lane). - A request with an unknown name, a name outside the worker's slim set,
mode: full, a full baseline, a physical device or Android is refusedBAD_REQUEST, on the socket, HTTP and MCP. - A device whose kept labels do not read back enabled is never granted; after two failures the request is
PROVISION_FAILED. - Through a gateway, a lease excepting a category only one worker slims, or naming no mode where only one worker defaults to slim, is granted on that worker; one no worker can serve is refused
BAD_REQUESTat the gateway. - An agent-device allocate with
deviceExceptgets the same lease as--except. slim-labels.tsmatches simslim v0.14.0'sprofiles.go,mdmincluded.
Open questions
none
Decisions
- ADR 0066 — A slim lease may keep named categories running (PR docs(adr): propose 0066, a slim lease may keep named categories running (#1326) #1327): the request field and its refusals, the smaller list written before a boot (a warm device rebooted), a kept label not enabled fails the boot, one retry then
PROVISION_FAILED, the device reportsexcept, routing by the worker's slim set and default mode, and the v0.14.0 label list. - A gateway's own
catalog.getreportsslimCategoriesas the union of its workers' sets and nodefaultMode(decided in delivery, pending the maintainer). Tests: A gateway routes an except lease by each worker's slim set and default mode #1331's "fleet union" case. assessanswersBAD_REQUESTfor anexceptrequest when no single known worker serves the model and runtime and can keep every name with effective mode slim; the row follows ADR 0009 §4's model and runtime rows (decided in delivery, pending the maintainer). Tests: A gateway routes an except lease by each worker's slim set and default mode #1331's "none can →BAD_REQUEST" case, with the model on one worker and the category on another.- For an
exceptrequest, ADR 0009 §4 row 5 (NO_CAPACITY) counts only workers that take requests and can keep every name with effective mode slim, so it fails at once instead of waiting (decided in delivery, pending the maintainer). Tests: A gateway routes an except lease by each worker's slim set and default mode #1331 case: one worker lacks the category, the one that has it is drained →NO_CAPACITY.
Shared values
| Value or state | Rule | Written by | Read by | Source |
|---|---|---|---|---|
| Category names | SLIM_CATEGORIES names, 16 after the re-sync (simslim v0.14.0) |
#1328 | #1329, #1330, #1331 | ADR 0066 §6 |
except (request) |
1 to 16 distinct names, each 1 to 32 characters of a-z, 0-9, -, starting with a letter; known-name and slim-set checks by the worker's iOS driver |
#1330 | #1330, #1331, #1332 | ADR 0066 §1 |
| Smaller list | slim set minus except; kept labels written false even when a slimmed category lists them |
#1329 | #1329, #1330 | ADR 0066 §2 |
except (device) |
names kept on, in request order; absent when none or granted full |
#1330 | #1330, #1331, #1332 | ADR 0066 §4 |
| Effective mode | the baseline's when named, else mode, else the worker's ios.defaultMode; except needs it slim |
#1330 (worker), #1331 (gateway) | #1330, #1331 | ADR 0066 §1, §5 |
| Refusals | BAD_REQUEST; contract-level (physical, non-iOS, mode: full; messages in #1330), effective mode full (messages in #1330), unknown name and outside slim set (messages in #1329) |
#1329, #1330 | #1331, #1332 | ADR 0066 §1 |
defaultMode (catalog, iOS) |
the worker's ios.defaultMode |
#1331 | #1331 | ADR 0066 §5 |
Waiting reason cannot-keep-except |
a gateway worker the except stage dropped | #1331 | #1331 (CLI, console) | ADR 0066 §5 |
| Failure count | one per request across provision and the except boot; the second rejects PROVISION_FAILED |
#1330 | #1330 | ADR 0066 §3 |
slimCategories (catalog, iOS) |
names the worker's slim set resolves to | #1331 | #1331 | ADR 0066 §5 |
| Protocol version | +1 in #1330 and in #1331, each after #1261 merges | #1330, #1331 | every client | contract manual, "Protocol version" |
Behaviours
| Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|
An operator slims with the unset slim set and gets every v0.14.0 category, mdm and the two new other labels included |
src/drivers/ios/slim-labels.ts |
unset set; set naming mdm |
#1328 |
| The iOS driver boots a slim device with an except list and grants only when every kept label reads back enabled | iOS driver makeReady with a fake simctl |
kept labels enabled; a kept label also in a slimmed category; a kept label read back disabled; write fails; readback fails; a non-kept label mismatched (→ full, no except); except naming the whole slim set (→ full); device.slimmed fields |
#1329 |
| The iOS driver refuses an except list it cannot serve at resolve | iOS driver resolveSpec |
unknown name; name outside the slim set; set unset accepts every known name | #1329 |
A client leases slim with except and is granted a device reporting it |
lease.request through the daemon dispatcher, fake driver |
warm device (rebooted); new device; runtime below 18.5 (full, no except); reported in reply, list.get, status.get, lease.requested |
#1330 |
A client's except request is refused |
lease.request on socket, HTTP, MCP |
duplicate; bad characters; mode: full; no mode, no baseline, default full; full baseline; slim baseline with default full (granted); physical; Android; the driver's refusal reaches the client |
#1330 |
A failed except boot is never granted |
leasing with a failing fake boot | warm reboot's prepare fails then ok; warm reboot's shutdown fails; shut-down device boot ok and fails; provision failure then except boot failure → PROVISION_FAILED; replay with another except |
#1330 |
A gateway routes except by each worker's slim set and default mode |
gateway fleet request with two fake workers | one worker has the set; mixed default modes, no mode; slim baseline on a default-full worker; full baseline → BAD_REQUEST; none can → BAD_REQUEST; dropped worker's reason; worker receives except |
#1331 |
A client reads catalog.get and sees the iOS slim set and default mode |
worker catalog.get; gateway aggregateCatalog |
set unset; set [store]; default slim and full; fleet union |
#1331 |
An agent-device allocate with deviceExcept leases with except |
agent-device front device-mode.test.ts |
valid list; invalid name refused | #1332 |
Tasks
flowchart LR
T1["#1328 re-sync labels"] --> T2["#1329 driver except boot"] --> T3["#1330 lease except"]
T3 --> T4["#1331 gateway routing"]
T3 --> T5["#1332 agent-device front"]
- Re-sync the iOS slim label list to simslim v0.14.0 #1328 Re-sync the iOS slim label list to simslim v0.14.0 — a slim device also turns off
mdmand the two newotherservices. Risk: a test needing device management breaks on a host with the set unset. - The iOS driver boots a slim simulator with a lease's except list #1329 The iOS driver boots a slim device with an except list — the driver writes the smaller list and refuses a boot whose kept labels are not enabled. Risk: a kept label reported on while off.
- A slim lease keeps named categories running (--except) #1330 A slim lease keeps named categories running — a client passes
--exceptand gets a device reporting it, a warm one rebooted. Risk: a device granted that was not booted with the smaller list. - A gateway routes an except lease by each worker's slim set and default mode #1331 A gateway routes an
exceptlease by each worker's slim set and default mode — fleets serve it on the right worker. Risk: a request refused that one worker could serve. - The agent-device front maps deviceExcept to the lease's except #1332 The agent-device front maps
deviceExcepttoexcept— agent-device clients choose it too. Risk: the key dropped, asdeviceModewas in agent-device front drops the allocate's mode, so a full simulator cannot be leased through it #1223.
Completion conditions → tasks: label list → #1328; kept labels enabled, warm device, never granted when not enabled → #1329 and #1330; refusals → #1330; gateway → #1331; agent-device → #1332.
Open work in the same area:
- Warm pool: a baseline kind is learned on its Nth lease in 24 h and warms its newest version #1261 (task:ready) bumps the protocol: A slim lease keeps named categories running (--except) #1330 and A gateway routes an except lease by each worker's slim set and default mode #1331 depend on it.
- feat(ios): lease --label names the leased simulator #1243 (open PR,
lease --label, no task issue) edits the samelease.requestfields, CLI and protocol: no Depends on (not a task); whichever merges second takes both. - iOS simulator tunnels: forward only to the lease's simulator, reverse on the exact port #1288 (task:ready) edits
src/drivers/ios/index.tsnear its shrink-only size limit: The iOS driver boots a slim simulator with a lease's except list #1329 depends on it. - feat(agent-device): the allocate reply reports the granted device mode #1254 (open PR, no issue) adds
deviceModeto the agent-device reply: no Depends on (not a task); whichever merges second keeps both.
Written by an agent.
Activity
docs(adr): 0066 narrows 0009 §4 too (#1326)
docs(adr): 0066 keeps categories by a boot with a smaller list, not l…
V3RON commentedon Nov 5, 2026
Spec updated: all sections written; ADR 0066 (PR #1327) switched to a boot with the smaller list; tasks #1328–#1332 posted as
task:draft.Written by an agent.
docs(adr): 0066 effective mode includes the baseline's; catalog carri…
docs(adr): accept 0066 (#1326)
docs(adr): 0066's README row names 0060 §1 (#1326)
docs(adr): 0066 declares the narrowings of 0060 §2, 0007 §8, 0008 §4/…
docs(adr): 0066 links ADR 0008 (#1326)
docs(adr): 0066 row 5 NO_CAPACITY counts the except filter, declared …
V3RON commentedon Nov 5, 2026
Delivery run
Merged: none. The stack #1327 → #1333 is ready and waits for the rest of the feature.
Parked: none
Waiting: #1329 — on #1288 (feature #1282), #1330 — on #1261 (feature #1257), #1331 — on #1261 (feature #1257), #1332 — on #1330 and #1331
Decided: #1327 — what a gateway's own
catalog.getreports → the union of its workers'slimCategories, and nodefaultMode; #1327 — where theexceptBAD_REQUESTrow goes → after the model and runtime rows, checked one worker at a time; #1327 — whether row 5 (NO_CAPACITY) counts theexceptfilter → yes, so the request fails at once instead of waitingWritten by an agent.
V3RON commentedon Nov 6, 2026
Delivery run
Merged: none. The stack #1327 → #1333 → #1348 (#1329) → #1349 (#1330) → #1360 (#1331) stays open until every task joins it.
Parked: #1331 — R5 and R6 are still blocking after the fix-check, at the round cap. The except
BAD_REQUESTrow runs afterNO_CAPACITY, against ADR 0066 §5, and one test cannot fail. PR #1360 stays in draft.Waiting: #1332 — on #1331
Written by an agent.
V3RON commentedon Nov 6, 2026
Delivery run
Merged: none. All six PRs passed review and are ready in stack #1334 (#1327 → #1333 → #1348 → #1349 → #1360 → #1368). ADR 0066 is set to Accepted on the top branch.
Parked: #1331 — the gate's second red CI: Fallow fails
routable(CRAP 31.6 > 30) on #1360, run 42204614752. The first red,#readBackon #1348, is fixed.Decided: #1331 — order of the gateway's except check against the capacity check → ADR 0066 §5 as written (maintainer chose this in the session).
Written by an agent.
github-actions commentedon Nov 6, 2026
Closing: all 5 sub-issues are closed. The PR that closed the last one walks the completion conditions (delivery rule 9); reopen this if one does not hold on
main. Flip its ADRs to Accepted if delivery has not.docs(adr): propose 0066, a slim lease may keep named categories runni…
V3RON commentedon Nov 6, 2026
Delivery run
Merged: #1327 (ADR 0066), #1333 (#1328), #1348 (#1329), #1349 (#1330), #1360 (#1331), #1368 (#1332), main at ba6582d
Decided: #1331 — order of the gateway's except check against the capacity check → ADR 0066 §5 as written (maintainer); #1330 — initiator of a failed warm reboot's
ready → shutdown→lease-engine, the repo's existing one (PR assumption)Written by an agent.