feedback5 WK: golden — one 自选 match (coop2-NORMAL-70-diy): a human seat on AI 托管 slots 推进之王 (S3, SOL-X) and the prototypes Sharp (tiers 5 and 6) and 领主·Sharp, its 调度中心 at level 5 from the first prep; its own shop draws 推进之王 in round 3 (and Sharp in round 7), its AI fields 推进之王 — the operator kit — in rounds 3–7; the digest's diy lists per round the 自选 shop draws and the fielded pieces, and the stock left

Added to the fast subset (7 matches, 62 of 151 scenarios). No existing scenario moved (17 matches and every other family byte-identical).
Test: test/golden-diy.test.js.
This commit is contained in:
sganggs committed 2026-10-06 00:16:47 +08:00
1 parent 0def7babfd
commit 01d5fa3e94
4 files changed
+229 -12

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
// The 自选 golden match covers what it claims (test/golden/README.md, tools/golden.mjs — 0.2.0 自选编队): reads the stored
// digest only (test/golden.test.js recomputes it). Its human seat (AI 托管) slots 推进之王 and prototypes; its shop draws
// its 自选 pieces (and only from the slots' 调度中心 levels), its AI fields 推进之王 — the operator kit — in battle, the
// stock ends where the held copies leave it, and the match ends without errors.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const read = (p) => JSON.parse(readFileSync(new URL(p, import.meta.url), 'utf8'));
const MATCHES = read('./golden/matches.json');
const BACKUPS = read('../data/backups.json');
test('matches: the 自选 match\'s human seat draws its 自选 pieces in its shop and fields 推进之王 in battle', () => {
const [id, dg] = Object.entries(MATCHES.scenarios).find(([k]) => /-diy$/.test(k)) || [];
assert.ok(dg, 'scenario present');
assert.deepEqual(dg.errors, { engine: 0, logged: 0, sim: 0, dispatcher: 0 }, id);
assert.deepEqual(Object.keys(dg.diy.picks).sort(), Object.keys(BACKUPS.diy.slots).sort(), 'all four slots filled');
assert.equal(dg.diy.picks.chess_char_5_diy1_a.charId, 'char_112_siege');
const draws = dg.diy.rounds.flatMap(([, d]) => (d ? d.split(' ') : []));
assert.ok(draws.length >= 2, `shop draws: ${draws.join(', ')}`);
for (const d of draws) assert.ok(Object.hasOwn(BACKUPS.diy.slots, `chess_char_${d}`), d);
const fielded = dg.diy.rounds.filter(([, , f]) => f).flatMap(([r, , f]) => f.split(' ').map((x) => `${r}:${x}`));
assert.ok(fielded.some((x) => x.endsWith('5_diy1_a→char_112_siege')), `fielded: ${fielded.join(', ')}`);
for (const [r, , f] of dg.diy.rounds) {
for (const x of f ? f.split(' ') : []) {
const [slot, charId] = x.split('→');
assert.equal(dg.diy.picks[`chess_char_${slot}`].charId, charId, `round ${r}: ${x} fights as its pick`);
}
}
// the stock: never above its cap (8 at tier 5, 5 at tier 6)
for (const [slot, left] of Object.entries(dg.diy.stock)) assert.ok(left >= 0 && left <= (BACKUPS.diy.slots[slot].tier === 5 ? 8 : 5), slot);
});