Class FleetInvariants
java.lang.Object
ai.badmonkey.agentspaces.test.FleetInvariants
The minimal fleet oracle of srad/spoiler-peers.md ยง3.5 (SP-O-01, SP-O-02), checked over a
FleetProbe once a fleet is quiescent:
- no honest member raised an error on its own threads;
- every member holds the same root for every replicated state;
- the frame drops since the baseline, by reason, are exactly the drops the scenario expected (its injected bad frames, and the stale or replayed frames its holds made);
- in a class A scenario, no honest member struck or quarantined another.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassertHolds(Map<String, Long> expectedDrops, boolean classA) Fails with the first broken invariant, listing the rest.static FleetInvariantsbaseline(FleetProbe probe) Starts an oracle whose drop check counts from now: a scenario takes it after the fleet formed, so the joins' own refusals are not charged to the script.The invariants that do not hold, each as one line naming the member; empty when all hold.state(FleetProbe probe, boolean noPunishment) The invariants that need no baseline: no member raised an error, every member holds the same roots, and, whennoPunishment, no member struck or quarantined another.
-
Method Details
-
baseline
Starts an oracle whose drop check counts from now: a scenario takes it after the fleet formed, so the joins' own refusals are not charged to the script.- Parameters:
probe- the fleet's probe- Returns:
- the oracle
-
broken
The invariants that do not hold, each as one line naming the member; empty when all hold.- Parameters:
expectedDrops- drops the scenario expects by reason, summed over the members (absent means 0)classA- whether no member may be struck or quarantined- Returns:
- the broken invariants, the first one first
-
state
The invariants that need no baseline: no member raised an error, every member holds the same roots, and, whennoPunishment, no member struck or quarantined another. A fleet's own quiet-point check delegates here (RobustnessFleet.assertInvariants, SP-O-01).- Parameters:
probe- the fleet's probenoPunishment- whether a strike or quarantine of an honest member breaks the fleet- Returns:
- the broken invariants, empty when all hold
-
assertHolds
-