Repository navigation
fix(j5): archiving a Crew is gated on the Owner's scope in the client - #912
Conversation
…, and one docs line is accurate The server lets only an Owner archive a Crew, but the client guarded it with the Operate scope, so a Collaborator saw an enabled Archive crew button and was then refused. It now takes the same scope as answering a worktree cleanup, and the Fleet button reads its own command's permission instead of Stop crew's. agent-tools.md also said an accepted proposal is never checked again, which is only true of a retry; preview and approval check it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Review by Claude Opus 5.5 (single reviewer). The change is right, but it's only half of the scope move, and
The other three are the read-only refusal test and two handler tests that call archive as an operator. The fix is the same shape as
The server tests weren't in the packages run for this PR, so |
…Owner's scope Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Good catch, I only ran the contract and client packages. Moved |
Summary
The server only lets an Owner archive a Crew, but the client guarded Archive crew with the Operate scope. A Collaborator with Operate saw an enabled Archive crew button on Fleet and was refused when they clicked it. I said I'd fix this together with #762's cleanup item, and #762 only got the cleanup answer. This moves
archiveCrewto the same scope (settings:write, which only an Owner's device holds) in the contract and in the server's own scope table, and the Fleet button now reads Archive crew's own permission instead of borrowing Stop crew's.I also went back through every review comment on the #750–#762 and #770 stack (stack pingdotgg#771) for anything dropped. Everything else was either fixed in the later commits or deliberately declined with a reason in the thread. The one other miss was
agent-tools.md, which still said "An accepted proposal is not checked again". The panel pointed out that's only true of a retry; preview and approval do check it. #762 said it would be fixed with the models PR and it wasn't. It now says "A retry of a proposal already accepted is not checked again."Evidence
clientRpcPermissions.test.tsnow assertsarchiveCrewandanswerCrewWorktreeCleanupboth needsettings:write, andactions.test.tsmovesarchiveCrewinto the Owner-only group, where an Operate-only session gets it as unavailable.cd packages/contracts && vp test run src/j5/clientRpcPermissions.test.ts(4 passed)cd packages/client-runtime && vp test run src/j5/actions.test.ts(7 passed)wsRpc.test.tskeeps the server's table and the contract in step and now calls archive through an Owner client.cd apps/server && vp test run src/j5/wsRpc.test.ts src/j5/a2a/ClientActionsService.test.ts(12 passed)cd apps/web && vp test run src/j5/fleet(44 passed).vp run typecheckis clean (0 errors) inpackages/contracts,packages/client-runtimeandapps/web.Not verified: I didn't open Fleet in a browser as a Collaborator, so the disabled button is covered by the permission tests only.
vp run check:changedpasses format and lint here, but typecheck, knip and test fail in files this change doesn't touch (the server'sCrewWorktrees.test.ts, knip's config loading, and other agents' copies under.claude/worktrees), so I ran the affected packages directly. No full suite.Merge Danger
Door: two-way. A scope constant, a button's gating and one doc line, with no data or migration, so a revert undoes it.
Blast Radius: the Archive crew button on Fleet, for people whose device holds Operate but not Owner. Owners see no change. The server already refused everyone else.
After merge: nothing.
Checklist
FORK.md(none edited; all paths are J5-owned)docs/j5/product/upstream.md(none)docs/j5/product/and user docs rewritten where this changes them🤖 Generated with Claude Code