class

Crowbar::Core::CorpusRunner

Inherits Reference < Object

Tier 1 Core Engine: Deterministic seed replay and crash regression verification runner operating under a strict <= 60-second watchdog budget.

Constructors

new(name : String = "Corpus Regression Gate", seeds : Array(CorpusSeed) = [] of CorpusSeed, deterministic_seeds : Array(UInt64) = [] of UInt64, base_seed : UInt64 = 42_u64, iterations : Int32 = 0, mutations_per_seed : Int32 = 0, rules : Array(Rule) = [] of Rule, expected_errors : Array(Exception.class) = [] of Exception.class, per_seed_timeout : Time::Span = DEFAULT_SEED_TIMEOUT, watchdog_budget : Time::Span = DEFAULT_WATCHDOG_BUDGET, watchdog_interval : Time::Span = DEFAULT_WATCHDOG_INTERVAL, auto_shrink : Bool = true, fail_fast : Bool = false, verify_determinism : Bool = false, execution : Proc(Buffer, Nil) | Nil = nil)
Source

Instance methods

add_assertion(name : String = "assertion_#{@assertions.size + 1}", &block : Buffer -> Nil) : Nil
Source
add_base64_seed(b64 : String, id : String | Nil = nil, seed : UInt64 | Nil = nil, mutations : Int32 = 0) : CorpusSeed

Registers a Base64-encoded crash reproducer or seed payload

Source
add_crash_record(record : Campaign::CrashRecord) : CorpusSeed

Imports a CrashRecord (minimized or full reproducer) from a Campaign run

Source
add_deterministic_seed(seed_val : UInt64) : Nil

Registers an explicit PRNG seed for deterministic mutation replay across corpus baselines

Source
add_expected_error(err_class : Exception.class) : Nil
Source
add_fixup
Source
add_forbidden_error(err_class : Exception.class) : Nil
Source
add_hex_seed(hex : String, id : String | Nil = nil, seed : UInt64 | Nil = nil, mutations : Int32 = 0) : CorpusSeed

Registers a hex-encoded crash reproducer or seed payload

Source
add_invariant(name : String = "invariant_#{@invariants.size + 1}", &block : Buffer -> Bool) : Nil
Source
add_replay(seed_val : UInt64, payload : Buffer | Bytes | String, id : String | Nil = nil, mutations : Int32 = 1) : CorpusSeed

Registers a deterministic (PRNG seed, baseline input) mutation replay pair

Source
add_rule(rule : Rule) : Nil
Source
add_scope(scope : Scope) : Nil
Source
add_seed(payload : Buffer | Bytes | String, id : String | Nil = nil, seed : UInt64 | Nil = nil, mutations : Int32 = 0, replay_verbatim : Bool = true, expected_errors : Array(Exception.class) = [] of Exception.class) : CorpusSeed

Registers a corpus seed or crash reproducer for deterministic replay

Source
assertions
Source
assertions=(assertions : Array(Tuple(String, Proc(Buffer, Nil))))
Source
auto_shrink
Source
auto_shrink=(auto_shrink : Bool)
Source
base_seed
Source
base_seed=(base_seed : UInt64)
Source
deterministic_seeds
Source
deterministic_seeds=(deterministic_seeds : Array(UInt64))
Source
execution
Source
execution=(execution : Proc(Buffer, Nil) | Nil)
Source
expected_error?(ex : Exception, seed_expected : Array(Exception.class) = [] of Exception.class) : Bool
Source
expected_errors
Source
expected_errors=(expected_errors : Array(Exception.class))
Source
fail_fast
Source
fail_fast=(fail_fast : Bool)
Source
fixups
Source
fixups=(fixups : Array(Proc(Buffer, Nil)))
Source
forbidden_errors
Source
forbidden_errors=(forbidden_errors : Array(Exception.class))
Source
generate_deterministic_mutant(input : Buffer | Bytes | String, seed_val : UInt64, steps : Int32 = 1) : Tuple(Buffer, Array(String))

Generates the deterministic mutation of input for a given seed_val and step count

Source
invariants
Source
invariants=(invariants : Array(Tuple(String, Proc(Buffer, Bool))))
Source
iterations
Source
iterations=(iterations : Int32)
Source
load_directory(dir_path : String, pattern : String = "*") : Int32

Deterministically loads corpus files from a directory (sorted lexicographically)

Source
load_session(session : Session) : Int32

Loads corpus candidates and recorded session items from a persistent Crowbar::Session

Source
mutations_per_seed
Source
mutations_per_seed=(mutations_per_seed : Int32)
Source
name
Source
name=(name : String)
Source
on_heartbeat

Telemetry and lifecycle callbacks

Source
on_heartbeat=(on_heartbeat : Proc(Int32, Float64, Nil) | Nil)

Telemetry and lifecycle callbacks

Source
on_regression
Source
on_regression=(on_regression : Proc(SeedResult, Nil) | Nil)
Source
on_seed_complete
Source
on_seed_complete=(on_seed_complete : Proc(SeedResult, Nil) | Nil)
Source
pattern
Source
pattern=(pattern : Pattern)
Source
per_seed_timeout
Source
per_seed_timeout=(per_seed_timeout : Time::Span)
Source
replay(seed_val : UInt64, input : Buffer | Bytes | String, steps : Int32 = 1) : SeedResult

Replays a single deterministic (seed, input) mutation on demand

Source
rules
Source
rules=(rules : Array(Rule))
Source
run

Executes the full corpus regression gate under the <= 60s watchdog budget

Source
run!

Executes the full corpus regression gate and raises RegressionError if not clean

Source
scopes
Source
scopes=(scopes : Array(Scope))
Source
seeds
Source
seeds=(seeds : Array(CorpusSeed))
Source
timeout
Source
timeout=(span : Time::Span) : Time::Span
Source
verify_determinism
Source
verify_determinism=(verify_determinism : Bool)
Source
watchdog_budget
Source
watchdog_budget=(budget : Time::Span) : Time::Span

Enforces the Inviolable 60-Second Watchdog Law (0 < budget <= 60s)

Source
watchdog_interval
Source
watchdog_interval=(watchdog_interval : Time::Span)
Source