From cc72e00afbc2dbb646420309178de66a0e80123a Mon Sep 17 00:00:00 2001 From: Mattias Bodlund Date: Thu, 20 Aug 2026 13:45:30 +0200 Subject: [PATCH] na --- AGENTS.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 6cc1598..c1cb242 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,6 +54,30 @@ A `chance` answer needs a `{"type": "chance", "outcomes": [...]}` entry at its p it is flattened into sibling entries instead, the outcome lookup silently returns `nil` and that branch scores nothing. Verify with a `bin/rails runner` walk of the tree after editing. +### Result band consistency guard + +The two axes can diverge: a good `chance` outcome gives only `overall: 1` where a safe good +answer gives `2`, so a player can accumulate green impact but a low `overall` — and land a +"close call" headline above three positive impact texts. + +`GameHelper#result_state` therefore raises the band from `overall` to at least +`GameHelper#tone_floor`, computed from the same `impact_tone` values the impact texts use: +all three positive floors at `:best`, none negative floors at `:balanced`. **The guard only +lifts, never lowers** — a high `overall` still reaches `:best`, and any negative metric still +allows `:worst`. The early-exit / last-save branch returns before the guard and is unaffected. + +**Consequence:** the headline and the three impact texts are no longer independent. Retuning +`impact` values in `question_scores.json` can move the headline even when `overall` is +untouched, and changing `IMPACT_TONE_BANDS` changes both the texts and the band floor. + +### Results copy + +Each impact category needs three distinct tone strings — `positive`, `neutral`, `negative` +under `game.results.` — in **all 24 locale files**. A missing tone is easy to miss +because nothing raises: `neutral` was a verbatim copy of `positive` in every locale, so an +`income: 0` player was told they "earned some money". When touching these, sweep all locales +and check the three strings actually differ, not just that the key exists. + ## Project Structure - `app/controllers/admin/`: Admin backend logic.