babylon.engine.headless_runner.runner
Core headless simulation runner — orchestrates Postgres + tick loop + artifacts.
Spec: 064-headless-sim-runner (T028-T035).
The runner is intentionally thin: it composes pre-existing pieces from
babylon.persistence (PostgresRuntime, initialize_session,
persist_tick_atomic) and emits the contracted artifact bundle. The
simulation math itself is whatever the configured engine step performs
on the persisted state — this MVP carries hex state forward unchanged
so the pipeline (hex hydration → tick loop → trace view → CSV) ships as
a single executable e2e contract. Future specs can plug richer
per-tick advancement in via the step_function seam (currently
private; exposed when needed).
Exit code semantics live in contracts/cli_contract.yaml. Stderr
formatting on non-zero exits follows the
ERROR <NAME>: <message> | partial_artifacts=<path-or-NONE> template.
Functions
|
Build config + dispatch + map exit code (T032). |
|
Execute the headless simulation per |
Exceptions
|
Spec-105: runtime liveness gate assertion failure. |
Base class for runner-side preflight errors. |
|
|
Spec-102 STEP 0: hex rows exist but county resolution yielded zero. |
- exception babylon.engine.headless_runner.runner.ConfigError[source]
Bases:
RunnerError
- exception babylon.engine.headless_runner.runner.PostgresUnreachableError[source]
Bases:
RunnerError
- exception babylon.engine.headless_runner.runner.ReferenceDataMissingError[source]
Bases:
RunnerError
- exception babylon.engine.headless_runner.runner.RunnerError[source]
Bases:
ExceptionBase class for runner-side preflight errors.
- babylon.engine.headless_runner.runner.build_parser()[source]
Construct the argparse parser for the headless runner CLI.
- Return type:
- Returns:
Fully configured parser mirroring
contracts/cli_contract.yaml.
- babylon.engine.headless_runner.runner.main_from_argv(args)[source]
Build config + dispatch + map exit code (T032).
Reads CLI args, dispatches to
run(), prints the artifact directory path on stdout for exit-0 runs, and emits the canonical error format on stderr for non-zero exits.
- babylon.engine.headless_runner.runner.run(config)[source]
Execute the headless simulation per
configand emit artifacts.- Return type:
- Returns:
SimulationRunResultdescribing the run outcome.- Parameters:
config (SimulationRunConfig)