Skip to content

Status and the worker list report host facts #181

Closed

Description

@V3RON

Part of #171.

Scope

After this PR simlock status and GET /v1/status report host facts: operating system, its version, CPU architecture, and the versions of Xcode and the Android SDK tools. On a gateway, simlock worker list and GET /v1/workers show each worker's host facts next to its catalog. The worker list samples in the docs match the real response.

"host": { "os": "macOS", "osVersion": "15.5", "arch": "arm64",
  "tools": [ { "platform": "ios", "name": "xcode", "version": "16.4", "build": "16F6" },
             { "platform": "android", "name": "emulator", "version": "35.4.9" },
             { "platform": "android", "name": "platform-tools", "version": "36.0.0" },
             { "platform": "android", "name": "cmdline-tools", "version": "19.0" } ] }

Technical spec

File and line references are to main at the time of writing.

Modules touched

  • src/ports/host-info.ts (new): a port for operating system name, version, and architecture, with a Node adapter and a fake. On macOS the adapter runs sw_vers once, with a timeout; elsewhere it uses node:os. Read once in the composition root.
  • src/core/driver.ts: optional toolVersions?() on Driver, shaped like advisories?(). It must not download and must not throw.
  • src/drivers/ios/index.ts: xcodebuild -version through ProcessRunner, bounded, returning version and build. A failure returns no entry.
  • src/drivers/android/index.ts: Pkg.Revision from source.properties of the emulator, platform-tools, and command-line tools packages, using the parser systemImageVersion already has. A package that cannot be read is left out. The driver takes the host ABI from the composition root instead of reading process.arch itself, so status and ABI preference agree.
  • src/core/host-facts.ts (new): joins the host port's facts with every driver's tool versions. Read at startup, served from memory, re-read in the background once older than a fixed 60 s, single-flight, last value kept when a re-read fails. Uses Clock. No config key.
  • src/contract/schemas.ts, src/contract/operations.ts: status.get gains required host beside daemon; workerViewSchema gains optional host. Every string and the tools list have a length limit.
  • src/daemon/dispatcher.ts, src/daemon/main.ts: the worker's status.get returns the cached host facts without waiting, also while other operations are parked on startup.
  • src/gateway/dispatcher.ts, src/gateway/aggregate.ts: a gateway's status.get reports its own host with tools: [].
  • src/gateway/worker-link.ts (#rebuildView, :338-376), src/gateway/worker-registry.ts: copy host from the worker's status.get into the view. An incompatible worker's view has none.
  • src/cli/index.ts: formatStatus prints a host line; formatWorkers prints each worker's operating system, architecture, and tool versions.
  • Docs: docs/CLI.md (status, worker list), docs/HTTP-API.md (status, worker routes), docs/CLIENT.md, docs/internal/ARCHITECTURE.md (what a view holds; that the catalog and config are re-read on the refresh tick). Replace the worker list samples in docs/HTTP-API.md and docs/CLI.md, which do not match workerViewSchema today, with output pasted from a real worker list --json.

Contract and event changes

  • status.get output gains required host. worker.list views gain optional host. No further protocol bump: this adds to the version the first task introduced.
  • No event changes.

Rules in play

  • ADR 0008 §5 to §9.
  • architecture.md rule 1 (the core names no tool), rule 2 (each driver reads its own tools), rule 9 (the host is read through a port), rule 11 (the sw_vers and xcodebuild calls are bounded), rule 12 (a failed read leaves the last value, a named state), rule 13.
  • safety.md rule 10 (host facts from a worker are bounded and validated on the gateway).
  • documentation.md rules 2 and 3.
  • testing.md rules 1 to 3.

Tests

  • iOS reports the Xcode version and build that xcodebuild -version prints.
  • iOS reports no Xcode entry when xcodebuild fails, and the daemon still starts.
  • Android reports emulator, platform-tools, and command-line tools revisions from each package's source.properties.
  • Android omits a tool whose source.properties cannot be read.
  • The host port reports the macOS product name and version from sw_vers.
  • Host facts are served without waiting and are re-read once older than the maximum age.
  • Host facts keep the last tool versions when a re-read fails.
  • status.get reports operating system, version, architecture, and every driver's tool versions.
  • status.get answers with host facts while other operations are parked on startup.
  • A gateway's status.get reports its own host with no tools.
  • A worker view carries the host facts its worker last reported.
  • An incompatible worker's view carries no host facts.
  • A changed tool version shows on the view after the next refresh.
  • status.get from a worker with an over-long host string is rejected by the gateway's schema.
  • simlock status prints the host line.
  • simlock worker list prints each worker's operating system, architecture, and tool versions.
  • E2E (e2e/gateway-fleet.test.ts): worker list --json and GET /v1/workers show each worker's host and catalog.

Done when

Out of scope

  • Routing by host facts, labels, or selectors.
  • CPU count and RAM in host facts; capacity already reports what it derives from them.
  • Any config key.

Depends on

Approval

  • Approved for delivery

Written by an agent.

Activity

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

    @github-actions
    Contributor

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

  4. self-assigned this
    on Oct 1, 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