omnistate
You can use this server to run OmniState-governed code-change transactions with audit, anti-tamper, and commit-clearance guardrails.
Initialize OmniState governance/config and pre-commit hook in a workspace.
Begin a transaction by declaring intent, scope, non-goals, original prompt, and risk tier.
Record progress milestones and details during the transaction.
Audit modified files against scope, anti-laziness gates, and tests, optionally specifying files and whether to run tests.
Finish with notes/evidence, verify anti-tamper fingerprints, archive a snapshot, and issue commit clearance.
Abort an active transaction and optionally roll back scoped uncommitted changes.
Check current status, active transaction details, git HEAD, and clearance state.
Inspect the working-tree diff for anti-laziness/scope issues without altering state.
Explain OMNISTATE lifecycle rules and guardrails for AI coding assistants.
Installs a Git pre-commit hook and enforces commit clearance tokens, blocking commits or pushes unless the changes have been audited and cleared by OMNISTATE.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@omnistate begin a transaction scoped to src/auth.py, then audit and finish it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ OMNISTATE
Planning before implementation
Prompted transactions must record the original requirement in a memo, decompose it into checklist items and dependency-aware subtasks, and attach evidence before audit/finish. Use memo, checklist, and subtask after begin; the planning gate rejects unfinished or unlinked work. After the first plan is complete, use plan-review to activate an independent subagent that checks alignment with the user request, omissions, conflicts, and better approaches. Audit requires the review to be APPROVED or RESOLVED.
Universal State Governance, Transaction Guardrails & Anti-Bypass Framework for AI Agents, MCP & CLI
Zero Context Loss โข Scope Enclosure โข Anti-Laziness Diff Defense โข Git Pre-commit Warden
Related MCP server: Harness Engineering MCP
๐ฏ The Problem
When Large Language Models (LLMs) and autonomous AI coding agents (Claude, Cursor, Copilot, ChatGPT, Cline, Antigravity) develop software, they inevitably run into four critical failure modes:
Context Loss & Amnesia Across Sessions: When a chat restarts or compacts, the AI forgets what was changed, what decisions were made, or what step it was on.
Scope Creep & Accidental Regression: The AI modifies files far outside its intended scope, breaking unrelated features or deleting essential comments and functions.
Lazy AI Placeholders: The AI generates truncated code snippets such as
// ... rest of implementation unchanged,# TODO: implement this, or silently deletes production logic.Unverified Commits: The AI hallucinates that "all tests pass" and commits directly to git without empirical proof or verified evidence.
OMNISTATE solves this by bringing deterministic ACID transaction semantics, multi-gate automated auditing, and a tamper-proof Git Warden to any software project.
๐๏ธ Architecture & Transaction Lifecycle
flowchart TD
subgraph Human_or_AI ["AI Agent or Developer"]
Init["omnistate init<br>(Mounts pre-commit hook)"] --> Begin
Begin["omnistate begin<br>(Declare Intent & Scope)"]
Begin --> Step["omnistate step<br>(Record Milestones)"]
Step --> CodeEdit["Perform Code Edits"]
CodeEdit --> Audit["omnistate audit<br>(Deterministic Gates)"]
end
subgraph Gates ["Quality & Security Gates"]
Audit --> G1["Gate 1: Scope Enclosure Check"]
Audit --> G2["Gate 2: Anti-Laziness Critic (Diff Scan)"]
Audit --> G3["Gate 3: Anti-Bloat Ratio Check"]
Audit --> G4["Gate 4: Automated Test Runner"]
Audit --> G5["Gate 5: Empirical Evidence Verification"]
end
subgraph State_Engine ["OMNISTATE Engine"]
G1 & G2 & G3 & G4 & G5 -->|All Passed| AuditPassed["Status: AUDITED<br>(Freezes SHA-256 Fingerprints)"]
AuditPassed --> Finish["omnistate finish"]
Finish --> TamperCheck{"Anti-Tamper Check:<br>Files changed since audit?"}
TamperCheck -->|No| Clearance["Issue Commit Clearance Token<br>OMNI_CLEAR_XXXXXXXX<br>Archive rev_XXXX.json"]
TamperCheck -->|Yes| TamperFail["๐จ Tamper Violation<br>Require Re-Audit"]
end
subgraph Git_Warden ["Git Pre-Commit Warden Hook"]
Clearance --> GitCommit["git commit -m '...'"]
GitCommit --> PreCommitHook[".git/hooks/pre-commit"]
PreCommitHook --> WardenScan{"Warden Verification:<br>1. Active session completed?<br>2. Valid clearance token?<br>3. Staged hashes == Audited hashes?"}
WardenScan -->|Yes| CommitAllowed["โ
Commit Permitted"]
WardenScan -->|No| CommitBlocked["โ COMMIT BLOCKED"]
endโจ Key Features
๐ก๏ธ ACID Transactions for AI Edits:
begin$\rightarrow$step$\rightarrow$audit$\rightarrow$finish$\rightarrow$commit.๐ Dual-Mode Adapters:
CLI Mode: Full-featured terminal interface with rich dashboards.
MCP Server Mode (Model Context Protocol): Exposes state tools directly to Claude Desktop, Cursor, Antigravity, OpenCode, Windsurf, and any MCP client over stdio.
๐ Anti-Tamper & Anti-Laziness Guardrail:
Scans unified diffs for lazy ellipsis comments (
// ...,# TODO: implement).Cryptographically locks audited files via SHA-256. Any modification made after audit invalidates the clearance token.
๐ฎ Git Warden Pre-Commit Hook:
Blocks any
git commitorgit pushif code was not properly audited and cleared by OMNISTATE.
๐ฆ Zero External Dependencies:
Pure Python standard library (compatible with Python 3.8+). No heavy dependencies, no version conflicts.
๐ Immutable History Snapshots:
Automatically records full state history in
.omnistate/snapshots/rev_0001.jsonwith revision deltas.
๐ Quick Start
1. Installation
git clone https://github.com/cwen0224/omnistate.git
cd omnistate
pip install -e .Or install directly via pip (once published):
pip install omnistate2. Initialize in Your Project
In any git repository:
cd /path/to/your/project
omnistate initThis will:
Create the
.omnistate/directory withomnistate.jsonconfiguration.Install the automated
pre-commithook in.git/hooks/pre-commit.
๐ค Using with AI via MCP (Model Context Protocol)
OMNISTATE includes a built-in, zero-dependency MCP server that enables AI models to govern their own changes safely.
Claude Desktop Configuration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"omnistate": {
"command": "omnistate-mcp",
"args": ["--workspace", "/path/to/your/project"]
}
}
}Cursor / Windsurf / Antigravity / OpenCode Configuration
Add to your project's MCP settings:
{
"name": "omnistate",
"command": "python",
"args": ["-m", "omnistate.mcp", "--workspace", "."]
}Tools Exposed to the AI
MCP Tool Name | Description |
| Initialize state governance and pre-commit hook in workspace |
| Start a transactional state change with declared intent and scope boundaries |
| Record an incremental milestone or progress step |
| Deterministically verify modified code against scope, anti-laziness, and test gates |
| Verify anti-tamper fingerprints, archive immutable snapshot, and issue commit clearance |
| Abort active transaction and optionally roll back uncommitted changes |
| Return active transaction status, git state, and clearance token |
| Scan working tree diff for anti-laziness violations |
| Return state governance and guardrail rules for the AI context |
๐ป CLI Usage Guide
1. Begin a Task
omnistate begin --intent "Implement OAuth login" --scope "auth/,tests/" --risk standard2. Record Progress
omnistate step --action "Implemented JWT token parser" --details "Added unit test in test_auth.py"3. Check Governance Dashboard
omnistate statusOutput:
==================================================================
๐ OMNISTATE STATE GOVERNANCE DASHBOARD (v1.0.0)
==================================================================
Project Root : /home/dev/my-project
State Directory : /home/dev/my-project/.omnistate
Current Revision : #0012
Git HEAD Commit : a4b91ef201
------------------------------------------------------------------
Transaction ID : sess_3f1a92b810de
Transaction State: ๐ก [ IN_PROGRESS ]
Intent Summary : Implement OAuth login
Scope Boundary : ['auth/', 'tests/']
Risk Tier : STANDARD
Steps Recorded : 3
Audit Status : โณ PENDING (Run 'omnistate audit' when edits complete)
------------------------------------------------------------------
Working Tree Mod : 2 files modified
โข auth/oauth.py
โข tests/test_oauth.py
==================================================================4. Audit Modifications
omnistate auditOutput:
================ OMNISTATE AUDIT RESULTS ================
โ
PASS | ScopeEnclosureGate
โ
PASS | AntiLazinessCritic
โ
PASS | AntiBloatCritic
โ
PASS | TestRunnerGate
=========================================================
๐ All quality gates PASSED! Ready to execute 'omnistate finish'.5. Finalize & Unlock Git Commit
omnistate finish --evidence "tests/report.txt" --note "All tests green"Output:
๐ [OMNISTATE] Transaction COMPLETED: sess_3f1a92b810de
๐ก๏ธ Commit Clearance Token: OMNI_CLEAR_8A90F1BC24D7A19E
๐ฆ Archived Revision : #0013
๐ You are now cleared to commit your changes with git!6. Commit to Git
git commit -m "feat(auth): implement OAuth login"
# Output:
# ๐ก๏ธ [OMNISTATE WARDEN PASSED] Clearance Token verified: OMNI_CLEAR_8A90F1BC24D7A19Eโ๏ธ Configuration (omnistate.json)
Created automatically inside .omnistate/omnistate.json:
{
"state_dir": ".omnistate",
"ignored_paths": [
".git",
".venv",
"node_modules",
"__pycache__",
"dist",
"build"
],
"gates": {
"scope_enforcement": true,
"anti_laziness": true,
"anti_bloat": true,
"max_file_growth_ratio": 2.0,
"max_line_growth": 600,
"test_command": "pytest -q",
"evidence_required": false
},
"warden": {
"enforce_pre_commit": true,
"block_unclear_commits": true
}
}๐ Python SDK API
You can also embed OMNISTATE directly into your Python scripts or custom agent loops:
from pathlib import Path
from omnistate import OmniStateCoordinator
coord = OmniStateCoordinator(Path("."))
# 1. Begin
session = coord.begin(
intent_summary="Refactor database models",
scope_paths=["models/", "migrations/"],
risk_tier="standard"
)
# 2. Record step
coord.record_step("Generated Alembic migration")
# 3. Audit
passed, gate_results = coord.audit(run_tests=True)
if passed:
# 4. Finish
finished_session = coord.finish(note="Migrations verified")
print("Clearance Token:", finished_session.commit_clearance)
else:
print("Audit failed! Gate errors:", [g.errors for g in gate_results if not g.passed])๐งช Running Tests
python -m unittest discover -s tests๐ License
MIT License. Copyright (c) 2026 cwen0224.
Available Tools
9 toolsomnistate_abortB
Abort active transaction and optionally roll back uncommitted changes in scope.
Inputs: note, rollback.
omnistate_auditB
Audit current modifications against scope boundaries, anti-laziness gates, and test suites.
Inputs: files, run_tests.
omnistate_beginB
Begin a safe, transactional state change. Declares intent, scope boundaries, and risk tier.
Inputs: intent (required), scope, prompt, non_goals, +1 more.
omnistate_explain_rulesA
Explain the OMNISTATE transaction lifecycle rules and guardrails for AI coding assistants.
Inputs: no named parameters.
omnistate_finishA
Finalize transaction, verify anti-tamper fingerprints, archive immutable snapshot, and issue commit clearance.
Inputs: note, evidence.
omnistate_initC
Initialize OMNISTATE state governance and pre-commit guardrail in the current workspace.
Inputs: overwrite.
omnistate_inspect_diffB
Run anti-laziness and scope inspection on the working tree diff without altering state.
Inputs: no named parameters.
omnistate_statusA
Get current OMNISTATE status, active transaction details, git head, and commit clearance state.
Inputs: no named parameters.
omnistate_stepA
Record an intermediate progress milestone or action within the active transaction.
Inputs: action (required), details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 9 tools
Tools map cleanly to a transaction lifecycle (init, begin, step, audit, finish, abort) with status and inspect_diff as read-only helpers. The main possible confusion is audit vs inspect_diff, both involving scope/anti-laziness checks, and init vs begin, but descriptions distinguish state-changing versus read-only and setup versus transaction start.
All tools share the omnistate_ prefix and snake_case formatting, making the set highly predictable. Minor deviations exist: status is a noun while most names are verbs, init is abbreviated, and step is less action-specific, but the convention remains readable.
Nine tools fit comfortably within the ideal 3-15 range for a transaction-governance server. Each tool corresponds to a distinct lifecycle stage or helper, with no obvious filler.
The surface covers setup, transaction start, progress recording, auditing, commit clearance, abort/rollback, status, diff inspection, and rule explanation. A minor gap is that archived immutable snapshots are created but no tool lists or retrieves transaction history or past snapshots.
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Contract-change authorization for AI agents: preflight a change to an API or MCP contract, get a signed decision, and verify the receipt offline. Only a granted change can proceed.
Related MCP Servers
- FlicenseAqualityBmaintenanceGovernance/control plane for MCP-enabled coding-agent workflows with validation, findings, approvals, budgets, and proof bundles.5511-
- AlicenseNot gradedqualityCmaintenanceEnables AI coding environments to enforce engineering governance through MCP tools and resources for init, check, route, and review workflows.18 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents and hosts to enforce deterministic repository boundaries via MCP, providing structured reads, supervised edits, snapshots, audits, and recovery with machine-readable evidence.MIT
- AlicenseBqualityBmaintenanceCommit-time audit engine for AI coding agents. Scans git diffs with 24 audit rules, writes HMAC-signed tamper-evident audit history, and ships MCP tools for governance aggregation.10455MIT