Raxol. Harness. Fixture. Bless
(Raxol v2.6.1)
View Source
Regenerates <name>.blocks.json snapshots by running a pluggable
projector over each golden fixture session in a directory.
Mirrors the RATE precedent (priv/rate/golden.refs +
mix raxol.rate --gen + assert RATE.run() == RATE.run(),
06-projection §7 open question 6) at the fixture/session level rather
than the pixel-hash level. Adversarial fixtures are skipped — they are
authored to be semantically pathological for a projection consumer, not
blessed as golden output.
Two modes: the default writes snapshots; check: true diffs the
on-disk snapshot against a fresh projection without writing anything
and reports {:error, {:drift, names}} when any golden fixture's
snapshot is stale or missing — the CI-facing half of the drift
tripwire.
Summary
Types
@type result() :: %{ name: String.t(), path: Path.t(), blocks_path: Path.t() | nil, count: non_neg_integer() | nil, status: status() }
@type status() :: :written | :current | :drift | :skipped
Functions
@spec default_dir() :: Path.t()
Run the bless pass.
Options:
:dir— directory containing*.jsonlfixtures (defaulttest/fixtures/harness/sessions):projector— module implementingRaxol.Harness.Fixture.Projector(defaultRaxol.Harness.Fixture.Projectors.Identity):names— explicit fixture base names (without.jsonl) to bless; defaults to every fixture found in:dir:check— whentrue, write nothing; compare each on-disk snapshot to a fresh projection and return{:error, {:drift, names}}if any differ or are missing