From 1b0bc0cebf28f9a0d39bfd804cbc5fe2f85561a1 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sun, 5 Jul 2026 18:22:41 +0900 Subject: [PATCH] Verify first camp sortie integrity --- scripts/verify-release-candidate.mjs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/verify-release-candidate.mjs b/scripts/verify-release-candidate.mjs index dfcf79f..21ea269 100644 --- a/scripts/verify-release-candidate.mjs +++ b/scripts/verify-release-candidate.mjs @@ -133,6 +133,23 @@ try { ), `Expected first camp deployment preview to keep the founding trio assigned: ${JSON.stringify(firstCampProbe.state?.sortieDeploymentPreview)}` ); + assert(firstCampProbe.state?.sortieHasBattle === true, `Expected first camp to expose a playable next battle: ${JSON.stringify(firstCampProbe.state)}`); + assert( + firstCampProbe.state?.sortieRecommendationEnabled === true, + `Expected first camp to support recommended sortie planning: ${JSON.stringify(firstCampProbe.state)}` + ); + assert( + firstCampProbe.state?.sortiePlan?.selectedCount === firstCampProbe.state?.sortieDeploymentPreview?.length, + `Expected deployment preview to match selected sortie count: ${JSON.stringify(firstCampProbe.state?.sortiePlan)} / ${JSON.stringify(firstCampProbe.state?.sortieDeploymentPreview)}` + ); + assertUnique( + firstCampProbe.state?.sortieDeploymentPreview?.map((slot) => slot.unitId), + `Expected first camp deployment preview to avoid duplicate units: ${JSON.stringify(firstCampProbe.state?.sortieDeploymentPreview)}` + ); + assertUnique( + firstCampProbe.state?.sortieDeploymentPreview?.map((slot) => `${slot.x},${slot.y}`), + `Expected first camp deployment preview to avoid duplicate tiles: ${JSON.stringify(firstCampProbe.state?.sortieDeploymentPreview)}` + ); assert(firstCampProbe.summary?.includes('보유 군자금'), `Expected camp summary to show held gold: ${JSON.stringify(firstCampProbe)}`); assert(firstCampProbe.texts.some((text) => text.includes('전투 보상')), `Expected camp report to show battle reward: ${JSON.stringify(firstCampProbe.texts)}`); assert( @@ -577,6 +594,12 @@ function assert(condition, message) { } } +function assertUnique(values, message) { + assert(Array.isArray(values) && values.length > 0, message); + assert(values.every(Boolean), message); + assert(new Set(values).size === values.length, message); +} + function runCommand(command, args, env = {}) { const result = spawnSync(command, args, { cwd: process.cwd(), env: { ...process.env, ...env }, stdio: 'inherit' }); if (result.status !== 0) {