Skip to content

Commit b6a6f59

Browse files
docs(remote): name the lease id on host DELETE and the ways a macos-app lease ends
1 parent 7a0cc02 commit b6a6f59

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎docs/adr/0007-remote-device-leases.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,17 @@ token like host holds; tenant `lease_allocate` refuses the backend. The host pic
175175
repeated PUT renews it, and a PUT naming another scope for an existing id is refused rather than
176176
rewritten. Heartbeat, expiry, and the loss on daemon restart are those of any lease, except that a
177177
tenant heartbeat or request cannot renew it for longer than the window of the host's last PUT, and
178-
only the host ends it: `DELETE /admin/leases`, expiry, or `close` when `retainOnClose` is false. A
179-
tenant `lease_release` is refused with `MACOS_APP_LEASE_HOST_OWNED`.
178+
a tenant cannot release it: `lease_release` is refused with `MACOS_APP_LEASE_HOST_OWNED`. The lease
179+
ends by the host's `DELETE /admin/leases/<lease-id>`, by expiry, by the loss on daemon restart, or
180+
when a session it holds closes and the host set `retainOnClose` to false.
180181

181182
Request admission confines every request admitted under the lease, so `batch` steps and `replay`
182183
actions are confined when they re-enter it: an allow list of commands, the ones whose command
183184
registry descriptor declares `appLease: 'allowed'` (later commands are refused, and of the commands
184185
lease admission otherwise exempts only `lease_heartbeat` and `lease_release` declare it),
185186
`open` and `close` of the leased bundle only, the `app` surface only, window-only screenshots, no
186187
input that names a host path or launches beside the app, and an existing session that is the leased
187-
app for every request but `open`, the `batch` envelope, and the lease's heartbeat, so a
188+
app for every request but `open` and the `batch` envelope, so a
188189
request naming no session cannot fall back to the host Mac. `open` requires the native app backend (ADR 0031), because XCTest
189190
posts screen events that can land outside the app's window. A pid-pinned lease is checked against the
190191
running process before each admitted request. A session opened under the lease holds its app, not

‎website/docs/docs/remote-proxy.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ The lease id is 16 to 128 hex characters the host chooses. Repeating the PUT ren
141141
that names another scope for an existing id is refused. The lease stays allocated across the
142142
client's `close` unless the body sets `retainOnClose: false`, and DELETE revokes it at once. It
143143
expires after `ttlMs` without a renewal or a client request, like any lease. A client heartbeat can
144-
shorten that window but never extend it past the `ttlMs` of the last PUT. Only the host ends
145-
the lease: `DELETE /admin/leases`, expiry, or `close` when `retainOnClose` is false. A client cannot
146-
release it: `disconnect` drops only its local connection state, and a tenant `lease_release` is
147-
refused with `MACOS_APP_LEASE_HOST_OWNED`.
144+
shorten that window but never extend it past the `ttlMs` of the last PUT. A client cannot release
145+
it: `disconnect` drops only its local connection state, and a tenant `lease_release` is refused with
146+
`MACOS_APP_LEASE_HOST_OWNED`. The lease ends by the host's `DELETE /admin/leases/<lease-id>`, by
147+
expiry, by daemon restart, or when a session it holds closes and the body set `retainOnClose` to
148+
false.
148149

149150
The client connects with a remote config that names the lease, and runs `open <bundleId>`:
150151

0 commit comments

Comments
 (0)