test: require incremental pallet growth

This commit is contained in:
2026-09-04 15:30:59 +08:00
parent 7babcb9e0d
commit 9c96bdfaa8
3 changed files with 41 additions and 4 deletions
@@ -18,8 +18,10 @@ test('pallet location matrix declares deterministic one, two, and three-image sc
assert.match(source, /--verify-pallet-location-guide', 'true'/)
assert.match(source, /--wait-split-package-count', '18'/)
assert.match(source, /--wait-split-package-count', '12'/)
assert.match(source, /--wait-split-package-count', '61'/)
assert.match(source, /--route-mode', 'random', '--wait-split-random-value', '2'/)
assert.match(source, /第3张确认后扩容只追加且既有槽身份不漂移/)
assert.match(source, /beforeSlots=1, afterSlots=2/)
assert.match(source, /beforeSlots=2, afterSlots=3/)
})
test('matrix options select known scenarios without duplicate or unknown names', () => {
@@ -77,6 +79,32 @@ test('scenario inspection detects naturally observed shared A0 from evidence wit
assert.equal(inspectScenarioReport(scenario, report, 1).resources.sharedOverflowObserved, true)
})
test('three-image scenario rejects a no-op growth assertion even when the base step passed', () => {
const scenario = PALLET_LOCATION_SCENARIOS.at(-1)
const report = {
success: true,
createdResources: {
inboundMeasurement: { palletCount: 3, processStatus: 'WAIT_SPLIT' },
inboundMeasurementLocationGuide: {
blockId: '1', reservationId: '2', locationId: '3', deleteSucceeded: true, slotReused: true,
},
},
steps: [
{ name: '删除只解绑图片且原 reservation/location 变为 RESERVED_EMPTY', passed: true },
{ name: '替代图片按新 resultId 复用原空槽', passed: true },
{ name: '固定客户第 1 单停在待分柜', passed: true },
{ name: '报告敏感信息扫描', passed: true },
{ name: '第2张确认后扩容只追加且既有槽身份不漂移', passed: true,
evidence: 'beforeSlots=3, afterSlots=3' },
{ name: '第3张确认后扩容只追加且既有槽身份不漂移', passed: true,
evidence: 'beforeSlots=3, afterSlots=3' },
],
}
const inspected = inspectScenarioReport(scenario, report, 0)
assert.equal(inspected.assertions.requiredStepEvidence, false)
assert.deepEqual(inspected.mismatchedStepEvidence, scenario.requiredSteps)
})
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' } },