Skip to main content

Crate proef_core

Crate proef_core 

Source
Expand description

Engine-agnostic core of proef, the declarative multi-engine e2e test runner.

This crate owns the full front-end pipeline (gherkin parse → bind → lower → emit), the engine seam (engine::EngineFactory / engine::EngineSession, ADR-0002), the world::World variable scope (ADR-0005), the serde event::Event spine (ADR-0008), and the fault taxonomy with stable exit codes (ADR-0009).

§Core purity (sans-IO lite)

The pipeline stages in this crate do no IO, read no clocks or environment, and generate no randomness — run_id, timestamps, and env snapshots are injected values. The single sanctioned persistence component is world::GlobalStore, whose load/save functions are invoked only from the orchestrating edge (the CLI), never from pipeline code. This is what makes snapshot and property tests bit-deterministic; do not break it for convenience.

Modules§

analyze
Collect-all suite analysis: the LSP’s whole-suite recompute in one function.
bind
Step binding (TECH-SPEC §4.3): match each authored step against the loaded macros’ match: patterns.
cancel
Cooperative cancellation plumbing (ADR-0007).
diag
Source-located diagnostics with stable codes (ADR-0009, TECH-SPEC §9).
emit
Canonical artifact emission (ADR-0010, TECH-SPEC §4.5).
engine
The engine seam (ADR-0002): EngineFactory / EngineSession, step-kind routing, and capability hooks (step_kinds, doctor).
error
Fault taxonomy and stable exit codes (ADR-0009).
event
The serde event spine (ADR-0008).
fake
Deterministic synthetic data for ${fake:*} (ADR-0005).
feature
Feature front end (TECH-SPEC §4.2, §4.4, §7): gherkin parse, tag accumulation, Background prepending, Rule pass-through, Scenario Outline expansion, and data-table capture.
html
render_html — a self-contained HTML view of a run’s event stream.
lower
Lowering (TECH-SPEC §4.4): bound scenarios → engine batches.
matcher
The {name} step matcher: cucumber-expression-style patterns binding Gherkin prose to macros (TECH-SPEC §4.3).
pack
Macro packs: the YAML binding skeleton with embedded raw payload blocks (ADR-0004, TECH-SPEC §6).
provider
The injected source-access seam. proef-core never reads a file; it asks a SourceProvider for the units under a suite and for their bytes. The CLI provides a disk-backed impl; the LSP provides an overlay-then-disk impl. This is the ADR-0012 pattern — IO at the edge, injected into the sans-IO core.
report
Reporters (ADR-0008): composable consumers of the event spine.
resolve
Author-time ${…} variable resolution (ADR-0005, TECH-SPEC §8).
runner
The run orchestrator (TECH-SPEC §1, §12; ADR-0007): scenario-per-OS-thread, --jobs-bounded, cooperative cancellation at batch boundaries, and a heartbeat watchdog that abandons over-budget scenario threads (recording a System failure and detaching — the process reaps them at exit).
step
Lowered, engine-agnostic step and batch types (TECH-SPEC §3).
tags
Tag expressions (ADR-0004 tags) — the --tags filter grammar.
world
Typed variable scope and persistent global store (ADR-0005).