reci.compiler

Compiler — recipe + action specs + config → GitHub Actions workflow YAML.

The compiler resolves data-flow wiring using a five-level precedence, injects a setup job that exports config values as job outputs, auto-generates the cross-job output forwarding ceremony, and adds needs: edges from data-flow dependencies.

Functions

compile_recipe(recipe, action_specs, *[, config])

Compile a recipe into a GitHub Actions workflow dict.

describe_cycle_edges(cycle, edges)

The data-flow reads that justify each consumer -> producer hop of cycle.

detect_cross_job_edges(graph, config)

Find data-flow edges between steps in different jobs.

Exceptions

CompilationError

Raised when compilation fails.

exception reci.compiler.CompilationError[source]

Bases: Exception

Raised when compilation fails.

reci.compiler.compile_recipe(recipe, action_specs, *, config=None)[source]

Compile a recipe into a GitHub Actions workflow dict.

Parameters:
  • recipe (Recipe) – Parsed recipe.

  • action_specs (dict[str, ActionSpec]) – Action specs keyed by ref string.

  • config (dict[str, Any] | None) – Flat config dict (optional). If non-empty, a setup job is injected, jobs depend on it, and config references are wired. Cross-job data-flow wiring happens either way.

Return type:

dict

reci.compiler.describe_cycle_edges(cycle, edges)[source]

The data-flow reads that justify each consumer -> producer hop of cycle.

Return type:

list[str]

reci.compiler.detect_cross_job_edges(graph, config)[source]

Find data-flow edges between steps in different jobs.

Public: the validation rules use the same detection as the compiler.

Return type:

list[CrossJobEdge]