From c8c402ffc5cac70c93561088524cb03a097884f7 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 4 Sep 2026 15:29:06 +0800 Subject: [PATCH] test: detect shared overflow evidence --- ...let-location-test-env-acceptance.contract.test.mjs | 11 +++++++++++ scripts/pallet-location-test-env-acceptance.mjs | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/pallet-location-test-env-acceptance.contract.test.mjs b/scripts/pallet-location-test-env-acceptance.contract.test.mjs index 46374bed6..5d1141170 100644 --- a/scripts/pallet-location-test-env-acceptance.contract.test.mjs +++ b/scripts/pallet-location-test-env-acceptance.contract.test.mjs @@ -66,6 +66,17 @@ test('scenario inspection requires deletion release, refill reuse, WAIT_SPLIT, a assert.equal(inspectScenarioReport(scenario, report, 0).passed, false) }) +test('scenario inspection detects naturally observed shared A0 from evidence without coupling to step wording', () => { + const scenario = PALLET_LOCATION_SCENARIOS[0] + const report = { + success: false, + createdResources: {}, + steps: [{ name: '正式数据 A0 共享溢出观测', passed: true, + evidence: 'sharedOverflow=true, slots=1:reservation:A0' }], + } + assert.equal(inspectScenarioReport(scenario, report, 1).resources.sharedOverflowObserved, true) +}) + test('cross-scenario inspection permits shared A0 location but rejects shared reservation or block', () => { const results = [ { resources: { inboundId: '1', blockId: '11', reservationId: '21', locationId: 'A0' } }, diff --git a/scripts/pallet-location-test-env-acceptance.mjs b/scripts/pallet-location-test-env-acceptance.mjs index 475d46669..ba3dc874d 100644 --- a/scripts/pallet-location-test-env-acceptance.mjs +++ b/scripts/pallet-location-test-env-acceptance.mjs @@ -109,7 +109,8 @@ export function inspectScenarioReport(scenario, report, exitCode = 0) { expectedGuideShape: guideEvidenceMatched, } const passed = Object.values(assertions).every(Boolean) - const overflowStep = steps.find((step) => String(step.name || '').includes('A0共享溢出位状态可见')) + const sharedOverflowObserved = steps.some((step) => + /sharedOverflow=true/.test(String(step.evidence || ''))) return { name: scenario.name, description: scenario.description, @@ -126,7 +127,7 @@ export function inspectScenarioReport(scenario, report, exitCode = 0) { locationId: guide.locationId || null, palletCount: measurement.palletCount ?? null, processStatus: measurement.processStatus || null, - sharedOverflowObserved: /sharedOverflow=true/.test(String(overflowStep?.evidence || '')), + sharedOverflowObserved, }, } }