Repository navigation
Closed
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Description
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 aslistCatalog(:252).receiptis built by the same functionfindComponentandinstallComponentuse, so a listed component and the record of its install compare equal.variantis the driver's own words for what tells two components of one version apart.foreignDevicesis 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: fromsimctl 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 -jwith 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,sizeBytesfrom the image directory.foreignDevices= AVDs in the user's own AVD home (not Simlock's root) whoseconfig.ininames this image's directory.src/ports/filesystem.ts:directorySize(path), with its in-memory implementation. An unreadable directory rejects, and the driver then leavessizeBytesout.src/core/component-installer.ts:list(platform?)merges, per driver,listComponents()with the registry's component records and devices:installedBySimlockis true when a record's receipt equals the entry's;installedAtcomes from that record;devicescounts registry devices of that platform and version in any state butdeleted. The core cannot tell variants apart, so two variants of one version show the same count. A driver whoselistComponentsrejects is left out and logged, ascatalog.getdoes 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=, roleagent.src/core/fake-driver.ts,e2e/fake-driver/fake-driver.ts:listComponentsfrom 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.mdrule 2 (receiptandvariantare 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.mdrule 1 (everything outside the root is read-only) and rule 8 (ownership comes from the record, never from a name or a path).documentation.mdrule 2.testing.mdrules 1 to 4.
Tests
- A component Simlock installed is listed with
installedBySimlock: trueand itsinstalledAt. - 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.
devicescounts 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
sizeBytesout when the image directory cannot be read, and still lists the image. - The receipt
listComponentsreturns for a component equals the oneinstallComponentreturned for it. listComponentsstarts 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 listshows 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 installis listed as Simlock's; one scripted as already present is not. pnpm checkis 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
- Lease-triggered downloads go through one installer in the core #216
simlock component installinstalls a component from the CLI, the client and HTTP #217
Approval
- Approved for delivery
Written by an agent.
Metadata
Metadata
Assignees
Labels
task:readySpec checked. An agent may implement it once its Depends on allow.
Activity
V3RON commentedon Oct 2, 2026
Spec updated: Technical spec uses the receipt #216 defines and says devices are counted per version.
Written by an agent.
V3RON commentedon Oct 2, 2026
Spec updated: wording of the foreign-device read.
Written by an agent.
github-actions commentedon Oct 2, 2026
Now
task:ready: approved, technical spec present, #216, #217 closed.