0085. The coach reads the colour split, names the peer benchmark and uses the glossary
Source:
docs/decisions/0085-coach-colour-split-benchmark-glossary.md. Generated at build time; edit the source file.
Date: 2026-11-22. Status: accepted (next round, task T4). Builds on ADR 0080 and 0081 (the peer benchmark), ADR 0082 (the colour split’s profile rows), ADR-FIX-D-1 (numbers keep their units) and ADR-R2-2 (the CoachingInput contract).
Context
Section titled “Context”T1 stores every profile row per side (both, White, Black), and the peer benchmark compares with
the opponents the player has faced. The coach (report and chat) read only the both rows, never
said where White and Black differ, and had no words for the comparison group. The web has a
plain-language glossary (glossary.ts) the prompts did not see.
Decision
Section titled “Decision”- coaching-input-v2.
InputVersiongainsV2("coaching-input-v2"), which the builder writes; v1 still parses (stored report-run inputs) and serialises byte for byte. v2 adds:byColor: { white, black }, required in v2. Each colour hasgames(its most recent analysed games, at most 50, the KPIlast50window), W-D-L,score(points per game with an 80% Wilson interval),accuracyandblundersPerGame(the colour’slast50snapshot rows and their intervals), and up to 5weaknesses(the colour’s own estimates against its own benchmark rows: compared ones withpriority > 0by priority, then uncompared ones by rate; never belowMIN_GAMES(30) colour games, the minimum evidence or a single event). Each weakness carriespeerRate,peerPercentileandpeerPlayersonly when the colour has its own peers (a both benchmark is never applied to a colour).benchmark: the stored benchmark band (source,ratingLow,ratingHigh,players,games), present when the account has served both rows. The minimum evidence holds per colour: belowMIN_COLOR_GAMES(10) games the colour, and below a metric’s ownmin_nthe metric, issufficient: falsewith null numbers andneedMore.validaterejects a 0 (or any number) where the evidence is insufficient. Both v2 keys are optional on the wire (x-optionalin the schema transform), so v1 inputs stay valid; v1 may not carry them. The zod export stays v1’s: the parity tests compare the schema’s v1 shape (v1_shape). The committed schema is renamedschema/coaching-input.schema.json.
- Citable with units. The evidence index keys a colour’s weakness rows by series key
(
byColor.white.weaknesses.W4_missed.rate), marks scores and weakness rates as rates (pct0/pct1) and accuracies as percent. A null number has no path, so it cannot be cited. - Prompts.
report/reportv2 andreport/section-overviewv2 teach the colour split (only from cited numbers of both colours, a difference only when the ranges separate, nothing for an insufficient colour) and the benchmark’s words: “players you’ve faced on chess.com, rated about X to Y”, with the bias sentence, never “players at your level”.chat/systemv3 does the same and drops “do not compare the player with anyone” for “only with the named group”. The chat context carriesbyColorandbenchmark(the “how do I do as Black?” answer needs no tool call). The prompt version labels stayreport@1andchat@1, as for Fix D; the set hashes record the files. - The glossary.
glossaryForCoach()cuts every glossary entry (weaknesses, KPIs, areas, terms, states, opening verdicts) to itsnameandmeaning: about 14 KB where the full entries are about 71 KB, sent with each of the five section calls and every chat turn. It is embedded as the generated prompt filecore/glossary.v<N>.md, appended to system[1] of the report and the chat.apps/web/test/profile/glossary.test.tsfails when the latest file differs fromcoachGlossaryPrompt(); withUPDATE_SNAPSHOTS=1it writes the next version, whichprompts.rsthen registers (a prompt never changes in place). - Set versions are what is sent. The report request read every prompt at version 1, so
core/tokensv2 (Fix D) was recorded in the set hash but never sent. The request now reads each prompt at its version inREPORT_PROMPT_SET. - The report. The computed report carries
byColorandbenchmark(absent for a v1 input). The web adds a “White and Black” section: both colours side by side with n, a dash and the shortfall below the minimum, a comparison sentence only when the ranges separate, each colour’s weakness rows against that colour’s own peers and the bias sentence. The overview’s strengths (alreadyselect_strengths) link to the Strengths page.
Consequences
Section titled “Consequences”- Report and chat prompts grow by about 4,000 tokens (the glossary), cached as part of system[1].
- Stored reports from v1 inputs show no colour section until the next build.
- A colour with fewer than 30 games has no weakness rows, and one without its own peers has only uncompared ones.