Skip to content

Crews: members start when there's work for them #745

Closed

Description

@bryantderosier

Item 5 of 9 in the Crews: organic teamwork milestone.

The problem

When I approve a roster, every seat starts at the same moment on the same brief. That's right for seats that work in parallel, and wrong for seats that come later in the flow. The reviewer wakes up before there's anything to review, spends a turn working out that it's waiting, and often messages the builder to ask when things will be ready. Then the Captain has to wake it again anyway. Existing members also never hear about someone who joins later unless they happen to call j5_list_participants again.

Where this sits

This is the "First useful turn" and "Follow-up work" rows of Crews proposal v2 (25 October). It replaces #685 and #681, which were closed as not planned. The Captain starts each member when it has actionable work for it, and that first turn carries everything the member needs. Finished members stay on the team for later assignments.

What we already have

  • startBriefs in apps/server/src/j5/a2a/CrewLaunchService.ts:615-696 builds one spawnFirstTurnText per created seat and starts it right away. Additions go through addSeats (:827) on the same path.
  • spawnFirstTurnText (apps/server/src/j5/a2a/spawnIds.ts:96) assembles these blocks in order:
    • spawn context
    • crew context with the roster as of launch
    • the seat's playbook block
    • <crew_collaboration>
    • seat instructions
    • the handoff artifact obligation
    • the brief
  • Launch outcomes are created, not_created, and not_started (CrewLaunchService.ts:162-164), reported once by CrewLaunchReporter.ts.
  • Seat states on the Fleet row and Captain's expander are running | failed | needs-you | settled | idle | archived | unknown (apps/web/src/j5/crew/crewState.ts:17-24). There's no "not started" state.
  • No roster-change notice goes to existing seats. Only the Captain hears about an addition.
  • The platform never settles a seat because its run finished (crews.md AC18), so a finished seat can already take more work.

Proposal

  • Approval creates every seat (its thread exists and it's on the roster) but gives it no turn.
  • A seat's first turn starts on the first message anyone sends it, or the first playbook step handed to it. That turn is its normal first-turn text with the roster as it is at that moment, followed by the message as its assignment.
  • A seat that hasn't started shows as Not started, which is different from idle.
  • When the roster changes, members who have already started see the change at the top of their next delivery. Nobody is woken just to hear about it.

Acceptance criteria

  • Approving a roster creates every seat's thread and adds it to the roster without starting a turn.
  • Adding a member to a running Crew does the same: the new member is created and waits.
  • The first message from any participant, or the first playbook step delivered to a seat, starts its first turn: the full first-turn text, then that message. The message keeps its own envelope and any reply obligation.
  • The first turn's roster is the roster at activation, and lists each member's responsibility (the Captain's reason) and participant id, so the member knows who to reply to.
  • The shared brief is still included in the first turn, so the Captain's message only needs the assignment.
  • The launch report lists a waiting seat as created and waiting for work, not pending or unconfirmed, and doesn't wait on it before posting.
  • The Fleet row and Captain's expander show Not started separately from idle, running, and failed, and the Crew summary counts it.
  • Stop, archive, settle, and unarchive treat a not-started seat like an idle one.
  • When the roster changes, a member that has already started gets a short roster-changed block at the top of its next delivery, naming who joined or left and their responsibility. No roster change starts a turn on its own.
  • A seat that hasn't started gets no roster-changed block, because its first turn already carries the current roster.
  • A member that finished stays on the roster and keeps its thread and workspace. A later message gives it a new assignment in the same thread with nothing re-sent.
  • Nothing about availability creates polling or acknowledgment turns. A seat that has nothing to do sends nothing.
  • The standing guidance tells Captains, in one or two sentences, that members start when sent their first assignment, and to reuse finished members for follow-up work instead of adding new ones.
  • The shipped j5_propose_crew and j5_request_crew_member descriptions and their quoted copies in agent-tools.md are updated together.
  • Focused tests cover:
    • approval creates seats without starting turns;
    • a first message starts a seat with the current roster;
    • a playbook step starts a seat;
    • the launch report with waiting seats;
    • a roster-changed block on the next delivery to a started member;
    • no block for a waiting member;
    • reusing a finished member.
  • crews.md is rewritten where it says approval briefs every seat (AC6, AC12, AC22), and agent-tools.md AC8 is updated for the first-turn contents.

Out of scope

  • Scheduled or conditional starts ("start when the PR opens"). The Captain sends the work, and that's the whole trigger.
  • A per-seat "start now" flag. If parallel seats need it, the Captain messages each one, which it has to do anyway to assign work.
  • Shared notebooks or scratchpads (deferred in proposal v2).

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions