Skip to content

Slim lease hint line in simlock lease and lease_simulator #1843

Done

Description

@V3RON

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 JSON notice line; names are regex-bound and JSON-escaped, so no escapeControl.
  • CLI manual: any error is one JSON line on stderr. The hint is a notice line, never an error, 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 lease and gets an iOS slim device: catalog all 16, no except → 16 named in catalog order; --except siri → 15, no siri; except covers the list → no line; catalog slimCategories: [], absent, or no iOS entry → no line; full → no line and no catalog.get call; Android → no line; physical → no line; catalog.get rejects → 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_simulator and gets an iOS slim device: catalog all 16 → hint names 16; except: ["store"] → all but store; full → no hint; Android → no hint; catalog read rejects → no hint, call succeeds; unanswered past 2 s → no hint; the answer parses against the tool's outputSchema with and without hint; the rest equals the grant in every case
  • B3: a reader of the CLI and MCP reference finds the line: cli.mdx ## simlock lease shows the notice text and when it is absent; mcp-tools.mdx ## lease_simulator names hint and when it is absent

Done when

  • pnpm test:changed passes, with the B1 and B2 tests among them.
  • pnpm typecheck passes.
  • The website build in toolchain.md passes with the two reference pages changed.
  • git diff origin/main -- src/contract is 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

  1. added
    task:draft
    on Nov 25, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 25, 2026
  3. self-assigned this
    on Nov 25, 2026
  4. V3RON commented on Nov 25, 2026

    @V3RON
    ContributorAuthor

    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.

  5. added
    task:blocked
    on Nov 25, 2026
  6. 3 remaining items

  7. removed
    task:blocked
    on Nov 25, 2026
  8. self-assigned this
    on Nov 25, 2026
  9. V3RON commented on Nov 25, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: PR #1847 at b6503a2. Round 2 ran every lens. R1–R5 are fixed: exact wording per frontend, grant before the hint, --url reconnect while the hint waits, and the test loops. The fix-check verified R4 by reverting it. escapeControl and 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:

    • R8 src/cli/commands/lease.ts:493: the held-lease hint print has no test; removing it leaves 69 tests green.
    • R9 vi.waitFor in both *-slim-hint.test.ts files 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.

  10. added
    task:blocked
    and removed
    task:ready
    on Nov 25, 2026
  11. removed their assignment
    on Nov 25, 2026
  12. V3RON commented on Nov 25, 2026

    @V3RON
    ContributorAuthor

    Maintainer decisions (2026-11-25):

    1. Round cap: one more fix run is allowed past delivery rule 14's cap for PR feat(cli): slim lease hint line in simlock lease and lease_simulator #1847. Fix R8 (a test for the held-lease hint print, src/cli/commands/lease.ts:493) and R9 (bound the total fake time in both *-slim-hint.test.ts files' waits to 2 s), then one fix-check. After that, gate and merge as usual.
    2. Spec change confirmed: no escapeControl on category names and no length cap on the MCP hint, 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.

  13. added
    task:ready
    and removed
    task:blocked
    on Nov 25, 2026
  14. self-assigned this
    on Nov 25, 2026
  15. added a commit that references this issue on Nov 25, 2026
    2a5aa81
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