Skip to main content

moai constitution Constitution

UPDATED 2026-08-13 2 min read EDIT ON GITHUB ↗

moai constitution queries and validates the zone registry (the codification of FROZEN/EVOLVABLE zones). It is a command tree that governs which parts of the rules are FROZEN and cannot be casually changed, and which parts are EVOLVABLE.

When a single SPEC flows through multiple manager agents and harness rules, accidentally touching a core invariant breaks the consistency of the entire system. So this command tags each rule with its zone and mechanically verifies whether the FROZEN area has drifted from the source files. Hanging moai constitution guard off the CI pipeline catches violations before merge, which is why it serves as the safety net during large-scale rule overhauls.

Subcommands

CommandDescription
moai constitution listList zone-registry entries
moai constitution guardCheck for FROZEN-zone violations (for CI integration)
moai constitution amendPropose a constitutional amendment that passes the 5-layer safety gate
moai constitution validateValidate zone-registry drift and invariants against the source files

moai constitution list

bash
moai constitution list
moai constitution list --zone frozen --format json
FlagDescription
--zone <frozen|evolvable>Zone filter
--file <path>File-path filter (partial match)
--format <table|json>Output format

moai constitution guard

bash
moai constitution guard --violations CONST-V3R2-001,CONST-V3R2-002

Takes a list of changed rule IDs and checks for FROZEN-zone violations. For CI integration.

FlagDescription
--violations <ids>List of changed rule IDs (comma-separated or repeated flag)

moai constitution amend

bash
moai constitution amend --rule CONST-V3R2-001 --before "..." --after "..." --evidence "..."

Must pass the FrozenGuard → Canary → ContradictionDetector → RateLimiter → HumanOversight 5-layer safety gate to be applied.

FlagDescription
--rule <id>Rule ID (CONST-V3R2-NNN) [required]
--before <text>Current clause text [required]
--after <text>New clause text [required]
--evidence <text>Amendment rationale (required for the Frozen zone)
--dry-runSimulate only, without modifying files

moai constitution validate

bash
moai constitution validate

Confirms that each registry entry’s clause exists in the source files, validates the zone_class enum and canary_gate invariants, and reports drift.

FlagDescription
--strictStrict mode (enforce all checks)
--fail-on-warningTreat warnings as errors (includes --strict)
--format <text|json>Output format

Exit codes: 0 = OK, 1 = drift/error, 2 = fatal (source file missing).