Skip to content

feat(j5): add Agent Setup and configurable Crew approval - #754

Merged
bryantderosier merged 12 commits into
j5/742-flat-roster-cardfrom
j5/743-agent-setup-crew-approval
Nov 3, 2026
Merged

bryantderosier merged 12 commits into
j5/742-flat-roster-cardfrom
j5/743-agent-setup-crew-approval

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Every Crew addition currently waits for a human, and trusted Captains have no way to skip initial roster approval. I added project-scoped auto-approval for new Crews, direct additions by their Captain, and an Agent Setup settings page that keeps the existing /settings/personas route. Closes #743.

Initial approval stays on by default. Automatic decisions retain proposal history, refusals retain their reasons across retries, and member access still controls tool approvals. Pending addition requests from older versions remain answerable above their Captain's composer. Mobile keeps its persona controls under the Agent Setup name.

This PR targets j5/742-flat-roster-card.

Evidence

  • At 9b8ceaf94e, on top of feat(web): review Crew proposals from the composer #751 after the stack was rebased onto j5/main: the CI typecheck command exits 0, server src/j5/a2a src/j5/agents src/mcp passes (1220 tests) and web src/j5/crew src/components/settings passes (710 tests). Migration 048 and Migrations.test.ts pass:
    cd apps/server && vp test run src/j5/a2a/migrations/048_CrewApprovalMode.test.ts src/j5/a2a/Migrations.test.ts
  • The earlier storageCleanup.test.ts relaxation for Git versions is gone. Main's fix(server): storage cleanup reads Git 2.56's broken-gitfile message #769 fixed that in the source, so this PR restores the file to main's version. A local run of that whole file fails on macOS temp-path assertions (/var against /private/var) and is left to CI.
  • Historical validation at f2a1b38cbdb94d96227a3ca6d2f04c44c555309f: 499 tests passed across 24 focused files. The full command below describes that earlier run, not a fresh 499-test run on this repair.
  • The key regressions cover setting inheritance in both directions, unchanged pending human proposals after a setting flip, concurrent retries, provider sign-out, supervised member access, refusal reason replay, legacy migration, and section-link routing through web and Electron history.
  • At the original implementation head, typechecks passed with vp run typecheck in apps/server, apps/web, apps/mobile, and packages/client-runtime. Web typechecking was repeated on this stacked head.
  • vp lint $(git diff --name-only origin/j5/742-flat-roster-card...HEAD -- '*.ts' '*.tsx') passed with the existing react(set-state-in-effect) warning in HumanInboxPage.tsx. git diff --check origin/j5/742-flat-roster-card...HEAD passed.
  • Independent code and security reviews covered the earlier implementation snapshot. The confirmed code findings were fixed and regression-tested; the security review reported no confirmed findings in its reviewed snapshot.
Exact focused test command (run from the repository root)
vp test run \
  apps/server/src/j5/a2a/CrewProposalService.test.ts \
  apps/server/src/j5/a2a/AgentCrewProposalService.test.ts \
  apps/server/src/j5/a2a/crewGateNotice.test.ts \
  apps/server/src/j5/a2a/CrewLaunchReporter.test.ts \
  apps/server/src/j5/a2a/runtimeLayer.test.ts \
  apps/server/src/j5/a2a/Migrations.test.ts \
  apps/server/src/j5/a2a/migrations/048_CrewApprovalMode.test.ts \
  apps/server/src/j5/a2a/spawnIds.test.ts \
  apps/server/src/j5/a2a/mcp/handlers.test.ts \
  apps/server/src/j5/a2a/mcp/tools.test.ts \
  apps/server/src/j5/a2a/mcp/j5ToolPreapproval.test.ts \
  apps/web/src/j5/crew/crewProposals.logic.test.ts \
  apps/web/src/j5/crew/crewRuntimeRequests.logic.test.ts \
  apps/web/src/j5/agents/settingsSearch.test.ts \
  apps/web/src/components/settings/settingsSearch.test.ts \
  packages/shared/src/projectSettings.test.ts \
  packages/contracts/src/settings.test.ts \
  apps/web/src/j5/agents/AgentSetupLinks.test.tsx \
  packages/client-runtime/src/j5/playbooks.test.ts \
  apps/web/src/j5/crew/CrewProposalCard.test.tsx \
  apps/web/src/j5/crew/crewNotices.logic.test.ts \
  apps/web/src/j5/crew/crewProposalDraft.test.ts \
  apps/web/src/j5/crew/useCrewProposalPreview.test.tsx \
  apps/web/src/j5/crew/crewState.test.ts

UI changes

Agent Setup groups Personas, Crews, and Playbooks, uses upstream's settings scope, and adds section links. The Crews section exposes Auto-approve new Crews. Legacy addition cards move from the Inbox to the Captain's thread. Screenshots below compare base 27968f8b3b32b8032ff9395c257c46351d821e0f with head f2a1b38cbdb94d96227a3ca6d2f04c44c555309f, at 1280×800 on isolated generated test data. These screenshots predate the repair head; the settings UI source is unchanged by the repair. Legacy addition cards and the native mobile title are not pictured.

Before After
Personas becomes Agent Setup Before After
Crew auto-approval defaults off new Crew auto-approval defaults off
Project override and inherited default new Project override and inherited default

All four uploaded PNGs were read back through the GitHub Contents API and matched the local captures byte-for-byte. Direct raw-image HTTP checks were blocked on this machine by Zscaler (403 text/html), so signed-out image rendering remains unverified.

An interaction video is still outstanding; the collaborative browser has no GitHub Video Upload profile configured.

Live testing

Partial, primary-agent browser pass at historical head f2a1b38cbdb94d96227a3ca6d2f04c44c555309f using node scripts/j5/setup-agent-live-test.ts --base origin/j5/742-flat-roster-card. I verified the Agent Setup labels and section links, the auto-approval switch initially off, a project override turning it on, its source popover showing Project On / Default Off, and reset returning it to off. The base and head settings pages were captured in separate private browser tabs.

No provider agents were launched: this run was authorized for screenshots. Crew launch/addition execution, legacy pending cards (absent from the generated fixture), supervised tool approval routing, persistence across a server restart, fresh-install defaults, Electron navigation, native mobile, and remote/relay/tunnel remain untested live. Before marking ready, enable auto-approval for the test project and propose a Crew, disable it and confirm the next proposal requires approval, add a member as Captain, and check a supervised member still prompts in the Inbox. Repeat section navigation in Electron and check the Agent Setup title on mobile. Prior unit tests use offline stores and mocked provider/dispatch boundaries; some exercise the real Crew launcher.

Not verified: a new browser/provider pass at the repair head, the live paths listed above, an interaction recording, and independent review of the final fixes and stacked head. Browser evidence covers only the local web settings UI. The repository-wide suite was not run.

Merge Danger

Door: one-way for persisted state. Migration 048 adds approval-mode and refusal-detail columns; reverting the code leaves those columns, recorded decisions, and launched Crew members in the database. Existing proposal rows default to human approval.

Blast Radius: Crew staffing and approval history, scoped settings, and Agent Setup navigation on web/desktop/mobile. An incorrect override could skip a desired roster review; member tool approval policy remains unchanged.

A Captain's addition is always automatic, and a custom member's access defaults to Full access. A Supervised Captain can therefore start a Full-access custom member without review. I decided to allow that, and it's recorded in FORK.md case 24, crews.md and the comment on the pre-approval list.

After merge: normal server startup applies the J5 migration. Auto-approval remains off unless enabled at environment or project scope. Merge this PR into j5/742-flat-roster-card.

Upstream impact

J5 integration edits are described in FORK.md case 105:

  • packages/contracts/src/settings.ts: setting, patch, and project-override registration.
  • apps/web/src/components/settings/settingsSearch.ts: Agent Setup name, search terms, and setting target.
  • apps/mobile/src/Stack.tsx: existing screen title.
  • apps/mobile/src/features/settings/SettingsRouteScreen.tsx: existing navigation label.

These integrate J5 behavior without changing upstream's product semantics. Case 88 and the file table now include all four upstream integration files.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md)
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them

Implementation: GPT-6.1-Sol through the Codex harness in J5 Code.

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 2, 2026 3:12pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 effective changed lines (test files excluded in mixed PRs). labels Oct 27, 2026
@bryantderosier bryantderosier self-assigned this Oct 27, 2026
@bryantderosier
bryantderosier added this pull request to stack #753 October 27, 2026 15:08
bryantderosier added a commit that referenced this pull request Oct 27, 2026
@bryantderosier
bryantderosier marked this pull request as ready for review October 27, 2026 17:43
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Jacksondr5

Copy link
Copy Markdown
Owner

Panel review: #754

Live (Astra, stack tip): auto-approve on gave an automatic launch, and off brought the card back. A Captain's direct addition worked, and the settings persisted across a restart.

Factual, whichever way Jackson rules on additions: j5_request_crew_member is still in J5_COORDINATION_TOOLS (mcp/j5ToolPreapproval.ts:67). That list's comment says "Lifecycle and spawning tools keep the harness's prompting", and FORK case 24 (FORK.md:249) justifies the pre-approval with "membership still waits for the platform's human roster or Inbox decision". After this PR, the tool spawns a member with no human decision (approvalMode: "automatic", CrewProposalService.ts:796). An unconfigured custom seat gets Full access (CrewLaunchService.ts:434). So a Supervised Captain can start a Full-access agent and is never prompted, while j5_spawn_agent still prompts. The code contradicts its own comment and FORK's rationale. Whether to fix the list or the comment is a product call, and it's with Jackson.

Docs still describe Inbox additions. These need rewriting in this PR:

  • crews.md AC23 (:111)
  • inbox.md :18, :36 and :44 (pending Crew-member requests in contents, badge and AC1)
  • shared-conversations.md AC12 (:64)
  • FORK case 24 (:249)
  • FORK's mobile row (:290), which still says "appends one Personas row"

Process

Nits

  • refusal_detail (migration 048) exists only to replay a refused automatic approval. Re-validating on replay, or returning a generic "refused, use a new client_request_id", would drop the column. resolveRuntime also runs twice on the automatic path (:704 and :971).
  • An automatic proposal can be left open by an uncaught operation error between create and resolve. It's filtered out of every client read (ClientReadsService.ts:411) but still counts against CREW_SEAT_CAP. This is rare, so only noting it.

Review panel for the #750–#762 stack, judged as the code that lands at da64b2795c: Claude Opus 5.5 (lead and three code reviewers), GPT-6.1-Sol (process, docs, CI) and GPT-6-Astra (live test on an isolated server, Haiku 5.5 and GPT-6 Luna turns). Every finding here was agreed by the whole panel. Product questions are with Jackson and are not listed. Posted by Claude Opus 5.5 via J5 Code.

@BastiHu BastiHu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline findings from the crew review of #750, #751, #754 and #755, checked against this PR's current diff. Integrated validation at #755 head 30bbf0a: 535 existing focused tests passed, six targeted correctness assertions failed, and two access-policy observations passed. Comments distinguish P2 defects, a policy decision, and nonblocking P3 notes. No source changes were made.

@bryantderosier
bryantderosier removed this pull request from stack #753 October 28, 2026 11:45
@bryantderosier
bryantderosier force-pushed the j5/743-agent-setup-crew-approval branch from 08ef6e7 to e2f9512 Compare October 28, 2026 11:45
@bryantderosier
bryantderosier added this pull request to stack #771 October 28, 2026 11:48
@bryantderosier
bryantderosier force-pushed the j5/743-agent-setup-crew-approval branch from e2f9512 to 56275e6 Compare October 28, 2026 12:06
@github-actions github-actions Bot added size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). and removed size:XL 500-999 effective changed lines (test files excluded in mixed PRs). labels Oct 28, 2026
@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (test files excluded in mixed PRs). label Oct 28, 2026
@bryantderosier
bryantderosier force-pushed the j5/743-agent-setup-crew-approval branch from 56275e6 to a473f60 Compare October 28, 2026 13:47
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Thanks. Here's where each one landed:

  • Pre-approval vs the rationale: I decided to allow it, so I fixed the comment on the pre-approval list and the FORK.md case 24 wording instead of removing the tool from the list (a473f608c4).
  • Docs: rewrote crews.md AC23, inbox.md, shared-conversations.md AC12, FORK case 24 and the FORK mobile row so they match what the PR does now.
  • Description: fixed the migration number (048) and the focused test command.
  • storageCleanup test: dropped. Main's fix(server): storage cleanup reads Git 2.56's broken-gitfile message #769 already fixed that in the source, so this PR restores the file to main's version.
  • refusal_detail: leaving it. It's a nit, and the column keeps the original reason when a refused request is replayed.
  • resolveRuntime running twice: leaving it. The first call is a check before the proposal is recorded, so removing it would change behavior.
  • Open automatic proposal counting toward the seat cap: not changing it, since it's rare and the proposal is hidden from every client read.

@BastiHu BastiHu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for this layer at a473f60. The automatic custom-member access question now has an explicit acceptance and matching documentation in crews.md, FORK.md and the preapproval comment. This is an accepted policy choice; the broader-access behavior remains intentional. Current CI passes, and the relevant proposal/launch tests passed in the 298-test focused verification of the integrated stack. The separate empty-persona-instructions issue remains tracked on #751.

bryantderosier and others added 4 commits October 29, 2026 08:16
The CI repair in this PR relaxed the invalid-gitfile assertion for a Git-version
difference. origin/j5/main now fixes the source for that (#769), so the test is
back to main's exact version and FORK.md no longer records an upstream-test edit
under case 88. `vp test run src/storageCleanup.test.ts -t "compares the
checked-out branch without a full status"` passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…embers (#743)

A Captain's addition and an auto-approved roster launch without review, and a
custom member defaults to Full access, so a Supervised Captain can start a
Full-access member. The person accepted that; FORK.md case 24, the
j5_request_crew_member pre-approval comment and crews.md now say so. Also
rewrites the text that still described Crew additions as Inbox requests
(inbox.md, shared-conversations.md AC12, crews.md AC23) and FORK's mobile row,
which now names the Agent Setup row.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Jacksondr5

Copy link
Copy Markdown
Owner

Jackson's decision, relayed by the review lead (Claude Opus 5.5): Jackson accepts that a Supervised Captain can add a Full-access custom member without review.

crews.md and the comment in j5ToolPreapproval.ts record it as accepted without naming who decided. Please add "Jackson, 2026-10-31".

bryantderosier and others added 8 commits November 2, 2026 09:05
Automatic approvals record no feature.used event (nobody acted), and the
Inbox page drops its Crew requests section as this layer decided.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…thread records

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… member

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Added "Jackson, 2026-10-31" as who accepted that in crews.md, FORK.md and the comment in j5ToolPreapproval.ts (e62cb92217).

@bryantderosier
bryantderosier merged commit d774962 into j5/main Nov 3, 2026
37 of 39 checks passed
@bryantderosier
bryantderosier deleted the j5/743-agent-setup-crew-approval branch November 3, 2026 01:30

This branch was successfully deployed

1 active deployment
Preview — f3d09786 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crews: Agent Setup, auto-approve new Crews, and additions without approval

3 participants