fix(shadow): protect observed vehicle traffic

This commit is contained in:
zgw
2026-09-09 15:42:09 +08:00
parent edb13450a6
commit 4408958443
12 changed files with 545 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ public final class ShadowDispatchSnapshotAssembler {
private final Clock clock;
private final java.util.Set<String> safeWaitSites;
private final java.util.Set<String> safeYieldSites;
private final ShadowObservedTrafficProjector observedTraffic = new ShadowObservedTrafficProjector();
public ShadowDispatchSnapshotAssembler(
String warehouseCode,
@@ -72,7 +73,7 @@ public final class ShadowDispatchSnapshotAssembler {
stateLoader.apply(topology), "stateLoader result");
return new DispatchSnapshot(tasks(batch, topology),
vehicles(batch, topology), topology, state.getLedger(),
state.getWaitForGraph(), state.getSnapshotVersion());
state.getWaitForGraph(), state.getSnapshotVersion(), observedTraffic.project(batch, topology));
}
private EffectiveTopology topology(List<ShadowMapFact> facts) {