Module recipe_closure

Module recipe_closure 

Source
Expand description

2026-10-02: The recipe a gate serves, as part of what its records attest.

A gate serves the recipe its BENCH entry names, read from recipes/<id>.yaml in the tree under test (read_in_tree). A record carries the canonical content hash of what it served (GateRecord::served_recipe_sha256), and stands at a later commit only while that commit’s recipe hashes the same (recipe_standing).

The canonical form (canonical) is the parsed recipe (metrale_config::recipe_yaml), so comments, blank lines, quoting and key order do not count. It drops metadata, which no serve reads, and applies the run’s serve overrides to defaults, so a recipe key that an override pins does not count either.

Owner: bench gate. Invariants:

  • recipe_standing answers Same only when both hashes exist and agree. A recipe the tree does not have, one that does not parse, and a record without a served-recipe hash are Changed, never Same: such a record was served from a recipe outside the tree (a node’s cached index), so nothing attests what it served.
  • A record with no served_by (an operator’s own endpoint) served no recipe, so the recipe does not bear on its standing.

Enums§

RecipeStanding
2026-10-02: Whether the recipe a record served is still what its gate serves.

Functions§

canonical
2026-10-02: The served form of a recipe: parsed, without metadata, with overrides replacing or adding defaults keys.
content_sha256
2026-10-02: Hex sha256 of canonical, over a JSON rendering whose maps are in key order.
read_in_tree
2026-10-02: The text of recipe id in the tree at root. A recipe the tree does not have is refused: a gate serves only the recipe committed beside its BENCH.toml, never a node’s cached copy.
recipe_path
2026-10-02: Where recipe id (<family>/<stem>) lives in a tree.
recipe_standing
2026-10-02: Compare what record served with what its gate serves in the tree at root: the recipe the BENCH entry for the record’s (hardware, model) names, rendered with the record’s serve overrides (which check_record requires to equal the entry’s pins).