class

Crowbar::DSL::CorpusGateBuilder

Inherits Reference < Object

Tier 2 Declarative Builder for configuring and running a Crowbar.corpus_gate inside crystal spec under a 60-second watchdog budget.

Constructors

new(name : String = "Corpus Regression Gate", assert_clean : Bool = true)
Source

Instance methods

allow_errors(*classes : Exception.class)
Source
assert(name : String = "assertion_#{@runner.assertions.size + 1}", &block : Buffer -> Nil)

Registers an assertion block (e.g. containing Crystal spec .should expectations)

Source
assert_clean(val : Bool = true)
Source
assert_clean=(assert_clean : Bool)
Source
assert_each(name : String = "assertion_#{@runner.assertions.size + 1}", &block : Buffer -> Nil)
Source
assert_invariant(name : String = "invariant_#{@runner.invariants.size + 1}", &block : Buffer -> Bool)

Registers a boolean regression invariant that must hold for every seed/mutant

Source
auto_shrink(val : Bool)
Source
base64_seed(b64 : String, id : String | Nil = nil, seed : UInt64 | Nil = nil) : Core::CorpusSeed
Source
budget(span : Time::Span)
Source
budget(seconds : Int32 | Float64)
Source
build
Source
corpora(*items : Buffer | Bytes | String)
Source
corpus(payload : Buffer | Bytes | String, id : String | Nil = nil, seed : UInt64 | Nil = nil, mutations : Int32 = 0, replay_verbatim : Bool = true) : Core::CorpusSeed

Adds a deterministic seed / crash reproducer payload to the corpus

Source
corpus_dir(dir_path : String, pattern : String = "*") : Int32

Loads all matching seed files from a corpus directory (sorted deterministically)

Source
execute

Registers the primary target execution block under test

Source
expected_error(err_class : Exception.class)

Declares expected non-fatal exception classes

Source
expected_errors(*classes : Exception.class)
Source
fail_fast(val : Bool)
Source
fixup

Registers a post-mutation fixup callback

Source
forbidden_errors(*classes : Exception.class)
Source
from_directory(dir_path : String, pattern : String = "*") : Int32
Source
from_report(report : Campaign::CampaignReport) : Int32

Imports crash records from a CampaignReport

Source
from_session(session : Session) : Int32

Imports corpus candidates and recorded items from a Crowbar::Session

Source
from_session(session_id : String, dir : String = Session.default_dir) : Int32
Source
hex_seed(hex : String, id : String | Nil = nil, seed : UInt64 | Nil = nil) : Core::CorpusSeed
Source
input(payload : Buffer | Bytes | String, id : String | Nil = nil) : Core::CorpusSeed
Source
inputs(*items : Buffer | Bytes | String)
Source
invariant(name : String = "invariant_#{@runner.invariants.size + 1}", &block : Buffer -> Bool)
Source
iterations(count : Int32)

Number of deterministic mutation iterations across the corpus

Source
mutations_per_seed(count : Int32)

Number of deterministic mutations executed per corpus seed entry

Source
name(val : String)
Source
on_heartbeat
Source
on_regression
Source
on_seed_complete
Source
pattern(name : Symbol)

Configures mutation pattern (:once, :many, :burst)

Source
per_seed_timeout(span : Time::Span)
Source
preserve(format : Symbol) : Rule | Nil
Source
preserve(format : Symbol, &block : Rule -> Nil) : Rule | Nil
Source
raise_on_failure(val : Bool = true)
Source
reject_error(err_class : Exception.class)

Declares explicitly forbidden exception classes that always trigger a regression failure

Source
replay(seed_val : UInt64 | Int32 | Int64, payload : Buffer | Bytes | String, id : String | Nil = nil, mutations : Int32 = 1) : Core::CorpusSeed

Registers a deterministic (seed, input) mutation replay pair

Source
reproducer(payload : Buffer | Bytes | String, id : String | Nil = nil, seed : UInt64 | Nil = nil) : Core::CorpusSeed

Registers a crash reproducer payload for verbatim regression replay

Source
reproducer_base64(b64 : String, id : String | Nil = nil, seed : UInt64 | Nil = nil) : Core::CorpusSeed

Registers a Base64-encoded crash reproducer for verbatim regression replay

Source
reproducer_hex(hex : String, id : String | Nil = nil, seed : UInt64 | Nil = nil) : Core::CorpusSeed

Registers a hex-encoded crash reproducer for verbatim regression replay

Source
rule(format : Symbol) : Rule | Nil

Attaches a structure-preserving format rule

Source
rule(instance : Rule) : Rule
Source
runner
Source
sample(payload : Buffer | Bytes | String, id : String | Nil = nil) : Core::CorpusSeed
Source
samples(*items : Buffer | Bytes | String)
Source
scope(name : String | Symbol, bytes range : Range(B, E), &) forall B, E
Source
scope(name : String | Symbol, selector : Selector, &)

Defines a scoped mutation region

Source
scope(name : String | Symbol, footer length : Int32, &)
Source
seed(val : UInt64 | Int32 | Int64)

Sets the base deterministic PRNG seed

Source
seeds(vals : Enumerable(UInt64 | Int32 | Int64))
Source
seeds(*vals : UInt64 | Int32 | Int64)

Registers explicit PRNG seeds for deterministic mutation replay

Source
target
Source
timeout(span : Time::Span)

Sets the per-seed execution timeout

Source
timeout(ms : Int32)
Source
verify_determinism(val : Bool = true)
Source
watchdog(span : Time::Span)
Source
watchdog(seconds : Int32 | Float64)
Source
watchdog_budget(span : Time::Span)

Sets the overall watchdog budget (strictly <= 60 seconds)

Source
watchdog_budget(seconds : Int32 | Float64)
Source
watchdog_interval(span : Time::Span)

Sets the periodic watchdog heartbeat emission interval

Source
watchdog_interval(seconds : Int32 | Float64)
Source