The Governance Layer ships a unified CLI runner (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xcoder-es/governance-layer/llms.txt
Use this file to discover all available pages before exploring further.
src.governance.runner) that executes all four experimental scenarios — GridWorld, TemptationBank, DriftLab, and DeadlockMaze — under any combination of strategies and seeds. A single command can produce a full benchmark matrix of 4 × 5 × 20 × 1,000 = 400 runs and automatically export the results to CSV, JSON, and publication-ready figures.
CLI Commands
The runner is invoked as a Python module. Every subcommand accepts--steps, --seeds, --strategies, and --csv.
CLI Flags
| Flag | Default | Description |
|---|---|---|
--steps N | 1000 | Steps executed per strategy–scenario run. Must be ≥ 1. |
--seeds N | 1 | Independent random seeds per strategy–scenario pair. Must be ≥ 1. |
--baselines | off | Includes all five baseline strategies alongside governance. |
--strategies a,b,… | all | Comma-separated subset of strategies (overrides --baselines). |
--csv [path] | off | Export step-level records to CSV. Defaults to results/run_<timestamp>.csv if no path is given. |
The Five Baseline Strategies
When--baselines is passed, each scenario is run under all five strategies in parallel (one fresh instance per seed). Each baseline replaces the full Speaker state machine with a simpler decision rule so the governance layer’s marginal contribution can be measured directly.
governance
Full Neural Parliament
SpeakerStateMachine. All proposals go through budget enforcement, priority ordering, weighted voting, safety vetoes, and identity checks.monolithic_rl
Selects the proposal with the highest
expected_reward metadata value. No safety filtering. Corresponds to a standard unconstrained RL policy.random
Uniformly samples one proposal at random. Seeded with the per-run seed so results are reproducible.
static_masking
Blocks a predefined set of actions, then selects the highest-reward proposal from those remaining. Initialised with an empty block-set in benchmarks, making it equivalent to
monolithic_rl.veto_only
Accepts the first proposal whose
risk metadata is below a fixed threshold (0.3). Provides lightweight safety without full deliberation.Workflow
Choose your scenarios and strategies
Run a single scenario (
gridworld, temptation, drift, deadlock) or all at once with all. Add --baselines to enable the full comparison matrix, or restrict to a subset with --strategies.Set step count and seed count
The defaults (1,000 steps, 1 seed) are suitable for a quick sanity check. For statistically rigorous results, use
--seeds 20, which runs each strategy–scenario pair from 20 independent initial conditions.Execute the runner
The runner creates one fresh scenario instance per (strategy, seed) combination, runs it for the specified number of steps, and collects an
ExperimentReport with reward, violations, deadlocks, vetoes, identity drift, and governance latency.Review the console output
Results are printed per scenario block. Each line shows strategy, seed, total steps, total reward, deadlock count, and constraint violations.
Scenarios at a Glance
The four scenarios stress-test different governance properties. See the Scenarios page for full parameter tables and per-strategy results.| Scenario | What it tests | CLI subcommand |
|---|---|---|
| GridWorld | Poison-fruit reward hacking; Safety Committee veto | gridworld |
| TemptationBank | Voluntary self-binding via Ulysses Contracts | temptation |
| DriftLab | Identity drift resistance under shifting reward signals | drift |
| DeadlockMaze | Deadlock breaker and cold-boot recovery | deadlock |
The governance strategy is fully algorithmic — no neural networks, no sampling. A fixed seed therefore produces bit-identical results across platforms. This determinism is the foundation of the reproducibility guarantees documented in Appendix D of the book.