fix(mcp): перечитывать состояние, когда маршрут fe80 моста задержался после ухода из VRF

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
DenozordecandClaude Sonnet 5.5 committed 2026-11-19 01:46:25 +07:00
1 parent ce29dc0d22
commit 1efc265e36
2 files changed
+28 -1

No files matched your search

@@ -317,6 +317,30 @@ for (const [label, current, mutate] of [
await assert.rejects(settleVrfTransition(greAfter, after => classifyVrfProductionTransition({ ...inputs[4], after }), async () => { greRereads++; return greAfter }, async () => {}), /VRF production transition refused/)
assert.equal(greRereads, VRF_SETTLING_REREADS); cases++
assert.ok(joining && joining !== leaving)
// Owner decision 2026-11-19 (run v26 write 29): the isolate post-read lost the bridge LL address but still holds its
// fe80 connected route (separate GETs). Only that shape is re-read; after the bound the same refusal stands.
{
const lingering = structuredClone(transferred)
lingering.catalogs.ipv6_address = lingering.catalogs.ipv6_address.filter(row => !(row.dynamic === "true" && row.interface === leaving))
assert.ok(lingering.catalogs.ipv6_route.some(row => linkLocalRoute(row, leaving)))
const classifyLeave = (after: VrfProductionSnapshot) => classifyVrfProductionTransition(input(reenabled, after, transfer, chainPrevious))
let count = 0
const settled = await settleVrfTransition(lingering, classifyLeave, async () => { count++; return structuredClone(left) }, async () => {})
assert.equal(settled.status, "explained-native-transition"); assert.equal(count, 1)
assert.deepEqual(durable(settled.checkpoint).leftBridgeLl.map((item: { member: string }) => item.member), [leaving]); cases++
count = 0
const exhausted = await settleVrfTransition(lingering, classifyLeave, async () => { count++; return structuredClone(lingering) }, async () => {}).then(() => undefined, (error: unknown) => error)
assert.equal(readVrfTransitionRefusal(exhausted)?.guard, "PATCH_BRIDGE_LL_CONNECTED_ROUTE_CLOSURE"); assert.equal(count, VRF_SETTLING_REREADS); cases++
// The same lingering route with a non-empty bridge or a changed bridge row: refused at once (earlier checks).
const portedLinger = ported(lingering)
count = 0
await assert.rejects(settleVrfTransition(portedLinger, after => classifyVrfProductionTransition(input(ported(reenabled), after, transfer, chainPrevious)), async () => { count++; return portedLinger }, async () => {}), /PATCH bridge LL empty configuration/)
assert.equal(count, 0); cases++
const changedLinger = structuredClone(lingering); changedLinger.catalogs.bridge.find(row => row.name === leaving)!.mtu = "1400"
count = 0
await assert.rejects(settleVrfTransition(changedLinger, classifyLeave, async () => { count++; return changedLinger }, async () => {}), /opaque configuration drift/)
assert.equal(count, 0); cases++
}
// Owner decision 2026-11-18 (run v24 step 31): the rejoin post-read holds the owed bridge's fe80 route but not yet its
// LL address (non-atomic read). That shape alone is re-read (settling); nothing is accepted without the address.
{
@@ -300,6 +300,8 @@ function bridgeLinkLocalLoss(before: VrfProductionSnapshot, after: VrfProduction
const statics = beforeSources.filter(item => item.member === name && !item.ll)
return statics.some(item => item.family === 4) && statics.every(item => afterSources.some(next => next.member === name && next.resource === item.resource && !next.ll && next.row[".id"] === item.row[".id"] && next.network === item.network)) && !afterSources.some(item => item.member === name && item.ll)
},
// The proven before-route is still in a non-atomic post-read (the address and route come from separate GETs).
routeLingers: () => before.catalogs.ipv6_route.filter(linkLocalRoute).length === 1 && before.catalogs.ipv6_route.filter(linkLocalRoute)[0] === oldRoute && after.catalogs.ipv6_route.some(linkLocalRoute),
connectedRouteClosure: () => before.catalogs.ipv6_route.filter(linkLocalRoute).length === 1 && before.catalogs.ipv6_route.filter(linkLocalRoute)[0] === oldRoute && !after.catalogs.ipv6_route.some(linkLocalRoute),
}
}
@@ -332,7 +334,8 @@ function leftBridgeLinkLocal(before: VrfProductionSnapshot, after: VrfProduction
must(facts.automaticProvenance(), "PATCH bridge LL automatic provenance")
facts.eui64()
must(facts.staticAddressClosure(), "PATCH bridge LL static address closure")
must(facts.connectedRouteClosure(), "PATCH bridge LL connected route closure")
// Owner decision 2026-11-19 (run v26 write 29): only the lingering-route shape is re-read; every other check stays immediate.
settling(() => facts.routeLingers(), () => must(facts.connectedRouteClosure(), "PATCH bridge LL connected route closure"))
}
/** Existing object guards must see the exact concrete parent/dependent
* identities already proved by admission, not a guessed numeric namespace. */