Repository navigation
Description
Part of #1832.
Scope
A user can run simlock lease --requires bank-network,eu-west, locally or with --url. An agent can pass requires to the MCP lease_simulator tool, locally or in farm mode. Either way the lease goes only to a worker that has every name.
If this task goes wrong, the flag or field is accepted but the names never reach the daemon, so the lease lands on any worker.
Technical spec
Commit 200afe5.
Rows
- Behaviours: B7, B8
- Interfaces: I4, I5
- Existing code: X14, X15, X17
Facts
| # | Fact | Source |
|---|---|---|
| F1 | Today simlock lease --platform android --requires bank-network prints {"error":{"code":"USAGE","message":"Unknown option '--requires'. …"}}, exit 2 |
ran node dist/cli/main.js lease --platform android --requires bank-network on main |
| F2 | --except is split on , the same way --requires will be |
src/cli/commands/lease.ts:322 |
| F3 | The MCP server lists lease_simulator from leaseSimulatorInputSchema's shape; removing requires from the omit lists it |
src/mcp/contracts.ts:46; src/mcp/server.test.ts:61 |
Modules touched
src/cli (lease command and its help), src/mcp (lease_simulator input), website reference/cli.mdx, reference/mcp-tools.mdx, reference/errors.mdx:57. Searches: leaseSimulatorInputSchema, except: in src/cli/commands/lease.ts, requires in website/src/content/docs.
Rules in play
- ADR 0091 §4: every frontend can pass
requires. src/mcp/AGENTS.md: the MCP server reaches the daemon only throughsimlock/client, so it adds no check of its own.src/cli/AGENTS.md: no decision logic in the CLI; the contract checks the names.- Documentation rule 9: cli.mdx, mcp-tools.mdx and errors.mdx
:57(CAPABILITY_MISSING: the CLI and MCP now ask too).
Tests
Seam: the lease command with a fake client, and lease_simulator through the MCP server with a fake client. Model them on src/cli/index-lease-run-id.test.ts and src/mcp/server.test.ts.
- B7:
simlock lease --requires:bank-network;bank-network,eu-west; with--urlthe request carries bothrequiresandidempotencyKey;--requires ""prints the daemon'sBAD_REQUEST, exit 2;--helpshows[--requires <capability,...>] - B8: MCP
lease_simulatorwithrequires: local["bank-network"]; farm mode sends bothrequiresandidempotencyKey; none given, none sent; the listed input schema hasrequires
Done when
pnpm test:changedandpnpm typecheckpass.- cli.mdx and mcp-tools.mdx document
--requiresandrequires.
Out of scope
- Tags on single devices (Devices on one worker cannot be tagged by the network they can reach #1542).
Depends on
- Tags on a worker, matched by requires, and requires with an idempotency key #1844
- Slim lease hint line in simlock lease and lease_simulator #1843
- Plain http to a remote farm by explicit opt-in: --allow-insecure-http, SIMLOCK_ALLOW_INSECURE_HTTP, allowInsecureHttp #1839
#1843 and #1839 change the same lease command, and #1843 also changes the same MCP contracts file and doc sections.
Written by an agent.
Activity
docs(adr): 0091 to Accepted (#1845)
feat(daemon): tags on a worker, matched by requires, and requires wit…
feat(cli): simlock lease --requires and MCP lease_simulator requires (#…