gaia run
Execute inference and emit presentation outputs.
gaia run infer [path] Run belief propagation on the compiled graph
gaia run render [path] Generate docs / GitHub / Obsidian outputs
| Verb | Purpose |
|---|---|
infer |
Choose Junction Tree / TRW-BP / Mean Field VI based on graph size and treewidth; write .gaia/beliefs.json |
render |
Emit docs/, .github-output/, or gaia-wiki/ artifacts using compiled IR and (optionally) beliefs |
The historical flat run verbs moved under this group
(gaia infer --depth 1 <path> → gaia run infer --depth 1 <path>). See
CLI Commands for workflow examples and
use gaia run <verb> --help for the executable option surface.
Implementation
gaia.cli.commands.infer
gaia run infer -- run BP from compiled IR with metadata priors.
infer_command
infer_command(path: str = typer.Argument('.', help='Path to knowledge package directory'), depth: int = typer.Option(0, '--depth', help='Dependency depth for joint inference. 0=flat priors (default), 1=direct deps, -1=all transitive deps.')) -> None
Run BP inference on a compiled knowledge package.
Reads fresh .gaia/ir.json (run gaia build compile first),
lowers the IR into a factor graph, runs belief propagation, and
writes .gaia/beliefs.json. Priors come from claim metadata (set
by priors.py and reason+prior DSL pairing during
compilation). Review status is qualitative and never supplies
numeric priors; gaia run infer previews the compiled graph
without gating unreviewed warrants. Use gaia build check --gate
or gaia inquiry review for publish-quality review gating.
With --depth N (N>0), dependency packages' factor graphs are
merged for joint cross-package inference instead of using flat
prior injection from dep_beliefs/. --depth -1 merges all
transitive deps.
Example:
.. code-block:: bash
gaia build compile .
gaia run infer .
gaia run infer . --depth 1
Source code in gaia/cli/commands/infer.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
gaia.cli.commands.render
gaia run render command for package presentation outputs.
RenderTarget
Bases: StrEnum
Supported presentation targets for gaia run render.
render_command
render_command(path: str = typer.Argument('.', help='Path to knowledge package directory'), target: RenderTarget = _TARGET_OPTION) -> None
Render presentation outputs from a compiled package.
--target docs renders docs/detailed-reasoning.md from the compiled IR
alone; when gaia run infer has also been run, the output is enriched with
belief and prior values. --target github strictly requires inference
results and emits the .github-output/ README/wiki/data bundle.
--target obsidian writes gaia-wiki/ and enriches pages with beliefs
when fresh inference results are available.
--target all (default) always renders docs and adds github when
inference results are available, emitting a warning when they are not.
Compile freshness is required; beliefs freshness is required when
present. Typical pipeline: gaia build compile → gaia run infer
→ gaia run render.
Example:
.. code-block:: bash
gaia build compile .
gaia run infer .
gaia run render . --target all
gaia run render . --target obsidian
Source code in gaia/cli/commands/render.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |