Repository navigation
Description
Request: #1688
Problem
From the request, in the reporter's words:
Slim mode is subtractive: a worker turns off its slim categories, and a lease keeps whole categories back with
except(ADR 0066), or individual services throughios.slim.include/exclude(#1650). The caller has to know what simlock turns off and argue against it.That makes slim conservative in practice. Even with every category on, a slim iOS 26 simulator still runs about 85 system processes (a full one runs about 217), including daemons most UI suites never touch:
nanoregistryd/nanoprefsyncd(Watch pairing),routined,geod,mobiletimerd,eventkitsyncd,donotdisturbd,mediaremoted. On a busy Mac, CPU is what limits how many devices a worker can host, so every idle daemon costs capacity.
Today a test that needs one service a slim simulator turns off must keep its whole category running: a test that needs push sends --except store, and so also keeps the App Store, StoreKit and Wallet services, 14 services in all. The caller has to know which category holds the service.
Who it is for
- An agent or CI suite that leases slim iOS simulators and uses a few system services (push, contacts, photos), and wants to say so in its own words.
- An operator who runs many slim simulators on one Mac and wants each lease to keep on only what it uses.
Outcome
- A lease names the slim features it needs (
--needs push,contacts). Simlock keeps those services running and turns the rest of slim's services off as usual. - A suite sends the same
--needslist on every lease. A lease that lands on a device already running everything (full, Android, a phone, old iOS) is granted as it is. - The lease record and the event history show what each lease needed.
How it works for the user
flowchart TD
A["lease --needs push,contacts"] --> K{"every name a slim feature?"}
K -- no --> X["BAD_REQUEST: names the known features"]
K -- yes --> M{"device the lease gets"}
M -- "full, Android, phone, iOS below 18.5" --> G1["granted as is, device.needs shown"]
M -- "slim simulator" --> W{"ready simulator, and the worker already runs those services?"}
W -- yes --> G2["granted as is"]
W -- no --> B["write the list with push and contacts on, boot"]
B --> R{"push and contacts read back running?"}
R -- yes --> G3["granted slim, device.needs shown"]
R -- "no, or cannot tell" --> F["boot again once, then PROVISION_FAILED"]
Before:
$ simlock lease --platform ios --mode slim --needs push
{"error":{"code":"USAGE","message":"Unknown option '--needs'. ..."}} exit 2
$ simlock lease --platform ios --mode slim --except store
leased iPhone 17 Pro (iOS 26.5, slim) ... device.except: ["store"] (14 services kept on)
After:
$ simlock lease --platform ios --mode slim --needs push
leased iPhone 17 Pro (iOS 26.5, slim) ... device.needs: ["push"] (apsd kept on)
$ simlock lease --platform ios --mode full --needs push
leased iPhone 17 Pro (iOS 26.5, full) ... device.needs: ["push"]
$ simlock lease --platform ios --mode slim --needs location
{"error":{"code":"BAD_REQUEST","message":"needs: \"location\" is not a slim feature; known: push, storekit, app-store, ..."}}
Examples
What a lease request gets. "Today" is main at the commit in Existing code: the CLI line was run; the socket, HTTP and MCP answers are from the strict request schema (src/contract/operations-lease-request.ts:80).
| Input | Today | After |
|---|---|---|
--mode slim --needs push |
CLI USAGE exit 2; socket/HTTP/MCP BAD_REQUEST (unknown key) |
granted slim; apsd on, the other 13 store services off; device.needs: ["push"] |
--mode slim --needs push --except web |
as above | granted slim; apsd and the 10 web services on |
--mode slim --needs push,push |
as above | BAD_REQUEST: needs names "push" twice |
--mode slim --needs location |
as above | BAD_REQUEST: needs: "location" is not a slim feature; known: ... |
--mode slim --needs Push |
as above | BAD_REQUEST: needs: "Push" is not a slim feature; known: ... |
needs: [] (HTTP, MCP) |
BAD_REQUEST (unknown key) |
BAD_REQUEST: needs names 1 to 32 features |
| 33 names | as above | BAD_REQUEST: needs names 1 to 32 features |
--mode full --needs push |
as above | granted full; device.needs: ["push"] |
--mode full --except store |
BAD_REQUEST: except needs a slim lease (mode is full) |
unchanged |
--platform android --needs push |
as above | granted; device.needs: ["push"] |
--physical --needs push |
as above | granted; no device.needs (a phone's record outlives the lease) |
slim, iOS 18.4, --needs push |
as above | granted full; device.needs: ["push"] |
slim, worker categories: ["web"], --needs push |
as above | granted slim, a ready simulator as is (push is not off there) |
slim, worker exclude: ["com.apple.apsd"], --needs push |
as above | granted slim with apsd on (a need wins over exclude) |
slim, --needs game-center |
as above | granted slim as is (gamed is never turned off) |
What could go wrong
- A test that named a feature still finds its service off: simslim's map misses a service the feature needs. Likely now and then; the fix is a re-sync or
--exceptof the category. - A lease with
--needstakes longer on a worker with a warm pool, because a ready simulator is booted again (about 9 s idle, more under load). - A lease is refused after two failed boots because a needed service would not read back as running under heavy load, where a plain slim lease would have been granted.
- A gateway and a worker on different Simlock versions cannot talk at all after this lands (the protocol moves), as with any contract change.
Words used
- slim feature: a name for something a test uses, mapped to the system services it needs; simslim v0.15.0's 27 names. Example:
pushiscom.apple.apsd. - service: a launchd job inside the simulator, named by its label, e.g.
com.apple.apsd. - category: a group of services slim turns off together, e.g.
store(14 services). Six feature names are also category names (siri,icloud,photos,health,widgets,mdm): as a need, the name means the feature's few services, not the category. except: the lease field that keeps whole categories running (ADR 0066), unchanged.- met need: a need whose services the device runs anyway: every full device, and a slim one whose worker does not turn them off.
- readback: after a slim boot, Simlock asks the simulator which services are disabled (
launchctl print-disabled system) and compares. - ready simulator: a booted, unleased simulator, kept only on a worker that turns the warm pool on (ADR 0101).
Non-goals
- Turning off more daemons than today (
routined,geod, Watch pairing and the others the request names). The maintainer kept slim's list as simslim's. - Turning a service on in a running simulator when a tool first needs it (the request's "better still"). Left to a later request.
- Removing or changing
except,ios.slim.includeorios.slim.exclude. - Features Simlock names itself (
location,notifications,keychain-sharing): only simslim's list. - A routing change in the gateway, or a catalog field listing the features.
- The agent-device flag itself: agent-device adds
deviceNeedsin its own repository.
Completion conditions
- On a Mac, a slim iOS lease with
--needs pushgets a simulator wherecom.apple.apsdreads back enabled and every otherstoreservice reads back disabled. - A lease with an unknown feature, a repeated one, none or more than 32 is refused
BAD_REQUESTwith the message in I1, on the CLI, HTTP, MCP and through a gateway. - A lease with
--needsis granted on a full lease, a full-default worker, Android, a phone and iOS below 18.5. - The lease reply,
simlock list,simlock status --jsonandlease.requestedshow the lease'sneeds. - A ready simulator is booted again for a
--needslease only when a need's service is off on that worker. - An agent-device allocate with
deviceNeedsleases withneeds. - The website lists the 27 slim features and documents
--needson every surface.
Open questions
none
Decisions
- ADR 0105 — A slim lease may name the features it needs:
needsbesideexcept, simslim's names, a met need granted, a needed service must read back running, a ready simulator booted again only when needed, no routing change. - ADR 0066 — A slim lease may keep named categories running: the boot-before-grant, the strict readback and the one retry
needsreuses. - ADR 0083 — A worker may turn single slim services on or off: the precedence a need joins (a need wins over
exclude). - ADR 0060 — iOS slim writes launchd overrides while the simulator is shut down: the file and readback the needs are written into.
- Decided in the session: the field is
needsand its values are called slim features, because "capability" already names worker capabilities a lease asks for with--requires. - Decided in the session: the names and their services are simslim v0.15.0's
features.go, synced with the category list, because every one of its services is already in Simlock's list. - Decided in the session: a lease may name
needsandexcepttogether; a service is on when either asks, because they answer different questions and neither should block the other. - Decided in the session: a need wins over the worker's
exclude, because a kept category already does (ADR 0083 §2). - Decided in the session (answered after the design check): a need whose service this worker would turn off must read back running, or the boot fails with
except's one retry; a met need adds no check, so its boot is granted as a plain slim lease's would be, because the ready-simulator path takes a met need with no boot either. - Decided in the session: a ready simulator is booted again only when a need's service is off on that worker, because a met need would pay a boot for nothing.
- Decided in the session: a virtual device reports
needswhatever its mode; a phone reports none, because its record outlives the lease. - Decided in the session: up to 32 names in the
exceptname grammar, because simslim has 27 and a few more may come. - Decided in the session: the contract holds the names and the iOS driver the map, held equal by one test, because the contract imports nothing and a driver never imports the contract; each re-sync then moves the protocol.
- Decided in the session: the slim hint line (
slimLeaseHint) is unchanged, because it names categories turned off, which a need does not change.
Behaviours
| Id | Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|---|
| B1 | The iOS driver maps each slim feature to its services, as simslim v0.15.0's features.go does, and every service is one Simlock manages |
src/drivers/ios/slim-features.ts (new, I4), unit test beside src/drivers/ios/slim-labels.test.ts |
the 27 names in simslim's order; push is com.apple.apsd; storekit is its 7 services; game-center is com.apple.gamed; every service is a label of SLIM_CATEGORIES or NEVER_DISABLE_LABELS |
#2103 |
| B2 | The iOS driver boots a slim device with needs and grants only when every needed service this worker would turn off reads back enabled |
IosSimctlDriver.makeReady with fake simctl and filesystem (bootWithExcept, src/drivers/ios/slim-except.test.ts:52, extended to take include and exclude) |
needs: [push], categories unset: apsd written false, the other store labels true, readback as written → slim and device.slimmed with one label fewer; needs with except: [web] → both kept; a need's label in exclude → false; a need's label in include → false; game-center → gamed false; a needed label read back disabled → KeptCategoriesError; the write fails → KeptCategoriesError; the readback fails or times out → KeptCategoriesError; categories [web] with needs: [push] (a met need) and a readback that fails → slim, no throw, as without needs; another label not as written → full, no throw; needs that leave nothing off → full, no device.slimmed; iOS 18.4 → no write, full; purpose: recover → no write |
#2103 |
| B3 | The iOS driver answers whether a slim boot on this worker turns off a service of any of a lease's needs (I3) | IosSimctlDriver.slimTurnsOff on a driver built with slim options (src/drivers/ios/slim-named-services.test.ts) |
categories unset, [push] → true; categories [web], [push] → false; categories unset, include: [com.apple.apsd], [push] → false; categories [], exclude: [com.apple.apsd], [push] → true; [game-center] → false; exclude: [com.apple.gamed], [game-center] → true; [push, game-center] with categories unset → true |
#2103 |
| B4 | The fake driver takes needs on makeReady and answers slimTurnsOff as told, so leasing tests can drive both answers |
FakeDriver (src/core/fake-driver.ts:106) |
needs recorded on the call; slimTurnsOff option true, false, absent (→ false) |
#2103 |
| B5 | A client's needs is checked the same way on the socket, HTTP and MCP, and through a gateway, before anything is resolved |
lease.request through buildDispatcher (src/daemon/test-dispatcher.ts), POST /v1/lease-requests (src/http/app-leases.test.ts), MCP lease_simulator (src/mcp/server.test.ts), gateway lease.request through its dispatcher (src/gateway/test-dispatcher.ts) |
[]; 33 names; "Push"; "location"; "push" twice; each answers I1's message as BAD_REQUEST; a non-list answers the schema's own type refusal, as except does today (on MCP the SDK's Invalid arguments for tool); [push] with mode: full, Android and physical is accepted |
#2104 |
| B6 | A client leases with needs and is granted a device reporting it |
lease.request through buildDispatcher with a fake driver (model: src/daemon/dispatcher-except.test.ts:19) |
slim, new device: the driver's makeReady gets needs, device.needs in the reply, list.get and status.get, and requestSpec.needs in lease.requested; slim, ready device, slimTurnsOff true → shut down and prepared again with needs, lease.granted source booted; slim, ready device, slimTurnsOff false → granted as is, source warm, no makeReady; mode: full → granted, makeReady gets no needs, device.needs reported; default full with no mode → granted; Android → granted, reported; physical → granted, no device.needs; slim on an unslimmable runtime → full, reported; needs with except → both reported and both passed; slim baseline → booted with needs; full baseline → granted, reported |
#2104 |
| B7 | A failed boot of a lease whose needs the worker turns off (slimTurnsOff true) is never granted, and counts once toward the request's one retry; a lease with only met needs fails as a plain slim lease does |
leasing with a failing fake boot (model: src/daemon/dispatcher-except.test.ts:209) |
the ready device's prepare fails, then succeeds → granted; it fails twice → PROVISION_FAILED; a shut-down device's boot fails then succeeds; a provision failure then a needs boot failure → PROVISION_FAILED; a BootTimeoutError on a boot with slimTurnsOff true is retried, not boot-timeout; with slimTurnsOff false it ends boot-timeout, and a failed shut-down boot is rejected, as without needs |
#2104 |
| B8 | The registry keeps a lease's needs on its virtual device and on its stored request, across a reload |
Registry (model: src/core/registry-except.test.ts:17) |
virtual device with needs; physical device with needs → none on the device, on the request yes; no needs → no key; both needs and except; after reopening state.db |
#2104 |
| B9 | A request repeated under its idempotency key matches only when its needs are the same set |
LeaseRequestBook replay (src/leasing/lease-request-book.ts:227) through buildDispatcher |
same needs in another order → the stored request; other needs → IDEMPOTENCY_CONFLICT, as other except is today; one with and one without → IDEMPOTENCY_CONFLICT |
#2104 |
| B10 | A user sends needs from the CLI, HTTP, MCP and the Node client, and sees it back |
simlock lease (src/cli/index-lease-requests.test.ts), POST /v1/lease-requests and GET /v1/lease-requests/{id} (src/http/tracker.test.ts), MCP lease_simulator (src/mcp/server.test.ts), SimlockClient.lease (src/simlock-client/client.test.ts) |
--needs push,contacts → needs: [push, contacts]; the usage line names --needs <feature,...>; the HTTP body's needs reaches lease.request and the granted lease's device shows it; the MCP tool's schema lists needs and its description names it |
#2104 |
| B11 | A gateway forwards needs and routes the request as it would without them |
gateway fleet request with two fake workers (src/gateway/fleet-routing-ranges-and-except.test.ts) |
the picked worker receives needs; a worker whose slimCategories lack the feature's category is still picked; a request with needs and no except is never cannot-keep-except |
#2104 |
| B12 | The contract's feature names and the iOS driver's map name the same features | a test in src/daemon/ importing I2 and I4 |
the two lists are equal as sets | #2104 |
| B13 | On a real simulator, a slim lease with --needs push boots with apsd running and the rest of store off |
e2e/slow-ios-slim.test.ts:326 (withRealDaemon) |
the newest installed iOS 26.x: readback shows com.apple.apsd not disabled and every other store label disabled; the grant shows device.needs: ["push"] |
#2104 |
| B14 | An agent-device allocate with deviceNeeds leases with needs, and agent-device never sees the field |
the agent-device front (src/agent-device/device-mode.test.ts:78) |
deviceNeeds: [push] → lease request needs: [push], allocate forwarded without it; deviceNeeds: null → absent; ["Push"] → refused by simlock: with I1's message and no lease; "push" → refused by simlock: with the message lease.request gives it and no lease; a command with deviceNeeds on flags, on input or in a batch step reaches agent-device without it |
#2105 |
Stored state
| Id | What and where | Created, changed, deleted by | Listed or swept by | A restart mid-step leaves | Schema step | Task | Used by |
|---|---|---|---|---|---|---|---|
| S1 | devices.needs (TEXT, the feature names joined by ,, NULL when none) in state.db |
written in the grant commit (Registry.createLease) for a virtual device whose lease named needs, whatever its mode; never changed; deleted with the record |
list.get, status.get and the lease reply read it as device.needs |
nothing: the grant is one commit | core +1 |
#2104 | — |
| S2 | lease_requests.needs (TEXT, as S1) in state.db |
written when the request is stored (LeaseRequestBook.admit); deleted with the request |
replay matching (B9) only: the stored request's view shows no device fields, as for except |
the request is failed daemon-restarted at the next start, as today |
core +1 |
#2104 | — |
Interfaces
| Id | What | Shape and bounds | Errors and limits | Where | Task | Used by |
|---|---|---|---|---|---|---|
| I1 | lease.request input needs |
optional z.array(z.string()), 1 to 32 distinct names, each in I2; the bounds and names are checked in one object-level refinement with no path, as except's, never on the field (the MCP SDK would refuse first with its own text); allowed with any mode, platform and physical; bumps the protocol by one |
BAD_REQUEST, word for word: needs names 1 to 32 features; needs: "<name>" is not a slim feature; known: <the 27 names, comma and space>; needs names "<name>" twice; checked in that order |
src/contract/operations-lease-request.ts (the field, its refinement, and requestedDevice, which copies it into the request every transport and the gateway's forward use) |
#2104 | #2105 |
| I2 | SLIM_FEATURE_NAMES and slimFeatureNameSchema |
the 27 names of simslim v0.15.0 features.go, in its order: push, storekit, app-store, universal-links, spotlight, files-recents, siri, icloud, keychain-sync, contacts, calendar, reminders, mail, photos, health, homekit, imessage, widgets, wallet, maps, weather, news, game-center, find-my, mdm, app-clips, screen-time. The schema types the device views' needs (I5) only; I1's refinement reads the names |
— | src/contract/device-schemas.ts |
#2104 | — |
| I3 | Driver.slimTurnsOff?(needs: readonly string[]): boolean and makeReady option needs?: readonly string[] |
slimTurnsOff: true when a slim prepare boot on this worker writes true for a service of any named feature; absent answers as false. needs: the request's feature names, given on a prepare of a slim spec only |
makeReady throws KeptCategoriesError (src/core/driver.ts:678) when a needed service the worker would turn off is not shown enabled (a failed write, a readback that cannot run, or the service read disabled); a met need's service is never checked this way; message <n> kept labels are not enabled; first: <label> as today |
src/core/driver.ts |
#2103 | #2104 |
| I4 | SLIM_FEATURES |
readonly { name: string; labels: readonly string[] }[], copied from simslim v0.15.0 features.go under its MIT notice, beside SLIM_CATEGORIES |
— | src/drivers/ios/slim-features.ts |
#2103 | #2104 |
| I5 | Device views gain needs |
needs?: string[], I1's bounds, on the lease reply's device, list.get and status.get devices; absent when the lease named none or the device is physical; same protocol bump as I1 |
— | src/contract/device-schemas.ts |
#2104 | — |
| I6 | lease.requested carries needs |
inside requestSpec, which is the DeviceRequest (I9): the list as the request named it, absent when none; additive (docs/internal/EVENTS.md lease.requested row); no top-level key |
— | src/leasing |
#2104 | — |
| I7 | CLI, HTTP, MCP and Node client needs |
CLI --needs <feature,...> split on ,; HTTP POST /v1/lease-requests body needs (coarse bound: 64 strings of at most 64 characters, as except's), and the stored request; MCP lease_simulator needs with its description; SimlockClient.lease needs (types from the contract) |
I1's messages | src/cli/commands/lease.ts, src/http/lease-declarations.ts, src/mcp/server.ts, src/simlock-client/ |
#2104 | — |
| I8 | agent-device allocate deviceNeeds |
a list of strings mapped to I1's needs; null is absent; removed from every command forwarded to agent-device |
refused by simlock: <I1 message> |
src/agent-device/front/allocate.ts, src/agent-device/shared/rpc.ts (leaseCallFields), src/agent-device/front/request-rules.ts (ruleLeaseKeys) |
#2105 | — |
| I9 | DeviceRequest.needs |
readonly needs?: readonly string[] on core's DeviceRequest (not ExactDeviceRequest: resolveSpec never reads it); filled by requestedDevice (I1) |
— | src/core/driver.ts |
#2104 | — |
Existing code
Commit 9280021.
Searches: rg -n "except" src --type ts -g '!*.test.ts' (about 90 lines, the lease ones read); rg -n "except_categories|exceptOption|rebootsBeforeGrant|KeptCategoriesError|overridesFor|splitByExcept|assertKeptEnabled|writeOverrides" src (34); rg -n "nanoregistry|routined|geod|mobiletimerd|eventkitsyncd|donotdisturbd|mediaremoted" src docs e2e (0); simslim v0.15.0 features.go labels checked against src/drivers/ios/slim-labels.ts (27 features, 0 labels missing): gh api 'repos/mobai-app/simslim/contents/features.go?ref=v0.15.0'; gh search code --repo callstack/agent-device deviceExcept (5 files, packages/contracts/src/client-lease.ts among them).
| Id | Code (path:line) | Today | With this feature | Handled by |
|---|---|---|---|---|
| X1 | src/contract/operations-lease-request.ts:54, :169 |
except and exceptRefusal, refused with full, physical and Android |
needs beside it with its own refinement, never refused for mode or platform |
I1, B5 |
| X2 | src/contract/device-schemas.ts:42, :241, :264, :304 |
EXCEPT_NAME_PATTERN, exceptCategoriesSchema and the device views' except |
the feature names and the views' needs beside them |
I2, I5 |
| X3 | src/contract/protocol.ts:13 |
{ min: 116, max: 116 } |
moves by one, both ends | I1 |
| X4 | src/leasing/acquisition-spec-resolver.ts:145, :211, :214 |
except with an effective full mode, or a full baseline, is BAD_REQUEST; a slim baseline's except goes to resolveSpec |
needs is checked by neither: met on full, and its names are I1's |
B6 |
| X5 | src/leasing/acquisition-waiter.ts:50, :56 |
rebootsBeforeGrant is true for any except; exceptOption passes except only for a slim spec |
also true when the spec is slim and driver.slimTurnsOff(needs); needs passed only for a slim spec |
B6, I3 |
| X6 | src/leasing/acquisition-workflow.ts:280, :286, :504, :618, :632 |
provision, reboot and boot pass except; a failed except boot counts toward the one retry, a timeout of one too |
needs passed beside it; a slim boot whose needs the worker turns off (slimTurnsOff) counts the same as an except boot, one with only met needs as a plain boot |
B6, B7 |
| X7 | src/leasing/acquisition-planner.ts:41 |
rebootReady takes a ready device through the claimed reboot |
fed by X5, unchanged | B6 |
| X8 | src/leasing/waiter-outcomes.ts:44 |
a grant carries except only when the device is slim |
needs carried whatever the mode |
B6 |
| X9 | src/leasing/lease-lifecycle.ts:27, :86, src/leasing/lease-acquisition-coordinator.ts:127, src/gateway/fleet-admission.ts:157 |
the grant's createLease input carries except; lease.requested carries the request as requestSpec, on a worker and a gateway |
createLease takes needs; requestSpec carries it through I9 with no change here |
I6, I9, B6 |
| X10 | src/core/registry.ts:744 |
a virtual device gets except in the grant commit, a physical one never |
needs the same way |
S1, B8 |
| X11 | src/core/registry-schema.ts:128, src/core/registry-rows.ts:294, :399, :574 |
except_categories on devices and lease_requests, joined by , |
needs columns, written and read the same way |
S1, S2, B8 |
| X12 | src/leasing/lease-request-book.ts:227, :438 |
a repeated request matches only the same except order, else IDEMPOTENCY_CONFLICT |
needs compared as a set |
B9 |
| X13 | src/core/managed-device-lifecycle.ts:78, :110, :166, :309, src/core/device-provisioner.ts:53, :183 |
except handed to makeReady on a lease's boot, reboot and provisioned boot |
needs handed beside it |
B6 |
| X14 | src/core/driver.ts:289, :362 |
Driver has rebootReadyBeforeGrant; makeReady takes except |
gains slimTurnsOff and the needs option |
I3 |
| X15 | src/core/fake-driver.ts:107, :284, :532 |
refuses an except category it does not slim; records makeReady options |
records needs, answers slimTurnsOff as configured |
B4 |
| X16 | src/drivers/ios/index.ts:392 |
makeReady passes except to writeOverrides |
passes needs too |
B2 |
| X17 | src/drivers/ios/slim-boot.ts:166, :257, :294 |
writeOverrides splits categories by except; a kept category makes a failed write or readback throw |
the kept labels are the kept categories' and the needed features' that the worker's list would write true; a met need's labels are written false as today and not kept |
B2 |
| X18 | src/drivers/ios/slim-except.ts:15, :32 |
splitByExcept and assertKeptEnabled work on kept categories |
assertKeptEnabled checks the needed labels the worker would turn off too |
B2 |
| X19 | src/drivers/ios/slim-labels.ts:355 |
overridesFor writes kept categories' labels false last |
the needed labels are written false last too |
B2 |
| X20 | src/drivers/ios/slim-boot.ts:133 |
a copy gets its source's disabled.plist; the next prepare writes the whole map |
unchanged: every needed label is a managed label, so the prepare writes it |
B1 |
| X21 | src/gateway/fleet-dispatch.ts:369, src/gateway/fleet-request-shape.ts:54, src/gateway/routing/serviceability.ts:115 |
the gateway forwards the request built by requestedDevice; routable gives except to routing, which routes it by slimCategories |
needs is forwarded through requestedDevice (X30); routable and routing do not take it |
B11 |
| X22 | src/http/app-helpers.ts:45, src/http/lease-declarations.ts:37, :245, src/http/tracker.ts:19, :86, :101 |
the HTTP body and the tracked device carry except; the stored request's view (src/http/tracker.ts:434) shows none |
needs beside except in the body and the device; the view unchanged |
I7, B10 |
| X23 | src/cli/commands/lease.ts:78, :98, :323 |
--except option, usage line and split |
--needs the same way |
I7, B10 |
| X24 | src/mcp/contracts.ts:31, src/mcp/server.ts:205 |
the tool's schema derives from the contract's fields; the description explains except |
the schema gains needs with the contract; the description names it |
I7, B10 |
| X25 | src/agent-device/front/allocate.ts:132, :302, src/agent-device/shared/rpc.ts:108, :116, src/agent-device/front/request-rules.ts:140 |
deviceExcept read by leaseCallFields, mapped to except, and removed from every forwarded command by ruleLeaseKeys |
deviceNeeds the same way |
I8, B14 |
| X26 | src/lease-policy/index.ts:515 |
slimLeaseHint names the categories a slim lease has off, minus except |
unchanged (Decided in the session) | — |
| X27 | e2e/slow-ios-slim.test.ts:326 |
a real lease with --except store,other reads every kept label enabled |
a case with --needs push |
B13 |
| X28 | docs/internal/EVENTS.md:49 |
lease.requested carries except |
and needs |
I6 |
| X30 | src/contract/operations-lease-request.ts:307, src/daemon/dispatcher-leases.ts:23, src/gateway/dispatcher.ts:780 |
requestedDevice copies only the fields it names into the DeviceRequest every transport, the gateway's admission and its forward use |
copies needs too; without it needs is dropped silently |
I1, I9, B6, B11 |
| X29 | website/src/content/docs/docs/concepts/slim-simulators.mdx, reference/cli.mdx, reference/mcp-tools.mdx, reference/events.mdx, reference/node-client.mdx:85, reference/errors.mdx:51, :52, using-devices/lease-a-specific-device.mdx, using-devices/http-api.mdx, using-devices/agent-device.mdx, docs/internal/flows/device-selection.md:85 |
describe --except and slim categories; IDEMPOTENCY_CONFLICT, the failed-boot retry and the ready-device reboot name except alone |
a "Name the features a test needs" section with the 27 names; --needs on each surface |
#2104, #2105 |
Tasks
flowchart LR
T1["#2103 iOS driver boots with needs"] --> T2["#2104 a lease names its needs"] --> T3["#2105 agent-device front"]
- Slim features: the iOS driver boots with a lease's needs on #2103 Slim features: the iOS driver boots with a lease's needs on — a worker's driver knows the 27 features, keeps a lease's needed services on and answers whether a need is off there. Risk: a simulator granted with a needed service off.
- Slim features: a lease names the features it needs #2104 Slim features: a lease names the features it needs — a client sends
--needson every surface and through a gateway, and sees it on the device and inlease.requested. Risk:needsdropped on the way to the worker, or refused where it is met. - Slim features: the agent-device front maps deviceNeeds #2105 Slim features: the agent-device front maps deviceNeeds — an agent-device client leases with
needsonce agent-device sends the flag. Risk: the field dropped or passed to agent-device.
Completion conditions → tasks: --needs push on a real simulator → #2104 (B13, on #2103's driver); refusals on every surface → #2104; granted on full, Android, phones, old iOS → #2104; reported in the reply, list, status --json and the event → #2104; a ready simulator booted again only when needed → #2103 (B3) and #2104 (B6); agent-device → #2105; the website → #2104 and #2105.
Open work in the same area:
- iOS sandbox: a worker setting boots every leased simulator sandboxed and checked #2043 (task:ready, PR feat(ios): a worker setting boots every leased simulator sandboxed and checked #2058) and iOS copy: keep the app database at the copy's own UDID #2077 (task:ready, PR feat(ios): a copy keeps its app database at its own UDID #2084) change
IosSimctlDriver.makeReady: Slim features: the iOS driver boots with a lease's needs on #2103 depends on both. - iOS: a warm simulator is leased without a restart, and renamed to the lease's label #2079 (task:ready) retires
rebootReadyBeforeGrantand changesrebootsBeforeGrant: Slim features: the iOS driver boots with a lease's needs on #2103 and Slim features: a lease names the features it needs #2104 depend on it. - Android backends: device records and baselines name the backend that made them #2049 (task:ready) takes the next registry migration and bumps the protocol; Lease files: get a folder back #2005, Lease files: push a file or folder into an app's container #2006, iOS sandbox: a reverse tunnel opens its port to the lease's own simulator while it runs #2045 and Android backends: one Android driver runs several backends, picked by tags and the operator's order #2050 (task:ready) bump the protocol: Slim features: a lease names the features it needs #2104 depends on each.
- iOS copy: simctl create and one clone of the source's data #2078 (PR feat(ios): copy with simctl create and one clone of the source's data #2090) and iOS: simctl clone and create are cut off at a fixed 30 s, and under deviceSet "default" each cut-off clone leaves a simulator nothing can delete #1546 (draft PR fix(ios): the simctl commands of a simulator's lifecycle wait ios.simulator.lifecycleTimeoutMs, and a create or clone that answers late is deleted (#1546) #1547) edit
src/drivers/ios/index.tsaway frommakeReady: no Depends on. - Follow-ups opened from this session: Slim: turn a slim feature on for a leased simulator when a tool first needs it #2106 (request: turn a slim feature on in a running leased simulator) and Lease allocate: a deviceNeeds option for slim simulator features callstack/agent-device#5381 (
deviceNeedson allocate; agent-device has nodeviceExcepteither).
Written by an agent.
Activity
docs(adr): 0105 cross-references in the index (#2100)
V3RON commentedon Dec 4, 2026
Design posted: business sections from the attended interview, Decisions (ADR 0105, PR #2101), Behaviours B1–B14, Stored state S1–S2, Interfaces I1–I8, Existing code X1–X29, split into three tasks (driver, lease, agent-device front).
Written by an agent.
docs(adr): 0105 §3, a met need adds no strict readback (#2100)
V3RON commentedon Dec 4, 2026
#2100 Slim: nothing optional by default, a lease declares the capabilities it needs: #2100
ADR 0105 (PR #2101): a slim iOS lease may name slim features (
needs, simslim v0.15.0's 27 names) besideexcept; a met need is granted and adds no strict check; a need the worker turns off must read back running (one retry); a ready simulator is booted again only when a need changes its list; no routing change.Decided in the session:
needs, its values called slim features (not "capabilities", taken by--requires)Decided in the session: names and services from simslim v0.15.0
features.go, synced with the categoriesDecided in the session:
needsandexcepttogether, a service on when either asks; a need wins overexcludeDecided in the session: a need whose service the worker turns off must read back running, with
except's one retry; a met need adds no checkDecided in the session: a ready simulator is booted again only when a need's service is off on that worker
Decided in the session: a virtual device reports
needswhatever its mode; a phone noneDecided in the session: up to 32 names in the
exceptgrammarDecided in the session: names in the contract, map in the iOS driver, held equal by one test; each re-sync moves the protocol
Decided in the session: the slim hint line is unchanged
Decided in the session: no new daemons turned off; turning a service on in a running simulator is a later request; agent-device's own
deviceNeedsflag is requested in its repositoryneeds, and answersslimTurnsOff; the fake driver followsneedson the CLI, HTTP, MCP, Node client and through a gateway, and is granted a device reporting itdeviceNeedstoneedsCheck: ready (build, handoffs, break, then a fresh build check; 0 open findings)
Written by an agent.
docs(adr): accept 0105, not yet implemented (#2100)
V3RON commentedon Dec 4, 2026
Spec updated: tasks #2103, #2104 and #2105 written as sub-issues, Task and Used by cells numbered, Tasks section filled, follow-ups #2106 and callstack/agent-device#5381 opened.
Written by an agent.
V3RON commentedon Dec 4, 2026
Planned: every task is
task:ready; ADR 0105 is Accepted — not yet implemented on PR #2101.needson, and answersslimTurnsOffneedson the CLI, HTTP, MCP, the Node client and through a gateway, and sees it on the device and inlease.requesteddeviceNeedstoneedschain 3 of 3 tasks(runnable now: none; #2103 waits on #2043, #2077 and #2079 in other features)Decisions since the design was settled:
acquisition-spec-resolver.ts; X29 gained the Node client, errors and device-selection pages.deviceExceptflag today (an earlier search matched loosely): Slim features: the agent-device front maps deviceNeeds #2105's fact says so, and Lease allocate: a deviceNeeds option for slim simulator features callstack/agent-device#5381 asks fordeviceNeeds.Written by an agent.