Skip to content

inference

mode: subagent — runs after the SACC data vector and its covariance are assembled and reviewed.

What it does

Runs Firecrown + CosmoSIS inference on the session's SACC by filling a typed InferenceSpec — it does not hand-author any config. The loop:

  1. draft_inference_spec reads the SACC and writes a skeleton spec with the structure filled and the value choices left as TODO slots.
  2. The agent fills those slots via update_inference_spec (a deterministic deep-merge) — choosing priors, IA model, external likelihoods, sampler — guided by the cosmosis-standard-library skill.
  3. validate_inference_spec checks the spec against the schema and the SACC and promotes it to inference_spec.json.
  4. The human spec gate: the agent emits SPEC_READY: and stops; @cosmotron presents the parameterisation and waits for your approval (default-on — see below).
  5. On approval, compile_inference compiles the config and runs the deterministic dry-run gate; on a PASS verdict, run_inference launches the CosmoSIS chain as a background job, confirms it's alive, then pauses for convergence rather than blocking the session.

Tools-only, never writes Firecrown/CosmoSIS config text by hand. The model picks the choices in the spec; the compiler owns all syntax (firecrown YAML, values.ini, pipeline.ini) — the same "model picks a choice, the tool owns the syntax" pattern used throughout. See Writing TASK.md for the ## inference priors: / ## inference sampler: / ## inference scale cuts: / ## inference gate: sections that seed the draft.

The spec gate is default-on. The run pauses for your approval of the spec before anything compiles or launches. Add ## inference gate: skip (or set the session-wide skip_gates) to proceed unattended — validation and the dry-run still run, and a dry-run FAIL still stops the run. The legacy text-driven build_cosmosis_inference / run_inference path still works but is superseded by the spec path.

Remote chains. run_inference runs the CosmoSIS chain on a cluster when the session pins inference remote (a ## remote: block or site:path data) — the agent's submit → confirm-alive → summarise flow is identical; the job just runs over Slurm. See Remote execution.