gaia build
Create and validate a knowledge package.
gaia build init <name> Scaffold a new <name>-gaia package
gaia build compile [path] Lower DSL into .gaia/ir.json + manifests
gaia build check [path] Validate structure, priors, and warrants
| Verb | Purpose |
|---|---|
init |
Scaffold a new package with pyproject.toml, src/<import_name>/, and starter DSL |
compile |
Execute the DSL declarations, lower to LocalCanonicalGraph, write IR + manifests + hash |
check |
Validate pyproject.toml, IR hash, schema, naming, priors, warrants, and quality gate |
The historical flat build verbs moved under this group
(gaia compile <path> → gaia build compile <path>). See
CLI Commands for workflow examples and
use gaia build <verb> --help for the executable option surface.
Implementation
gaia.cli.commands.init
gaia init -- scaffold a new Gaia knowledge package.
init_command
init_command(name: str = typer.Argument(help="Package name (must end with '-gaia')."), docstring: str | None = typer.Option(None, '--docstring', help='Module docstring for the generated src/<import_name>/__init__.py. Wrapped in triple quotes at line 1. Default: no docstring.')) -> None
Create a new Gaia knowledge package.
Example: gaia build init mypkg-gaia --docstring "My package."
Source code in gaia/cli/commands/init.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
gaia.cli.commands.compile
gaia build compile -- compile Python DSL package to Gaia IR v2 JSON.
compile_command
compile_command(path: str = typer.Argument('.', help='Path to knowledge package directory')) -> None
Compile a knowledge package to .gaia/ir.json.
Loads the package's Python DSL, applies any sidecar priors (priors.py),
lowers it into the canonical IR v2 JSON, runs the IR validator, and
writes .gaia/ir.json + .gaia/ir_hash + .gaia/compile_metadata.json.
Downstream verbs (gaia run infer, gaia run render, gaia inspect
starmap, gaia pkg register) all require fresh compile artifacts.
Example:
.. code-block:: bash
gaia build compile .
Source code in gaia/cli/commands/compile.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
gaia.cli.commands.check
gaia build check -- validate a Gaia knowledge package.
check_command
check_command(path: str = typer.Argument('.', help='Path to knowledge package directory'), brief: bool = typer.Option(False, '--brief', '-b', help='Show per-module warrant brief after check'), show: str | None = typer.Option(None, '--show', '-s', help='Expand detail for a module name or claim/strategy label (implies --brief)'), hole: bool = typer.Option(False, '--hole', help='Show detailed prior review report for all independent claims'), warrants: bool = typer.Option(False, '--warrants', help='Show v6 ReviewManifest warrants with audit questions'), blind: bool = typer.Option(False, '--blind', help='With --warrants, omit status values and prior diagnostics'), inquiry: bool = typer.Option(False, '--inquiry', help='Show goal-oriented reasoning progress and review status'), gate: bool = typer.Option(False, '--gate', help='Run quality gate checks and exit non-zero on failure'), refs: bool = typer.Option(False, '--refs', help='Show reference/citation/artifact diagnostics for this package.')) -> None
Validate structure and artifact consistency for a Gaia knowledge package.
Compiles the package in-memory, validates the resulting IR (including
Bayes coherence: dangling predictions, unobserved targets, prior
coherence), checks that any stored .gaia/ir.json is fresh, and
classifies every claim into a role bucket (independent / derived /
structural / background / scaffolded / orphaned). Exits non-zero on
any error diagnostic. After gaia author <verb> cycles, this is
the natural quality probe before gaia build compile.
Common option combinations:
--brief/--show <label>— per-module warrant brief or expand a single claim/strategy--hole— list independent claims with no external prior--warrants/--blind— show v6 ReviewManifest warrants (use--blindto hide statuses for self-review)--inquiry— render goal-oriented inquiry trees--gate— applytool.gaia.qualitythresholds, exit non-zero on failure (CI-friendly)--refs— show citation/local-reference/artifact diagnostics
Example:
.. code-block:: bash
gaia build check .
gaia build check . --hole
gaia build check . --refs
gaia build check . --gate
Source code in gaia/cli/commands/check.py
1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 | |