Reciprocal allied Ecaz and Fremen with fighters in Sietch Tabr now satisfy that part of the Fremen final-turn victory, as explicitly clarified by the GF9 Ecaz/Moritani p15 FAQ. One public board quote drives automatic victory and the table guide; the chronicle explains the result. Other blockers, ordinary stronghold/BG prediction precedence, Guild fallback, advisor posture and concealed marker privacy remain intact. Habbanya symmetry and full mode/publication acceptance remain unfinished. A genuine Advanced sample also exposed a pre-existing accepted Guild shipment which could never finish: allowance opened BG accompaniment and then hit the Ambassador arrival guard. Prior HEAD replay reproduced the exact 90-action failure. Fresh shipment preflight now rejects unsupported arrival combinations before accepting their pending windows. A valid legacy ordinary Guild allowance can return its unspent declaration to choose another destination; special parent/card receipts retain their separate gates. The change does not invent simultaneous reaction order or refund spent cards. Independent rules/privacy/persistence review and focused engine/controls tests pass. Seventeen Fremen/Ecaz tests include all four profiles and authenticated final readiness/restart/concurrent writes. Shipment regressions cover pre-declaration immutability, supported arrival, malformed saved declarations and authenticated unspent return/replacement/reconnect/concurrency. All 4716 offline tests, types, lint, production build and 43 HTTP tests passed against unchanged source. The original fixed seeds were repeated after repair and the exact failed snapshot resumed with documented new continuation seed 202609147: resume-advanced-202609147: 842 accepted, 109 guarded rejections, 22 periodic JSON restores; genuine-basic-202609145: 563 accepted, 14 guarded rejections, 15 periodic JSON restores; genuine-advanced-202609146: 806 accepted, 81 guarded rejections, 21 periodic JSON restores. All three finish and preserve physical custody/private views. These samples do not establish naturally reached allied Fremen special wins; a separate conserved browser final-turn fixture verifies the actual Ready-to-win transition, public guide/log, private hand and pending/finished refresh. All 835 opening games and original seat/recovery records remain unchanged (902 after checks). All 869 rooms and records present after the reported outage also remain unchanged; database integrity and foreign keys pass. The healthy server and finished browser seat recovered without restart, reset or recurring automation. Full rules coverage and release gates remain open work. Verified source tree: 1d9fcf30b54132f66be5f994f410dec6ec019683ee66b24fd4efb7a6aa7f7bbd
169 lines
5.7 KiB
TypeScript
169 lines
5.7 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import type { BoardContext } from '../game/board-resolution-quote';
|
|
import { fremenSpecialVictory } from '../game/fremen-victory';
|
|
import { VictoryProgressError } from '../game/victory-progress';
|
|
|
|
function fixture(advanced = false): BoardContext {
|
|
return {
|
|
advanced,
|
|
storm: 18,
|
|
order: ['x', 'f', 'e', 'r'],
|
|
players: [
|
|
{ id: 'f', faction: 'fremen', ally: 'e', forces: {} },
|
|
{ id: 'e', faction: 'ecaz', ally: 'f', forces: {} },
|
|
{ id: 'x', faction: 'beneGesserit', ally: null, forces: {} },
|
|
{ id: 'r', faction: 'richese', ally: null, forces: {} },
|
|
],
|
|
};
|
|
}
|
|
|
|
function seat(g: BoardContext, id: string) {
|
|
return g.players.find((player) => player.id === id)!;
|
|
}
|
|
|
|
function place(g: BoardContext, id: string, key: string) {
|
|
const player = seat(g, id);
|
|
player.forces = { ...player.forces, [key]: 1 };
|
|
}
|
|
|
|
void test('allied Ecaz co-occupation is ignored only at Sietch Tabr in Basic and Advanced', () => {
|
|
for (const advanced of [false, true]) {
|
|
const g = fixture(advanced);
|
|
place(g, 'f', 'sietch_tabr:14');
|
|
place(g, 'e', 'sietch_tabr:14');
|
|
const result = fremenSpecialVictory(g)!;
|
|
assert.equal(result.player, 'f');
|
|
assert.deepEqual(result.members, ['f', 'e']);
|
|
assert.equal(result.qualifies, true);
|
|
assert.deepEqual(result.sietches, [
|
|
{
|
|
territory: 'sietch_tabr',
|
|
blockers: [],
|
|
ecazCooccupation: true,
|
|
},
|
|
{
|
|
territory: 'habbanya_ridge_sietch',
|
|
blockers: [],
|
|
ecazCooccupation: false,
|
|
},
|
|
]);
|
|
assert.deepEqual(result.tueksBlockers, []);
|
|
}
|
|
});
|
|
|
|
void test('a valid board without Fremen has no special-victory prospect', () => {
|
|
const g = fixture();
|
|
seat(g, 'f').faction = 'atreides';
|
|
assert.equal(fremenSpecialVictory(g), null);
|
|
});
|
|
|
|
void test('solitary, nonallied and third-party Ecaz presence do not receive the Tabr exception', () => {
|
|
const solitary = fixture();
|
|
place(solitary, 'e', 'sietch_tabr:14');
|
|
assert.deepEqual(fremenSpecialVictory(solitary)!.sietches[0].blockers, ['e']);
|
|
|
|
const nonallied = fixture();
|
|
seat(nonallied, 'f').ally = null;
|
|
seat(nonallied, 'e').ally = null;
|
|
place(nonallied, 'f', 'sietch_tabr:14');
|
|
place(nonallied, 'e', 'sietch_tabr:14');
|
|
assert.deepEqual(fremenSpecialVictory(nonallied)!.sietches[0].blockers, [
|
|
'e',
|
|
]);
|
|
|
|
const third = fixture();
|
|
place(third, 'f', 'sietch_tabr:14');
|
|
place(third, 'e', 'sietch_tabr:14');
|
|
place(third, 'r', 'sietch_tabr:14');
|
|
assert.deepEqual(fremenSpecialVictory(third)!.sietches[0].blockers, ['r']);
|
|
assert.equal(fremenSpecialVictory(third)!.qualifies, false);
|
|
});
|
|
|
|
void test('Ecaz co-occupation at Habbanya remains a blocker', () => {
|
|
const g = fixture();
|
|
place(g, 'f', 'habbanya_ridge_sietch:17');
|
|
place(g, 'e', 'habbanya_ridge_sietch:17');
|
|
const result = fremenSpecialVictory(g)!;
|
|
assert.equal(result.sietches[1].ecazCooccupation, true);
|
|
assert.deepEqual(result.sietches[1].blockers, ['e']);
|
|
assert.equal(result.qualifies, false);
|
|
});
|
|
|
|
void test('accompanied BG advisors do not block, while mandatory lone-advisor release restores fighter presence', () => {
|
|
const accompanied = fixture(true);
|
|
place(accompanied, 'f', 'habbanya_ridge_sietch:17');
|
|
place(accompanied, 'x', 'habbanya_ridge_sietch:17');
|
|
seat(accompanied, 'x').advisors = { habbanya_ridge_sietch: {} };
|
|
assert.deepEqual(fremenSpecialVictory(accompanied)!.sietches[1].blockers, []);
|
|
|
|
const released = fixture(true);
|
|
place(released, 'x', 'sietch_tabr:14');
|
|
seat(released, 'x').advisors = { sietch_tabr: {} };
|
|
const before = structuredClone(released);
|
|
assert.deepEqual(fremenSpecialVictory(released)!.sietches[0].blockers, ['x']);
|
|
assert.deepEqual(released, before);
|
|
});
|
|
|
|
void test('Tuek blockers preserve Basic and Advanced faction scope and never inspect marker secrets', () => {
|
|
const basic = fixture(false);
|
|
place(basic, 'r', 'tueks_sietch:5');
|
|
assert.deepEqual(fremenSpecialVictory(basic)!.tueksBlockers, []);
|
|
|
|
const advanced = fixture(true);
|
|
seat(advanced, 'r').noField = {
|
|
deployed: { location: { territory: 'tueks_sietch', sector: 5 } },
|
|
};
|
|
Object.defineProperty(seat(advanced, 'r').noField!.deployed, 'value', {
|
|
get() {
|
|
throw new Error('Hidden marker denomination read');
|
|
},
|
|
});
|
|
for (const player of advanced.players)
|
|
for (const key of ['hand', 'spice', 'leaders', 'prediction'])
|
|
Object.defineProperty(player, key, {
|
|
get() {
|
|
throw new Error(`Private field read: ${key}`);
|
|
},
|
|
});
|
|
const result = fremenSpecialVictory(advanced)!;
|
|
assert.deepEqual(result.tueksBlockers, ['r']);
|
|
assert.equal(result.qualifies, false);
|
|
});
|
|
|
|
void test('members and blockers follow public order rather than player-array order', () => {
|
|
const g = fixture();
|
|
g.order = ['r', 'e', 'x', 'f'];
|
|
place(g, 'f', 'sietch_tabr:14');
|
|
place(g, 'e', 'sietch_tabr:14');
|
|
place(g, 'r', 'habbanya_ridge_sietch:17');
|
|
place(g, 'x', 'habbanya_ridge_sietch:17');
|
|
assert.deepEqual(fremenSpecialVictory(g), {
|
|
player: 'f',
|
|
members: ['e', 'f'],
|
|
qualifies: false,
|
|
sietches: [
|
|
{
|
|
territory: 'sietch_tabr',
|
|
blockers: [],
|
|
ecazCooccupation: true,
|
|
},
|
|
{
|
|
territory: 'habbanya_ridge_sietch',
|
|
blockers: ['r', 'x'],
|
|
ecazCooccupation: false,
|
|
},
|
|
],
|
|
tueksBlockers: [],
|
|
});
|
|
});
|
|
|
|
void test('invalid shared board and alliance state is reported through VictoryProgressError', () => {
|
|
const invalid = fixture();
|
|
seat(invalid, 'e').ally = null;
|
|
assert.throws(() => fremenSpecialVictory(invalid), VictoryProgressError);
|
|
const malformed = fixture();
|
|
seat(malformed, 'x').forces = { 'sietch_tabr:99': 1 };
|
|
assert.throws(() => fremenSpecialVictory(malformed), VictoryProgressError);
|
|
});
|