MOSES Constitutional Governance Framework
Sovereign governance for AI agents — modes, postures, roles, SHA-256 audit chain, commitment conservation, lineage custody, and enterprise hardening.
© 2026 Ello Cello LLC. All rights reserved. Patent Pending: Serial No. 63/877,177
Overview
MOSES (Modular Open System for Executive Sovereignty) is a constitutional governance framework for AI agents. It provides real-time execution-path enforcement through blocking constitutional gates, cryptographic provenance, and semantic commitment conservation.
Three Interfaces, One Core
# Library
from commitgov import governed_step, GovernanceState, AuditLedger
# CLI
python -m commitgov.cli status
python -m commitgov.cli run-task "deploy app" "read config|build|deploy"
# MCP Server
python server.py # FastMCP stdio — 40 tools
Architecture
Core Library (Phase 1-3A)
| Module | Purpose | Tests |
|---|---|---|
engine.py |
Modes, postures, roles, GovernanceState, action checking | 80 |
audit.py |
SHA-256 chained audit ledger with Isnad provenance | 32 |
commitment.py |
Commitment kernel extraction, Jaccard similarity, ghost tokens | 44 |
lineage.py |
3-layer custody chain, archival chain, instance hash | 31 |
loop.py |
6-gate ReAct loop, resilience monitoring | 19 |
signing.py |
Governance-gated HMAC signing (no bypass path) | 23 |
witness.py |
Moltbook external witness (blind envelopes) | 14 |
oracle.py |
Grok API external verification (fail-safe) | 11 |
swarm.py |
Primary→Secondary→Observer coordination | 16 |
meta.py |
Constitution amendments, rollback, proposals | 18 |
review.py |
Adversarial blind peer review + external referee | 10 |
model_swap.py |
Cross-model kernel comparison | 10 |
presence.py |
Nonce challenge/response liveness | 11 |
handshake.py |
Inter-agent envelope pack/unpack/verify | 11 |
progress.py |
Task tracking + recovery flags | 10 |
patterns.py |
Ghost pattern registry + fingerprinting | 14 |
Enterprise Modules (Phase 3B — 21 Grok Upgrades)
| Module | Component | Dependencies |
|---|---|---|
otel_tracing.py |
OTel Auto-Tracing | opentelemetry-sdk (optional) |
sinks.py |
Salesforce + Splunk + ConstitutionalCognitiveSink | requests (optional) |
envelope.py |
MissionEnvelope YAML | PyYAML (optional) |
gates.py |
ScriptedGates declarative checks | — |
obo.py |
OBO Claims (OAuth2 token exchange) | requests (optional) |
policy_bundle.py |
PII guard, rate limit, approval workflow | — |
flame_gateway.py |
DynamicFlameGateway (adaptive posture) | — |
trace.py |
SelfPayingConstitutionalTrace (Atomic Game Changer #1) | — |
royalty.py |
RoyaltyObligation webhook | requests (optional) |
omni_gateway.py |
IntentConservingOmniGateway (Atomic Game Changer #2) | — |
control_plane.py |
SovereignControlPlane | — |
passport.py |
ConstitutionalCognitivePassport | — |
playback.py |
ProvenanceAwareSessionPlayback | — |
config.py |
Enterprise YAML config | PyYAML (optional) |
MCP Server (Phase 4)
40 tools exposed via FastMCP:
- Governance (6): set_mode, set_posture, set_role, check_action, get_status, assemble_context
- Vault (3): load, list, clear
- Audit (4): log, verify, recent, hash_session
- Commitment (2): check_commitment, check_ghost_tokens
- Lineage (2): verify, get_status
- Loop (2): run_step, run_task
- Signing (1): sign
- Witness (1): witness_event
- Oracle (1): oracle_verify
- Swarm (1): run_swarm_round
- Review (1): adversarial_review
- Model Swap (1): model_swap_test
- Presence (1): presence_challenge
- Handshake (1): handshake
- Progress (1): get_progress
- Meta (6): list_amendments, propose, ratify, rollback, constitution_status, list_modes
- Enterprise (5): load_envelope, check_gates, get_playback, emit_passport, control_plane
- Resilience (1): resilience_report
CLI (Phase 5)
22 commands wrapping the core library for terminal usage.
Installation
# No external dependencies required (stdlib only)
pip install -e .
# Optional dependencies for enterprise features
pip install requests pyyaml opentelemetry-sdk
Quick Start
from commitgov import GovernanceState, governed_step, AuditLedger
# Set up governance
gs = GovernanceState(mode="High Security", posture="DEFENSE", role="Primary")
# Run a governed step through the 6-gate ReAct loop
result = governed_step(
task="deploy application",
action="write config file",
step_num=1,
total_steps=3,
governance=gs,
ledger_path="audit.jsonl",
lineage_path="lineage.json",
progress_path="progress.json",
)
print(f"Success: {result.success}")
print(f"Reason: {result.reason}")
Testing
# Run all 469 tests
python -m pytest tests/ -q
# Run specific module tests
python -m pytest tests/test_engine.py -q
# Run stress tests
python -m pytest tests/test_stress.py -q
Key Concepts
Six Fold Flame
Every action must pass all six constitutional gates before execution:
- Sovereignty — Traceable to a registered agent
- Compression — Substantive, high-signal (no filler)
- Purpose — Serves a constitutional function
- Modularity — Compatible with existing structure
- Verifiability — Outcome can be tested/verified
- Reciprocal Resonance — Produces value when mirrored
Conservation Law of Commitment
C(T(S)) ≈ C(S) — commitment is conserved under transformation. The Jaccard similarity between commitment kernels before and after transformation must stay above threshold.
Ghost Tokens
When commitment tokens leak, the pattern of leaked tokens is fingerprinted. If two agents produce the same fingerprint, it's a structural flaw, not extraction variance.
6-Gate ReAct Loop
- Lineage verify (anchor chain)
- Status load (governance state)
- Ghost token gate (cascade risk)
- Posture gate (SCOUT blocks, DEFENSE requires confirm, OFFENSE permits)
- Audit log (with Isnad)
- Progress write (continuity across context windows)
License
© 2026 Ello Cello LLC. All rights reserved. Patent Pending: Serial No. 63/877,177
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file commitgov-1.0.0.tar.gz.
File metadata
- Download URL: commitgov-1.0.0.tar.gz
- Upload date:
- Size: 83.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a525cf2722547dda43953ba30d56f18b3c9f753aaf3a9edf2ed21bcd5ad9c337
|
|
| MD5 |
1d91332e9be0780a8f0ea4990d5d95dd
|
|
| BLAKE2b-256 |
141a1ed23ecd9fb031eb9482e77f2ccfd848906a9f68747eae97c73d14d266bf
|
Provenance
The following attestation bundles were made for commitgov-1.0.0.tar.gz:
Publisher:
publish.yml on SunrisesIllNeverSee/commitgov
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
commitgov-1.0.0.tar.gz -
Subject digest:
a525cf2722547dda43953ba30d56f18b3c9f753aaf3a9edf2ed21bcd5ad9c337 - Sigstore transparency entry: 2757167503
- Sigstore integration time:
-
Permalink:
SunrisesIllNeverSee/commitgov@88d2a991d94b6ea098b5f75c767ae36c507d78c9 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/SunrisesIllNeverSee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88d2a991d94b6ea098b5f75c767ae36c507d78c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file commitgov-1.0.0-py3-none-any.whl.
File metadata
- Download URL: commitgov-1.0.0-py3-none-any.whl
- Upload date:
- Size: 69.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcefe7bc04091421e00260bd99a6e8ff2750a14b9625a1734a6cf77b2c0de111
|
|
| MD5 |
e724e9fe00f452b196b0670321588ee7
|
|
| BLAKE2b-256 |
f109cf5fac8c19166d82516dc1bf1faac593076303ed093be0bb080854a7e226
|
Provenance
The following attestation bundles were made for commitgov-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on SunrisesIllNeverSee/commitgov
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
commitgov-1.0.0-py3-none-any.whl -
Subject digest:
bcefe7bc04091421e00260bd99a6e8ff2750a14b9625a1734a6cf77b2c0de111 - Sigstore transparency entry: 2757167538
- Sigstore integration time:
-
Permalink:
SunrisesIllNeverSee/commitgov@88d2a991d94b6ea098b5f75c767ae36c507d78c9 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/SunrisesIllNeverSee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@88d2a991d94b6ea098b5f75c767ae36c507d78c9 -
Trigger Event:
push
-
Statement type: