34bf064904f407f8cad02aba3b74c63c2e78ca90
Final whole-branch review of M4-b. Six findings.
1. The player could press his way into an invalid draft. can_take_bonus()
refused an already-picked skill; can_pick() did not consider the bonus, so
the guard was one-directional. Take athletics as the human's bonus, pick it
again from the Sellsword's pool, and the draft is one NewGame.validate
rejects — the invalid draft "he did not cause and cannot see" that
set_calling's own comment forbids. Fixed in the DRAFT (the screen owns no
rules): can_pick() now mirrors can_take_bonus(), so the chip goes inert, the
idiom the pool row already uses for a race-granted skill. Recoverable: hand
the bonus back and the chip is live again. Both directions tested.
2. The theme drift guard STILL could not fail. ThemeKeys.ALL is stylebox
variations only, by its own docstring — so the six FONT roles the builder
sets fonts, sizes and colours for were entirely unguarded. Changing
Palette.CREAM and skipping the rebuild shipped a stale game_theme.tres with
the suite green (proven, on the committed test). Adds ThemeKeys.FONT_ROLES
beside ALL (never inside it — ALL's contract is relied on), compares fonts,
font sizes and font colours as well as styleboxes, and names the variation
AND the property that drifted. Plus a meta-guard that walks the builder's own
output and fails if a variation it styles is in neither collection — this is
the second time this guard has been fixed by "enumerate the right set", and
nothing was checking the set.
3. §13: the CTA label piped NewGame.validate's diagnostics straight to the
player. On the game's SECOND SCREEN he read "hedge_mage picks 2 skills, got
0". Now CreationCopy.error_line maps them to authored copy — "name yourself",
"choose two more proficiencies" (the number DERIVED from Callings.skill_count,
never written down), "one more proficiency, any of them — take it" — with an
authored fallback for anything unmapped, because §13 means the unmapped case
still speaks in voice. validate's strings are untouched: they are a contract,
so they are translated in the presentation layer, not rewritten.
4. §2 had no test that fails if the boundary is breached. The emit test compared
the signal to draft.to_creation() — both sides move together. Pins the seven
contract keys exactly, and feeds construct a hostile creation dict carrying an
18 in every stat, asserting the sheet is still roll_attributes(seed) + spend.
Every other test in test_new_game passed with that breach in place.
5. Three holes: the orphan sweep skipped PoolRow (a stray Pool6 rendered unbound
and visible, suite green — the exact bug the test exists to catch, in the one
row it forgot); the §7 sweep forbade "luck" but not Luck.BANDS' descriptors,
which are worse than the number (the player would re-roll until his Luck read
well — calculable Luck); and the DM panel's composition hardcodes the article
"a", so a vowel-initial calling would break it silently — guarded in the
content parity test, which names the template as the reason.
6. The calling card printed "talent second_wind". Four of seven talents carry an
underscore. Humanised, the way skill_label() already does. The test that
pinned the RAW form is moved to the full derived phrase ("talent second wind")
so it still fails if someone hardcodes a talent into the format string.
Every guard was proven by re-breaking the code and watching the named test go
red (docs/traps.md). Suite 302 -> 315, content build green, no new warnings.
Report: .superpowers/sdd/final-review-fix-report.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
coc-rpg
AI-driven single-player, party-based fantasy RPG. Godot 4 client, FastAPI proxy, AI as Dungeon Master.
Read CLAUDE.md first — project charter and working agreement. It is the source of truth. If code disagrees with it, the charter wins until the charter is changed.
The one rule
Code owns state. AI owns text. (charter §2)
Repo layout
/client Godot 4.7 game client (GDScript) — ALL game state, ALL game rules
/docs Client-specific docs (scenes, input, combat wiring)
/api FastAPI proxy — auth, metering, prompt routing, logging (charter §4)
/docs API-specific docs (endpoints, model routing, deploy)
/prompts Role prompts — source code, versioned, reviewed (charter §5, §16)
/content Authored game data — quests, NPC knowledge lists, fallback text
/quests Story skeletons and quest definitions
/npcs Per-NPC knowledge lists (charter §6 — "the whole design")
/fallback Authored degraded-DM text for every AI surface (charter §13)
/docs Cross-cutting docs — roadmap, ADRs, planning affecting both sides
/adr Architecture Decision Records
The three processes (charter §4)
client (GDScript) ──HTTP──▶ api (FastAPI) ──▶ Replicate / Ollama
The client holds no API key, ever. It knows one base URL and a set of role endpoints. It sends game state, receives text.
Description
Languages
Text
100%