Skip to content

feat(leasing): lease.maxPerRequester per platform - #975

Merged
V3RON merged 31 commits into
mainfrom
task/966
Oct 24, 2026
Merged

V3RON merged 31 commits into
mainfrom
task/966

Conversation

@V3RON

@V3RON V3RON commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #966

Status

Implement: done Review: round 1 + fix-check passed at b98a3de Hardware: n/a Gate: running
Next: merge

Done when

  • pnpm test:changed passes with the Tests lines of the issue (config: src/core/config.test.ts; worker: src/leasing/create-leasing.test.ts, physical-leasing.test.ts; gateway: src/gateway/fleet-coordinator.test.ts; client: src/simlock-client/client.test.ts; HTTP: src/http/tracker.test.ts; config.get schema: src/contract/operations.test.ts)
  • CI's pnpm check is green; the gateway imports requesterLimitDecision, HeldLease and MaxPerRequester through the allow-list in .oxlintrc.json
  • The website build passes
  • remote-agents.mdx, gateway/access-control.mdx and gateway/setup.mdx say the limit is per requester and per platform when the operator sets the object form; agent-device.mdx says each agent-device session is its own requester holding one device
  • the grep over website/src/content/docs lists only lines true under both forms
  • No slow-lane test

Completion conditions of #961

  • Object form on a worker: iOS + Android granted at once, second iOS exit 13 naming the iOS lease (src/leasing/create-leasing.test.ts)
  • Waits iOS + Android at once; cancelling Android leaves iOS waiting (create-leasing.test.ts, src/daemon/dispatcher.test.ts, src/simlock-client/client.test.ts, src/http/tracker.test.ts)
  • Number and absent values give every Examples row its After result (create-leasing.test.ts, src/core/config.test.ts)
  • The same through a gateway, counted across workers and after a rebuild (src/gateway/fleet-coordinator.test.ts, src/gateway/dispatcher.test.ts)
  • Website pages describe the new shape; none says an agent-device token holds one lease at a time (audit grep, review claims lens)

Assumptions

  • Assumption: a gateway probe under the number form — the issue says a probe applies step 1 only, so a probe is refused only by a waiting probe on its own platform, in both forms.
  • Assumption: the config keeps what the operator wrote ({"ios":2} stays that way); a platform left out counts as 1 where the limit is read, not at load.
  • Assumption: the gateway's lease index keeps a lease's platform beside the entry, not in it, because modules see the entry's shape (FleetLease).
  • Assumption: waiting && !atLimit in the object-form refusal picks the held text when both hold, as the issue says; that state is not reachable through a request, so no test reaches it.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 1. Tokens: 5.1M.
Runs: 9. Cost USD: 7.7673. Agent seconds: 3498.

Assessment: complete

Written by an agent.

V3RON added 28 commits October 24, 2026 18:53
…cel (#966)

Protocol-bump: none (the bump is already in this PR)
…cancel names one, and a numeric limit still counts all platforms (#966)
@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question. The audit found that platform on lease.cancel reaches cancelPending and pendingRequestOwner through the daemon and gateway dispatchers with no test: deleting it leaves every test green. The spec's Behaviours table names the dispatcher seam, but the Tests lines stop at createLeasing.

Options.

  • A: add a dispatcher test on the daemon and the gateway (taken). A user sees nothing new; a regression that cancels the wrong platform's request, or owner-checks the wrong request, turns a test red.
  • B: leave the wiring untested. A user sees nothing until a refactor drops the platform and an aborted Android call cancels the iOS request.

Why A. It changes no behaviour, only adds tests, and it guards the feature's named risk.

Reverting. Delete the added dispatcher tests and the Tests line marked (decided in delivery, pending the maintainer) in #966.

Written by an agent.

@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 7e68426
Round fix-check: b98a3de

Runs: 9. Cost USD: 7.7673. Agent seconds: 3498.
Tokens input 598, output 173017, cache read 29862634, cache write 874155.
- build implementer: claude-sonnet-5-5 1327 s $3.3929
- audit implementer: claude-sonnet-5-5 907 s $0.9943
- fix implementer: claude-sonnet-5-5 313 s $0.41
- review 1 reviewer: claude-sonnet-5-5 476 s $0.3961
- review 1 spec: claude-sonnet-5-5 74 s $0.4642
- review 1 claims: claude-sonnet-5-5 43 s $0.2259
- review 1 code both: claude-opus-5-5 306 s $1.7288
- fix 1 implementer: claude-sonnet-5-5 30 s $0.0857
- review fix-check reviewer: claude-sonnet-5-5 22 s $0.0694
Finding outcomes: {"fixed":1}. Classes: {"comment points to a deleted comment":1}.
{"findings":[{"id":"R1","role":"claims","class":"comment points to a deleted comment","outcome":"fixed","path":"src/gateway/fleet-coordinator.ts","round":"1","fix":"b98a3ded3"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 24, 2026 17:46
@V3RON
V3RON merged commit 91b0af8 into main Oct 24, 2026
62 checks passed
@V3RON
V3RON deleted the task/966 branch October 24, 2026 17:56
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.

Per-platform lease limit per requester, on a worker and a gateway

1 participant