Skip to content

Silence the coach in warmup/practice/bot games (Premier/Competitive only) - #55

Merged
PureXYZ merged 1 commit into
mainfrom
claude/quirky-yalow-f98997
Jun 16, 2026
Merged

PureXYZ merged 1 commit into
mainfrom
claude/quirky-yalow-f98997

Conversation

@PureXYZ

@PureXYZ PureXYZ commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Problem

The coach reacted (greeting, buy calls, kill/MVP/round-end hype, clock callouts) while the user warmed up by killing bots. Root cause: live coaching was gated on match phase, never mode or bot status. The engine dispatch (handleOne) had zero mode/bot checks, so any session that reached map.phase === "live" in a non-ranked mode (casual, deathmatch, community/aim maps, Wingman) or an offline practice-with-bots game fired the full reaction set. The existing botsDetected flag only gated post-match recording and only trips once the user dies and spectates a bot — useless for a pubstomp where you never die.

(The detailed coach log for the reported session was unrecoverable: the prod coach container had been recreated and its /app/logs lives in the container's ephemeral filesystem. Diagnosis is from the code, cross-checked against the Caddy access log and sessions.json.)

Fix

A "coachable match" gate at the engine chokepoint — the single path every spoken line flows through:

  • Mode allowlist COACHABLE_MODES = {competitive, premier} ("premier" defensive; Premier reports "competitive" today, only medium confidence per RESEARCH.md). Everything else is treated as warmup/practice and gets no live coaching. Unknown/undefined mode fails OPEN — a real live speech event always carries a defined map.mode; the menu/blip frames that lack one emit no speech anyway.
  • coachableNow(ctx) = isCoachableMode(ctx.mode) && !botsDetected(). EngineDeps gains botsDetected, wired in index.ts to roster.matchReport().botsDetected (already OR'd across feeds), so an offline competitive-with-bots game latches silent once a bot is spotted — the one case the mode gate can't catch (it reports "competitive").
  • matchEnd still runs onMatchEnd + cancelTimers + flag resets when non-coachable, so a real game's recording/recap (self-gated in index.ts) is never mis-skipped.
  • The clock/bomb timer callouts re-check coachableNow for the mid-match bot flip.

Per the requested scope, Wingman (scrimcomp2v2) is silenced too.

Reviewer notes

  • The gate is an allowlist, not === "competitive" — equality would silence Wingman immediately and put Premier one Valve token-change away from going mute. (An adversarial review pass flagged exactly this, plus that a blanket early-return would have silently dropped real-game recording — hence onMatchEnd is preserved.)
  • Residual gap (documented): offline "Practice with bots" launched in competitive mode talks until the first death+spectate, then latches silent — no GSI field can name bots while the user is alive and instant-respawning. Realistic warmups (aim/casual/dm) report a defined non-ranked mode and are silenced from the first frame.
  • ctx.mode is the fused/authority mode, so the gate behaves correctly in the multi-feed squad case.

Tests

  • Flipped the sim assertion that Wingman round 12 speaks → now asserts silence.
  • New scenario "non-ranked modes and bot matches get NO live coaching": casual/deathmatch silent, undefined mode still coaches (fail-open), bot match goes silent after the first spectate.
  • npm run typecheck and the full npm run sim (260+ checks) pass.

🤖 Generated with Claude Code

…nly)

Live coaching was gated on match *phase*, never *mode* or bot status: the
engine dispatch had no mode/bot checks, so any session reaching map.phase
"live" in a non-ranked mode (casual, deathmatch, community/aim maps, Wingman)
or an offline practice-with-bots game fired the full reaction set — greeting,
buy calls, kill/MVP/round-end hype, clock callouts. The existing botsDetected
flag only gated post-match recording, and only trips once the user dies and
spectates a bot, so a pubstomp where you never die stayed loud.

Add a "coachable match" gate at the engine chokepoint (handleOne):
- COACHABLE_MODES allowlist {competitive, premier} ("premier" defensive; Premier
  reports "competitive" today). Unknown/undefined mode fails OPEN — a real live
  speech event always carries a defined mode; menu/blip frames emit no speech.
- coachableNow(ctx) = isCoachableMode(ctx.mode) && !botsDetected(); EngineDeps
  gains botsDetected, wired in index.ts to roster.matchReport().botsDetected
  (already OR'd across feeds) so offline competitive-with-bots latches silent
  once a bot is spotted (the one case mode can't catch).
- matchEnd still runs onMatchEnd + cancelTimers + flag resets when non-coachable,
  so a real game's recording/recap (self-gated in index.ts) is never mis-skipped.
- The clock/bomb timer callouts re-check coachableNow for the mid-match bot flip.

Per the user's choice, Wingman (scrimcomp2v2) is silenced too — the sim
assertion that wingman round 12 speaks is flipped to expect silence, plus a new
"non-ranked modes and bot matches get NO live coaching" scenario (casual/dm
silent, undefined fail-open speaks, bot-latch goes silent after first spectate).

Residual gap (documented): offline practice-with-bots in COMPETITIVE mode talks
until the first death+spectate, then latches silent — no GSI field can name bots
while the user is alive and instant-respawning. Realistic warmups (aim/casual/dm)
report a defined non-ranked mode and are silenced from the first frame.

typecheck + full sim green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PureXYZ
PureXYZ merged commit 727aae3 into main Jun 16, 2026
1 check passed
@PureXYZ
PureXYZ deleted the claude/quirky-yalow-f98997 branch June 16, 2026 04:19
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