Skip to content

feat(ios,core,docs): component remove removes an iOS runtime whose only other simulators were never used - #249

Merged
V3RON merged 3 commits into
mainfrom
task/241
Oct 2, 2026
Merged

V3RON merged 3 commits into
mainfrom
task/241

Conversation

@V3RON

@V3RON V3RON commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Closes #241

When an iOS runtime install ends, macOS creates about eleven simulators for it in the default device set. component remove counted them as users, so no runtime Simlock installed could be removed.

Now a default-set simulator counts as a user only when its simctl list -j devices entry has lastUsedAt. One function, devicesPerRuntime, decides this for listComponents and removeComponent. An entry that is not an object still counts, so an unreadable entry never unblocks a removal.

Never-used simulators are left in place. After the removal, residue says how many became unavailable and that xcrun simctl delete unavailable clears them. When the download also stays in the asset store, residue carries both sentences. If another build of the same runtime is still installed, the simulators stay available, so they are not reported.

ADR 0010 §8 and safety rule 1 are amended as the spec says, and the ADR header records the amendment. CLI, HTTP API, client, ARCHITECTURE, EVENTS and KNOWN-PITFALLS docs are updated, including the #79 measurement on Xcode 26.4.1.

Done when

  • Real hardware: remove a runtime installed with component install while its macOS-created simulators are present, and record residue. Not run, needs the maintainer's go-ahead.
  • Real hardware: component list foreignDevices equals the runtime's default-set simulators with lastUsedAt. Not run, needs the maintainer's go-ahead.
  • pnpm check: lint, format, typecheck and unit tests are green. Locally, only e2e/gateway-fleet.test.ts and e2e/held-lease-liveness.test.ts failed. Both are known to fail on this machine and pass in CI, so CI decides.

#213 Completion conditions (last sub-issue)

  • Listing shows a Simlock install as Simlock's with its size, and a pre-existing one as not: e2e/component-list.test.ts (fake driver).
  • Removing an owned, unused component succeeds and catalog drops it: e2e/component-remove.test.ts (fake driver). Real hardware not run.
  • Not Simlock's: refused, nothing deleted: e2e/component-remove.test.ts.
  • Used by a Simlock device: refused, nothing deleted: e2e/component-remove.test.ts.
  • Used by a simulator in the user's own set: refused, nothing deleted: e2e/component-remove.test.ts, plus the iOS driver test "refuses with ComponentInUseError when one default-set device of the runtime has lastUsedAt". "Uses" now means used at least once (this PR).
  • Dry run changes nothing: e2e/component-remove.test.ts.
  • Agent session gets FORBIDDEN: e2e/component-remove.test.ts.
  • docs/CLI.md describes the commands and both refusals, and docs/EVENTS.md lists component.removed: checked by reading.

Review

Spec review: 10 findings, 1 fixed. Code review (two rounds): 10 findings, 5 fixed.

Rejected:

  • Done-when real-hardware lines not delivered: they need the maintainer's go-ahead and are left unchecked above.
  • pnpm check cannot be confirmed from the diff: it ran locally, see Done when.
  • Edits to ARCHITECTURE.md, internal EVENTS.md, the ComponentRemoval comment and the KNOWN-PITFALLS in-use section go beyond Modules touched: the deliver skill requires fixing every doc the change makes false, and each of these described the old count or a single-sentence residue.
  • End-user docs say "booted" where the code checks lastUsedAt: simctl sets lastUsedAt when a simulator boots, and "booted" is the word a user can check.
  • The edited "no residue" test does not assert on residue: its body asserts the whole result toEqual({ sizeBytes }), so any residue fails it.
  • ADR 0010 is edited in place, which the ADR README forbids (blocking, raised twice): the maintainer decided in the approved spec to amend §8 in this task. The ADR is still Accepted — not yet implemented and its feature is open. The header now records the amendment. Spec needs: confirm that an unimplemented ADR may be amended in place, or ask for a superseding ADR.
  • Safety rule 1 is relaxed (blocking), and the preamble forbids enforcing it only inside a driver: the spec amends rule 1. The refusal is still enforced centrally by removeListedComponent and ComponentInstaller, and the driver only supplies the count, as architecture rule 2 assigns.
  • An object entry without lastUsedAt counts as unused, so a future simctl that drops the key would unblock every removal: the spec keys on lastUsedAt, which is measured on Xcode 26.4.1. Flagged for the maintainer.

Written by an agent.

V3RON added 3 commits October 2, 2026 17:59
…ly other simulators were never used

A simulator in the default device set counts as a user of its runtime only
when its simctl entry has lastUsedAt. The never-used ones macOS creates for
every installed runtime no longer block a removal; they stay in place, and
residue says how many became unavailable and how to clear them. ADR 0010 §8
and safety rule 1 are amended to match.

Closes #241
…unused simulator is named in the singular

Also mark ADR 0010's §8 amendment by #241 in its header.
…image goes

Another installed build of the same runtime keeps its simulators available.
Also pin how the two residue sentences join, and note in KNOWN-PITFALLS that
a simulator first booted after the last count is not seen.
@V3RON
V3RON merged commit d0034a4 into main Oct 2, 2026
14 checks passed
@V3RON
V3RON deleted the task/241 branch November 6, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

component remove removes an iOS runtime whose only other simulators were never used

1 participant