Skip to content

simlock component list shows every installed component, its size, and who installed it #220

Closed

Description

@V3RON

Part of #213.

Scope

After this PR simlock component list shows every installed component on the machine: iOS runtimes and Android system images, each with its size, whether Simlock installed it, and how many devices use it. It is read-only. It is what an operator reads before removing anything, and what the removal's dry run is checked against.

Technical spec

File and line references are to main at 88c4eeb.

Modules touched

  • src/core/driver.ts: Driver.listComponents() returns one entry per installed component: { version, variant?, sizeBytes?, receipt, foreignDevices }. Read-only, never downloads, every process it starts is bounded; same contract as listCatalog (:252).
    • receipt is built by the same function findComponent and installComponent use, so a listed component and the record of its install compare equal.
    • variant is the driver's own words for what tells two components of one version apart.
    • foreignDevices is the number of devices outside Simlock's root that use the component. This is the only place a driver looks at devices that are not Simlock's; it reads them and never writes there.
  • src/drivers/ios/index.ts: from simctl runtime list -j, iOS images only. version, sizeBytes, variant = the build, receipt = { image, build } (the image identifier and its build). foreignDevices = devices in the default device set (simctl list devices -j with no --set) whose runtime is this image's runtime identifier.
  • src/drivers/android/index.ts: from the installed images (#installedImages). version = API level, variant = tag and ABI, receipt = { package, revision, stamp } as Lease-triggered downloads go through one installer in the core #216 defines it, sizeBytes from the image directory. foreignDevices = AVDs in the user's own AVD home (not Simlock's root) whose config.ini names this image's directory.
  • src/ports/filesystem.ts: directorySize(path), with its in-memory implementation. An unreadable directory rejects, and the driver then leaves sizeBytes out.
  • src/core/component-installer.ts: list(platform?) merges, per driver, listComponents() with the registry's component records and devices: installedBySimlock is true when a record's receipt equals the entry's; installedAt comes from that record; devices counts registry devices of that platform and version in any state but deleted. The core cannot tell variants apart, so two variants of one version show the same count. A driver whose listComponents rejects is left out and logged, as catalog.get does for a driver that cannot answer.
  • src/contract/operations.ts: component.list, role: "agent". Input { platform? }. Output { components: [{ platform, version, variant?, sizeBytes?, installedBySimlock, installedAt?, devices, foreignDevices }] }, ordered by platform, then version, then variant.
  • src/daemon/dispatcher.ts: the handler. src/gateway/dispatcher.ts: UNSUPPORTED_IN_GATEWAY_MODE.
  • src/simlock-client/client.ts, types.ts: SimlockClient.listComponents(input?).
  • src/cli/index.ts: component list [--platform <ios|android>], one JSON object on stdout.
  • src/http/app.ts: GET /v1/components?platform=, role agent.
  • src/core/fake-driver.ts, e2e/fake-driver/fake-driver.ts: listComponents from the scripted versions, with scriptable size and foreign devices.
  • Docs: docs/CLI.md, docs/HTTP-API.md, docs/CLIENT.md, docs/internal/ARCHITECTURE.md.

Contract and event changes

  • New operation component.list. No protocol change: no gateway relays it.
  • No event.

Rules in play

  • ADR 0010 §5 (the record is the only proof) and §8.
  • architecture.md rule 2 (receipt and variant are compared and carried, never read, by the core), rule 9 (the new filesystem call goes through the port), rule 10 (one function builds a receipt), rule 11 (bounded tool calls).
  • safety.md rule 1 (everything outside the root is read-only) and rule 8 (ownership comes from the record, never from a name or a path).
  • documentation.md rule 2.
  • testing.md rules 1 to 4.

Tests

  • A component Simlock installed is listed with installedBySimlock: true and its installedAt.
  • A component that was on the machine before is listed with installedBySimlock: false.
  • A record whose receipt no longer equals any installed component marks nothing as Simlock's.
  • devices counts registry devices of that platform and version, and not deleted ones.
  • Two variants of one version both show the devices of that version.
  • The iOS driver lists one entry per iOS runtime image with its size and build, and no entry for another platform's runtime.
  • The iOS driver counts a device in the default device set as foreign and a device in Simlock's set as not.
  • The Android driver lists two images of one API level as two entries with different variants.
  • The Android driver counts an AVD in the user's AVD home that names the image as foreign.
  • The Android driver leaves sizeBytes out when the image directory cannot be read, and still lists the image.
  • The receipt listComponents returns for a component equals the one installComponent returned for it.
  • listComponents starts no installer on either driver.
  • A driver that rejects is left out and the other platform is still listed.
  • An agent session may call component.list.
  • On a gateway the operation answers UNSUPPORTED_IN_GATEWAY_MODE.

Done when

  • On a real machine, simlock component list shows the installed iOS runtimes and Android images with plausible sizes, and marks only the ones installed through Simlock since Lease-triggered downloads go through one installer in the core #216.
  • e2e with the fake driver: a component installed with simlock component install is listed as Simlock's; one scripted as already present is not.
  • pnpm check is green.

Out of scope

  • Removing a component: the next task.
  • Listing through a gateway.
  • Components other than iOS runtimes and Android system images.

Depends on

Approval

  • Approved for delivery

Written by an agent.

Activity

  1. added
    task:draft
    on Oct 2, 2026
  2. V3RON commented on Oct 2, 2026

    @V3RON
    ContributorAuthor

    Spec updated: Technical spec uses the receipt #216 defines and says devices are counted per version.

    Written by an agent.

  3. V3RON commented on Oct 2, 2026

    @V3RON
    ContributorAuthor

    Spec updated: wording of the foreign-device read.

    Written by an agent.

  4. added
    task:ready
    and removed
    task:draft
    on Oct 2, 2026
  5. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    Now task:ready: approved, technical spec present, #216, #217 closed.

  6. self-assigned this
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions