mix ex4pm.ggen.sync (ex4pm v26.9.9)

Copy Markdown View Source

Runs every ggen_igniter generation unit declared in a manifest, then verifies the result -- replacing the bespoke per-consumer bash scripts (scripts/standing_coded_sync.sh) with one shared, general Mix task.

Real, confirmed motivation (ERRC cluster c8, 2026-09-09 deep-search workflow): scripts/standing_coded_sync.sh hand-rolls "mix deps.get; N x mix ggen_igniter.sync calls; mix compile --warnings-as-errors; mix test" for exactly one consumer (Ex4pm.Standing.Coded); beam4pm's scripts/gate_m2_check.sh independently hand-rolls a much larger, documented-buggy version of the same idea. Neither has a real, general, in-BEAM Mix task. This is that task.

Usage

mix ex4pm.ggen.sync
mix ex4pm.ggen.sync --manifest priv/ggen/manifest.json
mix ex4pm.ggen.sync --unit standing_coded

Manifest shape

A JSON array of generation units:

[
  {
    "name": "standing_coded",
    "ontology": "priv/ontology/ex4pm.ttl",
    "query_bindings": {"admitted": "priv/ggen/queries/admitted_standing_codes.rq"},
    "template": "priv/ggen/templates/standing_coded.ex.eex",
    "out": "lib/ex4pm/standing_coded.ex",
    "test_path": null
  }
]

Each unit is passed to mix ggen_igniter.sync as:

mix ggen_igniter.sync --ontology <ontology> \
  --query <k>=<v> [--query <k>=<v> ...] \
  --template <template> --out <out>

Failure semantics

A failed unit aborts the whole run immediately via Mix.raise/1, naming the exact unit that failed -- no partial, silently-incomplete run. This mirrors GgenIgniter.SyncShellout's own real/error tuple discipline rather than swallowing a non-zero exit.

After every unit succeeds, this task runs mix compile --warnings-as-errors once, then mix test scoped to the union of every unit's non-nil test_path (or a bare mix test with no test_path filter if no unit declares one).