fix: close phase4 overseas acceptance gaps

This commit is contained in:
2026-08-24 21:00:22 +08:00
parent 005c3f54e2
commit 3607bebbfd
42 changed files with 860 additions and 203 deletions
@@ -58,6 +58,25 @@ test('entry orders marker-owned prerequisites before cross-region acceptance', (
}
})
test('cross-region normalization keeps existing producers ahead of every phase-three consumer', () => {
const requested = [
'merchant-qualification-fixture', 'orders', 'inbound-measurement', 'phase3-container-loading',
'phase3-loading-model-bridge', 'phase3-loading', 'ocean-bookings', 'phase3-loading-finalize',
'phase3-customs', 'phase3-outbound-dispatch', 'phase3-outbound-aggregate',
'phase4-overseas-pda', 'phase4-cross-region-events',
]
const modules = normalizeModuleOrder(requested)
for (const [producer, consumer] of [
['merchant-qualification-fixture', 'orders'], ['orders', 'inbound-measurement'],
['inbound-measurement', 'phase3-container-loading'], ['phase3-container-loading', 'phase3-loading'],
['phase3-loading', 'phase3-loading-model-bridge'], ['phase3-loading', 'ocean-bookings'],
['phase3-loading-finalize', 'phase3-customs'], ['phase3-customs', 'phase3-outbound-dispatch'],
['phase3-outbound-dispatch', 'phase3-outbound-aggregate'],
['phase4-overseas-pda', 'phase4-cross-region-events'],
]) assert.ok(modules.indexOf(producer) < modules.indexOf(consumer), `${producer} -> ${consumer}`)
assert.deepEqual(normalizeModuleOrder(modules), modules)
})
test('contract covers dual audience, canonical 403, both event directions and diagnostics', () => {
for (const token of [
'context.token)', 'context.overseasToken)', 'cn-overseas-event-not-delivered',