Skip to content

Leases and device lists report the device mode #177

Closed

Description

@V3RON

Part of #172.

Scope

After this PR every surface reports a device's mode as mode: "slim" or mode: "full": the lease grant, the HTTP lease object, simlock status, and simlock list --devices, on a worker and through a gateway. featureProfile and the HTTP slim flag are gone. How a mode is chosen does not change yet: --full and ios.slim.enabled still work as on main.

Technical spec

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

Modules touched

  • src/contract/schemas.ts: one mode enum (slim, full) replaces featureProfileSchema (:35). mode is required on deviceRecordSchema, grantedDeviceSchema, and statusDeviceSchema, and optional on driverDeviceSchema.
  • src/contract/protocol.ts: raise PROTOCOL_VERSION_RANGE min and max by one from what main has, and extend the comment.
  • src/core/driver.ts: DriverDevice.mode? replaces featureProfile. readyTransitionUpdate writes mode ?? "full" on every readiness transition, so a stale slim cannot outlive a boot that did not slim.
  • src/core/domain.ts: DeviceRecord.mode is required.
  • src/core/registry.ts: registerDevice sets mode: "full". On load, a record with no mode loads as full; a stored mode that is neither slim nor full fails the load with RegistryLoadError; the old featureProfile key is ignored and not written back. No value is derived from featureProfile (ADR 0007 §11).
  • src/drivers/ios/index.ts: report slim where it reported reduced, and full where it reported full or nothing.
  • src/core/fake-driver.ts, e2e/fake-driver/: the same vocabulary.
  • src/http/tracker.ts: the lease object carries mode in place of slim.
  • src/cli/index.ts: formatStatus prints each device's mode.
  • src/gateway/worker-link.ts: nothing to add; the view narrows devices through statusDeviceSchema, which now carries mode.
  • Docs: docs/CLI.md, docs/HTTP-API.md, docs/CLIENT.md describe mode on the lease and on devices and drop featureProfile and slim; say "device mode" where status also shows the daemon's mode. Update every mention of the protocol number in docs/CLI.md, docs/HTTP-API.md, and docs/internal/ARCHITECTURE.md. docs/internal/KNOWN-PITFALLS.md: the iOS slim section uses the new word.

Contract and event changes

  • Output shapes as above. Protocol version raised by one, no shim.
  • No event changes.

Rules in play

  • ADR 0007 §8, §9, §11, §12.
  • architecture.md rule 10 (the default full is written in one place, not per surface) and rule 13 (comments naming featureProfile become false).
  • safety.md rule 10 (a stored mode is validated, not trusted).
  • testing.md rules 1 to 3.
  • documentation.md rule 2.

Tests

  • A lease grant's device carries mode: "slim" when the driver reported a slim boot, and mode: "full" when it reported none.
  • A ready transition whose driver reports no mode stores full, replacing a stored slim.
  • A record written before mode existed loads as full, whatever its featureProfile was, and featureProfile is not written back.
  • A stored mode that is neither slim nor full fails the registry load.
  • status.get and list.get return mode for every device, including one still provisioning.
  • No lease.request, list.get, status.get, or HTTP lease response contains featureProfile or slim.
  • The HTTP lease object's mode equals the granted device's mode.
  • simlock status prints each device's mode.
  • A gateway's status.get and worker.list report each worker device's mode.
  • A worker advertising the previous protocol version is marked incompatible by a gateway advertising the new one.
  • Slow lane, real iOS (e2e/slow-ios-slim.test.ts): a slim lease's grant carries mode: "slim" and a --full lease's grant carries mode: "full".

Done when

  • Every test above passes and pnpm check is green.
  • grep -rn "featureProfile" src docs e2e finds nothing outside docs/internal/adr/.
  • --full and ios.slim.enabled behave as on main.

Out of scope

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.

  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