Record Class ConsensusSafetyReport
java.lang.Object
java.lang.Record
org.j7m.middleware.api.consensus.ConsensusSafetyReport
- Record Components:
electionSafety- whether at most one leader was observed per termleaderAppendOnly- whether leaders preserved append-only local logslogMatching- whether logs match through equal index/term pairsleaderCompleteness- whether future leaders contain committed entriesstateMachineSafety- whether applied entries agree at every indexcommittedEntryDurability- whether committed entries survived recoverystaleLeaderRejection- whether stale-leader rejection evidence was observedevidence- safe invariant evidence records, such as scenario and node idsviolations- safe violation messages with no payload or credential data
- All Implemented Interfaces:
Serializable
public record ConsensusSafetyReport(boolean electionSafety, boolean leaderAppendOnly, boolean logMatching, boolean leaderCompleteness, boolean stateMachineSafety, boolean committedEntryDurability, boolean staleLeaderRejection, List<String> evidence, List<String> violations)
extends Record
implements Serializable
Deterministic consensus safety invariant report.
The report is generated from actual node state, durable logs, commit indexes, applied indexes, and deterministic simulation evidence. It is a redacted value object for tests, demos, and operator evidence; it must never include raw command payload bytes or private endpoint material. A required invariant that was not exercised must be represented as a failure or safe violation text by the implementation rather than as a silent pass.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConsensusSafetyReport(boolean electionSafety, boolean leaderAppendOnly, boolean logMatching, boolean leaderCompleteness, boolean stateMachineSafety, boolean committedEntryDurability, boolean staleLeaderRejection, List<String> evidence, List<String> violations) Creates a safety report. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecommittedEntryDurabilityrecord component.booleanReturns the value of theelectionSafetyrecord component.final booleanIndicates whether some other object is "equal to" this one.evidence()Returns the value of theevidencerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theleaderAppendOnlyrecord component.booleanReturns the value of theleaderCompletenessrecord component.booleanReturns the value of thelogMatchingrecord component.booleanpassed()Returns whether all invariants passed.booleanReturns the value of thestaleLeaderRejectionrecord component.booleanReturns the value of thestateMachineSafetyrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theviolationsrecord component.
-
Constructor Details
-
ConsensusSafetyReport
public ConsensusSafetyReport(boolean electionSafety, boolean leaderAppendOnly, boolean logMatching, boolean leaderCompleteness, boolean stateMachineSafety, boolean committedEntryDurability, boolean staleLeaderRejection, List<String> evidence, List<String> violations) Creates a safety report.Evidence and violation lists are defensively copied. The record is immutable and thread-safe after construction. Implementations should use stable reason text so failed acceptance evidence is reproducible.
-
-
Method Details
-
passed
public boolean passed()Returns whether all invariants passed.- Returns:
truewhen every invariant is true and no violation exists
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
electionSafety
public boolean electionSafety()Returns the value of theelectionSafetyrecord component.- Returns:
- the value of the
electionSafetyrecord component
-
leaderAppendOnly
public boolean leaderAppendOnly()Returns the value of theleaderAppendOnlyrecord component.- Returns:
- the value of the
leaderAppendOnlyrecord component
-
logMatching
public boolean logMatching()Returns the value of thelogMatchingrecord component.- Returns:
- the value of the
logMatchingrecord component
-
leaderCompleteness
public boolean leaderCompleteness()Returns the value of theleaderCompletenessrecord component.- Returns:
- the value of the
leaderCompletenessrecord component
-
stateMachineSafety
public boolean stateMachineSafety()Returns the value of thestateMachineSafetyrecord component.- Returns:
- the value of the
stateMachineSafetyrecord component
-
committedEntryDurability
public boolean committedEntryDurability()Returns the value of thecommittedEntryDurabilityrecord component.- Returns:
- the value of the
committedEntryDurabilityrecord component
-
staleLeaderRejection
public boolean staleLeaderRejection()Returns the value of thestaleLeaderRejectionrecord component.- Returns:
- the value of the
staleLeaderRejectionrecord component
-
evidence
-
violations
Returns the value of theviolationsrecord component.- Returns:
- the value of the
violationsrecord component
-