Repository navigation
feat(daemon): adoption CAS + daemon auth — ADR-026 D3 (Phase 1 S2) - #1315
Conversation
… D3 (Phase 1 S2) cm_daemon_* auth against the ledger (lifecycle-scoped: cannot pass agentRuntimeAuth or act as any agent); botMetadata.machineId declared on interface AND schema; POST /api/agent-binding/adopt is an atomic unbound→bound(machineId) conditional update — machineId comes from the credential server-side, never the body; concurrent adopts yield one winner and a clean 409; release is an explicit owner action, making rebind a deliberate two-step. 6 CAS invariant tests on mongodb-memory-server incl. the concurrent race. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
…equiring factory Vera on #1315: a scope nobody reads doesn't hold the claim. adopt now requires 'agents:adopt'; heartbeat-only credentials 403. No legacy daemon credentials exist, so enforcement is strict from birth. This is THE daemon middleware — #1316 should consume it, not duplicate it. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
…act)
Minimal projection {machineId, ownerUserId, scopes} — the credential
document and its internals never reach route handlers.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
|
Review at
|
Adoption requires an active installation installedBy the owner AND no active installation of the identity installedBy anyone else. Test pins the negative clause: a shared identity is not adoptable by either party. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK
|
Held by Sam's ruling (2026-08-30): ADR-026's direction is approved and the doc merges as Proposed, but Phase 0 (token substrate) and everything after it are gated on ADR-023 W2 (hosted runtime) being live — casual signups are the activation goal and hosted is the bigger lever for them. This PR stays open until that gate opens; rebase when it does. Added acceptance criterion for Phase 1: revoke a machine → every agent bound to it stops within one heartbeat, as a tested requirement. The D6 ack race is now its own P1 row (TASK-090) — fix it independently of this stack. |
|
RETRACTED — the hold comment above was written from a stale queue listing. Sam ratified ADR-026 as Accepted via his other session on 2026-08-30 and this PR was merged and deployed under that decision before the comment landed. The ratification stands; ignore the hold. |
Phase 1 S2, on the #1312 substrate:
unbound → bound(machineId)conditional update. machineId is read from the daemon credential server-side — a caller-supplied value is ignored by construction. Ownership predicate: the daemon's owner must hold an active installation of the agent. Concurrent adopts: one winner, loser 409s with the holder. Idempotent re-adopt for the holder.6 invariant tests incl. the concurrent-race case. Merge gate: @vera's S3 verdict. Pairs with Kai's S1 (Machine rows); adoption references machineId as an opaque string so the two merge independently.
🤖 Generated with Claude Code
https://claude.ai/code/session_013pc6nGXRS8mHvrwcXMSRDK