Repository navigation
Description
Part of #1835.
Scope
After this PR, a slim iOS lease from simlock lease prints one stderr line naming the categories off and the way out, and lease_simulator answers the same line as hint. Full, Android and physical leases are unchanged. The CLI and MCP reference pages describe it.
A user would notice if it goes wrong: the line is missing on a slim lease, names a category the lease kept, or a lease fails or waits because of it.
Technical spec
Commit 200afe5.
Rows
- Behaviours: B1, B2, B3
- Stored state: none
- Interfaces: I1, I2, I3
- Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12
Facts
| # | Fact | Source |
|---|---|---|
| F1 | getCatalog is on the agent-role SimlockClient, so both frontends can call it with the client they hold. |
src/simlock-client/client-api.ts:92, src/simlock-client/client-api.ts:97 |
| F2 | The grant schema is a plain z.object, so .extend works for I3. |
src/contract/lease-schemas.ts:60 |
| F3 | writeResult writes one JSON line; stderr notices are written as JSON.stringify({ notice }) lines. |
src/cli/args.ts:30-32, src/cli/commands/lease.ts:122 |
| F4 | success() writes the structured answer both as the one text item and as structuredContent, so hint reaches both. |
src/mcp/server.ts:415-420 |
| F5 | The protocol-bump check counts only files under src/contract/; src/mcp/contracts.ts is outside it. |
.agents/scripts/protocol-bump-check.mjs:4-6 |
| F6 | lease-policy is shared by the CLI and MCP and is not exported from simlock/client or simlock/admin. |
src/lease-policy/index.ts:13-14, src/cli/commands/lease.ts:10, src/mcp/session.ts:24 |
Modules touched
src/lease-policy (I1, its manual's Does line), src/cli/commands/lease.ts (I2), src/mcp/contracts.ts, src/mcp/session.ts, src/mcp/server.ts (I3), website reference/cli.mdx, reference/mcp-tools.mdx (B3). Searches: leaseSimulatorOutputSchema, writeResult(, success(, awaitWithin, getCatalog.
Rules in play
- CLI manual: no decision logic in the CLI. The list is computed in
lease-policy(I1); the CLI only prints it as a JSONnoticeline; names are regex-bound and JSON-escaped, so noescapeControl. - CLI manual: any error is one JSON line on stderr. The hint is a
noticeline, never anerror, and never changes the exit code. - MCP manual: never imports core, daemon or drivers. I1 reads only the catalog through
simlock/client. - Contract manual: no contract shape changes, so no protocol bump (F5).
- Documentation rule 9: the CLI and MCP reference pages change in the same PR. The slim simulators page stays as it is (maintainer decision on Slim lease silently disables Siri; nothing tells the user which categories are off #1806).
Tests
The seams are simlock lease with a fake client, modelled on src/cli/index-lease-requests.test.ts, and the lease_simulator tool call on createMcpServer with a fake client, modelled on src/mcp/server.test.ts.
- B1: a user runs
simlock leaseand gets an iOS slim device: catalog all 16, no except → 16 named in catalog order;--except siri→ 15, nosiri; except covers the list → no line; catalogslimCategories: [], absent, or no iOS entry → no line; full → no line and nocatalog.getcall; Android → no line; physical → no line;catalog.getrejects → no line, grant and exit code as today; unanswered past 2 s on the fake clock → no line, command goes on;--detach→ line, then exit 0;--export-env→ export lines on stdout, notice on stderr - B2: an MCP client calls
lease_simulatorand gets an iOS slim device: catalog all 16 →hintnames 16;except: ["store"]→ all butstore; full → nohint; Android → nohint; catalog read rejects → nohint, call succeeds; unanswered past 2 s → nohint; the answer parses against the tool'soutputSchemawith and withouthint; the rest equals the grant in every case - B3: a reader of the CLI and MCP reference finds the line:
cli.mdx## simlock leaseshows the notice text and when it is absent;mcp-tools.mdx## lease_simulatornameshintand when it is absent
Done when
pnpm test:changedpasses, with the B1 and B2 tests among them.pnpm typecheckpasses.- The website build in
toolchain.mdpasses with the two reference pages changed. git diff origin/main -- src/contractis empty.
Out of scope
- The agent-device front and the Node client (feature Non-goals).
- The slim simulators page on the website.
Depends on
Written by an agent.
Activity
test: the hint names only the categories the lease kept off, and only…
feat(lease-policy): the hint skips non-slim, Android and physical lea…
test: a failing or silent catalog read leaves the lease as it was (#1843
feat(lease-policy): a catalog read that fails or takes over 2 s gives…
test: lease_simulator answers a hint for a slim iOS lease (#1843)
feat(mcp): lease_simulator answers the slim hint (#1843)
docs(website): the slim hint line in the CLI and MCP references (#1843)
docs(lease-policy): the hint rule copies no value (#1843)
V3RON commentedon Nov 25, 2026
Handoff
Done: PR #1847 is built and pushed at d474053. The audit found nothing to fix, and all four Done when lines pass.
Not done: review round 1. Auto mode refused the reviewer's lens Agent calls twice, because a hook adds the brief after auto mode has checked the call. No lens ran, so the assessment is incomplete.
Findings: none, since nothing was reviewed. Check this first in round 1: the build recorded an Assumption that the line's wording was open. But the feature's Completion conditions give the exact text (
slim: <names> off; use --except <name> or --mode full).Blocked on: a session where the lens agents can start, either outside auto mode or with their calls approved. Then re-run
deliver #1835, which resumes at review round 1.Written by an agent.
3 remaining items
fix(lease): the slim hint uses the decided wording per frontend and f…
fix(lease): a slim remote lease's hint wait follows the reconnect hoo…
V3RON commentedon Nov 25, 2026
Handoff
Done: PR #1847 at b6503a2. Round 2 ran every lens. R1–R5 are fixed: exact wording per frontend, grant before the hint,
--urlreconnect while the hint waits, and the test loops. The fix-check verified R4 by reverting it.escapeControland the 1024 cap were dropped from the spec (Decision taken comment, pending the maintainer).Not done: R8 and R9 are open at rule 14's round cap. The PR stays draft. Done when ticks and the gate are not run.
Findings:
src/cli/commands/lease.ts:493: the held-lease hint print has no test; removing it leaves 69 tests green.vi.waitForin both*-slim-hint.test.tsfiles advances fake time on every poll, so a 30 s catalog wait still passes.Blocked on: the maintainer allowing one more fix run (R8 held-lease row; R9 bound total fake time to 2 s) plus a fix-check, then re-run
deliver #1835.Written by an agent.
V3RON commentedon Nov 25, 2026
Maintainer decisions (2026-11-25):
src/cli/commands/lease.ts:493) and R9 (bound the total fake time in both*-slim-hint.test.tsfiles' waits to 2 s), then one fix-check. After that, gate and merge as usual.escapeControlon category names and no length cap on the MCPhint, as the PR's Decision taken comment explains. The "(decided in delivery, pending the maintainer)" marks on the feature's I2/I3 rows and this task's Rules line are to be removed.Written by an agent.
test(lease): the held lease prints the slim hint; hint waits advance …
feat(cli): slim lease hint line in simlock lease and lease_simulator (c…