test: adapt PDA loading completion contract

This commit is contained in:
2026-08-12 13:48:46 +08:00
parent 584b73faf5
commit 49967bbc28
2 changed files with 32 additions and 9 deletions
@@ -73,8 +73,13 @@ test('container loading follows push, claim, real pick, completed sequence', ()
"pushed?.status === 'EDITING'",
"claimedPlan?.status === 'LOADING'",
"const pickResponse = await request",
"const completeResponse = await request",
"finalPlan?.status === 'COMPLETED'",
])
assert.match(value, /picked\?\.workflowStatus === 'AWAITING_REVIEW'/)
assert.match(value, /`\$\{PDA\}\/tasks\/\$\{taskId\}\/complete`/)
assert.match(value, /expectedTaskVersion: Number\(picked\?\.version\)/)
assert.match(value, /operationId: `\$\{context\.marker\}-pda-complete`\.slice\(0, 128\)/)
})
test('bridge loading starts through a real PDA batch before preload confirmation', () => {
@@ -119,11 +124,12 @@ test('PDA inventory snapshot gates batch and records the only safe mutation gap'
assert.match(convergence, /fixture\?\.inventoryMutationVerified !== true/)
})
test('PDA completion acceptance verifies immutable BATCH audit with operator metadata', () => {
test('PDA completion acceptance verifies immutable BATCH and COMPLETE_LOADING audit with operator metadata', () => {
const container = source('./phase3-container-loading.mjs')
const convergence = source('./phase3-pda-convergence.mjs')
assert.match(container, /回查完成后的 PDA 操作审计/)
assert.match(container, /item\.actionType === 'BATCH'/)
assert.match(container, /item\.actionType === 'COMPLETE_LOADING'/)
assert.match(container, /Boolean\(item\.operatorId\) && Boolean\(item\.createdAt\)/)
assert.match(convergence, /PDA 原子批次完成审计包含 BATCH 操作/)
assert.match(convergence, /item\.actionType === 'BATCH'/)