Skip to content

No seat can launch into a retired or retiring Crew #223

Closed

Description

@bryantderosier

A Crew archives only as a unit, and a Captain with a live Crew is never archived alone. Two windows let seats come into existence under a Crew that is already retired or a Captain that is already gone.

Where it breaks:

  • captainFor (apps/server/src/j5/a2a/CrewProposalService.ts:254-268) reads the Captain thread's projection and never checks archivedAt. A roster proposal still open when the person archives or deletes the Captain can be approved afterward; the cascade in CrewCaptainArchiveCascade.ts already ran when there was no live Crew, so the new seats are placed under an archived Captain and nothing retires them.
  • ArchiveCrewService reads the roster (ArchiveCrewService.ts:344), archives those members, and stamps the record retired only at :437. An approved addition can reserve and spawn a seat between those steps. That seat is live and addressable beneath a Crew record that says retired.

What should change:

  • A proposal whose Captain thread is archived or deleted is refused at resolution with a message that names the Captain, and the boot sweep declines such proposals.
  • Launch and addition take the same serialization as archive on the Crew record, so either the approved seats are included in the unit retirement or approval is refused before any seat is created. Whatever the mechanism (a status on the instance row checked inside the same transaction that reserves members, or a claim on the record), it has to hold across a restart between steps.
  • The Captain cascade's boot reconcile catches a Crew created against an archived Captain, as a last line.

Tests to ship (CrewProposalService.test.ts, ArchiveCrewService.test.ts, CrewCaptainArchiveCascade.test.ts):

  • approve an open roster after the Captain was archived; after the Captain was deleted
  • archive interleaved after an addition's validation but before its reservation; after its reservation but before its spawn
  • archive's roster snapshot taken before an addition lands
  • in every case no running or addressable seat remains under a retired Crew
  • drive interleavings with Deferred and receipts, never with sleeps or polling

Done when a retired Crew has no live seats and an archived Captain acquires no new Crews, under any interleaving with an open gate.

Related criteria: crews.md AC17, AC19.

Dependencies: land #224 first. Refusing a launch into a retiring Crew leaves reservations with no thread behind them, and unit archive has to be able to finish over those rows before this race can be closed and tested end to end. Soft: #221 first, so a refused launch always has a proposal linked to its recorded Crew.

Activity

  1. added this to the Crews milestone on Sep 21, 2026
  2. added
    size:L
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

size:L

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions