From 7c94de62185253eadbd4a3d6e0c53c6deb4d5685 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:05:23 +0200 Subject: [PATCH 1/8] docs(adr): 0046 a local agent reaches agent-device without a token (proposed) --- ...nt-reaches-agent-device-without-a-token.md | 36 +++++++++++++++++++ docs/internal/adr/README.md | 1 + 2 files changed, 37 insertions(+) create mode 100644 docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md diff --git a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md new file mode 100644 index 000000000..5da05c513 --- /dev/null +++ b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md @@ -0,0 +1,36 @@ +# 0046. A local agent reaches agent-device without a token + +- **Status:** Proposed +- **Date:** 2026-10-23 +- **Issue:** [#952](https://github.com/callstackincubator/simlock/issues/952), from request #950 +- **Narrows:** [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) + §4 ("One simlock token is one tenant"): on a standalone worker, a loopback + caller with no credential is its own tenant, named by the session it sends. + [ADR 0033](0033-a-sign-in-proxy-is-a-second-way-to-sign-in-and-auth-is-one-module.md) + §2: a third strategy joins the chain, and a strategy may read the peer's + address and the route it guards. +- **Builds on:** [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md) + (joined workers keep HTTP off). + +## Context + +Draft in progress; the spec session for #952 is still collecting facts. + +## Decision + +1. On a standalone worker, `http.enabled` defaults to on (`127.0.0.1:4701`) + and `capabilities.agent-device.enabled` defaults to on. A joined worker + keeps both as today. +2. A request to `/v1/agent-device` from a loopback peer, with no + `Authorization` header and an `x-agent-device-tenant` header, is an + `agent` identity named after that tenant. No other route accepts it. +3. `http.loopbackTrust` (`session` by default, or `off`) turns rule 2 off + for a shared Mac. + +## Consequences + +To come. + +## Alternatives considered + +To come. diff --git a/docs/internal/adr/README.md b/docs/internal/adr/README.md index db96963bf..5ca07b13e 100644 --- a/docs/internal/adr/README.md +++ b/docs/internal/adr/README.md @@ -83,3 +83,4 @@ the status is stale. | [0042](0042-simlock-updates-itself-through-a-frozen-call-and-a-detached-updater.md) | Simlock updates itself through a frozen call and a detached updater | Accepted — not yet implemented; narrows 0009's `takes-requests` stage | | [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part | | [0044](0044-the-console-reads-what-its-page-shows-and-events-mark-it-stale.md) | The console reads what its page shows, and events mark it stale | Accepted — not yet implemented; supersedes 0013 §3 | +| [0046](0046-a-local-agent-reaches-agent-device-without-a-token.md) | A local agent reaches agent-device without a token | Proposed | From 63ec9977f60ce5a723712cf116d11285f6d1e419 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:15:30 +0200 Subject: [PATCH 2/8] docs(adr): 0046 full draft --- ...nt-reaches-agent-device-without-a-token.md | 175 ++++++++++++++++-- 1 file changed, 159 insertions(+), 16 deletions(-) diff --git a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md index 5da05c513..1f553eff6 100644 --- a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md +++ b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md @@ -4,33 +4,176 @@ - **Date:** 2026-10-23 - **Issue:** [#952](https://github.com/callstackincubator/simlock/issues/952), from request #950 - **Narrows:** [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) - §4 ("One simlock token is one tenant"): on a standalone worker, a loopback - caller with no credential is its own tenant, named by the session it sends. + §4 ("One simlock token is one tenant"): on a standalone worker, every + trusted no-token loopback caller shares one identity and so one tenant. [ADR 0033](0033-a-sign-in-proxy-is-a-second-way-to-sign-in-and-auth-is-one-module.md) §2: a third strategy joins the chain, and a strategy may read the peer's - address and the route it guards. -- **Builds on:** [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md) - (joined workers keep HTTP off). + address and whether the request is for the agent-device mount. + [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md)'s + "A standalone worker retains optional HTTP": it stays optional, but is on + by default. +- **Builds on:** ADR 0039 (joined workers keep HTTP off), ADR 0030 (optional + modules). ## Context -Draft in progress; the spec session for #952 is still collecting facts. +agent-device is the main way agents use Simlock. On the same Mac as a +standalone worker it takes four operator steps today: turn on +`capabilities.agent-device.enabled` and `http.enabled` (both `false` by +default, `src/core/config.ts:894`, `:942`), restart, and mint an agent +token per agent. The CLI path needs none of them: the Unix socket is guarded +by file permissions, and the agent's session id names the requester. + +The agent-device CLI (0.21.28, the version `package.json` pins for +`@agent-device/proxy`) sends no token to a loopback daemon URL: only a +non-loopback URL "requires daemon authentication" +(`dist/src/daemon-client-lifecycle.js`). It sends its tenant in the JSON-RPC +body (`params.tenantId` for lease calls, `params.meta.tenantId` for +commands), in a header only on artifact downloads, and not at all on an +upload. So a per-request identity cannot be read from headers, and an +upload carries no hint of who sent it. + +Simlock's auth sees request headers only (`src/auth/strategy.ts:10-12`, +`src/http/auth.ts:19`). The host sets agent-device's tenant to the +identity's principal and overwrites what the client sent +(`src/agent-device/host/host.ts:124-127`). agent-device accepts a tenant of +1–128 letters, digits, `.`, `_` and `-`. + +Loopback TCP is open to every account on the Mac, and Node cannot read a +TCP peer's Unix user. ADR 0023 already accepts that any process running as +the Simlock user can skip the edge through agent-device's own loopback port. ## Decision -1. On a standalone worker, `http.enabled` defaults to on (`127.0.0.1:4701`) - and `capabilities.agent-device.enabled` defaults to on. A joined worker - keeps both as today. -2. A request to `/v1/agent-device` from a loopback peer, with no - `Authorization` header and an `x-agent-device-tenant` header, is an - `agent` identity named after that tenant. No other route accepts it. -3. `http.loopbackTrust` (`session` by default, or `off`) turns rule 2 off - for a shared Mac. +### 1. One local identity + +A trusted loopback request with no credential is the identity +`{ principal: "local", name: "Local agent", role: "agent", via: "loopback", ambient: false }`. +Every local agent shares it, and so shares the agent-device tenant `local`. +Agents keep apart by their agent-device `--session` names, as on the CLI +path. Leases it opens are owned by `local`; the requester stays the +agent-device lease id, as today. + +### 2. Where it applies + +A new auth strategy, `loopback`, last in the registry after `token` and +`proxy`, answers `identified` only when all of these hold, and `not-mine` +otherwise, so the result is today's 401 `Missing bearer token`: + +- the daemon is a worker with no `gateway.url` (never a gateway); +- `http.loopbackTrust` is `agent`; +- the request is for `/v1/agent-device` or a path under it. No other route + accepts it: the console and the rest of the HTTP API keep tokens; +- the peer address is `127.0.0.1`, `::1` or `::ffff:127.0.0.1`. + +`authenticateRequest` gains the peer address and whether the route is the +agent-device mount; the HTTP frontend passes them. + +### 3. Only a local program, not a browser or a proxy + +The strategy also answers `not-mine` when the request: + +- carries a credential: `Authorization` or `X-Agent-Device-Token`. A + credential is judged by its own strategy alone, so a bad token is never + rescued as `local`; +- carries `Origin` or `Sec-Fetch-Site`, which browsers send and Node's HTTP + clients do not (Node's `fetch` sends `Sec-Fetch-Mode` only); +- carries `Forwarded`, `X-Forwarded-For` or `X-Real-IP`, which a reverse + proxy on the Mac adds; +- has a `Host` whose hostname is not `127.0.0.1`, `localhost` or `[::1]` + (DNS rebinding). + +### 4. The operator can turn it off + +`http.loopbackTrust` is `agent` (the default) or `off`. `off` drops the +strategy; loopback callers need a token as today. Any other value is +refused at config load, naming the key. It has no effect on a gateway or a +joined worker. + +### 5. On by default on a standalone worker + +On a worker with no `gateway.url`, `http.enabled` and +`capabilities.agent-device.enabled` default to `true`. A joined worker keeps +both `false`, so ADR 0039's refusal is never hit by a default. A gateway +keeps `http.enabled: true` and agent-device off. A value the operator sets +wins everywhere. + +When agent-device is on only by default and its binary is not found, the +capability is unavailable with today's not-found message in +`simlock status`, and `simlock doctor` lists no finding for it: a Mac +without agent-device is not a problem. Set explicitly, today's finding +stays. + +A taken port is not handled specially: a worker whose HTTP cannot bind +fails to start, as it does today with `http.enabled: true`. + +```mermaid +flowchart LR + subgraph Before + A1[Agent] -->|token| H1[HTTP auth: token, proxy] + H1 --> F1[agent-device front] + end + subgraph After + A2[Agent on this Mac] -->|no token| H2[HTTP auth: token, proxy, loopback] + R[Remote agent] -->|token| H2 + H2 -->|local or token principal| F2[agent-device front] + end +``` + +```mermaid +sequenceDiagram + participant C as agent-device CLI + participant H as Worker HTTP (127.0.0.1:4701) + participant A as src/auth + participant F as agent-device front + C->>H: POST /v1/agent-device/rpc (no Authorization) + H->>A: headers, peer 127.0.0.1, agent-device mount + A->>A: token: not-mine, proxy: not-mine + alt loopback guards pass, trust agent, standalone + A-->>H: local (agent, via loopback) + H->>F: dispatch as local + F-->>C: reply + else any guard fails + A-->>H: AuthError 401 + H-->>C: 401 UNAUTHENTICATED "Missing bearer token" + end +``` ## Consequences -To come. +- Any account on the Mac, and any local program, can act as a local agent: + lease devices, drive them, and end another local agent's lease. This is + the exposure ADR 0023 accepts for agent-device's own loopback port, + widened from the Simlock user to every account. A shared Mac sets + `http.loopbackTrust off`. +- A program that forwards outside traffic to port 4701 without a + forwarding header and with a loopback `Host` lets outside callers in. The + docs tell an operator who fronts a worker to turn trust off. +- Local agents see each other's leased devices in `agent-device devices`. +- An upgraded standalone worker opens 127.0.0.1:4701 and starts + agent-device daemons when the binary is on `PATH`. A port already in use + stops the daemon from starting until the operator sets `http.port` or + turns HTTP off. +- Test harnesses that start several workers on one machine pin + `http.enabled` and `capabilities.agent-device.enabled` off unless a test + needs them. ## Alternatives considered -To come. +- **The tenant the client sends, per session.** Each Claude Code session + its own tenant, named by `--tenant`. The CLI sends the tenant in the + RPC body and not at all on uploads, so the front would parse bodies and + map uploads to leases to find it. Any local caller could still claim any + tenant, so it would guard against accidents only, which `--session` + already does. Rejected for cost. +- **Off by default, opt-in.** Safe on shared Macs, but leaves an operator + step before the first use, which is the problem. +- **Every agent route, not only agent-device.** Local agents use the socket + for the rest; opening `/v1/leases` and `exec` to every local account + gains nothing. +- **A per-user secret file (mode 0600) passed as the token.** Proves the + caller is the daemon's user. agent-device reads the token only from the + environment, so it costs every shell call an `export`. Left as a later, + hardened mode. +- **Run without HTTP when the default port is taken.** Avoids an upgrade + failure, but adds a second start path; rejected for one rule. From 5eb9a106a80ca0decc74400daa512514bfff2150 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:23:58 +0200 Subject: [PATCH 3/8] docs(adr): 0046 session fallback fact --- ...-a-local-agent-reaches-agent-device-without-a-token.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md index 1f553eff6..7eff35ee6 100644 --- a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md +++ b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md @@ -50,8 +50,12 @@ the Simlock user can skip the edge through agent-device's own loopback port. A trusted loopback request with no credential is the identity `{ principal: "local", name: "Local agent", role: "agent", via: "loopback", ambient: false }`. Every local agent shares it, and so shares the agent-device tenant `local`. -Agents keep apart by their agent-device `--session` names, as on the CLI -path. Leases it opens are owned by `local`; the requester stays the +Agents keep apart by their agent-device sessions, so every command passes +the agent's own `--session`: agent-device 0.21.28 runs a command with no +`--session` flag in the session that connected last +(`dist/src/cli.js`, `allowActiveFallback`), on every path. A per-session +identity would not help there, because the fallback brings that session's +tenant with it. Leases it opens are owned by `local`; the requester stays the agent-device lease id, as today. ### 2. Where it applies From 3b295c9c855194e522893d6eaf7b43d8b0d2bd3f Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:35:44 +0200 Subject: [PATCH 4/8] docs(adr): 0046 private profile instead of loopback trust --- ...nt-reaches-agent-device-without-a-token.md | 183 ------------------ ...evice-by-default-with-a-private-profile.md | 174 +++++++++++++++++ docs/internal/adr/README.md | 2 +- 3 files changed, 175 insertions(+), 184 deletions(-) delete mode 100644 docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md create mode 100644 docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md diff --git a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md b/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md deleted file mode 100644 index 7eff35ee6..000000000 --- a/docs/internal/adr/0046-a-local-agent-reaches-agent-device-without-a-token.md +++ /dev/null @@ -1,183 +0,0 @@ -# 0046. A local agent reaches agent-device without a token - -- **Status:** Proposed -- **Date:** 2026-10-23 -- **Issue:** [#952](https://github.com/callstackincubator/simlock/issues/952), from request #950 -- **Narrows:** [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) - §4 ("One simlock token is one tenant"): on a standalone worker, every - trusted no-token loopback caller shares one identity and so one tenant. - [ADR 0033](0033-a-sign-in-proxy-is-a-second-way-to-sign-in-and-auth-is-one-module.md) - §2: a third strategy joins the chain, and a strategy may read the peer's - address and whether the request is for the agent-device mount. - [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md)'s - "A standalone worker retains optional HTTP": it stays optional, but is on - by default. -- **Builds on:** ADR 0039 (joined workers keep HTTP off), ADR 0030 (optional - modules). - -## Context - -agent-device is the main way agents use Simlock. On the same Mac as a -standalone worker it takes four operator steps today: turn on -`capabilities.agent-device.enabled` and `http.enabled` (both `false` by -default, `src/core/config.ts:894`, `:942`), restart, and mint an agent -token per agent. The CLI path needs none of them: the Unix socket is guarded -by file permissions, and the agent's session id names the requester. - -The agent-device CLI (0.21.28, the version `package.json` pins for -`@agent-device/proxy`) sends no token to a loopback daemon URL: only a -non-loopback URL "requires daemon authentication" -(`dist/src/daemon-client-lifecycle.js`). It sends its tenant in the JSON-RPC -body (`params.tenantId` for lease calls, `params.meta.tenantId` for -commands), in a header only on artifact downloads, and not at all on an -upload. So a per-request identity cannot be read from headers, and an -upload carries no hint of who sent it. - -Simlock's auth sees request headers only (`src/auth/strategy.ts:10-12`, -`src/http/auth.ts:19`). The host sets agent-device's tenant to the -identity's principal and overwrites what the client sent -(`src/agent-device/host/host.ts:124-127`). agent-device accepts a tenant of -1–128 letters, digits, `.`, `_` and `-`. - -Loopback TCP is open to every account on the Mac, and Node cannot read a -TCP peer's Unix user. ADR 0023 already accepts that any process running as -the Simlock user can skip the edge through agent-device's own loopback port. - -## Decision - -### 1. One local identity - -A trusted loopback request with no credential is the identity -`{ principal: "local", name: "Local agent", role: "agent", via: "loopback", ambient: false }`. -Every local agent shares it, and so shares the agent-device tenant `local`. -Agents keep apart by their agent-device sessions, so every command passes -the agent's own `--session`: agent-device 0.21.28 runs a command with no -`--session` flag in the session that connected last -(`dist/src/cli.js`, `allowActiveFallback`), on every path. A per-session -identity would not help there, because the fallback brings that session's -tenant with it. Leases it opens are owned by `local`; the requester stays the -agent-device lease id, as today. - -### 2. Where it applies - -A new auth strategy, `loopback`, last in the registry after `token` and -`proxy`, answers `identified` only when all of these hold, and `not-mine` -otherwise, so the result is today's 401 `Missing bearer token`: - -- the daemon is a worker with no `gateway.url` (never a gateway); -- `http.loopbackTrust` is `agent`; -- the request is for `/v1/agent-device` or a path under it. No other route - accepts it: the console and the rest of the HTTP API keep tokens; -- the peer address is `127.0.0.1`, `::1` or `::ffff:127.0.0.1`. - -`authenticateRequest` gains the peer address and whether the route is the -agent-device mount; the HTTP frontend passes them. - -### 3. Only a local program, not a browser or a proxy - -The strategy also answers `not-mine` when the request: - -- carries a credential: `Authorization` or `X-Agent-Device-Token`. A - credential is judged by its own strategy alone, so a bad token is never - rescued as `local`; -- carries `Origin` or `Sec-Fetch-Site`, which browsers send and Node's HTTP - clients do not (Node's `fetch` sends `Sec-Fetch-Mode` only); -- carries `Forwarded`, `X-Forwarded-For` or `X-Real-IP`, which a reverse - proxy on the Mac adds; -- has a `Host` whose hostname is not `127.0.0.1`, `localhost` or `[::1]` - (DNS rebinding). - -### 4. The operator can turn it off - -`http.loopbackTrust` is `agent` (the default) or `off`. `off` drops the -strategy; loopback callers need a token as today. Any other value is -refused at config load, naming the key. It has no effect on a gateway or a -joined worker. - -### 5. On by default on a standalone worker - -On a worker with no `gateway.url`, `http.enabled` and -`capabilities.agent-device.enabled` default to `true`. A joined worker keeps -both `false`, so ADR 0039's refusal is never hit by a default. A gateway -keeps `http.enabled: true` and agent-device off. A value the operator sets -wins everywhere. - -When agent-device is on only by default and its binary is not found, the -capability is unavailable with today's not-found message in -`simlock status`, and `simlock doctor` lists no finding for it: a Mac -without agent-device is not a problem. Set explicitly, today's finding -stays. - -A taken port is not handled specially: a worker whose HTTP cannot bind -fails to start, as it does today with `http.enabled: true`. - -```mermaid -flowchart LR - subgraph Before - A1[Agent] -->|token| H1[HTTP auth: token, proxy] - H1 --> F1[agent-device front] - end - subgraph After - A2[Agent on this Mac] -->|no token| H2[HTTP auth: token, proxy, loopback] - R[Remote agent] -->|token| H2 - H2 -->|local or token principal| F2[agent-device front] - end -``` - -```mermaid -sequenceDiagram - participant C as agent-device CLI - participant H as Worker HTTP (127.0.0.1:4701) - participant A as src/auth - participant F as agent-device front - C->>H: POST /v1/agent-device/rpc (no Authorization) - H->>A: headers, peer 127.0.0.1, agent-device mount - A->>A: token: not-mine, proxy: not-mine - alt loopback guards pass, trust agent, standalone - A-->>H: local (agent, via loopback) - H->>F: dispatch as local - F-->>C: reply - else any guard fails - A-->>H: AuthError 401 - H-->>C: 401 UNAUTHENTICATED "Missing bearer token" - end -``` - -## Consequences - -- Any account on the Mac, and any local program, can act as a local agent: - lease devices, drive them, and end another local agent's lease. This is - the exposure ADR 0023 accepts for agent-device's own loopback port, - widened from the Simlock user to every account. A shared Mac sets - `http.loopbackTrust off`. -- A program that forwards outside traffic to port 4701 without a - forwarding header and with a loopback `Host` lets outside callers in. The - docs tell an operator who fronts a worker to turn trust off. -- Local agents see each other's leased devices in `agent-device devices`. -- An upgraded standalone worker opens 127.0.0.1:4701 and starts - agent-device daemons when the binary is on `PATH`. A port already in use - stops the daemon from starting until the operator sets `http.port` or - turns HTTP off. -- Test harnesses that start several workers on one machine pin - `http.enabled` and `capabilities.agent-device.enabled` off unless a test - needs them. - -## Alternatives considered - -- **The tenant the client sends, per session.** Each Claude Code session - its own tenant, named by `--tenant`. The CLI sends the tenant in the - RPC body and not at all on uploads, so the front would parse bodies and - map uploads to leases to find it. Any local caller could still claim any - tenant, so it would guard against accidents only, which `--session` - already does. Rejected for cost. -- **Off by default, opt-in.** Safe on shared Macs, but leaves an operator - step before the first use, which is the problem. -- **Every agent route, not only agent-device.** Local agents use the socket - for the rest; opening `/v1/leases` and `exec` to every local account - gains nothing. -- **A per-user secret file (mode 0600) passed as the token.** Proves the - caller is the daemon's user. agent-device reads the token only from the - environment, so it costs every shell call an `export`. Left as a later, - hardened mode. -- **Run without HTTP when the default port is taken.** Avoids an upgrade - failure, but adds a second start path; rejected for one rule. diff --git a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md new file mode 100644 index 000000000..25c547983 --- /dev/null +++ b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md @@ -0,0 +1,174 @@ +# 0046. A standalone worker serves agent-device by default and hands local agents a private profile + +- **Status:** Proposed +- **Date:** 2026-10-23 +- **Issue:** [#952](https://github.com/callstackincubator/simlock/issues/952), from request #950 +- **Narrows:** [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) + §1 ("The edge is off unless the operator turns it on"): on a standalone + worker it is on unless the operator turns it off. + [ADR 0030](0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md) + §2 ("When it is `false` or the section is missing, the host calls + nothing"): a module may declare that a missing `enabled` means on for a + standalone worker; agent-device is the one that does. + [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md)'s + "A standalone worker retains optional HTTP": it stays optional, but is on + by default. +- **Builds on:** ADR 0023 §4 (one simlock token is one tenant), ADR 0033 + (auth is unchanged: the profile carries an ordinary agent token). + +## Context + +agent-device is the main way agents use Simlock. On the same Mac as a +standalone worker it takes four operator steps today: turn on +`capabilities.agent-device.enabled` and `http.enabled` (both `false` by +default, `src/core/config.ts:894`, `:942`), restart, and mint an agent +token per agent. The CLI path needs none of them: the Unix socket is +guarded by file permissions. + +agent-device 0.21.28 (the version `package.json` pins for +`@agent-device/proxy`) reads a remote-config profile (`--remote-config`) +whose keys include `daemonBaseUrl` and `daemonAuthToken`. After +`agent-device connect --remote-config --session `, every later +command with that `--session` sends `Authorization: Bearer ` +read from the file, with no token in the environment (checked on +2026-10-23 against a local server: the `health` GET and the +`agent_device.lease.allocate` POST both carried it). The saved connection +stores the file's SHA-256 and refuses a changed file with "Active remote +connection config changed. Run agent-device connect --force to refresh +it." (`dist/src/cli.js`). + +A command with no `--session` flag runs in the session that connected +last (`dist/src/cli.js`, `allowActiveFallback`), whatever token it carries. + +## Decision + +### 1. On by default on a standalone worker + +On a worker with no `gateway.url`, `http.enabled` defaults to `true` +(`127.0.0.1:4701`), and agent-device is on unless +`capabilities.agent-device.enabled` is set. A joined worker keeps both off, +so ADR 0039's refusal is never hit by a default. A gateway keeps +`http.enabled: true` and agent-device off. A value the operator sets wins +everywhere, and a default is never written to `config.json`. + +The module definition declares this ("on by default on a standalone +worker"); the module host, not the core, knows whether `enabled` was set. +`config.get` shows the resolved value; no contract shape changes. + +When agent-device is on only by default and its command is not found, the +capability is `off`: no doctor finding, no warning in the console. Any +other failure (wrong version, not agent-device, start failed), or a +not-found when the operator set `enabled: true`, stays `unavailable` with +today's finding. + +A taken port is not handled specially: a worker whose HTTP cannot bind +fails to start, as it does today with `http.enabled: true`. + +### 2. A private profile for local agents + +When a standalone worker starts with HTTP and agent-device both on, it +writes `/agent-device-profile.json` (mode 0600, atomic) holding: + +```json +{ + "daemonAuthToken": "slk_…", + "daemonBaseUrl": "http://127.0.0.1:4701/v1/agent-device", + "daemonTransport": "http", + "leaseProvider": "proxy", + "runId": "simlock-local", + "sessionIsolation": "tenant", + "tenant": "local" +} +``` + +The URL uses `http.host` and `http.port`; a wildcard host (`0.0.0.0`, `::`) +becomes `127.0.0.1`. The token is an ordinary `agent` token with the label +`agent-device on this Mac`. A local agent connects once per session: + +```console +$ agent-device connect --remote-config ~/.simlock/agent-device-profile.json --session "$CLAUDE_CODE_SESSION_ID" +$ agent-device open --platform ios --session "$CLAUDE_CODE_SESSION_ID" +``` + +### 3. The profile is stable + +At each start the worker reuses the token in the file while it still +verifies and carries the label; otherwise it mints one, revokes every +other token with that label, and writes the file. It rewrites the file +only when its bytes would change, so a saved agent-device connection +survives restarts. When HTTP or agent-device is off, or the worker is +joined, it deletes the file and revokes the labelled tokens. + +A failure to mint, write or delete is logged as a warning; the worker +starts anyway, and tokens made by hand keep working. + +### 4. Every local agent shares one token + +Agents that use the profile share one Simlock token and so one +agent-device tenant. They keep apart by their agent-device sessions, so +every command passes the agent's own `--session`. + +```mermaid +flowchart LR + subgraph Before + O1[Operator] -->|config set x2, restart, token create| W1[Worker] + A1[Agent] -->|export token, connect proxy| W1 + end + subgraph After + W2[Standalone worker start] -->|0600| P[agent-device-profile.json] + A2[Agent, same Unix user] -->|connect --remote-config P| W3[/v1/agent-device, token check as today/] + end +``` + +```mermaid +sequenceDiagram + participant D as Worker start + participant T as Token store + participant F as Profile file + D->>F: read + alt file token verifies and carries the label + D->>F: rewrite only if bytes differ (URL changed) + else missing, unreadable or revoked + D->>T: create agent token, label "agent-device on this Mac" + D->>T: revoke other tokens with that label + D->>F: write 0600, atomic + end + Note over D,F: any failure: warn, start anyway +``` + +## Consequences + +- No change to auth or the HTTP API: the profile's token is checked as + today. Other accounts, browser pages and other machines get 401 as + today. +- Any process running as the daemon's user can read the file, the same + boundary as the Unix socket and `admin.token`. +- Local agents see each other's leased devices in `agent-device devices`, + and can end each other's leases by id. An agent that leaves `--session` + off a command, or reuses another's, drives the other agent's device. +- `simlock token list` shows the profile's token; revoking it cuts every + local agent off until the next start, which mints a new one. agent-device + then answers "Active remote connection config changed. Run agent-device + connect --force to refresh it." +- An upgraded standalone worker opens 127.0.0.1:4701 and starts + agent-device daemons when the command is on `PATH`. A port already in use + stops it until the operator sets `http.port` or turns HTTP off. +- Test harnesses that start several workers on one machine pin + `http.enabled` and `capabilities.agent-device.enabled` off unless a test + needs them. + +## Alternatives considered + +- **No token for loopback callers.** A new auth strategy would let a + credential-less request from 127.0.0.1 in as a shared local agent, with + guards against browsers (`Origin`, `Sec-Fetch-Site`), reverse proxies + (forwarding headers) and DNS rebinding (`Host`). Every account on the Mac, + and a tunnel that adds no forwarding header, would act as the developer. + Rejected once the profile showed the same zero-step setup with the socket's + boundary. +- **A tenant per session, read from the request.** agent-device sends its + tenant in the RPC body and not on uploads, and the session fallback above + would carry the wrong tenant anyway. +- **Off by default, opt-in.** Leaves an operator step before the first use. +- **Run without HTTP when the default port is taken.** Adds a second start + path; rejected for one rule. diff --git a/docs/internal/adr/README.md b/docs/internal/adr/README.md index 5ca07b13e..45e88d559 100644 --- a/docs/internal/adr/README.md +++ b/docs/internal/adr/README.md @@ -83,4 +83,4 @@ the status is stale. | [0042](0042-simlock-updates-itself-through-a-frozen-call-and-a-detached-updater.md) | Simlock updates itself through a frozen call and a detached updater | Accepted — not yet implemented; narrows 0009's `takes-requests` stage | | [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part | | [0044](0044-the-console-reads-what-its-page-shows-and-events-mark-it-stale.md) | The console reads what its page shows, and events mark it stale | Accepted — not yet implemented; supersedes 0013 §3 | -| [0046](0046-a-local-agent-reaches-agent-device-without-a-token.md) | A local agent reaches agent-device without a token | Proposed | +| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Proposed | From 7e43264a1df838ab8b720fcd739aa9417a38a87a Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:46:18 +0200 Subject: [PATCH 5/8] docs(adr): 0046 host owns profile and default resolution --- ...evice-by-default-with-a-private-profile.md | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md index 25c547983..f48c7aae8 100644 --- a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md +++ b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md @@ -9,7 +9,9 @@ [ADR 0030](0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md) §2 ("When it is `false` or the section is missing, the host calls nothing"): a module may declare that a missing `enabled` means on for a - standalone worker; agent-device is the one that does. + standalone worker, and a local profile the host writes or withdraws from + that declaration, loading none of the module's code; agent-device is the + one that does. [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md)'s "A standalone worker retains optional HTTP": it stays optional, but is on by default. @@ -52,8 +54,12 @@ so ADR 0039's refusal is never hit by a default. A gateway keeps everywhere, and a default is never written to `config.json`. The module definition declares this ("on by default on a standalone -worker"); the module host, not the core, knows whether `enabled` was set. -`config.get` shows the resolved value; no contract shape changes. +worker") as data. The config loader resolves it without naming the module: +an `enabled` that no layer sets becomes `true` on a standalone worker for a +definition that declares it. `config.get` shows the resolved value. The +loader also reports which modules' `enabled` came from a default; that fact +reaches the module host and the module, never `config.get`. No contract +shape changes. When agent-device is on only by default and its command is not found, the capability is `off`: no doctor finding, no warning in the console. Any @@ -66,8 +72,10 @@ fails to start, as it does today with `http.enabled: true`. ### 2. A private profile for local agents -When a standalone worker starts with HTTP and agent-device both on, it -writes `/agent-device-profile.json` (mode 0600, atomic) holding: +The agent-device definition declares a local profile: the file name, the +token label, and how to render the file from the URL and the token. When a +worker starts with HTTP on and agent-device turned on (set, or by default, +whether or not the command is found), the module host writes `/agent-device-profile.json` (mode 0600, atomic) holding: ```json { @@ -82,7 +90,7 @@ writes `/agent-device-profile.json` (mode 0600, atomic) holding: ``` The URL uses `http.host` and `http.port`; a wildcard host (`0.0.0.0`, `::`) -becomes `127.0.0.1`. The token is an ordinary `agent` token with the label +becomes `127.0.0.1`, and any other IPv6 host is bracketed. The token is an ordinary `agent` token with the label `agent-device on this Mac`. A local agent connects once per session: ```console @@ -92,12 +100,14 @@ $ agent-device open --platform ios --session "$CLAUDE_CODE_SESSION_ID" ### 3. The profile is stable -At each start the worker reuses the token in the file while it still -verifies and carries the label; otherwise it mints one, revokes every -other token with that label, and writes the file. It rewrites the file -only when its bytes would change, so a saved agent-device connection -survives restarts. When HTTP or agent-device is off, or the worker is -joined, it deletes the file and revokes the labelled tokens. +At each start, after the socket claim and before HTTP listens, the host +reuses the token in the file while it still verifies and carries the label; +otherwise it mints one. Either way it revokes every other token with that +label, so at most one stays live. It rewrites the file only when its bytes +would change, so a saved agent-device connection survives restarts. When +HTTP or agent-device is off (a joined worker always has HTTP off), it +deletes the file and revokes the labelled tokens. A gateway never writes +one. A failure to mint, write or delete is logged as a warning; the worker starts anyway, and tokens made by hand keep working. @@ -127,6 +137,7 @@ sequenceDiagram participant F as Profile file D->>F: read alt file token verifies and carries the label + D->>T: revoke other tokens with that label D->>F: rewrite only if bytes differ (URL changed) else missing, unreadable or revoked D->>T: create agent token, label "agent-device on this Mac" @@ -146,6 +157,9 @@ sequenceDiagram - Local agents see each other's leased devices in `agent-device devices`, and can end each other's leases by id. An agent that leaves `--session` off a command, or reuses another's, drives the other agent's device. +- On a standalone Mac without agent-device, the profile and its token are + still written (agent-device is on by default, only not found); they do + nothing until agent-device is installed and the worker restarts. - `simlock token list` shows the profile's token; revoking it cuts every local agent off until the next start, which mints a new one. agent-device then answers "Active remote connection config changed. Run agent-device From 9afc4460aceee42be355d52a2de8731eadbe5e18 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:50:37 +0200 Subject: [PATCH 6/8] docs(adr): accept 0046 (not yet implemented) --- ...ker-serves-agent-device-by-default-with-a-private-profile.md | 2 +- docs/internal/adr/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md index f48c7aae8..a8c6f3890 100644 --- a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md +++ b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md @@ -1,6 +1,6 @@ # 0046. A standalone worker serves agent-device by default and hands local agents a private profile -- **Status:** Proposed +- **Status:** Accepted — not yet implemented - **Date:** 2026-10-23 - **Issue:** [#952](https://github.com/callstackincubator/simlock/issues/952), from request #950 - **Narrows:** [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) diff --git a/docs/internal/adr/README.md b/docs/internal/adr/README.md index 45e88d559..84ad5668e 100644 --- a/docs/internal/adr/README.md +++ b/docs/internal/adr/README.md @@ -83,4 +83,4 @@ the status is stale. | [0042](0042-simlock-updates-itself-through-a-frozen-call-and-a-detached-updater.md) | Simlock updates itself through a frozen call and a detached updater | Accepted — not yet implemented; narrows 0009's `takes-requests` stage | | [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part | | [0044](0044-the-console-reads-what-its-page-shows-and-events-mark-it-stale.md) | The console reads what its page shows, and events mark it stale | Accepted — not yet implemented; supersedes 0013 §3 | -| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Proposed | +| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Accepted — not yet implemented | From ebba7efd33822dd83baee3a7ea1177b910467b9f Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 21:59:33 +0200 Subject: [PATCH 7/8] =?UTF-8?q?docs(adr):=200046=20declares=20the=200023?= =?UTF-8?q?=20=C2=A73-4=20narrowing=20and=20the=20index=20points=20at=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3-agent-device-is-served-by-an-optional-edge-module.md | 2 +- ...les-share-one-contract-and-load-only-when-turned-on.md | 2 +- .../0039-joined-workers-refuse-their-own-http-listener.md | 2 +- ...rves-agent-device-by-default-with-a-private-profile.md | 8 ++++++++ docs/internal/adr/README.md | 8 ++++---- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/internal/adr/0023-agent-device-is-served-by-an-optional-edge-module.md b/docs/internal/adr/0023-agent-device-is-served-by-an-optional-edge-module.md index 268e2a6e4..ac953d285 100644 --- a/docs/internal/adr/0023-agent-device-is-served-by-an-optional-edge-module.md +++ b/docs/internal/adr/0023-agent-device-is-served-by-an-optional-edge-module.md @@ -1,6 +1,6 @@ # 0023. agent-device is served by an optional edge module, and the simlock lease is the only clock -- **Status:** Accepted; §1 narrowed by 0026 for gateway mode; §3 narrowed by 0030 (no reap while turned off); §3–4 superseded in part by [ADR 0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) +- **Status:** Accepted; §1 narrowed by 0026 for gateway mode; §3 narrowed by 0030 (no reap while turned off); §3–4 superseded in part by [ADR 0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md); §1, §3 and §4 narrowed by [ADR 0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) for a standalone worker - **Date:** 2026-10-12 - **Issue:** [#466](https://github.com/callstackincubator/simlock/issues/466) - **Supersedes:** nothing. Builds on [ADR 0020](0020-a-requester-may-choose-its-lease-id.md) diff --git a/docs/internal/adr/0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md b/docs/internal/adr/0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md index 6be541090..054a75603 100644 --- a/docs/internal/adr/0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md +++ b/docs/internal/adr/0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md @@ -1,6 +1,6 @@ # 0030. Optional modules share one contract and load only when turned on -- **Status:** Accepted — not yet implemented +- **Status:** Accepted — not yet implemented; §2 narrowed by [ADR 0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) - **Date:** 2026-10-15 - **Issue:** [#591](https://github.com/callstackincubator/simlock/issues/591) - **Supersedes:** nothing. Narrows [ADR diff --git a/docs/internal/adr/0039-joined-workers-refuse-their-own-http-listener.md b/docs/internal/adr/0039-joined-workers-refuse-their-own-http-listener.md index 9b6563ec6..8338bb60c 100644 --- a/docs/internal/adr/0039-joined-workers-refuse-their-own-http-listener.md +++ b/docs/internal/adr/0039-joined-workers-refuse-their-own-http-listener.md @@ -1,6 +1,6 @@ # 0039. Joined workers refuse their own HTTP listener -- **Status:** Accepted — not yet implemented +- **Status:** Accepted — not yet implemented; narrowed by [ADR 0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) - **Date:** 2026-10-21 - **Issue:** [#806](https://github.com/callstackincubator/simlock/issues/806), from request #705 - **Supersedes:** ADR 0005 requirement 3's “Nothing else on the worker changes” only as it permits HTTP on a joined worker. Its other membership rules remain. diff --git a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md index a8c6f3890..f38ec0fd6 100644 --- a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md +++ b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md @@ -15,6 +15,14 @@ [ADR 0039](0039-joined-workers-refuse-their-own-http-listener.md)'s "A standalone worker retains optional HTTP": it stays optional, but is on by default. + [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) + §3 ("While the edge is turned on ... `simlock doctor` says the same"): + when agent-device is on only by default and its command is not found, + the capability is `off` and doctor says nothing (§1 below). + [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) + §4 ("Agents sharing a token share a tenant; the docs say not to"): the + local profile gives every local agent one token on purpose (§4 below); + the warning still holds for tokens an operator mints by hand. - **Builds on:** ADR 0023 §4 (one simlock token is one tenant), ADR 0033 (auth is unchanged: the profile carries an ordinary agent token). diff --git a/docs/internal/adr/README.md b/docs/internal/adr/README.md index d193c91cd..7da7bd21f 100644 --- a/docs/internal/adr/README.md +++ b/docs/internal/adr/README.md @@ -61,14 +61,14 @@ the status is stale. | [0020](0020-a-requester-may-choose-its-lease-id.md) | A requester may choose its lease id, and the gateway passes it through bare | Accepted | | [0021](0021-a-gateway-dispatch-is-a-probe-and-names-its-fleet-request.md) | A gateway dispatch is a probe, and the gateway records every fleet request's outcome | Accepted — partly implemented: §5 (usage figures) is not built | | [0022](0022-a-physical-device-is-a-second-device-type-the-core-knows.md) | A physical device is a second device type the core knows | Proposed; amends 0001 §3 and §5, 0015 §3 and 0019 §1–2 for physical devices | -| [0023](0023-agent-device-is-served-by-an-optional-edge-module.md) | agent-device is served by an optional edge module, and the simlock lease is the only clock | Accepted; §1 narrowed by 0026 for gateway mode; §3 narrowed by 0030 (no reap while turned off); §3–4 superseded in part by 0043 | +| [0023](0023-agent-device-is-served-by-an-optional-edge-module.md) | agent-device is served by an optional edge module, and the simlock lease is the only clock | Accepted; §1 narrowed by 0026 for gateway mode; §3 narrowed by 0030 (no reap while turned off); §3–4 superseded in part by 0043; §1, §3–4 narrowed by 0046 | | [0024](0024-leasing-calls-lease-end-participants-before-reclaim.md) | Leasing calls lease-end participants before it reclaims a device | Accepted | | [0025](0025-simlock-ships-android-profiles-and-a-model-pairs-only-with-images-that-fit.md) | Simlock ships Android device profiles, and a model pairs only with images that fit it | Accepted | | [0026](0026-agent-device-through-a-gateway-relays-over-the-uplink.md) | agent-device through a gateway: workers advertise capabilities, and the host link relays over the uplink | Accepted; §2 narrowed by 0028 for relayed bodies; §3's in-process link narrowed by 0043 | | [0027](0027-dependency-cruiser-checks-every-component-boundary.md) | dependency-cruiser checks every component's boundary and the module graph | Accepted | | [0028](0028-the-uplink-carries-byte-channels-and-small-messages-go-first.md) | The uplink carries byte channels beside its messages, and small messages go first | Accepted | | [0029](0029-host-load-is-an-optional-module-whose-readings-ride-on-status.md) | Host load is an optional module whose readings ride on status | Accepted | -| [0030](0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md) | Optional modules share one contract and load only when turned on | Accepted — not yet implemented | +| [0030](0030-optional-modules-share-one-contract-and-load-only-when-turned-on.md) | Optional modules share one contract and load only when turned on | Accepted — not yet implemented; §2 narrowed by 0046 | | [0031](0031-a-physical-iphone-streams-through-coredevice-behind-a-screen-source-seam.md) | A physical iPhone streams through CoreDevice's media stream, behind a screen-source seam | Accepted | | [0032](0032-the-event-history-is-a-sqlite-database-with-projections-beside-it.md) | The event history is a SQLite database, with projections beside it | Accepted — not yet implemented; §1 narrowed by 0036 | | [0033](0033-a-sign-in-proxy-is-a-second-way-to-sign-in-and-auth-is-one-module.md) | A sign-in proxy is a second way to sign in, and auth is one module | Accepted — not yet implemented | @@ -77,11 +77,11 @@ the status is stale. | [0036](0036-daemon-state-is-a-sqlite-database-whose-tables-each-owner-keeps.md) | Daemon state is a SQLite database, and each owner keeps its own tables | Accepted — not yet implemented | | [0037](0037-the-console-acts-through-the-http-routes-on-base-ui.md) | The console acts through the HTTP routes, on Base UI | Accepted — not yet implemented | | [0038](0038-the-warm-pool-learns-its-kinds-from-leases-and-boots-for-every-queued-request.md) | The warm pool learns its kinds from leases, and boots for every queued request | Accepted — not yet implemented | -| [0039](0039-joined-workers-refuse-their-own-http-listener.md) | Joined workers refuse their own HTTP listener | Accepted — not yet implemented | +| [0039](0039-joined-workers-refuse-their-own-http-listener.md) | Joined workers refuse their own HTTP listener | Accepted — not yet implemented; narrowed by 0046 | | [0040](0040-every-http-route-is-declared-once-and-the-openapi-document-is-built-from-the-declarations.md) | Every HTTP route is declared once, and the OpenAPI document is built from the declarations | Accepted — not yet implemented; its stream-route example stale since 0045 | | [0041](0041-the-daemon-can-run-under-the-users-service-manager.md) | The daemon can run under the user's service manager | Accepted — not yet implemented | | [0042](0042-simlock-updates-itself-through-a-frozen-call-and-a-detached-updater.md) | Simlock updates itself through a frozen call and a detached updater | Accepted — not yet implemented; narrows 0009's `takes-requests` stage | | [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part | | [0044](0044-the-console-reads-what-its-page-shows-and-events-mark-it-stale.md) | The console reads what its page shows, and events mark it stale | Accepted — not yet implemented; supersedes 0013 §3 | -| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Accepted — not yet implemented | | [0045](0045-a-devices-screen-streams-to-operators-not-a-leases.md) | A device's screen streams to operators, not a lease's | Accepted — not yet implemented | +| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Accepted — not yet implemented; narrows 0023 §1, §3–4, 0030 §2 and 0039 | From 7582ef8be0b0d0a7e0bd729b2760fd5155d821a0 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Fri, 23 Oct 2026 22:02:54 +0200 Subject: [PATCH 8/8] =?UTF-8?q?docs(adr):=200046=20declares=20its=20narrow?= =?UTF-8?q?ing=20of=200043=20=C2=A74?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...al-devices-reach-agent-device-through-a-second-daemon.md | 2 +- ...serves-agent-device-by-default-with-a-private-profile.md | 6 ++++++ docs/internal/adr/README.md | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/internal/adr/0043-physical-devices-reach-agent-device-through-a-second-daemon.md b/docs/internal/adr/0043-physical-devices-reach-agent-device-through-a-second-daemon.md index 878f13fce..b53eabc8c 100644 --- a/docs/internal/adr/0043-physical-devices-reach-agent-device-through-a-second-daemon.md +++ b/docs/internal/adr/0043-physical-devices-reach-agent-device-through-a-second-daemon.md @@ -1,6 +1,6 @@ # 0043. Physical devices reach agent-device through a second daemon on the worker -- **Status:** Accepted — not yet implemented +- **Status:** Accepted — not yet implemented; §4 narrowed by [ADR 0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) (default-on, command not found: `off`, no doctor line) - **Date:** 2026-10-22 - **Issue:** [#870](https://github.com/callstackincubator/simlock/issues/870) - **Supersedes:** in part, [ADR 0023](0023-agent-device-is-served-by-an-optional-edge-module.md) diff --git a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md index f38ec0fd6..c883b9e54 100644 --- a/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md +++ b/docs/internal/adr/0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md @@ -23,6 +23,12 @@ §4 ("Agents sharing a token share a tenant; the docs say not to"): the local profile gives every local agent one token on purpose (§4 below); the warning still holds for tokens an operator mints by hand. + [ADR 0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) + §4 ("a simulator daemon that is not running makes the worker unavailable + for agent-device" and "`simlock doctor` prints one line per daemon"): + when agent-device is on only by default and its command is not found, the + capability is `off` and doctor prints no line for either daemon (§1 + below). - **Builds on:** ADR 0023 §4 (one simlock token is one tenant), ADR 0033 (auth is unchanged: the profile carries an ordinary agent token). diff --git a/docs/internal/adr/README.md b/docs/internal/adr/README.md index 7da7bd21f..1dc9bc6ec 100644 --- a/docs/internal/adr/README.md +++ b/docs/internal/adr/README.md @@ -81,7 +81,7 @@ the status is stale. | [0040](0040-every-http-route-is-declared-once-and-the-openapi-document-is-built-from-the-declarations.md) | Every HTTP route is declared once, and the OpenAPI document is built from the declarations | Accepted — not yet implemented; its stream-route example stale since 0045 | | [0041](0041-the-daemon-can-run-under-the-users-service-manager.md) | The daemon can run under the user's service manager | Accepted — not yet implemented | | [0042](0042-simlock-updates-itself-through-a-frozen-call-and-a-detached-updater.md) | Simlock updates itself through a frozen call and a detached updater | Accepted — not yet implemented; narrows 0009's `takes-requests` stage | -| [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part | +| [0043](0043-physical-devices-reach-agent-device-through-a-second-daemon.md) | Physical devices reach agent-device through a second daemon on the worker | Accepted — not yet implemented; supersedes 0023 §3–4 in part; §4 narrowed by 0046 | | [0044](0044-the-console-reads-what-its-page-shows-and-events-mark-it-stale.md) | The console reads what its page shows, and events mark it stale | Accepted — not yet implemented; supersedes 0013 §3 | | [0045](0045-a-devices-screen-streams-to-operators-not-a-leases.md) | A device's screen streams to operators, not a lease's | Accepted — not yet implemented | -| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Accepted — not yet implemented; narrows 0023 §1, §3–4, 0030 §2 and 0039 | +| [0046](0046-a-standalone-worker-serves-agent-device-by-default-with-a-private-profile.md) | A standalone worker serves agent-device by default and hands local agents a private profile | Accepted — not yet implemented; narrows 0023 §1, §3–4, 0030 §2, 0039 and 0043 §4 |