Repository navigation
acpmux: host approvals, and host enroll enrolls this Mac's app key on the machine (peer-route approvals 2/4) - #26133
Conversation
|
Owned by an agent session · session |
… the machine (peer-route approvals 2/4) acpmux host approvals [add|rm] keeps the Macs whose app may allow this machine's prompts (ACPMUX_HOME/mac-approvers.json, a locked read-modify-write and one rename), then has the running daemon reload, so rm stops a Mac's Allows once it returns. host enroll and host doctor get an approvals step: this machine's app key (the local daemon's _acpmux/mac_approvers thisMac) is added on the machine over ssh with --fix; no app key skips, an old remote warns with host update. Never a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
9a4b956 to
cf385b5
Compare
|
Found 7 test failures on Blacksmith runners: Failures
|
|
Bead |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 5c79c71 to compare; do not merge until green; see lane-rules |
…oad, and a reload that fails fails the change Review of #26133: a concurrent add could land between rm's write and its reload and put back the key rm took out, and a running daemon that did not reload was reported as success with reloaded: false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
…provals change, and a refusal names only this daemon's peer Review of #26133: reload() read every connect error as "no daemon"; it now checks daemon.lock and fails the change when a daemon holds it. A peer's own data.peer on a refused answer is replaced by this daemon's name for that peer, so the app's Enroll button never targets a host the peer named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Peer-route approvals, part 2 of 4: enroll this Mac's app key on a peer. Part 1 (#26131) has landed; this PR is on
feat-cmux-next.Part 1 lets a peer count an Allow signed by a Mac listed in its
mac-approvers.json. This PR adds the commands that put the Mac in that file, plus the name a refusal needs for the card's hint.acpmux host approvalslists the Macs that may allow this machine's prompts, and this machine's own app key (thisMac).host approvals add --id ID --key HEX --name NAMEandhost approvals rm IDchange the file under a lock. The file is rewritten whole with 0600 permissions.reload), so a removal stops that Mac's Allows at once. The file's lock is held until that reload returns, so a concurrentaddcannot land betweenrm's write and its reload. A running daemon that does not reload fails the command (and so a remoteenroll/unenroll).host approvals enroll PEER/unenroll PEER, run on the Mac:_acpmux/mac_approversthisMac, which the app sets in part 3);host approvals add/rmon that peer over ssh, with the same ssh routehost enrolluses.acpmux host enrollandhost doctorgain an approvals step. It is the same check:acpmux host doctor NAME --fix" when it is not;--fixorenroll;acpmux host update NAMEwhen the remote acpmux has nohost approvals.permission_respondrefused by a peer now carriesdata.peer, the local daemon's name for that peer, unless the error names one already. The app uses it for the "enroll this Mac on HOST" hint (parts 3 and 4).Conditions
host approvals rm, andunenrollfrom the Mac, rewrite the file and then reload under the set's lock (part 1), holding the file's lock until the reload returns; a reload that fails fails the command.addwrites the peer's file as the ssh user.Tests (they fail before the fix and pass after)
They ran remotely through
cmux-ci test.Before: the enroll step taken out, and no peer name on a refusal.
Before (review round): the lock let go before the reload, and a reload failure ignored.
After:
No capture: CLI and daemon only, with no app or webview change. Part 3 carries the card captures.
Overlap: #25822 (an update step in
host enroll) changes the same step list. Whichever lands second rebases.Agent session: agent session
🤖 Generated with Claude Code