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 term
leaderAppendOnly - whether leaders preserved append-only local logs
logMatching - whether logs match through equal index/term pairs
leaderCompleteness - whether future leaders contain committed entries
stateMachineSafety - whether applied entries agree at every index
committedEntryDurability - whether committed entries survived recovery
staleLeaderRejection - whether stale-leader rejection evidence was observed
evidence - safe invariant evidence records, such as scenario and node ids
violations - 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 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:
      true when every invariant is true and no violation exists
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • electionSafety

      public boolean electionSafety()
      Returns the value of the electionSafety record component.
      Returns:
      the value of the electionSafety record component
    • leaderAppendOnly

      public boolean leaderAppendOnly()
      Returns the value of the leaderAppendOnly record component.
      Returns:
      the value of the leaderAppendOnly record component
    • logMatching

      public boolean logMatching()
      Returns the value of the logMatching record component.
      Returns:
      the value of the logMatching record component
    • leaderCompleteness

      public boolean leaderCompleteness()
      Returns the value of the leaderCompleteness record component.
      Returns:
      the value of the leaderCompleteness record component
    • stateMachineSafety

      public boolean stateMachineSafety()
      Returns the value of the stateMachineSafety record component.
      Returns:
      the value of the stateMachineSafety record component
    • committedEntryDurability

      public boolean committedEntryDurability()
      Returns the value of the committedEntryDurability record component.
      Returns:
      the value of the committedEntryDurability record component
    • staleLeaderRejection

      public boolean staleLeaderRejection()
      Returns the value of the staleLeaderRejection record component.
      Returns:
      the value of the staleLeaderRejection record component
    • evidence

      public List<String> evidence()
      Returns the value of the evidence record component.
      Returns:
      the value of the evidence record component
    • violations

      public List<String> violations()
      Returns the value of the violations record component.
      Returns:
      the value of the violations record component