ADR-FIX-D-1. Numbers keep their units, answers show their positions, numbers-only reports say why
Source:
docs/decisions/ADR-FIX-D-1-units-boards-and-numbers-only-reports.md. Generated at build time; edit the source file.
Date: 2026-11-22. Status: accepted (browser check on the owner’s real data, batch D). Builds on ADR-AI-8 (segments), ADR 0060 and 0071 (coach text), ADR 0073 (report states) and ADR 0078 (coach availability).
Context
Section titled “Context”- N1. A coach answer read “Your win chance was about 86.5 before it … You spent 40.7 on that
move”. The validator forbids
%next to a token (it is glue) and allowspct0/pct1only for fractions in [0, 1], while win chances, accuracies and clock times are stored on their own scales (0..100, seconds).format_numberknew no units, soint/dec1printed a bare number and the prompt told the model not to add units. The unit was lost in the formatter, not in the schema or the renderer. - N2. A report built computed-only before the coach was switched on said “Your coach’s notes
are off for now” while
ai_statuswas fresh and enabled. - N5. Answers cite moves but showed no position.
Decision
Section titled “Decision”- The server prints a number with its unit.
Evidence::unit_of(path)gives a path’s unit: a metric’s statedunit(pctis%,secondsiss), else the field name (winBefore,winAfter,accuracy:%;clockBefore,clockAfter,timeSpent,baseSeconds,incrementSeconds:s;cp:cp).format_num_atappends it for every format butpct0/pct1(already%) andsigned1(pawns), so the storedSegment::Num.displayand the resolved text agree. A no-break space keeps40.7 son one line. Counts stay bare: the text names them (“games”).core/tokensv2 tells the model the unit is the server’s; v1 stays for stored hashes. - “Numbers only” has two readings. With no coach now (
ai_status), the report banner and the area pages’ “Coach’s note” say “Coach not available right now” (ADR 0078). With the coach on, they say “This report was built from your numbers only. Your coach’s notes come with the next rebuild, available <when>” (nextManualAt, else “now”). The budget keeps its own copy. - Answers show the positions they cite.
getThreadreturnspositions, keyedplatformGameId#ply, for everymove,bestandpvsegment of a done answer (at most 60), read in the same read-only transaction frommoveson the conversation’s own account while the user is linked to it. The board is the move’sfen_before, from the player’s side, with the move played (pen for the player’s own mistake or blunder, else pencil) and the engine’sbest_uci(good). One board per ply, under the paragraph that first cites it; the board loads lazily near the viewport, a click opens the review at that ply, and the caption’s link is the one tab stop. Its name reads “Position before 30. Rxg7; engine preferred Qe3”.
Consequences
Section titled “Consequences”- Stored answers keep the display they were stored with; new answers carry units.
- The thread API grows by the cited positions; no request per board.
- Copied text reads “better move: Qe3” and the composer hint “Shift + Enter” (one “+”).
Amendment 1 (2026-11-23): a fraction always reads as a percentage
Section titled “Amendment 1 (2026-11-23): a fraction always reads as a percentage”Final QA Q9: a live answer read “As White you have 50 games and score 0.45, with a range of 0.36
to 0.54”. A score, rate or probability is stored as a fraction in 0..1, and dec1/dec2 printed
it bare.
- A rate path renders as a percentage in every format.
format_num_atprints a path inEvidence::rate_pathswith%whatever the token’s format:pct0/pct1as asked; any other format as a whole percentage from 10% and with one decimal below it, without a trailing.0(0.45→45%,0.096→9.6%,0.0017→0.2%), so a rare event never reads0%. - Every fraction of coaching-input v2 is a rate path (ADR 0085): the schema’s
0..1leaves (a weakness’sposteriorRate,intervalLow/High,bandMedian,confidence,pImp; an opening’sscoreand alternatives’bandScore; a change’srateBefore,rateAfter,posteriorProb; a colour weakness’srate,low,high,peerRate), an opening’sperformanceVsExpected(a score difference,-1..1, which reads-9%), and every metric or colour metric (byColor.*.score) whoseunitisrate. A colour metric’s unit now comes from itsunitfield, as a metric’s does. The chat toolsget_weaknessandget_opening_linemark the same fields of what they return.pct0/pct1stay refused outside[0, 1]. - A test walks the schema.
every_fraction_path_of_the_schema_renders_as_a_percentagelists theCoachingInputJSON schema’s number leaves and checks that every fraction leaf the v2 fixture holds is a rate path and renders with%indec1,dec2and no format; a new fraction field fails it until it is marked.
Stored answers keep the display they were stored with.