From 8cd7dd7eec4977faff1b09ce01dd6ef52664fa9c Mon Sep 17 00:00:00 2001 From: Wickedness Date: Tue, 28 Jul 2026 17:46:53 +0900 Subject: [PATCH] test: align release gates with canonical campaign saves --- scripts/verify-campaign-flow-data.mjs | 2 +- scripts/verify-desktop-browser-viewport.mjs | 2 +- scripts/verify-first-battle-camaraderie-memory.mjs | 7 ++++++- scripts/verify-first-pursuit-scout-memory.mjs | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/verify-campaign-flow-data.mjs b/scripts/verify-campaign-flow-data.mjs index d614fd2..593e969 100644 --- a/scripts/verify-campaign-flow-data.mjs +++ b/scripts/verify-campaign-flow-data.mjs @@ -169,7 +169,7 @@ assert( 'Both victory result routes must clear their persisted aftermath marker only when CampScene is reached' ); assert( - campaignStateSource.includes('state.pendingAftermathBattleId = battleId as BattleScenarioId') && + /state\.pendingAftermathBattleId\s*=\s*battleId as BattleScenarioId/.test(campaignStateSource) && campaignStateSource.includes('export function completeCampaignAftermath'), 'Campaign saves must persist a pending victory aftermath and expose an explicit completion transition' ); diff --git a/scripts/verify-desktop-browser-viewport.mjs b/scripts/verify-desktop-browser-viewport.mjs index be3b368..9953a32 100644 --- a/scripts/verify-desktop-browser-viewport.mjs +++ b/scripts/verify-desktop-browser-viewport.mjs @@ -43,7 +43,7 @@ for (const scriptPath of automatedBrowserChecks) { const source = readFileSync(scriptPath, 'utf8'); assert(source.includes("from './desktop-browser-viewport.mjs'"), `${scriptPath} must import the shared browser viewport`); assert( - /\b(?:newPage|newContext)\(desktopBrowserContextOptions\)/.test(source), + /\b(?:newPage|newContext)\(\s*desktopBrowserContextOptions\s*\)/.test(source), `${scriptPath} must explicitly create its primary browser page or context with the shared FHD context options` ); assert( diff --git a/scripts/verify-first-battle-camaraderie-memory.mjs b/scripts/verify-first-battle-camaraderie-memory.mjs index 8e17fe6..3dc4309 100644 --- a/scripts/verify-first-battle-camaraderie-memory.mjs +++ b/scripts/verify-first-battle-camaraderie-memory.mjs @@ -485,7 +485,12 @@ function verifyCampaignRoundTrip( raw.battleHistory[ memoryModule.firstBattleCamaraderieSourceBattleId ].sortieCooperation.bondId = 'ghost-bond'; - storage.set(campaignModule.campaignStorageKey, JSON.stringify(raw)); + const corruptedSave = JSON.stringify(raw); + storage.set(campaignModule.campaignStorageKey, corruptedSave); + storage.set( + `${campaignModule.campaignStorageKey}:slot-${raw.activeSaveSlot ?? 1}`, + corruptedSave + ); campaign = campaignModule.loadCampaignState(); assert( campaign.firstBattleReport?.sortieCooperation === undefined && diff --git a/scripts/verify-first-pursuit-scout-memory.mjs b/scripts/verify-first-pursuit-scout-memory.mjs index ed7dd10..90c7ea3 100644 --- a/scripts/verify-first-pursuit-scout-memory.mjs +++ b/scripts/verify-first-pursuit-scout-memory.mjs @@ -397,11 +397,11 @@ async function verifyCampExplorationWiring(memoryModule, visitModule) { 'An incomplete first-pursuit visit must lead to the walkable camp exploration scene.' ); assert( - explorationSource.includes( - "completeFirstPursuitScoutVisit(choice.id)" + /completeFirstPursuitScoutVisit\(\s*choice\.id,\s*this\.explorationDialogueCheckpoint\(/.test( + explorationSource ) && explorationSource.includes("textureKey: 'exploration-jian-yong'"), - 'The exploration scene must use the guarded action and Jian Yong dedicated SD sheet.' + 'The exploration scene must atomically use the guarded action with its checkpoint and Jian Yong dedicated SD sheet.' ); const campaign = createLiteralSyncCampaign(memoryModule);