Skip to content

feat(contract,core,ios,cli,http,gateway): a lease request chooses slim or full; ios.defaultMode sets the default - #204

Merged
V3RON merged 5 commits into
mainfrom
task/178
Oct 1, 2026
Merged

V3RON merged 5 commits into
mainfrom
task/178

Conversation

@V3RON

@V3RON V3RON commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Closes #178

A lease request can now choose its device mode. mode (slim or full) replaces full / --full on the CLI, MCP, HTTP, and the client. ios.defaultMode (default full) replaces ios.slim.enabled and sets what a request with no mode gets.

  • The composition root builds the default-mode map. LeaseAcquisitionCoordinator is the one place a missing mode gets that default, and it accepts a slim spec only for a slim request.
  • The iOS resolveSpec returns a slim spec only for a slim request on 18.5 or newer. makeReady reads the spec's mode from its options, and the driver no longer stamps full into its data.
  • DeviceSpec.mode keeps slim and full devices in separate pools. The registry drops a stored full on load.
  • The HTTP lease body is strict. The gateway forwards the mode as it arrived.
  • Protocol 7 → 8. docs/ and KNOWN-PITFALLS.md are updated, including the upgrade step and the Capacity counts slim and full devices separately #174 budget pitfall.

Done when (#178)

  • Every listed test passes; pnpm check is green. Its steps were run one by one, because the local pnpm is too old to read the workspace file. Unit: 2168 passed. Fast e2e: 78 passed.
  • The Done-when grep is empty outside ADRs. It is not: two tests that prove the removal must name the removed flag and key (src/cli/index.test.ts, src/core/config.test.ts). Docs and code are clean.
  • Slow lane on an iOS 18.5+ Mac. Not run yet. e2e/slow-ios-slim.test.ts is rewritten for --mode and ios.defaultMode.
  • Lease requests choose slim or full; config sets the default #172's Completion conditions are walked below.

Completion conditions (#172)

  • --mode slim on a default-full worker is slim, and --mode full on a default-slim worker skips idle slim devices. Covered only by the slow lane, which has not run. The fake-driver form is covered by lease-acquisition-coordinator.test.ts "device mode".
  • A request with no mode gets the worker's default. Covered by the coordinator tests and the e2e gateway test.
  • Slim below 18.5 is granted full, and so is slim on Android. Covered by the iOS resolveSpec tests and by the coordinator test for a driver that knows nothing of modes.
  • MCP and HTTP accept mode, and their leases report it. Covered by contract, MCP, and HTTP tests (the leases' mode comes from Leases and device lists report the device mode #177).
  • No featureProfile and no HTTP slim; status and list show mode. Delivered by Leases and device lists report the device mode #177.
  • full, a bad mode, and --full are rejected. Covered by contract, server, MCP, HTTP, and CLI tests.
  • A config with ios.slim.enabled gets the unknown-key warning and default full. Covered by config.test.ts.
  • Gateway with one worker of each default. Covered by e2e/gateway-fleet.test.ts.
  • The doctor advisory appears only when the default is slim. Covered by the iOS advisories() tests and deviceModeWiring.
  • simlock config renders ios.defaultMode. Covered by e2e/daemon-lifecycle.test.ts. The four docs are updated.
  • The upgrade step is in CONFIGURATION.md and KNOWN-PITFALLS.md.
  • The Capacity counts slim and full devices separately #174 overcommit pitfall is recorded.

Review

Spec review: 11 findings, 5 fixed. Code review: 10 findings, 9 fixed.

Rejected:

  • The Done-when grep still matches --full and ios.slim.enabled. The spec requires tests that name them in order to prove they are gone. Spec needs: exclude test files from that grep.
  • An omitted mode and a mode equal to the worker's default are different requests under one idempotency key. The default can differ per worker, so they do not mean the same thing.
  • Done when names pnpm check, the slow lane, and the PR walk, and no diff can show those. They are reported in this body instead.
  • The iOS resolveSpec returns a full spec when no slim options are configured. A driver that cannot slim gives a full spec (ADR 0007 §4), and the daemon always passes those options.
  • Nothing tests that startDaemon hands slimByDefault to the iOS driver. That is a one-line pass-through, the mapping itself is tested in deviceModeWiring, and no fast-lane test runs a real iOS driver.

Written by an agent.

V3RON added 5 commits October 1, 2026 16:22
…m or full; ios.defaultMode sets the default

A lease request carries an optional mode (slim or full) on every surface,
replacing full and --full. ios.defaultMode replaces ios.slim.enabled and sets
what a request with no mode gets; the acquisition coordinator is the one place
that default is applied. Every worker honours both modes: the iOS driver
returns a slim spec only for a slim request on 18.5 or newer, the core refuses
a slim spec for any other request, and the spec's mode keeps slim and full
devices in separate pools. Protocol raised to 8.

Closes #178
…over the warm re-boot mode and retired-key stripping
…o response shows a spec's planned mode; the fake reports full on recovery
# Conflicts:
#	src/contract/protocol.ts
@V3RON
V3RON merged commit 88c4eeb into main Oct 1, 2026
14 checks passed
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.

A lease request chooses slim or full; ios.defaultMode sets the default

1 participant