Report database size and make four genuine suites reproducible
Operations now report the SQLite database size and page count, read through PRAGMA page_count/page_size in the same authority-checked batch as the lifecycle counters with non-numeric values clamped to zero; the page renders both and states that free disk space is still unknown. replaceMoritaniAssassinationTraitors draws the first distinct physical Traitor Card from the reserve instead of the reserve's first entry, because the face-up set-aside card can still sit in that list: re-drawing it produced a receipt whose replacement equalled the revealed card, which the assassination integrity check rejects mid-Mentat. With no distinct card left the step is blocked with an explicit reason instead of committing an invalid receipt. Four tests were made reproducible after measuring their real failure rates, because a suite that fails for random reasons cannot act as a checkpoint gate: the Discovery typed Spice Blow test now removes other cards for the same territory so one blow deposits the printed amount (0/20 after, ~20% before); the Discovery E2 skills deal is pinned with the new shared tests/deterministic-random.ts helper so a Lasgun-shield explosion cannot pre-empt its skill consumer (0/12 after, ~20% before); the Ecaz Occupy Ix/CHOAM policy check accepts any legal continuation and still asserts the phase it reaches (0/30 after, ~10% before); and the mixed-E3 Moritani Cunning test keeps the random storm off red_chasm's single sector (0/25 after, ~20% before). Offline suite 7,801/7,801 with typecheck and lint clean. No game, seat, saved state or deployment changes.
This commit is contained in:
1 parent
8bea4c1a0c
commit
e493bcf58e
12 files changed
+128
-13
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { pinDeterministicRandom } from './deterministic-random';
|
||||
import { applyAction, handLimit, normalizeAutomaticGame, viewGame, type Action, type Game } from '../game/engine';
|
||||
import { botActions } from '../game/bots';
|
||||
import { DIFFICULTIES } from '../game/bot-profiles';
|
||||
@@ -296,7 +297,11 @@ for (const advanced of [false, true]) for (const marker of [0, 3, 5] as const) {
|
||||
});
|
||||
}
|
||||
|
||||
void test('four minimal policies resolve actual nested marker plans into physical revelation and a completed casualty/skill consumer', () => {
|
||||
void test('four minimal policies resolve actual nested marker plans into physical revelation and a completed casualty/skill consumer', (t) => {
|
||||
// The deal is pinned: an unseeded Lasgun-shield pair explodes, destroys both
|
||||
// armies and legitimately leaves no winner, which would pre-empt the casualty
|
||||
// and skill consumer this test exists to exercise.
|
||||
pinDeterministicRandom(t);
|
||||
const f = createDiscoveryNativeE2SkillsFixture({ advanced: true, tech: true, strongholds: true });
|
||||
const battle = prepareDiscoveryNativeE2SkillsMarkerBattle(f, { marker: 5, reserveCap: 3 });
|
||||
for (const difficulty of DIFFICULTIES) {
|
||||
@@ -319,7 +324,8 @@ void test('four minimal policies resolve actual nested marker plans into physica
|
||||
assert.equal(player(game, f.richese).forces[battle.key], 3);
|
||||
assert.equal(player(game, f.richese).reserves, 0);
|
||||
const done = finishDiscoveryNativeE2SkillsBattle(game);
|
||||
assert.ok(done.lastBattleContext?.winner === f.richese || done.lastBattleContext?.winner === f.guild);
|
||||
assert.ok(done.lastBattleContext?.winner === f.richese || done.lastBattleContext?.winner === f.guild,
|
||||
`The non-exploding marker battle must resolve to a real winner, not ${done.lastBattleContext?.result}.`);
|
||||
assert.equal(done.battle, null);
|
||||
assert.equal(player(done, f.richese).noField!.deployed, null);
|
||||
assert.equal(player(done, f.richese).noField!.lastShipped, battle.token);
|
||||
|
||||
Reference in new issue
Block a user