Repository navigation
docs(adr): propose 0083, a worker may turn single slim services on or off beside its categories (#1644) #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+112
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7ed21c7
docs(adr): propose 0082, a worker may turn single slim services on or…
V3RON f7ef176
docs(adr): 0082 records the named services it wrote (#1644)
V3RON dadf370
docs(adr): accept 0082 (#1644)
V3RON 1c92a12
docs(adr): renumber to 0083, 0082 is taken by #1647 (#1644)
V3RON a21f86c
Merge remote-tracking branch 'origin/main' into HEAD
V3RON 6fcfdc5
docs(adr): a recorded name in neither list follows §2, not a blanket …
V3RON 4500ab8
Merge remote-tracking branch 'origin/main' into HEAD
V3RON File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
.../0083-a-worker-may-turn-single-slim-services-on-or-off-beside-its-categories.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # 0083. A worker may turn single slim services on or off beside its categories | ||
|
|
||
| - **Status:** Accepted — not yet implemented | ||
| - **Date:** 2026-11-17 | ||
| - **Issue:** [#1644](https://github.com/callstackincubator/simlock/issues/1644) (requests [#1556](https://github.com/callstackincubator/simlock/issues/1556), [#1552](https://github.com/callstackincubator/simlock/issues/1552)) | ||
| - **Narrows:** [ADR 0060](0060-ios-slim-writes-launchd-overrides-while-the-simulator-is-shut-down.md) §1 (the managed labels gain the worker's named services and the ones it recorded, a never-disable label may be written `true`, and a record file sits beside the overrides) and §2 (a device is `slim` only when some label is written `true`); [ADR 0066](0066-a-slim-lease-may-keep-named-categories-running.md) §2 (a kept category also wins over a service the worker turns off by name). | ||
|
|
||
| ## Context | ||
|
|
||
| A worker slims whole categories (`ios.slim.categories`). Two requests | ||
| need one service at a time: | ||
|
|
||
| - #1556 keeps push, assets and StoreKit running while the rest of their | ||
| categories stay off. Today the only way is to drop the whole category. | ||
| - #1552 turns off `com.apple.diagnosticd`, which no category lists. On one | ||
| x86 VM with iOS 26.5 it cost 7–11% of a core per booted simulator. It | ||
| must stay opt-in: without it `log stream` inside the simulator breaks. | ||
|
|
||
| The file of ADR 0060 handles it. Checked on 2026-11-17 on iOS 26.4 | ||
| (23E254a), a throwaway iPhone 17 in a private device set: with | ||
| `com.apple.diagnosticd` written `true` before the boot, the boot finished, | ||
| `print-disabled` listed it disabled and no `diagnosticd` ran under the | ||
| runtime root; with the file removed and a reboot, it ran. | ||
|
|
||
| A lease's `--except` (ADR 0066) keeps whole categories, per lease. Both | ||
| requests are about the worker, not a lease. | ||
|
|
||
| ```mermaid | ||
| flowchart LR | ||
| subgraph Before["Today"] | ||
| A1[ios.slim.categories] --> A2["category labels off"] --> A3[disabled.plist] | ||
| end | ||
| subgraph After["This ADR"] | ||
| B1[ios.slim.categories] --> B2["category labels off"] | ||
| B3[ios.slim.exclude] --> B4["+ named services off"] | ||
| B5[ios.slim.include] --> B6["− named services on"] | ||
| B2 --> B4 --> B6 --> B7["− lease --except categories"] --> B8[disabled.plist] | ||
| end | ||
| ``` | ||
|
|
||
| ## Decision | ||
|
|
||
| ### 1. Two worker lists of service names | ||
|
|
||
| The worker config takes `ios.slim.include` (services that run anyway) and | ||
| `ios.slim.exclude` (services that do not run), beside | ||
| `ios.slim.categories`. Both hold launchd service names, never categories. | ||
| A name in both lists fails the config load. Neither reaches a lease | ||
| request, the catalog or a gateway. | ||
|
|
||
| ### 2. What a slim device turns off | ||
|
|
||
| The services written off are those of the worker's categories that the | ||
| lease does not keep, plus `exclude`, minus `include`. The services of a | ||
| category the lease keeps are always written on. A kept category wins over | ||
| `exclude` for its own services, as it already wins over a slimmed | ||
| category that lists the same one: the lease asked for it running. | ||
|
|
||
| `exclude` wins over simslim's never-disable list: the operator named the | ||
| service. Every name in either list becomes a managed label (ADR 0060 §1), | ||
| written `true` or `false` on every `prepare`. | ||
|
|
||
| ### 3. The readback keeps ADR 0060's rules for these names | ||
|
|
||
| An `include` or `exclude` service not read back as written grants `full`, | ||
| and a readback that cannot run grants `slim`, as for any managed label. A | ||
| `full` device runs every service, so an `include` service runs there too. | ||
| Only a lease's `--except` keeps ADR 0066's stricter rule. | ||
|
|
||
| ### 4. Slim means some service is off | ||
|
|
||
| A device is `slim` only when at least one label is written `true`. So | ||
| `categories: []` with an `exclude` is a slim worker, and a configuration | ||
| or an `--except` that leaves nothing off grants `full`, as today. | ||
|
|
||
| ### 5. Simlock records the names it wrote | ||
|
|
||
| The file also holds lines the runtime wrote, so Simlock cannot tell its | ||
| own lines from them once a name leaves both lists. Beside each | ||
| simulator's `disabled.plist`, Simlock keeps a record of the `include` and | ||
| `exclude` names it last wrote. A recorded name in neither list stays a | ||
| managed label at the next `prepare`, written by §2 as any other name: `true` | ||
| when a slimmed category the lease does not keep lists it, `false` otherwise. | ||
| The record is then rewritten. It is copied | ||
| with the file and removed with its folder. Without it, an idle simulator | ||
| that survives a restart, or a baseline's copy, keeps a reverted `exclude` | ||
| off with no warning. The file's name and shape are in the feature. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - #1552's setup is `categories: []`, `exclude: ["com.apple.diagnosticd"]`, | ||
| with slim leases. | ||
| - Simlock cannot tell a misspelt name: launchd reads back whatever the | ||
| file says. | ||
| - One more file per simulator (§5). A baseline saved before this ADR has | ||
| no record, so a name dropped from `exclude` stays off in its copies; | ||
| putting it in `include` turns it back on. | ||
| - No protocol change; the catalog's `slimCategories` stays the categories. | ||
|
|
||
| ## Alternatives considered | ||
|
|
||
| - **Fail the boot when an `include` service is off, as `--except` does.** | ||
| Every slim boot on such a worker would fail whenever the readback times | ||
| out under load, where it grants `slim` today; a plain slim boot that | ||
| fails is not retried. Rejected by the maintainer. | ||
| - **A `diagnostics` category for #1552.** Turns the service off for every | ||
| worker that leaves `categories` unset, which breaks `log stream`. | ||
| - **Names on a lease (`--except` of a service).** Out of scope for now; | ||
| `--except` stays categories-only. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the ADR Proposed until approval.
The PR objective says the spec session has not approved this ADR.
Accepted — not yet implementedmakes it a binding target. Mark it Proposed here and in the index until approval.