aarondb/distributed_harness

distributed_harness — deterministic adversarial safety oracle

This module deliberately models reproducible fault schedules and invariant checks only. The process/network adapter owns delivery; it records the resulting observations here so a failure can be replayed without timing or scheduler luck.

Types

pub type Artifact {
  Artifact(
    seed: Int,
    schedule: List(Fault),
    observations: List(Observation),
    violations: List(Violation),
  )
}

Constructors

pub type Fault {
  Partition(String, String)
  Heal(String, String)
  DuplicateRpc(String)
  ReorderRpc(String)
  Crash(String)
  Restart(String)
  DiskFault(String)
  SlowFollower(String)
  MembershipChurn(String)
  ClockSkew(String, Int)
}

Constructors

  • Partition(String, String)
  • Heal(String, String)
  • DuplicateRpc(String)
  • ReorderRpc(String)
  • Crash(String)
  • Restart(String)
  • DiskFault(String)
  • SlowFollower(String)
  • MembershipChurn(String)
  • ClockSkew(String, Int)
pub type Observation {
  Leaders(term: Int, nodes: List(String))
  Applied(index: Int, copies: Int)
  Fence(resource: String, expected: Int, received: Int)
  RecoveryAlarm(present: Bool)
}

Constructors

  • Leaders(term: Int, nodes: List(String))
  • Applied(index: Int, copies: Int)
  • Fence(resource: String, expected: Int, received: Int)
  • RecoveryAlarm(present: Bool)
pub type Run {
  Run(
    seed: Int,
    schedule: List(Fault),
    observations: List(Observation),
  )
}

Constructors

pub type Violation {
  SplitBrain(term: Int, leaders: List(String))
  DuplicateApply(index: Int, copies: Int)
  StaleFenceAccepted(
    resource: String,
    expected: Int,
    received: Int,
  )
  UnsafeRecoveryUnalarmed
}

Constructors

  • SplitBrain(term: Int, leaders: List(String))
  • DuplicateApply(index: Int, copies: Int)
  • StaleFenceAccepted(
      resource: String,
      expected: Int,
      received: Int,
    )
  • UnsafeRecoveryUnalarmed

Values

pub fn artifact(run: Run) -> Artifact

Persist this value exactly when an adapter run fails. It contains every deterministic input needed to reproduce the invariant failure locally or in CI; raw process logs may be attached alongside it but are not required to reconstruct the schedule.

pub fn inspect(run: Run) -> List(Violation)
pub fn passed(run: Run) -> Bool
pub fn replay(seed: Int, observations: List(Observation)) -> Run
pub fn schedule(seed: Int) -> List(Fault)

The stable seeds are a public replay corpus. Keep them fixed: changing a seed changes a reproducibility contract and belongs in a release note.

Search Document