Skip to content

feat(mobile): review a Captain's Crew proposal: approve, decline, remove seats - #983

Merged
Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/mobile-crew-roster-review
Nov 9, 2026
Merged

Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/mobile-crew-roster-review

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

A Captain's Crew proposal could only be answered on web or desktop. On a phone the Captain waited, since proposals never expire. Jackson's decisions on #836 (1 and 2): a phone can approve a Crew, the approval screen must show each seat's access because the approval binds the settings shown, and the only edit on a phone is removing seats.

Refs #836 (piece 3 of 7). Decision 6's one-line Settings pointer goes with it.

What changed

On mobile:

  • Strip: a row above the Captain's composer for each open, human-approved proposal: "Crew proposal", its name, the member count, and "Review". It mounts beside the playbook bar and takes its height. Auto-approved proposals never show.
  • Review screen (ThreadCrewProposal, pushed, not a sheet):
    • the proposal's name, brief and playbook;
    • one row per seat, with model · reasoning · access as the server's runtime preview resolved them, the workspace when it isn't the Captain's checkout, "Asks for approvals", steps and persona-swap notes;
    • a Remove button on each seat, disabled for the last one, with Restore removed seats and the "leaves step unowned" notes;
    • Decline and Approve Crew ("Approve member" for a legacy addition request).
  • Approval binding: Approve needs a complete preview of exactly the seats on screen. Each removal previews again, and a failed attempt asks for a fresh token. If the proposal was answered elsewhere, the screen says so. If reading the proposals failed, the screen shows the error and Retry. Without permission to write to the Captain's thread, it's read-only and says why. There's no add or edit; the screen points to the Captain or to web.
  • Platforms: pushed screens on both, with a glass header on iOS and a solid one on Android. There's no Modal or Menu, so Android's Menu-inside-Modal trap doesn't apply. The screen scrolls in ScreenScrollView with automatic insets (as in fix(mobile): J5 screens sit below the header and status bar on iOS #874).
  • Agent Setup: a "Crews" line says Crew settings (auto-approve, member models and reasoning) live in Agent Setup on web and desktop.

Shared with web: packages/client-runtime/src/j5/crewProposals.ts now holds:

  • the gate filter;
  • removeSeat;
  • the seat lines (crewSeatStopsForApprovals, describeCrewSeatWorkspace);
  • the playbook-plan helpers;
  • the preview hook's pure core (crewPreviewIsComplete, crewPreviewRuntimeForSeats).

client-runtime has no React dependency, so each client keeps a thin hook. Web's card and hook import the shared logic, with no change in behaviour, and their tests moved with it.

UI changes

iOS (iOS 26.5 Simulator, light theme; head 3d6e2429e9, with the same app code as later heads). A real Claude Haiku Captain proposed a Crew with two Haiku helper seats; auto-approve was off. After only: trunk shows nothing above the composer and has no review screen.

Captain's thread Review screen
Open Crew proposal row above the Captain's composer, iOS after Crew review screen with each seat's model, reasoning and access below the header, iOS after

Android (head 158ebb5fe7 against trunk 355672f6f1; real Claude Haiku proposals).

State Before After
Captain with a pending custom Crew proposal Captain with a pending custom Crew proposal, before Captain with a pending custom Crew proposal, after
Captain with a pending playbook Crew proposal Captain with a pending playbook Crew proposal, before Captain with a pending playbook Crew proposal, after
Agent Setup Crews guidance Agent Setup Crews guidance, before Agent Setup Crews guidance, after

New states (after only):

State Screenshot
Custom seats show model, reasoning, access and the approval warning Custom seats show model, reasoning, access and approval warning, after
Playbook seats show their assigned steps Playbook seats show their assigned steps, after
A Viewer sees why the actions are disabled Viewer review explains why actions are disabled, after
Removing the verifier leaves its playbook step unowned Removing verifier leaves its playbook step unowned, after
Removing a seat disables Approve while the preview is pending Removing a seat disables approval while preview is pending, after
Restoring the verifier resolves its runtime before approval Restoring verifier resolves runtime before approval, after
The restored roster has both seats resolved Restored roster has both resolved seats, after
A declined proposal leaves the Captain's composer Declined proposal leaves the Captain composer, after
The approved Crew completes its two playbook steps Approved Crew completes its two playbook steps, after
The created drafter and verifier seats appear in Chats Created drafter and verifier seats appear in Chats, after

Decline removes the proposal strip (excerpt):

decline-crew-excerpt-158ebb5-after.mp4

Remove and Restore wait for a fresh runtime preview:

remove-restore-confirmed-158ebb5-after.mp4

Approve creates the Crew and its playbook runs (excerpts):

approve-crew-excerpts-158ebb5-after.mp4

Live testing

iOS: partial pass at 3d6e2429e9, run by the iOS tester (Sol 6.1). The proposal row sits above the composer, and both seats' model · reasoning · access lines sit below the native header and status bar. The proposal stayed open (human approval, no Crew launched). This was a visual check only. Report: project artifact test-reports/pr-983/ios-3d6e2429e9.md.

Android: pass at 158ebb5fe7 (trunk 355672f6f1 for the before captures), run by the Android tester (Sol 6.1) with real Claude Haiku turns. Report: project artifact test-reports/pr-983/158ebb5fe7.md.

  • Both proposals passed: the strip, and the review's runtime, access and "Asks for approvals" lines.
  • As a Viewer, the actions are disabled with an explanation. The Owner role was restored afterwards.
  • On the playbook proposal, Remove leaves the removed seat's step unowned and Restore gives it back. Approve is disabled while a fresh preview is pending, and enabled once it arrives.
  • Both restored seats resolved to Haiku · Low before Approve.
  • Decline cleared the strip and launched no seats.
  • Approving the playbook proposal created the drafter and verifier seats. Both ran real Haiku steps, the playbook completed 2/2, and the output file was verified.
  • The new Crews line in Agent Setup shows.

Not exercised: nothing in scope. Head 158ebb5fe7 differs from the iOS head 3d6e2429e9 only by squashing and rebasing (a FORK ledger conflict), with no app code change.

Upstream impact

  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx: mounts J5's J5ComposerControls beside case 49's playbook control. This is new case 114. It's one J5 slot for every J5 row above the composer: the roster strip now, and builder-timeline's adjudication dock next, so that one doesn't need another seam.
  • apps/mobile/src/Stack.tsx: the existing case 98 spread is renamed to j5ThreadRoutes, which now also registers ThreadCrewProposal.
  • FORK.md: case 114 (renumbered, because fix(mobile): Metro doesn't watch a worktree's .j5code folder #984 took 113), case 98's text, and both ledger rows. upstreamSeams.test.ts is updated.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: crewProposals.test.ts (the gate filter, removal and unowned steps, seat lines, and preview binding: a token counts only for a preview of exactly the seats on screen, and stale runtime rows drop out); web's 115 crew tests pass on the shared code
  • UI changes: iOS and Android captures above, with three Android videos for the interactions
  • Live testing: Android full-flow pass and iOS visual pass, above
  • Upstream-owned files: each recorded in FORK.md (case text and file-table row) in this PR
  • Upstream product: no change to what upstream does
  • Surfaces: mobile gains the gate; web unchanged on shared logic; Agent Setup pointer; server and contracts untouched; the review screen's reverse state (restore removed seats) included
  • Docs: user docs (crews.md, personas.md) still say mobile can't answer proposals; per the wave plan they're updated in the wave's single docs PR

Built by Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 9, 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 9, 2026 6:07am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Mobile adds a Crew proposal review flow from thread composer controls through proposal preview and resolution. Client-runtime now exports shared Crew proposal helpers, which mobile and web use. Mobile thread routing also registers the Crew review screen alongside the existing artifact screens.

Changes: Crew proposal review

Layer / File(s) Summary
Shared Crew proposal helpers
packages/client-runtime/package.json, packages/client-runtime/src/j5/crewProposals*
Client-runtime adds shared proposal, seat, playbook, and preview helpers, exports them, and adds tests.
Web adopts shared helpers
apps/web/src/j5/crew/*
Web imports the shared helpers, removes the duplicate local implementations, and delegates preview checks and runtime-row filtering to client-runtime.
Mobile thread entry and route registration
apps/mobile/src/Stack.tsx, apps/mobile/src/j5/threadRoutes.ts, apps/mobile/src/j5/artifacts/routes.ts, apps/mobile/src/j5/composer/*, apps/mobile/src/j5/crew/CrewRosterStrip.tsx, apps/mobile/src/features/threads/ThreadDetailScreen.tsx, apps/mobile/src/j5/agents/AgentLibrarySettingsScreen.tsx, apps/mobile/src/j5/upstreamSeams.test.ts, FORK.md
Mobile adds Crew roster controls to eligible thread composers and registers the proposal review route alongside artifact routes. Supporting seam checks, settings text, and case documentation are updated.
Mobile proposal preview and resolution
apps/mobile/src/j5/crew/CrewProposalReviewScreen.tsx, apps/mobile/src/j5/crew/crewProposalsClient.ts, apps/mobile/src/j5/crew/useCrewProposalPreview.ts
The review screen loads proposal and permission state, previews the displayed seats, and submits approval or decline when the required conditions are met.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ThreadDetailScreen
  participant J5ComposerControls
  participant CrewRosterStrip
  participant CrewProposalReviewScreen
  participant crewProposalsClient
  ThreadDetailScreen->>J5ComposerControls: Render with environment and thread IDs
  J5ComposerControls->>CrewRosterStrip: Render with environment and thread IDs
  CrewRosterStrip->>CrewProposalReviewScreen: Navigate to selected proposal
  CrewProposalReviewScreen->>crewProposalsClient: Request preview
  CrewProposalReviewScreen->>crewProposalsClient: Resolve proposal with approval token or decline
Loading

Possibly related issues

Suggested reviewers: bryantderosier

Merge Risk: Minimal · up to d1c96

The change adds mobile review of Crew proposals and moves shared logic into client-runtime. No concrete merge-blocking risk was identified. Android testing is still pending, which is normal validation rather than a defect.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): review a Captain's Crew proposal: approve, decline, remove seats" matches the main change. The PR adds a mobile review screen for Crew proposals, and that screen supports appr…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is thorough and follows the template. It covers the problem (phones cannot answer Crew proposals, with a link to #836 piece 3 of 7) and what changed on mobile and in the shared client-…
Full details: Title check

Explanation

The title "feat(mobile): review a Captain's Crew proposal: approve, decline, remove seats" matches the main change. The PR adds a mobile review screen for Crew proposals, and that screen supports approve, decline, and seat removal. The title is specific and follows a conventional commit style. It is 78 characters, which is within a reasonable length for a title. It does not mention the shared client-runtime move or the Agent Setup pointer, which is expected because the title only needs the primary change.

Full details: Description check

Explanation

The description is thorough and follows the template. It covers the problem (phones cannot answer Crew proposals, with a link to #836 piece 3 of 7) and what changed on mobile and in the shared client-runtime. It includes UI before/after captures for iOS and Android, a detailed Live testing section with verdicts, commit heads, and what was not exercised, and an Upstream impact section that lists the upstream-owned files and FORK.md cases 114 and 98. Its checklist is filled in, with one open item: user docs are deferred to a separate wave PR. Minor gaps: the iOS live test is only a partial pass, and the Live testing section does not mention the reverse-state item beyond the checklist. Neither gap blocks merge.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bfee80d and d1c9689.

Files selected for processing: 27

  • FORK.md
  • apps/mobile/src/Stack.tsx
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/mobile/src/j5/agents/AgentLibrarySettingsScreen.tsx
  • apps/mobile/src/j5/artifacts/routes.ts
  • apps/mobile/src/j5/composer/J5ComposerControls.tsx
  • apps/mobile/src/j5/crew/CrewProposalReviewScreen.tsx
  • apps/mobile/src/j5/crew/CrewRosterStrip.tsx
  • apps/mobile/src/j5/crew/crewProposalsClient.ts
  • apps/mobile/src/j5/crew/useCrewProposalPreview.ts
  • apps/mobile/src/j5/threadRoutes.ts
  • apps/mobile/src/j5/upstreamSeams.test.ts
  • apps/web/src/j5/crew/CrewProposalCard.tsx
  • apps/web/src/j5/crew/CrewProposalMemberRow.tsx
  • apps/web/src/j5/crew/CrewRosterGate.tsx
  • apps/web/src/j5/crew/crewPlaybookPlan.test.ts
  • apps/web/src/j5/crew/crewPlaybookPlan.ts
  • apps/web/src/j5/crew/crewProposalDraft.test.ts
  • apps/web/src/j5/crew/crewProposalDraft.ts
  • apps/web/src/j5/crew/crewProposals.logic.test.ts
  • apps/web/src/j5/crew/crewProposals.logic.ts
  • apps/web/src/j5/crew/crewSeatRuntime.test.ts
  • apps/web/src/j5/crew/crewSeatRuntime.ts
  • apps/web/src/j5/crew/useCrewProposalPreview.ts
  • packages/client-runtime/package.json
  • packages/client-runtime/src/j5/crewProposals.test.ts
  • packages/client-runtime/src/j5/crewProposals.ts
Files with no reviewable changes: 7

  • apps/web/src/j5/crew/crewPlaybookPlan.test.ts
  • apps/web/src/j5/crew/crewProposals.logic.test.ts
  • apps/mobile/src/j5/artifacts/routes.ts
  • apps/web/src/j5/crew/crewProposals.logic.ts
  • apps/web/src/j5/crew/crewSeatRuntime.ts
  • apps/web/src/j5/crew/crewSeatRuntime.test.ts
  • apps/web/src/j5/crew/crewPlaybookPlan.ts

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Combined panel review (reviewer-opus + reviewer-sol) at eb068f7

Verdict: one small should-fix, plus a FORK.md case-number collision to settle. The source is otherwise approved. Still pending: the tester's Android run (strip, review, remove, restore, decline, approve, read-only) and J5 CI. iOS is planned for Checkpoint 4.

Small should-fix: a failed proposal read shows "Loading" forever (raised by reviewer-sol)

CrewProposalReviewScreen.tsx (around :245–255) chooses between loading and "Already answered" using only query.data === null. useEnvironmentQuery maps a failed read to data: null and puts the cause in query.error. So a cold deep link (…/crew-proposals/:proposalId is registered) whose listCrewProposals read fails shows "Loading the proposal…" with no way out. Show query.error with a retry (query.refresh) before deciding between loading and answered.

FORK.md case 113 collides with #984

This PR adds case 113, and #984 (Metro blockList) also records itself as case 113. Whichever merges second renumbers, including its ledger rows and seams-test record.

The three hard-look points

  • Approval binding: holds. The mobile hook's key is environment, proposal, the full seat list and a refresh counter. data (and so the token) is returned only for a settled preview with the current key that crewPreviewIsComplete accepts: same proposal, non-empty token, exactly one row per seat on screen. Every removal changes the key, so Approve stays disabled until a fresh complete preview arrives. A failed attempt calls refresh(), so the next approval uses a new token. A stale response is dropped by the effect's current flag. Runtime rows from an older preview only explain unchanged seats (crewPreviewRuntimeForSeats) and never enable Approve.
  • Read-only path: holds. Decisions need resolveCrewProposal's permission (AuthOrchestrationOperateScope) and useCanOperateThread for the Captain's thread. Without them, Remove, Decline and Approve are disabled and the screen says why. Preview isn't guarded, so a read-only viewer still sees each seat's model, reasoning and access.
  • No edits beyond removal: holds. Approval sends requestedSeats minus the removed ones, unmodified (decision 2). There's no add, swap or settings edit, and the screen points to the Captain or to web. The last seat can't be removed, and "Restore removed seats" is the way back.

Also checked

  • Faithful extraction. crewPreviewIsComplete and crewPreviewRuntimeForSeats are web's old inline logic verbatim. Web's hook keeps its request-identity rule, and its card and draft import the shared gate filter, seat lines and playbook helpers. Web's 115 crew tests pass on the shared code.
  • Answered elsewhere. crewProposals re-reads on the crew trigger, so the screen switches to "Already answered" and the strip disappears.
  • Seams. CrewRosterStrip mounts beside case 49 under the same conditions. Case 98's spread is renamed to j5ThreadRoutes, and the old artifact routes file is removed with no imports left. The ledger rows and two seams reaches are updated.
  • Nit: case 98's new text puts "(and, since case 113, ThreadCrewProposal)" before (…/ThreadArtifactsScreen.tsx), so the path reads as the proposal screen's file. Reorder it.
  • Docs. crews.md and personas.md still say mobile can't answer proposals, which the PR leaves to the wave's docs PR. That's fine if it's tracked.

Reviewer-run checks

  • client-runtime crewProposals.test.ts: 10 passed. Web src/j5/crew: 115 in 11 files. Mobile reactCompilerCoverage.test.ts and upstreamSeams.test.ts: 1136 (reviewer-opus). Reviewer-sol: 75 shared, seams and web-draft tests plus 5 new mobile compiler checks.
  • vp run typecheck: mobile exit 0 (both reviewers), web exit 0 (reviewer-opus)
  • lint: clean on the changed code; git diff --check: clean

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Nov 9, 2026
@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (test files excluded in mixed PRs). label Nov 9, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Panel delta check (reviewer-opus + reviewer-sol) at 3d6e242

Verdict: the should-fix is resolved, with no new code findings, and the panel approves the source. Still pending: the tester's run and captures, and J5 CI.

  • Failed read. CrewProposalReviewScreen now checks query.error first and shows "Couldn't load the Crew proposal" with Retry (query.refresh), before choosing between loading and "Already answered".
  • J5ComposerControls. It's a transparent wrapper around CrewRosterStrip, mounted under the same conditions as before. The upstream edit to ThreadDetailScreen.tsx stays one import and one call, and the seams reach follows the new component.
  • FORK.md. Case 98 now names the artifact screens' file before ThreadCrewProposal and keeps "read-only" on the artifact screens, which resolves our nit. The cross-references, both ledger rows and the seams records use 114.
  • Merge order. The case paragraph itself still reads "113." at this head, because the formatter renumbers the ordered list after trunk's 112. #984 must merge first. Then rebase #983 and confirm its paragraph comes out as 114, with Metro as 113, before merging.

Reviewer-run: upstreamSeams.test.ts and reactCompilerCoverage.test.ts pass (1137, reviewer-opus; 54 selected checks, reviewer-sol). Mobile vp run typecheck exits 0. Lint and git diff --check are clean.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Panel conflict check (reviewer-opus + reviewer-sol) at d1c9689: the rebase onto trunk with #984 is clean, and the source approval stands.

  • All 25 app and package files in the PR are byte-identical to the last reviewed head, 3b451ef, including the removed ones. The only difference in upstreamSeams.test.ts is trunk's Metro case-113 row.
  • FORK.md keeps #984's Metro entry as 113., and the roster review's own heading is now 114.. Case 98's text, the three ledger rows (ThreadDetailScreen.tsx, Stack.tsx, packages/client-runtime/package.json) and the seams records all say 114.
  • git diff --check is clean. The app and package sources are unchanged, so we didn't rerun tests; the builder reports check:changed passes on this head.

The tester's run, captures and J5 CI remain the gates.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

…ecline, remove seats

A Crew proposal could only be answered on web, so a Captain waited until the
person reached a computer. Mobile now shows a row above the Captain's composer
for each open proposal, and a review screen with every seat's model, reasoning
and access as the server resolved them, the binding the approval carries. The
person can remove seats (and restore them), decline, or approve; other edits
stay on web and desktop. J5's composer rows mount once (J5ComposerControls).
Agent Setup on mobile says where Crew settings live. The proposal gate, seat
lines, playbook notes and preview binding move to client-runtime and web
imports them.

Refs #836

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

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Panel conflict check (reviewer-opus) at 158ebb5: the rebase onto trunk 355672f (#985) is clean, and the source approval stands.

  • Against trunk, the PR's own change to packages/client-runtime/package.json is still just the ./j5/crew-proposals export. The file's only other difference from d1c9689 is trunk's new ./j5/crew-inbox-requests export. Every other app and package file is byte-identical to d1c9689.
  • FORK.md keeps Metro as 113. and the roster review as 114., and the client-runtime/package.json ledger row now reads "…, 101, 114, Role library".
  • The earlier red J5 CI was Electron download 504s, so a fresh run on this head is the gate.

Reviewed by Claude Opus 5.5 (reviewer-opus) in J5 Code.

@Jacksondr5
Jacksondr5 merged commit 3ab8462 into j5/main Nov 9, 2026
35 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-crew-roster-review branch November 9, 2026 07:28

This branch was successfully deployed

1 active deployment
Preview — 158ebb5f Deployed Nov 9, 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.

1 participant