Nomos Developer Documentation
NOMOS v4.0 / APACHE 2.0 OPEN-CORE / STATIC GO BINARY

Nomos Developer Documentation

Nomos is a compiled Go governance harness that sits between any coding agent and your Git repository. It enforces read-only trunk protection, transient task worktrees, 42 sub-400ms AST Definition of Done gates, and local SQLite + Git Notes provenance without requiring IDE plugins or cloud egress.

INSTALL BINARY (LINUX / MACOS / WSL2)
$ curl -fsSL https://sophialabs.ca/install | sh
<400ms 42-Gate AST Verification Read-Only Protected Trunk Local SQLite + Git Notes Receipts Zero IDE Plugins or Egress
SYSTEM TOPOLOGY · CLOSED-LOOP LIFECYCLE

End-to-End Repository Governance Blueprint

Every task executes across five deterministic boundaries: read-only trunk protection, SQLite CapBAC lease allocation, isolated Git worktree sandboxing, 42 sub-400ms AST quality gates, and atomic 2PC fast-forward sync.

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 test assertions, or compounding multi-turn regressions in shared working trees.

EXECUTION WORKFLOW

Provision an isolated task worktree -> pair-program in Claude Code, Cursor, Antigravity, or OpenCode -> verify 42 AST gates -> atomic 2PC release.

Read 3-Pass CLI Guide ->
CLI REFERENCE SEQUENCE (CLICK TO COPY)
02 · LIFECYCLE STATE MACHINE

Six-Phase Task Execution Reference

Workspace mutability is procedurally locked across six deterministic phases from task lease to atomic 2PC release.

PHASE TRANSITION: IDLE -> PLAN
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

Locks main read-only via self-healing Git defense hooks and provisions an isolated worktree (worktrees/repo-SUB-42) with a scoped CapBAC lease.

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). AntiShimGate inspects compiled AST return paths to block placeholder implementations.

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

Agent-Agnostic CLI & Pipeline Configuration

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.

Replaces sprawling markdown rulebooks with deterministic Git hooks, scoped CapBAC leases, and concise AST error diagnostics.

curl -fsSL https://sophialabs.ca/install | sh
cd your-repo && nomos init && nomos handshake
# Run Claude Code normally; Nomos enforces worktree isolation and AST gates underneath
05 · SPECIFICATIONS & ARCHITECTURE INDEX

Core Reference Documentation

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

Sophia AI · Live Architecture Chat (RTX 4080)