Skip to main content

Module emit

Module emit 

Source
Expand description

Canonical artifact emission (ADR-0010, TECH-SPEC §4.5).

For every scenario the emitter produces canonical .hurl text — that exact text is what parse_hurl_file + run_entries execute, so drift between artifact and execution is structurally impossible. Alongside it: the sidecar map (<slug>.map.json, schema v1: entry ↔ feature anchor, optional flags, capture names, batch boundaries) and, when the scenario references globals or secrets, a <slug>.vars file so the backend team can replay with hurl --variables-file. Secrets appear as names only — values never enter any artifact (ADR-0005).

The canonical format is a compatibility surface, locked by the insta snapshot corpus — emitter changes require deliberate cargo insta review.

Structs§

Artifact
One scenario’s emitted artifact set.
FeatureAnchor
Feature anchor for one entry.
MapEntry
One entry block in the artifact.
SidecarMap
Sidecar map: entry ↔ feature anchors (TECH-SPEC §4.5, schema v1).

Constants§

MAP_SCHEMA_VERSION
Sidecar map schema version.

Functions§

emit
Emit one scenario’s artifact set. None when the scenario lowers to no hurl entries (nothing to hand to the engine or the backend team).
file_references
Filenames referenced as hurl file,<name>; bodies or multipart parts in the artifact text. Stock hurl --test <file> resolves them relative to the .hurl file, so callers copy these next to emitted artifacts to keep the hand-off self-contained (ADR-0010).
slugify
File-safe slug: lowercase alphanumerics, everything else collapses to -.