Skip to content

Add COACH_SQUAD: configure the stack by identity, not a count - #52

Closed
PureXYZ wants to merge 0 commit into
mainfrom
claude/ecstatic-carson-23de27
Closed

PureXYZ wants to merge 0 commit into
mainfrom
claude/ecstatic-carson-23de27

Conversation

@PureXYZ

@PureXYZ PureXYZ commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What & why

Answering "can the coach auto-detect when we're playing as 5 so I don't have to set COACH_SQUAD_SIZE?"

Short version: a full premade cannot be auto-detected from GSI. While playing Premier/Comp, GSI exposes no roster, no party/lobby id, and no team size — the coach's whole notion of "the team" is reconstructed from which friends are running the cfg ("wired feeds"). So any size inferred from the live feed count is unsafe by construction: it can't tell "the 4 I see are all of us" from "the 4 I see, plus a 5th who forgot to launch and is still alive" — which is exactly the false "you're the last one alive" that COACH_SQUAD_SIZE exists to prevent.

The safe alternative: configure who the crew is, once, instead of a number.

What changed

New COACH_SQUAD env var — a comma-separated list of the crew's SteamID64s (including your own):

  • Size derives from the list length, so there's no separate count to keep in sync. COACH_SQUAD_SIZE stays as a fallback/override.
  • The whole-team-certainty gate is now identity-aware. rosterComplete and the last-man gate require every named member to be wired and fresh, not merely a count (crewAllPresent in roster.ts). Two consequences, both strictly safer than the bare integer:
    • A non-crew feed padding the count to 5 can't fake-complete the stack.
    • If one specific friend isn't wired, the coach knows the stack is incomplete and hedges (rather than assuming a generic 5th).
  • The same-side membership vote is deliberately untouched — crewAllPresent only ever tightens the gate, never bypasses the enemy-on-shared-token guard. All wired friends are still coached and recapped as before.
  • Fail-loud startup cross-checks: crew vs an explicit COACH_SQUAD_SIZE disagreeing, a COACH_PRIMARY_STEAM64 not in the crew, or a list outside 1–5 valid SteamID64s all throw at boot.

Both COACH_SQUAD and COACH_SQUAD_SIZE unset ⇒ always hedge, exactly as today.

Reviewer notes

  • The design (4 candidate approaches, adversarially reviewed against the "never make a confident-but-false whole-team call" invariant) rejected the two pure-auto-detect approaches — high-water-mark of wired feeds and learned-crew auto-size — because both derive the size from the wired set itself and therefore can't catch an alive-but-un-wired teammate.
  • Backward compatible: RosterManager's new crew constructor arg defaults to config; index.ts (new RosterManager()) and existing sim scenarios are unchanged. squadSize() returns the same value in production (crew length == derived config.coach.squadSize).
  • Known tradeoff: this is still a one-time config of who, and on a smaller-stack night (queueing 2–3 of your usual 5) it stays in hedge mode — same safe behavior as the integer. A future "recognition layer" (greet the usual crew, name who's missing) is the natural follow-up.

Testing

  • npm run typecheck — clean.
  • npm run sim — all 331 checks pass, including two new scenarios: size derivation from the list, and a stranger filling the count not completing the named crew (no false last-man while a named member is un-wired).

@PureXYZ PureXYZ closed this Jun 16, 2026
@PureXYZ
PureXYZ force-pushed the claude/ecstatic-carson-23de27 branch from 1644766 to b49f6b8 Compare June 16, 2026 00:36
@PureXYZ

PureXYZ commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

Closed via branch reset (not merged). Rationale: COACH_SQUAD was built for a FIXED 5-person crew, but the real use case is a rotating ~7-friend pool — any 5 may queue, and friends sometimes play without the owner. For a rotating pool the right tool is the existing COACH_SQUAD_SIZE=5 count gate: a CS2 team is exactly 5, so 5 confirmed same-side feeds already proves a full stack, with no list to maintain. The fixed-5 identity list (caps at 5, requires all listed present) can't express a 7-pool and would never complete. Superseded by upcoming full-stack-detection work that also covers games the owner isn't playing in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant