Nomos Developer Documentation
NOMOS v4.20.1 / APACHE 2.0 OPEN-CORE / POLYGLOT SINGLE BINARY (~20 MB, CGO_ENABLED=0)

Nomos Developer Documentation

Nomos is the deterministic execution substrate between any coding agent and your Git repository. Audit any legacy codebase read-only in 5 seconds with nomos xray ., freeze Day-0 debt via nomos init --baseline, keep prompting Claude Code, Cursor, Antigravity, OpenCode, or Gemini CLI in plain English, and let Nomos physically block deleted test assertions, hollow stubs, host credential reads (~/.ssh, ~/.aws), and direct main commits across TypeScript, Python, Rust, Go, C/C++, Java, Kotlin, Ruby, and C#.

QUICKSTART · LINUX / MACOS / WSL2 · SHA-256 VERIFIED
1 curl -fsSL https://sophialabs.ca/install | bash
2 cd your-project && nomos xray . && nomos init --baseline
3

Prompt your coding agent in plain English - SessionStart hooks, hermetic worktrees, 42 polyglot AST gates, and 2PC sync run automatically.

Audits read-only via nomos xray . and Scaffolds repo-local nomos.yaml, nomos.baseline.json, AGENTS.md (@AGENTS.md in CLAUDE.md), native .claude · .cursor · .gemini · .opencode · .agents hooks, and Git pre-commit/pre-push locks. Zero background daemons.

VERIFY FOOTPRINT Inspect nomos xray ., nomos init --baseline & nomos verify output
1. DAY-0 X-RAY & BASELINE (NOMOS XRAY / INIT) ~412ms · 0 upfront fixes
$ nomos xray .
AI Hangover Score : 34/100 Grade C (312 files · 412ms · 0 writes)
$ nomos init --baseline
[ok] nomos.yaml + nomos.baseline.json  # Day-0 debt envelope frozen
[ok] AGENTS.md + CLAUDE.md + .claude .cursor .gemini .agents .opencode
[ok] .git/hooks/pre-commit             # Read-only main + diff ratchet
2. DETERMINISTIC PROOF (NOMOS VERIFY) EXIT 0 · 42/42 GATES
$ nomos verify
Law 1: Dual-Core Inversion    [3/3 Cells]  PASS  (Governance & Control)
Law 2: Non-Verbal Proof       [3/3 Cells]  PASS  (AST, Coverage & Shims)
Law 3: Hermetic Worktree      [3/3 Cells]  PASS  (Read-Only Trunk Lock)
Law 4: Single Source of Truth [3/3 Cells]  PASS  (Schema & SSoT Parity)
Law 5: Zero-Hardcoded-Path    [3/3 Cells]  PASS  (Host & Path Hygiene)
Law 6: Canonical Singularity  [3/3 Cells]  PASS  (Zero Aliases/Symlinks)
Law 7: Fail-Closed Pre-Flight [3/3 Cells]  PASS  (CapBAC & Airlocks)
Exit 0 · 42/42 deterministic gates satisfied
42 AST Gates 11 Languages + Day-0 X-Ray
Read-Only Trunk Isolated Task Worktrees
Host Airlock ~/.ssh & ~/.aws Shield
Zero Daemons Local SQLite + Git Notes
01 · OPERATOR WORKFLOWS

Integration by Engineering Role

How individual contributors, technical leads, CI pipelines, and security teams interface with the Nomos binary.

FAILURE CLASS PREVENTED

Prevents coding agents from mutating trunk directly, deleting failing test assertions, reading host credentials, or compounding regressions in shared working trees.

EXECUTION WORKFLOW

Audit read-only in 5s with nomos xray ., lock Day-0 debt via nomos init --baseline, then prompt Claude Code, Cursor, Antigravity, OpenCode, or Gemini CLI in plain English - zero per-task CLI ceremony required.

Read Invisible Harness Guide →
DAILY AGENT INPUT (ZERO CLI CEREMONY)
> "Add TTL cache eviction to Store with unit tests"
OPTIONAL READ-ONLY INSPECTION & UPDATES
02 · LIFECYCLE STATE MACHINE

Six-Phase Autonomous Execution (Under the Hood)

You do not run these phase transitions manually. After nomos init, ambient hooks and your coding agent execute all six stages underneath your plain-English prompt.

PHASE TRANSITION: IDLE -> EDIT
UNBOUNDED WORKSPACE RISK

Agent mutates files directly on main or a shared branch without isolation, leaving uncommitted work exposed to destructive overwrites.

NOMOS ENFORCED INVARIANT

SessionStart hook verifies CapBAC state and recalls mneme.db pitfalls (~4ms); agent provisions an isolated worktree (worktrees/repo-SUB-1) while main stays read-only.

03 · AST GATE DIAGNOSTICS

Deterministic Pre-Merge Failure Modes

Representative agent shortcuts intercepted locally by compiled Go AST and CapBAC gates prior to merge.

LAW 2 · NON-VERBAL PROOF EVALUATED IN 19ms
CANDIDATE MUTATION IN WORKTREE
func ValidateInvoiceSignature(payload []byte) error {
-   return crypto.VerifyPSS(pubKey, payload)
+   // TODO: wire key rotation later
+   return nil
}
AntiShimGate (AST Return-Path Inspector) FAIL-CLOSED · EXIT 1
COMPILER DIAGNOSTIC OUTPUT
[FAIL] ERR_TRIVIAL_PASS_SHIM (billing/verify.go:42)
  -> Function ValidateInvoiceSignature returns constant literal 'nil' with 0 verification statements.
  -> Remedy: Implement concrete signature verification before transitioning to REVIEW.

Coding agents frequently satisfy callers by returning constant literals (nil, true, empty structs) or Python/Rust todo!() shims. AntiShimGate inspects AST return paths to block placeholder code.

Read Non-Verbal Proof & AST Invariants →
04 · AGENT & CI INTEGRATION

Agent-Agnostic Indirect Control & CI Pipelines

Nomos governs the repository at the Git hook, worktree, and compiler AST boundary, so teams can switch coding agents or models without rewriting enforcement rules.

nomos init scaffolds CLAUDE.md (@AGENTS.md SSoT import pointer), native .claude/settings.json hooks (SessionStart, PreToolUse, PostToolUse, Stop), and Git pre-commit/pre-push locks.

curl -fsSL https://sophialabs.ca/install | bash
cd your-project && nomos xray . && nomos init --baseline
# Open Claude Code and prompt in plain English:
# > "Add idempotent retry backoff to webhook dispatcher with unit tests"
05 · SPECIFICATIONS & ARCHITECTURE INDEX

Core Reference Documentation

Deep-dive specifications, formal invariants, and structural codebase telemetry.

Ask Sophia Docs & Specs Sophia AI · Grounded Nomos Architecture & Docs Concierge