fix(firstleg): preserve sealed pallet identity in atomic PDA picking

This commit is contained in:
2026-09-09 12:33:31 +08:00
parent 44ac24a9e2
commit ac3ce3703e
12 changed files with 323 additions and 47 deletions
@@ -104,9 +104,9 @@ test('measurement and loading pass destination identity into the LOADED producer
assert.match(loading, /canonicalPickItems\.map/)
assert.match(loading, /pickedPackageCount: Number\(item\.plannedPackageCount\)/)
assert.match(loading, /const dropshipWholePallet = source\?\.fulfillmentType === 'ONE_CLICK_DROPSHIP'/)
assert.match(loading, /tasks\/\$\{canonicalTaskId\}\/pallets\/pick/)
assert.match(loading, /palletNo: candidate\.palletNo/)
assert.match(loading, /canonicalPickAction = dropshipWholePallet \? 'PICK_PALLET' : 'BATCH'/)
assert.match(loading, /const canonicalPickPath = batchPath/)
assert.match(loading, /action: 'PICK_PALLET', palletNo: item\.palletNo/)
assert.match(loading, /const canonicalPickAction = 'BATCH'/)
assert.match(loading, /一件代发整托生产者不执行可拆分动态增量场景/)
assert.match(loading, /!dropshipWholePallet && Array\.isArray\(incrementalFixture\?\.skuCodes\)/)
assert.match(pda, /find\(\(item\) => item\?\.fulfillmentType === 'ONE_CLICK_DROPSHIP'\)/)
@@ -148,3 +148,22 @@ test('only PDA-operated variants traverse real outbound and carrier nodes before
assert.doesNotMatch(entry, /awaitingVariants\.length === 2/)
assert.match(entry, /awaitingVariants\.every\(\(item\) => item\.shippingReady === false/)
})
test('full phase3 chain validates sealed pallet query metadata and atomic batch protection', () => {
const loading = read('phase3-loading.mjs')
assert.match(loading, /canonicalPickItems\.every\(\(item\) => item\.unitType === 'SEALED_PALLET'/)
assert.match(loading, /unit\.unitType === 'SEALED_PALLET'/)
for (const field of ['pickItemId', 'loadingPlanItemId', 'inboundId', 'palletId', 'palletNo', 'indivisible']) {
assert.ok(loading.includes(`unit.${field}`), `inventory units must verify ${field}`)
}
assert.match(loading, /if \(!taskUnitsValid \|\| !inventoryUnitsValid\) return/)
assert.match(loading, /items: \[\.\.\.batchPayload\.items, \{/)
assert.match(loading, /taskItemsSignature\(unchangedAfterInvalid\) === taskItemsSignature\(beforeInvalidTask\)/)
assert.match(loading, /operationsSignature\(afterInvalidOperations\) === operationsSignature\(beforeInvalidOperations\)/)
assert.match(loading, /for \(const action of \['PICK', 'PARTIAL', 'SKIP'\]\)/)
assert.match(loading, /operationsSignature\(afterBypassOperations\) === operationsSignature\(beforeInvalidOperations\)/)
assert.match(loading, /整托batch同键改托盘码必须冲突/)
assert.match(loading, /item\.operationId === batchKey[\s\S]*?\.length === 1/)
assert.doesNotMatch(loading, /tasks\/\$\{canonicalTaskId\}\/pallets\/pick/)
})