Behavioural Audit — Prima Materia @ 2026-10-02¶
Point-in-time findings report. It covers what the existing systems actually do, as opposed to what the requirements say they should do. The requirements-vs-code comparison is the canon register and drift report; this audit was aimed at the class of defect that comparison cannot see.
Audited tree: origin/main at 95f6068 plus the uncommitted fixes on
fix/combat-action-and-spawn-bugs.
Update, same day. Every defect whose correct behaviour did not depend on a ruling has since been fixed test-first on that branch. §8 lists which, and what is still open. §4 is left as found, so the defect numbers stay stable.
1. Verdict¶
The pure-logic engines are sound. The integration layer and the shipped data are not.
- The turn loop does not softlock, runs one turn coroutine at a time, and keeps the grid consistent under normal movement. The managers (CTB, AP, Break, status, Momentum, the four signature managers, boss) do what their unit tests say.
- Almost every defect lives where those engines meet
combat_manager.gdor meet the JSON: an effect type the data uses and the code never handles, a resource granted at a moment it is then overwritten, a rule applied once per target instead of once per action. - About 130 findings came back from the reviewers. After merging duplicates there are 77 distinct defects (§4), plus a set of tests that cannot fail (§5).
- The requirements register cannot yet serve as the settled statement (§6). It needs rulings first, then regenerating.
Three facts frame how urgent any of it is:
- The only way into combat in the shipped build is the Combat Test Lab's six presets, which field scouts, brutes and casters. No menu launches a boss encounter. Boss findings are real in code and reachable only through the test seam.
- Save and load have no caller. The API exists; nothing invokes it.
- Exploration cannot start combat or dialogue. Nothing in the exploration scene is interactable.
2. Method and confidence¶
Ten independent read-only reviewers, one per lane: player action flow; turn flow; damage and Break; status effects; Momentum and Apotheosis; signature mechanics, items and gear; grid, movement, tiles and AI; boss, data layer and Test Lab; the shell around combat; and requirements. None could run Godot. Each traced code paths from shipped data to an outcome.
The orchestrating session then checked the most serious claims. Each defect in §4 carries one of:
| Mark | Meaning |
|---|---|
| Run | Reproduced by a throwaway probe in the real booted combat scene (7 defects) |
| Read | Confirmed by the orchestrator reading the code or data directly |
| Lane ×N | Traced by N reviewers independently, by reading; not re-checked |
| Unreachable | The code is wrong but no shipped path triggers it; the trigger is named |
Probe results, verbatim in substance:
| Probe | Observed |
|---|---|
Shadow Arrow (range_band: "ranged") at distance 5 |
0 valid targets |
| Kill the only enemy with AP left | Phase stays SELECTING_ACTION; the 0-HP enemy is still listed |
| Attack options after that kill | The corpse is the valid target |
| Vaughn hits the corpse | Gauge 25 → 50 |
end_turn, grant_ap(1), start_turn |
4 AP before, 4 AP after: the grant is lost |
| Poison Coating's effect applied to its caster | The marker carries damage_per_turn = 8 |
| Restrained enemy takes its turn | blocks_movement is true; it walks from (5,1) to (1,1) |
save_game then load_game |
Script error at save_manager.gd:145; load_game returns true; the flag is not restored |
Line numbers are omitted below because the working tree has uncommitted edits; every item is located
by symbol. cm is godot/scripts/presentation/combat/combat_manager.gd.
3. What was found sound¶
Recorded so the next audit does not redo it.
- Turn loop. One coroutine in flight at a time; every route into
_end_turnis serialized; skip chains terminate; the queue head is never a removed unit;_end_combatruns at most once. - AP arithmetic. Caps, pending and recurring bonuses are correct;
spend_apcannot go negative; movement bills per tile and stops cleanly when AP runs out. - Grid under normal movement.
_execute_movementand_apply_forced_movementnever write two units to one hex or a unit off-grid. The four copies of the hex↔pixel maths agree. - Damage maths. Tier resolution, layer order (Shields, Armor, Overhealth, Health), the multi-hit loop stopping on death, and the Vulnerability Window gating on pre-hit state.
- Break lifecycle. Recovery, sweep scope, no re-chip while Broken, unregister on removal.
- Gauge. Clamped, no charge while active, zeroed on activation, carry does not compound.
- Form teardown.
on_endruns on expiry and on defeat, never twice, for every form. - Data cross-references. 114 skills, 13 roles, no duplicate ids; every role, enemy, boss and equipment-granted skill id resolves, except Euphen's two missing items.
- Yesterday's six fixes hold on the paths their tests cover.
4. Defects¶
Severity: C critical (softlock, crash, corrupted fight, lost save) · H high (wrong outcome a player would notice) · M medium (wrong in an edge case) · L low.
4.1 Defeated units linger until the acting unit's turn ends¶
One root cause. _remove_defeated_units runs from _end_turn and a few effect paths, never after an
ordinary kill. get_enemy_units, get_ally_units, target_selector.start_targeting and
PositionValidator.get_valid_targets have no HP filter.
| # | Sev | Defect | Verified |
|---|---|---|---|
| 1 | H | Killing the last enemy with AP left does not end the fight; the action panel returns | Run |
| 2 | H | A corpse stays targetable, and each hit re-fires killed = true: Vaughn's victor mode gains +25 gauge per corpse hit; kill Momentums re-fire |
Run |
| 3 | C | A corpse that absorbs the damage type is healed above 0 and never removed. Corrupted Scout absorbs slash; a slash AOE or basic attack revives it | Lane ×3 |
| 4 | M | The AI picks the corpse as lowest-HP target, then falls back to a random unit from a pool that includes it | Lane ×3 |
| 5 | M | A skill's rider (status, shove) still resolves on the target it just killed | Lane ×1 |
Test: L3, enemy at 1 HP, attack with AP left; assert VICTORY, the unit gone from all_units and
grid, and no 0-HP unit in valid_targets.
4.2 Data the code does not understand¶
A single data-contract test (every effect.type, targeting.type, range_band and applied status
name in the JSON is one the code handles) would have caught all of these.
| # | Sev | Defect | Verified |
|---|---|---|---|
| 6 | H | "range_band": "ranged" falls through to melee in string_to_range_band. 24 skills: all 5 Adam spells, 6 Euphen, 5 Chiranjeevi, 2 Lione, Paidi's 2 heals, commotion, grapple_pull, enemy venom_spit and ignite. The AI path reads a different key and gets unlimited range |
Run |
| 7 | H | Effect types with no arm in _apply_skill_effect: knockback (Shove, in every kit; Brute Charge), pull (Grapple Pull), self_heal (Flesh Knit), taunt (Armored Shell), reposition_self (Mobility Leap), aoe_debuff (Corrupting Aura). Cost is paid, nothing happens |
Read |
| 8 | H | No tile targeting. Euphen's traps are laid under a standing enemy, where they cannot trigger. line_enemies skills hit one unit |
Lane ×3 |
| 9 | M | requires_status is read nowhere. Sophia can Dive from the ground; no water is placed but the log says it pooled |
Lane ×3 |
| 10 | M | Statuses applied with no magnitude and no reader: strengthened (War Tonic, Bone Lockdown), enshrouded without a reduction (Warding Draught, Bone Plating), optimized, intercepted, protective_instinct |
Lane ×3 |
| 11 | M | Payload keys copied and never read: consumes_on_attack/hit/skill, redirect_damage_to, counter_on_ally_hit, mp_cost_reduction, apotheosis_gauge_bonus, harmony_gain, steal, splash. Ready Stance reduces every hit for its duration, not the next one |
Lane ×3 |
| 12 | M | Elemental edges convert nothing; only Infernal Incarnate does. _blade_element is never cleared when an edge expires |
Lane ×3 |
| 13 | M | Three Lione skill-panel entries (mirror_cast, inscribe_skill, pickpocket) cost AP and MP and do nothing |
Lane ×2 |
| 14 | M | call_the_opening and stone_ward are in no role's skill list, so Rally and two effect handlers are unreachable |
Lane ×3 |
| 15 | L | Euphen equips shadow_longbow and snare_kit, which do not exist; the loadout still validates as legal |
Lane ×1 |
4.3 Momentum¶
Five of the nine default Momentums never produce spendable AP in normal play.
| # | Sev | Defect | Verified |
|---|---|---|---|
| 16 | H | AP granted outside the owner's turn is overwritten by start_turn. Phaidros's Tremor fires on enemy turns and never pays. The log still prints "+1 AP". Eruption already works around this with bank_pending_ap |
Run |
| 17 | H | Homeostasis (Chiranjeevi) grants inside _end_turn, just before AP is zeroed. It is worth 5 ticks of tempo, never an AP, and fires even when he did nothing |
Read |
| 18 | H | Crash (Cyrus) fires only for a terrain tag that only tests set. Walls, pillars and unit collisions grant nothing. The register lists this as met | Lane ×2 |
| 19 | H | Hawkstrike (Vaughn) needs a multi-enemy skill; his kit has none | Lane ×1 |
| 20 | M | Cap-0 options become unbounded loops once a selection UI exists: Vanish in Shadow Lord, Predator in Showtime, Approval on corpse hits, Crescendo in Magnum Opus | Unreachable (no selection UI) |
Paidi's Sync having no emitter is already recorded in the drift report.
4.4 Status effects¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 21 | H | Poison Coating and Razor Edge damage Vaughn. The marker reuses the name poisoned / bleed, so the catalog DOT is merged onto it. If he is already Poisoned the coating is dropped and his poison becomes 99 turns. Antidote strips the coating |
Run |
| 22 | H | Restrained does not stop enemies. blocks_movement has one caller, the player's move handler |
Run |
| 23 | H | Burning and Disease spread unsaved to adjacent opponents at every turn end and refresh each other's duration, so adjacent units keep each other afflicted indefinitely. Disease ratchets to 3 stacks on both sides and persists into later fights | Lane ×2 |
| 24 | H | Stat modifiers are restored only when a status expires by timer. Cure, counter-pair cancel, Disrupted consumption and Frozen shatter leave the stat change in place for the rest of the fight | Lane ×3 |
| 25 | H | Re-applying a status that is already present discards the new payload and overwrites the duration. Many different debuffs share the name weakened, so a second one does nothing, and a shorter one shortens |
Lane ×2 |
| 26 | H | Unerring Menace's pool applies an unsaved 2-turn Staggered, refreshable every cast: a turn-lock on any enemy. A skipped boss turn also skips its escalation tick | Lane ×1 |
| 27 | H | Any non-Vulnerable damage braces the damage Break axis, because BreakManager.chip commits the brace before checking eligibility. A poison tick at the enemy's turn end closes its damage axis for the party's whole next round |
Read (brace order) · Lane ×2 |
| 28 | M | Stat modifiers take effect only at the holder's next turn start. A defence cut gives the party nothing that round; a self-buff does nothing on the cast turn | Lane ×3 |
| 29 | M | Turn-counted statuses tick on the turn they are applied. Take Flight's Aerial is gone before any enemy acts | Lane ×2 |
| 30 | M | Agility changes never reach turn order or the AP budget; speed is captured once at load. Hamstring does not delay its target | Lane ×1 |
| 31 | M | Regenerating runs after the DOT loop with no alive check, and revives a unit its own poison just killed | Lane ×2 |
| 32 | M | Poison and Bleed stacks are counted and displayed but never multiply the tick | Lane ×2 |
| 33 | M | The apply_status effect type can brace a Break axis on a failed save but never chips it on success |
Lane ×1 |
| 34 | L | The skip log always says "Staggered" for Stunned, Frozen and Paralyzed | Lane ×1 |
4.5 One action, resolved once per target¶
_execute_skill_on_all calls _execute_skill once per target, so anything meant to happen once per
action happens N times, or only for the first target.
| # | Sev | Defect | Verified |
|---|---|---|---|
| 35 | H | Leadership applies a stack to every ally on each iteration: three stacks from one cast in a three-member party | Read (loop) · Lane ×2 |
| 36 | H | Break Stock spends all MP on the first target; the others get the 2-hit minimum | Lane ×3 |
| 37 | M | Pitched Stance doubles only the first target; a five-attack coating loses one charge per target | Lane ×3 |
| 38 | M | The AI resolves all_enemies and aoe_adjacent_enemies skills against one target. The boss telegraph says "strikes the entire front row" |
Lane ×3 |
4.6 Apotheosis forms¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 39 | C | Sword Surgeon's placement picker is parented to grid_node, which every grid redraw empties. It is freed after the first interactive placement. Tests never see it: the interactive path is skipped when headless |
Lane ×1 |
| 40 | H | Form layers fire on every _execute_skill, including items and self-buffs. In Showtime, a potion on an ally Marks that ally and draws free attacks onto it. In Sword Surgeon, a salve triggers a sweep |
Lane ×3 |
| 41 | H | The sweep's AP spend ignores a refusal, so it is free below 2 AP; it runs once per AOE target; it never Crashes on the interactive path | Lane ×2 |
| 42 | H | Showtime's aura counter decrements on every unit's turn start, enemies included, and expires after three. Vaughn never receives it. With three enemies at most and +25 per kill he also cannot reach the form except through defect 2 | Lane ×2 |
| 43 | H | Shadow Lord is inert. The re-cloak is applied before the cast and any damaging ability strips it; "instant traps" only changes a log string | Lane ×3 |
| 44 | H | Paidi's Harmony heal and ward land on Paidi, not the target. The ward is permanent, uncapped, non-depleting Armor | Lane ×3 |
| 45 | M | Counterpoint's "status on touch" gives adjacent enemies Energized or Regenerating | Lane ×2 |
| 46 | M | Under Omnific Mirror with Echo, every Mirror cast is AP-neutral, and select-then-cancel gains AP with no cast. The Mirror path never checks MP | Read (Echo at selection) · Lane ×2 |
4.7 Signature mechanics¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 47 | H | Vanarism ignores which stage was cast. Any stage is castable first at the stage-1 price, and a cast the chain rejects ("falters") still resolves at full damage for 0 HP | Lane ×2 |
| 48 | H | A Dive onto water pays AP twice (the resolver's refund and the Plunge Momentum). Repeated dives cost nothing; in Maelstrom each dive gains AP | Lane ×2 |
| 49 | M | Harmony is never a gate: at 0 Harmony the spenders cast at full effect | Lane ×1 |
4.8 Player action flow¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 50 | C (touch) | Touch Cancel re-shows the action panel but leaves the skill, item or Mirror panel open. The _on_*_selected handlers behind its rows have no phase check, so a stale panel can restart targeting mid-resolution, end two turns, or act during an enemy's turn |
Read (_on_skill_cancelled never hides the panel; _on_skill_selected has no phase guard) |
| 51 | M | The turn auto-ends at 0 AP, locking out the free actions: Defend, Apotheosis activation, Pressure-paid skills, Mien switch | Lane ×1 |
| 52 | M | Targeting with zero valid targets is a dead end with no on-screen way out on desktop | Lane ×2 |
| 53 | M | The skill list has no scroll container; long kits (Phaidros 21 rows, Chiranjeevi 23) run off the screen | Lane ×1, not rendered |
| 54 | L | The skill panel prices skills without the Disrupted surcharge; the Mirror button gates on the wrong cost | Lane ×1 |
| 55 | L | "End Combat (Test)" ships in the arena, is live in every phase, and records a victory | Lane ×3 |
| 56 | L | Tooltips state rules the game does not have: "Unspent AP carries to next turn", "Move (1 AP)" | Lane ×2 |
4.9 Grid, movement and terrain¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 57 | H | Hook on an adjacent enemy: step_toward returns the caster's own hex, the "already adjacent" guard never fires, and both units take 20 collision damage |
Read (step_toward) · Lane ×2 |
| 58 | H | The Wall places permanent pillars on every hex of the caster's column, occupied ones included. Nothing can target or damage an obstacle except a shove | Lane ×1 |
| 59 | H | Spawn placement has no collision or bounds check. Test Lab positions can stack an ally on an ally or an enemy, and a smaller grid leaves units off the board | Lane ×2 |
| 60 | M | Tile-effect durations tick on every unit's turn end. A 3-turn surface in a 3v3 lasts half a round; Sophia's water is gone before she acts again | Lane ×2 |
| 61 | M | Lunge, forced movement and sweep placement skip parts of the movement bookkeeping. A unit pushed onto ice has its next move halted after one tile | Lane ×1 |
| 62 | L | create_terrain "around_target" has its even and odd neighbour tables swapped |
Unreachable (no skill uses it) |
4.10 Enemy AI¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 63 | M | The AI ranks skills by base damage alone and ends its turn when the pick is unaffordable. A brute swings once and discards 1 AP every turn; after approaching it stands adjacent and does nothing | Lane ×2 |
Already known, still open: an AI unit killed during its own move keeps acting; the planner mutates taunt state when asked for a telegraph; taunt redirection is inert; the out-of-range fallback target is random.
4.11 Data layer, encounters and the Test Lab¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 64 | H | Test Lab enemies get vigor × 60 HP and ignore the authored hp: a brute has 540 against 140, a scout 180 against 60. The boss-support path uses the authored value for the same template |
Read |
| 65 | H | Gear vigor and resonance never reach max HP or MP. The derive is gated on max_hp being absent, and the party builder always sets it. Phaidros fights with vigor 12 and the HP of vigor 9 |
Read |
| 66 | H | No launcher applies encounter data. The Test Lab drops starting_tile_effects; nothing ever sets _combat_encounter_id |
Lane ×3 |
| 67 | M | Between-fight carry cannot be observed: every Test Lab launch rebuilds the party, wiping gauge and persistent statuses. A KO'd ally keeps a stale stored gauge. HP, MP and charges are never written back | Lane ×4 |
| 68 | M | Absorb's Poise restore is written to the unit dictionary only; BreakManager never learns of it, so the restore is display-only |
Lane ×1 |
| 69 | M | F5 hot reload reverts the Test Lab grid size, strips gear bonuses, wipes live terrain, and is not debug-gated. A malformed config silently swaps to code defaults that differ from the shipped file | Lane ×2 |
| 70 | L | _deal_damage callers pass subtypes as types (traps, tiles, Counterpoint), so family resistances are skipped; DOT and collision float text shows the pre-mitigation number |
Lane ×1 |
4.12 Boss framework¶
Real in code; reachable only through the _combat_encounter_id test seam.
| # | Sev | Defect | Verified |
|---|---|---|---|
| 71 | H | the_unmaker_escort spawns the brute on a conduit's hex: enemy slot 3 maps to slot 1's position |
Lane ×3 |
| 72 | H | the_unmaker_apotheosis suppresses party Apotheosis for the whole fight, not only Phase 3; gauge_feed and gauge_drain are unread; the boss form's authored tuning is discarded |
Lane ×2 |
| 73 | M | The Unmaker cannot be Broken: it has Poise 14, no chip axes and no Vulnerable tier. Its Phase-1 Recipe needs Staggered, which then only Unerring Menace can supply | Lane ×2 |
| 74 | M | Escalation counts every boss turn from turn 1 and never resets, so later phases open with a large multiplier banked. Vent fires on every hit past the threshold | Lane ×1 |
| 75 | M | The replaces promotion yields a boss with unkillable phantom conduits and the champion's stats; the smoke test asserts only that the log says "escalates" |
Lane ×1 |
4.13 The shell around combat¶
| # | Sev | Defect | Verified |
|---|---|---|---|
| 76 | H | Dialogue choice effects are discarded whenever the choice leads to another node: choose stores them, then _go_to_node resets them on its first line. In the shipped test dialogue the "builds trust" flag is never set |
Read |
| 77 | C | load_game restores nothing and reports success. Assigning the parsed array to the typed party property raises and aborts the restore |
Run |
Also reported by the shell lane, traced by reading only:
- Shift rolls and Alt sprints, against on-screen instructions that say Shift sprints and Ctrl rolls.
- Nothing in the exploration scene is interactable (no collision shape, wrong mask, no group).
- Hop is cosmetic; the "Hop over!" obstacle blocks a hopping player.
- Touch: action buttons are dead while the joystick finger is down (suspected); a joystick hidden mid-drag leaves movement stuck; a held button hidden by the 3-second auto-hide never releases.
- A dialogue choice with no
nextwould re-present its choices forever (no shipped data does this). - The main menu title still reads "DISRUPTION".
5. Test integrity¶
The suite is green and large, and it did not catch any of §4. Three reasons.
1. Tests that cannot fail. Found by the reviewers, by reading:
- Six form-activation tests in
test_signature_mechanics_l3.gdassert that the log contains the form name, which the generic "X activates Y!" line already does. test_sophia_maelstrom_dive_places_waterasserts a value that is true for an empty result.test_adam_strain_…wellformed,test_chiranjeevi_vanarism_subsystem_registers, the Charmed and Frightened tests and others end inassert_true(true)on one or both branches. There are 19 such calls undertests/integration.test_push_moves_target_fixed_directionasserts movement only inside the branch where it moved.test_charmed_unit_turns_on_nearest_allysets a forced roll that the scene's own config reload wipes before it is used.test_spec_status_saves.gd::test_save_resolve_keys_the_mapped_statproduces the same result for either stat.- Two spec tests recompute the AP formula in the test and never call
APSystem. test_euphen_kit.gdandtest_sophia_data.gdpin JSON strings the code ignores or misreads.
2. The logic runner has no vacuous-pass guard. run_tests.gd prints ok for a method that
aborted before its first assertion. smoke_main.gd has the guard.
3. Whole behaviours have no test at any level:
- victory and defeat detection, defeated-unit removal,
_end_combat, the results screen; - the
_handle_ai_turnloop; - the order of operations inside
_end_turn(DOT, regen, spread, tick, countdown); - a full player cast through
_on_skill_selectedand_on_target_selected; _execute_skill_on_all;- forced movement, lunge, self-reposition;
TileEnvironmentManager(placement, durations, interactions);- stat-modifier apply and restore;
- every Momentum call site except one;
- Break wiring in the scene;
- the Test Lab launch path, spawn positions beyond the default three;
SaveManager,DialogueStateMachine, exploration, the touch overlay;- the data contract between the JSON and the code.
CI is also not running: GitHub Actions has been blocked on billing since 2026-08-10, so every result is a local run.
6. Requirements¶
6.1 State of the register¶
register.md is a sound record of what the July audit detected. It is not usable as the settled
statement:
- It lists 533 requirement IDs and no file defines them as checkable statements. A test cannot be
held to
CM-REQ-020. - Several IDs carry different verdicts in different modules.
- The coverage table and module docs were never updated when reconciliation lanes 1, 2, 4 and 5 closed.
- About thirty "drifted" groups never became findings and have no lane.
- It records as satisfied several things this audit found broken: Crash wired end to end, Shadow Lord fully wired, Vanarism fully wired, all Momentum triggers wired, Poison stacking.
- No requirement has a horizon. Every unimplemented entry therefore reads as a defect.
Combat_Behavior_Spec.mdis declared non-canon, yet the spec tests take their expected values from it.
There is no single roadmap file. Future intentions are spread across Design_TODO.md, the
STATUS "Next steps", the drift report's reconciliation table, three specs, the July alignment audit,
several handoffs, prima-lore's Lore_Roadmap, and the agent memory.
6.2 Rulings needed¶
Blocking: the core rules. These decide what the fixes in §4 should do.
| # | Ruling | Today |
|---|---|---|
| R1 | When is a defeated unit removed and victory checked? Does a kill count only when HP crosses to 0 on that hit? | Removed at the actor's turn end; "killed" is true for any hit on a 0-HP unit |
| R2 | Momentum AP earned off-turn or at end of turn: bank it for the owner's next turn, or pay only for own-turn triggers? | Silently discarded |
| R3 | What does ranged mean (unlimited, or a band), and which range key wins when a skill has several? |
Player path: melee. AI path: unlimited |
| R4 | CTB delay: per-action delay printed on the skill, or the leftover-AP formula? | Leftover-AP; no skill has a delay field |
| R5 | CTB ties: random or deterministic? | Random; 7 of 8 standard enemies share a speed |
| R6 | At 0 AP: auto-end the turn, or stay open for free actions? | Auto-ends |
| R7 | Durations: do tile effects and Showtime's aura count rounds, the owner's turns, or every unit's turn? Does a self-applied status count its cast turn? | Tiles and the aura tick on every unit's turn; statuses tick on the cast turn |
| R8 | Stat changes: immediate, or from the target's next turn? Does agility drive turn order live? | Next turn start; never |
| R9 | Status re-application: replace, extend, or stack? | Keep the old payload, overwrite the duration |
| R10 | Spread: every turn, both ways, unsaved (code), or once and save-gated (canon)? Burning to units or to tiles? | Code and canon disagree |
| R11 | DOT: multiplied by stacks? Amplified by Marked, Frozen and the Window? Reduced by Armor? Who gets kill credit? Regen or death first? | No; yes; yes; nobody; regen can revive |
| R12 | Break track: does environmental or DOT damage touch it? Does a Normal-tier hit brace? Is Hardening a permanent close or a tier downgrade? | Yes; yes; permanent close |
| R13 | Area skills: which effects apply once per action and which per target? | Everything per target |
| R14 | Is Staggered allowed from a non-Break source, for more than one turn, unsaved? | Yes |
Per-mechanic rulings. Each unblocks one cluster in §4.
| # | Ruling |
|---|---|
| R15 | Sword Surgeon sweep: cost, behaviour when unaffordable, once per action or per target, do non-strikes sweep |
| R16 | Showtime: do marks and reactions apply only to damaging strikes on enemies; how long is the aura |
| R17 | Crash: do walls, pillars and unit collisions count |
| R18 | Vanarism: is a skill bound to its stage and cost; is an illegal cast blocked or priced |
| R19 | Plunge: one +1 AP or two; must a Dive be Aerial; how long does Aerial last |
| R20 | Harmony: is it a cost gate; who receives the heal and ward; is the ward permanent Armor |
| R21 | Mirror: AP and MP cost; what Omnific Mirror waives; is Echo capped. Uncommitted fix assumes 1 AP always, waiver covers the use cap only |
| R22 | Momentum caps generally: ratify the data's caps, and cap Echo |
| R23 | Traps and terrain: hex targeting; terrain on an occupied hex; do constructed walls expire or take damage |
| R24 | Enemy HP: authored hp, or derived from vigor. Does gear vigor raise max HP |
| R25 | What carries between fights: HP, MP, items, charges, a casualty's gauge. Does a Test Lab relaunch reset the party |
| R26 | Boss: escalation per fight or per phase; Vent per turn or per hit; is The Unmaker meant to be un-Breakable; what replaces produces |
| R27 | What counts as a hit when Shields or Armor soak it (gauge, Tremor, Vent); front-row scope; damage floor before or after Armor |
| R28 | Disrupted: does it tax a basic attack. Restrained: does it block forced movement and lunges too |
| R29 | Enemy AI invariants: honour AP cost, requires_los, charges; resolve area skills as area |
| R30 | Shell: sprint and roll keys; whether hop clears obstacles; how exploration starts combat; save scope and whether loading mid-combat is allowed; dialogue rules; whether "End Combat (Test)" ships |
Horizon stamps. Mostly quick: build now, move to the roadmap, or cut.
| # | Item |
|---|---|
| R31 | Give every requirement a horizon, and define "existing systems" as combat as shipped in the Test Lab |
| R32 | Campaign layer: zone gating, Consumption, progression, rest, Inscribe persistence, the Trial archetype |
| R33 | Reactions, Reflectable, Interruptible: build, or strip the flags the boss telegraph promises |
| R34 | Legibility UI that canon marks must: resistance chart, Recipe state, status icons, Momentum display |
| R35 | Player-choice surfaces: Momentum and charge-mode selection, Paidi's potency split, sweep placement |
| R36 | Unbuilt kit promises: Lione Attunement, Pocket, Distortion; Sophia Tideturn; remove dead options from data |
| R37 | Statuses with a consumer and no applier (Charmed, Frightened, Quickened): author or cut. Paidi's Sync: retag or change her default |
| R38 | Roles and progression: three documents disagree; declare out of scope with one roadmap entry |
Housekeeping, no new decision needed.
- Apply rulings already made to the text that still contradicts them (TRC §3,
Apotheosis_Mechanics,Status_Effects). - Decide the status of
Combat_Behavior_Spec.md; it is what the tests answer to. - Move rules that live only in specs, handoffs and
Design_TODOinto the canonical docs. - Approve or reject the kit-seam spec, open since 2026-07-28.
- Rewrite the
CLAUDE.mdquick reference from canon.
7. Recommended sequence¶
- Rule R1–R14. They are the core rules; most of §4 cannot be fixed correctly without them.
- ~~Add the data-contract test (§4.2).~~ Done; see §8.
- ~~Fix the no-ruling defects, each test-first.~~ Done; see §8.
- Fix by cluster as rulings land: dead units (4.1), Momentum (4.3), per-action resolution (4.5), status rules (4.4), forms (4.6).
- ~~Repair the tests that cannot fail (§5) and add the vacuous-pass guard to
run_tests.gd.~~ Mostly done; the remainder pins behaviour that is waiting on a ruling. See §8. - Create the single roadmap file, move every scattered list into it, stamp horizons (R31–R38).
- Regenerate the register with one row per requirement: statement, source anchor, one status, horizon. Tag each spec and L3 test with the requirement it pins.
The rulings are worked through one at a time from the rulings handoff.
8. Status after the pre-ruling pass¶
Everything here is uncommitted on fix/combat-action-and-spawn-bugs. Both runners are green:
the logic suite at 850 methods, 2161 checks, 0 failures; the scene suite at 82 methods, 281 checks,
0 failures. Before the audit they stood at 799 / 2127 and 43 / 109.
8.1 Defects fixed¶
Each was reproduced by a failing test first.
| # | Defect | What changed |
|---|---|---|
| 7 (part) | Effect types with no handler | knockback and pull now resolve as forced movement; self_heal heals and applies its status. Shove pushes; Grapple Pull pulls; Flesh Knit heals. taunt, reposition_self and aoe_debuff are still unhandled and need a rule |
| 21 | Coatings damage their caster | The markers are now statuses of their own (poison_coating, razor_edge), so the catalog DOT is not merged onto them, an existing Poison no longer swallows the coating, and Antidote no longer strips it |
| 22 | Restrained does not stop enemies | The AI's move step honours blocks_movement. Forced movement and lunges are untouched (R28) |
| 24 (part) | A removed debuff keeps cutting the stat | Turn start now restores the original stats when no modifier remains, so the cut ends at the unit's next turn. It is still not immediate (R8) |
| 34 | Skip log always says "Staggered" | It names the status actually held, or "Broken" |
| 39 | Placement picker freed mid-sweep | The grid redraw no longer frees the picker or the turn highlight |
| 43 (part) | Shadow Lord's re-cloak is stripped | The re-cloak is applied after the cast resolves. "Instant traps" is still a log string only |
| 50 | Touch Cancel leaves the picker open; handlers unguarded | Cancel closes the picker; the skill, item, Mirror, target and move handlers each act only in their own phase |
| 52 | Targeting with no valid target dead-ends | The selector cancels itself and the status line says why |
| 53 | Skill list runs off the screen | The list sits in a scroll container. Checked by a layout test; not yet looked at in a window |
| 54 (part) | Skill panel ignores the Disrupted surcharge | The panel prices and gates rows with the cost the cast will charge. The Mirror button's gate is unchanged (R21) |
| 56 | Tooltips state rules the game does not have | Move says "1 AP per hex"; End Turn mentions carryover only when it is enabled |
| 57 | Hook on an adjacent enemy | A pull ends beside the caster; no collision |
| 59, 71 | Spawn placement unchecked | Units with an authored hex claim it first; any unit whose hex is taken, off the board or inside a starting obstacle moves to the nearest free hex |
| 61 (part) | Displacement skips bookkeeping | A pushed, pulled, lunged or swept unit no longer keeps the "movement ended" flag; a retreat no longer steps into an obstacle. Soil decay on displacement is untouched |
| 62 | around_target neighbour tables swapped |
Uses the pathfinder's neighbours |
| 66 | The Test Lab drops encounter data | A launch names its encounter, so starting tile effects appear. "Default 3v3" now starts with its authored fire and pillar |
| 76 | Dialogue choice effects discarded | choose returns the chosen choice's effects |
| 77 | load_game restores nothing |
The party is rebuilt as a typed array, so the restore completes. The wider save questions stay open (R30): numbers come back as floats, vector-valued flags come back as strings, version is unread |
| — | An AI unit killed during its turn keeps acting | The AI loop stops when its unit is dead |
| — | Joystick or touch button hidden while held stays pressed | Both release when hidden |
| — | A NaN volume reaches the audio bus | Rejected |
| — | Main menu title read "DISRUPTION" | Now "PRIMA MATERIA" |
8.2 Test infrastructure¶
- Data-contract test (
tests/logic/test_data_contract.gd). Every effect type, targeting type and range band in the skill data, and every equipped item id, must be one the code handles. It reads the handled effect types from_apply_skill_effect's own source. Known violations waiting on a ruling are listed in the test and may only shrink:taunt,reposition_self,aoe_debuff;tile,line_enemies;ranged;shadow_longbow,snare_kit. - Vacuous-pass guard in
run_tests.gd: a method that records no check and no explicit did-not-execute now fails. It surfaced no existing offender in the logic suite. - The logic runner no longer hangs on a test file with a parse error; it reports the file as a failure. Before, the runner never quit.
assert_almostfails on NaN. It used to pass, because NaN compares false against everything.- Shared scene-test helpers in
l3_base.gd: boot with seeded flags, boot parked on a named ally, move a unit with the grid kept in step, pump until an action finishes.
New suites: test_action_flow_l3.gd (17), test_combat_integrity_l3.gd (18), test_shell_l3.gd
(4), test_data_contract.gd (5), test_dialogue_state_machine.gd (3), test_coating_markers.gd (3).
8.3 Tests repaired¶
- No
assert_true(true)call remains anywhere undergodot/tests. Self-skips are now recorded as did-not-execute, not as passing checks. - The six form-activation tests assert the form's own log line and its state, not the generic activation line.
- The Sword Surgeon test resolves a real strike and asserts the sweep; the Eruption test asserts the absorb; the Charmed test forces its roll after boot and asserts the attack; the Frightened test asserts the retreat moved the unit; the Crimson Vessel test no longer accepts the rejected path; the Maelstrom test asserts the water exists.
- The push test keeps grid occupancy in step and asserts the destination.
- The two AP spec tests call
APSystem; the save test uses a DC at which the two stats differ; the move-range and crit tests pin values; two boss tests no longer pass when nothing happened.
All of these passed once made real, so none of them was hiding a defect.
8.4 Still open without a ruling¶
Small, and left because they are cosmetic, need a look in a window, or sit next to a ruling:
- Look at the scrolled skill list in a real window (defect 53).
exploration_scene.gdreferences a camera node that does not exist; it logs an error on every load and its follow code is dead._blade_elementis never cleared when an edge expires (part of defect 12).- F5 hot reload is not debug-gated and resets live state (defect 69).
_deal_damagecallers pass subtypes as types (defect 70).- The taunt planner mutates state when asked for a telegraph; inert while taunt itself is inert.
- Tests that pin behaviour a ruling will change, left alone until then:
test_sophia_dive.gd::test_aerial_ticks_to_brief_window(R7, R19),test_euphen_kit.gdandtest_sophia_data.gddata-string checks (R3, R19),test_break_manager.gd::test_non_eligible_hit_braces_but_does_not_chip(R12),test_momentum_seam_mapping.gd(rebuilds its events by hand),test_unmaker_devouring_maw.gd(does not use the shipped encounter data, R26),test_boss_activation.gd::test_puzzlebox_ends_on_hp_not_meter(name contradicts its assertion).
8.5 Moved under a ruling¶
These looked ruling-free in §7 and are not:
- Gear vigor to max HP (defect 65). The code's own comment says gear should reach HP, but it changes every character's HP and R24 asks the question directly.
- Absorb's Poise restore (defect 68). Making it real means deciding whether Absorb can un-Break an enemy, which belongs with R12.