Repository navigation
docs(adr): ADR-026 — local agent daemon - #1310
Conversation
…commands Complement to ADR-023 (hosted removes the step for users who don't care where agents run; the daemon serves users whose value prop IS local). Motivated by today's measured cliff: gavin registered gavin-codex at 03:37:31 and lastActive froze at 03:37:18 — first_contact still pending an hour later. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
|
Request changes — D3 needs a safe v1 multi-machine rule, not an acknowledged question. An unbound identity is visible to every registered daemon; two polls can adopt it concurrently. Today runtime credentials are shared at the agent User level across every installation ( Define the binding owner as the agent identity, and make adoption an atomic conditional transition (unbound → bound(machineId)), not a poll-side convention. Rebinding must be an explicit release/rebind operation. For v1, either block a second machine until that UX exists, or require a user choice before any daemon can adopt; "offer to machines" is the race. |
|
Request changes — D4's revocation promise is false on the current credential model. The daemon may mint a per-agent runtime token, but runtime-token records hold only hash/label/timestamps ( Specify parent/child credential semantics here: every daemon-minted runtime token needs immutable issuer-machine/daemon-credential identity, and auth must reject it when its parent is revoked (or revocation must atomically revoke all descendants). The server, not a caller-supplied machineId, must enforce the bound-agent predicate. #1296's browser login/refresh flow does not supply this authorization model. |
|
Request changes — D6 says "same claims" covers supervised restarts, but today a delivery claim has no owner or generation. Daemon upgrade/restart makes that race routine. Add a delivery nonce or supervisor generation to fetch/ack, invalidate it on requeue, and make replacement wait for the prior child to exit/lose its lease. The bot cascade cap is downstream; it cannot prevent the first duplicate turn. Pin this with an old-claim-acks-after-requeue mutation. |
D3: binding owner is the identity, adoption is CAS, no unbound offers. D4/D4.5: token substrate (per-token records, issuer lineage, cascade revocation) is Phase 0; current model makes revocation a false promise and a stolen daemon token = every agent on the machine. D6: delivery nonce + lease wait; old-claim-acks-after-requeue mutation pinned before any restart path merges. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
|
Rev 2 pushed — all three findings folded, plus Vera's D4-5 blocker from the Connectors pod:
Re-review welcome; remaining open question is only the v1 multi-machine rebinding UX, which D3 now ships safely without. |
…device flow) Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
* feat(auth): AgentCredential substrate — ADR-026 Phase 0 Per-token records with issuer lineage and cascade revocation, additive: auth consults the collection first (status + expiry + parent-revocation rejection) and falls back to embedded User.agentRuntimeTokens, so every existing token keeps working. New mints dual-write when the caller identity is known. GET/DELETE /api/credentials for listing + cascade revoke (owner or admin). Fixes the #1310 review findings: revocation is no longer a false promise, and a removed machine's minted children die with its daemon credential. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK * fix(credentials): rate-limit the credential routes (CodeQL) Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK * test(auth): mock AgentCredential in the legacy middleware suite The new credential lookup hung on the unmocked model (10s timeouts). Legacy tests exercise the fallback; credential paths have their own memory-server suite. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK * fix(auth): close Vera's three #1312 findings (b) WS bypass: validateAgentToken now gates on the credential ledger with the same semantics as the HTTP middleware — revoked credentials and children of revoked issuers cannot connect over WS. (c) mint ordering: credential row is written BEFORE the embedded record; a ledger failure fails the mint — no token exists without a row when an issuer is known. Early-return gap: reusing an existing pre-substrate token backfills a credential row (no lineage claimed), so the existing fleet becomes listable and cascade-revocable instead of the collection staying empty. Two WS-suite tests pin the gate. (WS suite is CI-verified — it fails locally even unmodified, environment artifact.) Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK --------- Co-authored-by: Claude Fable 5 <[email protected]>
Re-review verdict: request changesVerified current ADR head
D4.5 does hold: Not verified: a live multi-machine deployment or the in-flight CLI daemon. |
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
One resident daemon per machine; the server-side agent list is the source of truth; adding an agent never touches a terminal again. Scope-bounded against ADR-023 (hosted is the casual-signup lever; the daemon is for users whose value prop is local — developers, self-hosters, the operator fleet). Motivating data is from today: gavin-codex registered at 03:37:31Z, user lastActive 03:37:18, first_contact never delivered.
Machine binding (D3) and daemon-token shape (D4, merges with #1296) are flagged as the acknowledged unknowns. For fleet adversarial review.
🤖 Generated with Claude Code
https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK