Skip to content

Slim: worker include and exclude lists of single services #1650

Closed

Description

@V3RON

Part of #1644.

Scope

A worker operator sets ios.slim.include and ios.slim.exclude in the worker config: slim simulators keep the named services running or turn them off, beside the categories, and a name taken out of both lists goes back on at the next prepare. This is the whole feature.

If it goes wrong, an operator sees a service that should run stay off (push, StoreKit, log stream), or a slim worker grant full devices.

Technical spec

Commit 1cd9315.

Rows

  • Behaviours: B1, B2, B3, B4, B5, B6
  • Stored state: S1, S2
  • Interfaces: I1, I2, I3, I4
  • Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11

Facts

# Fact Source
F1 On iOS 26.4 (23E254a), an iPhone 17 in a private device set with com.apple.diagnosticd written true in disabled.plist before its first boot finished bootstatus -b, print-disabled system listed "com.apple.diagnosticd" => disabled, and no RuntimeRoot/usr/libexec/diagnosticd process ran; with the file removed and a reboot it ran. run on 2026-11-17: xcrun simctl --set <scratch> spawn <udid> launchctl print-disabled system and ps -axo pid,command | grep "RuntimeRoot.*diagnosticd"
F2 com.apple.apsd is a label of the store category. src/drivers/ios/slim-labels.ts:107-112
F3 Module checks already run on the merged config, and both the daemon and the CLI pass the driver entries to the config load, so a driver check runs for daemon start and config set alike. src/core/config.ts:206, src/daemon/main.ts:243, src/cli/environment.ts:233-238
F4 copyOverrides returns early when the source has no disabled.plist, so a clone of a seed starts with no overrides folder. src/drivers/ios/slim-boot.ts:131-139
F5 The slow-lane slim test drives a real daemon with an ios config and reads back print-disabled. e2e/slow-ios-slim.test.ts:185-200

Modules touched

Searches: rg -n "overridesFor|writeOverrides|copyOverrides|resolveSlimCategories|DriverConfigEntry|runModuleChecks|iosDriverConfig" src e2e.

  • src/drivers/ios/ (definition.ts, slim-labels.ts, slim-boot.ts, AGENTS.md)
  • src/core/ (config-types.ts, config-role-checks.ts, config.ts)
  • src/drivers/ios/test-slim.ts (FaultyFilesystem fails only disabled.plist writes, :143-148; it must be able to fail the record write too) and src/drivers/ios/index-slim-mode.test.ts (its filesystem.writes checks at :172, :396, :429, :564 hold for a config without the keys, since S2 writes no empty record)
  • e2e/slow-ios-slim.test.ts
  • website/src/content/docs/docs/reference/configuration.mdx, website/src/content/docs/docs/using-devices/choosing-a-device.mdx
  • docs/internal/EVENTS.md

Rules in play

  • ADR 0083 (all sections): the lists, the precedence, the readback, when a device is slim, the record.
  • ADR 0060 §1–§4: the file write stays a merge, atomic, 0644, folder 0700; the readback table is unchanged for every label; destroy removes the whole folder.
  • ADR 0066 §2: --except keeps its strict failures for kept categories only; include names never join them.
  • docs/internal/agent-rules/documentation.md rule 9: the configuration reference and the slim guide change in the same PR.
  • Drivers manual: a driver imports only core and ports; the new check is on core's DriverConfigEntry.

Tests

The seams are configFromLayers (model on src/drivers/ios/definition.test.ts) and IosSimctlDriver.makeReady with fake simctl and filesystem (model on src/drivers/ios/slim-except.test.ts and src/drivers/ios/index-slim-mode.test.ts).

  • B1: an operator loads a worker config with include/exclude: both set; an empty list; a duplicate; a name in both (fails, names it); include in the file and the same name in exclude in the overrides layer (fails); a string instead of a list; an empty string; config get ios.slim shows both
  • B2: a slim prepare writes each managed label: include of a slimmed category → false; exclude in no category → true; exclude of a never-disable label → true; --except category with one label in exclude → false; an unmanaged line kept; a recorded name in neither list → false and the record rewritten; no record → empty, no log; an unreadable record → empty, logged; a failed record write counts as a failed write; an unchanged record is not written; a copy gets its source's record
  • B3: the readback grants I2's mode: all as written → slim and device.slimmed counting the exclude label; exclude read enabled → full; include read disabled with no --except → full, no throw; readback fails → slim; categories: [] + exclude → slim; nothing off → full, no event; no categories and no exclude → full, skipped as today
  • B4: a lease with --except on such a worker: kept label read disabled → KeptCategoriesError; exclude label read enabled → full, no throw
  • B5: the configuration reference lists ios.slim.include and ios.slim.exclude (src/core/config-reference.test.ts)
  • B6: slow lane, real simulator: categories: [], exclude: ["com.apple.diagnosticd"] → slim, no diagnosticd process; include: ["com.apple.apsd"], categories unset → readback shows apsd not disabled and every other category label disabled

Done when

  • pnpm test:changed passes, with the B1–B5 cases above.
  • The website build and its HTTP API check pass (definition.ts changes).
  • On a Mac with a real simulator, the B6 cases pass in e2e/slow-ios-slim.test.ts, run through scripts/slow-e2e.sh e2e/slow-ios-slim.test.ts.
  • src/drivers/ios/AGENTS.md states the precedence, the record and the old-baseline gap; the configuration reference says that categories and exclude turn services off and include keeps them running.

Out of scope

  • Service names on a lease (--except stays categories-only).
  • Catalog, gateway routing or protocol changes.
  • Checking that a name is a real service.
  • Baselines saved before this ships (no record).

Depends on

Written by an agent.

Activity

  1. added
    task:draftScope written; technical spec or its spec check missing.
    on Nov 17, 2026
  2. added
    task:readySpec checked. An agent may implement it once its Depends on allow.
    and removed
    task:draftScope written; technical spec or its spec check missing.
    on Nov 17, 2026
  3. self-assigned this
    on Nov 17, 2026
  4. 5 remaining items

  5. V3RON commented on Nov 17, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: PR #1655 (task/1650, stacked on ADR PR #1646, stack #1656) builds ios.slim.include and ios.slim.exclude. Review passed: round 1, round 2, and fix-checks at 5a0d833 and 5d9cfc6. Six blocking findings, all fixed. ADR PR #1646 passed review too. Both PRs are ready.

    Not done: the slow-lane Done when line (B6 in e2e/slow-ios-slim.test.ts) and the feature's two real-simulator Completion conditions. The gate has not run, so nothing is merged. CI was still running on 5d9cfc6, the commit that fixed Fallow's CRAP findings.

    Findings: none open. The ledger and notes are on #1655.

    Blocked on: the slow lane refused this machine because it has 10.2 GiB of free disk and needs 15. The maintainer can run scripts/slow-e2e.sh e2e/slow-ios-slim.test.ts on a Mac with room, or re-run /deliver 1644 there. The stack then merges through merge-pr.sh 1655 after the ADR flip to Accepted.

    Written by an agent.

  6. added
    task:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.
    and removed
    task:readySpec checked. An agent may implement it once its Depends on allow.
    on Nov 17, 2026
  7. added
    task:readySpec checked. An agent may implement it once its Depends on allow.
    and removed
    task:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.
    on Nov 17, 2026
  8. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:readySpec checked. An agent may implement it once its Depends on allow.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions