nomos
Health Uyari
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Basarisiz
- rm -rf — Recursive force deletion command in install.sh
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Transactional Go runtime between any coding agent and Git: causal INT/SUB spec-vs-code DAGs, isolated git worktrees, 42 polyglot anti-shim AST checks, receipt-gated SQLite memory, and atomic 2PC releases.
Nomos (Νόμος)
Agents guess; Git cannot. The transactional governance harness between any coding agent and your repository.
AI coding agents optimize for making their prompt finish, even when that means taking shortcuts. Without a deterministic boundary, agents routinely introduce three silent failures into production repositories:
- Reward Hacking Tests: Deleting, skipping, or weakening failing assertions instead of fixing the root cause.
- Hollow Shims & Stubs: Leaving empty
// TODOstubs, mock returns, or dead unreferenced code to make a build compile. - Unbounded Workspace Drift: Mutating
maindirectly, polluting unrelated modules, or forgetting architectural context across sessions.
Just as PostgreSQL placed ACID transactions between concurrent applications and raw disk files, Nomos introduces a new infrastructure layer between your coding agent (Claude Code, Cursor, Antigravity, OpenCode, Windsurf, or Aider) and your Git repository - physically enforcing causal INT-*/SUB-* spec-vs-code DAGs, hermetic Git worktree sandboxes, 42 polyglot anti-reward-hacking AST quality gates (with trunk-pinned nomos.yaml), receipt-gated SQLite memory (mneme.db), and atomic Two-Phase Commit (2PC) releases before a single line can touch main:
| What Nomos Is Not | Why Legacy Layers Fail on Coding Agents | What the Nomos Layer Enforces |
|---|---|---|
| Not Another Coding Agent | Switching models or IDEs does not stop a stochastic optimizer from taking shortcuts under context pressure. | Keep Claude Code, Cursor, Antigravity, OpenCode, Windsurf, or Aider; Nomos governs state isolation and merge safety underneath them. |
| Not a Linter or Post-Hoc CI | Linters (golangci-lint, eslint) assume cooperative humans after edits already dirtied your active branch. |
Isolates tasks in disposable git worktree sandboxes, separates INT-* specs from SUB-* code so agents cannot rewrite specs to excuse broken code, pins nomos.yaml to main, and blocks deleted assertions or hollow shims before merge. |
Not a .cursorrules Prompt Pack |
Advisory markdown rules decay once context crosses 60%, and failed runs poison repo notes. | Enforces compiled Go, Git hook, and AST exit codes (exit 1) outside the model context window, promoting mneme.db lessons strictly after a verified 2PC Git Notes receipt. |
⚡ Two commands to install and initialize. Invisible after that.
Runcurl -fsSL https://sophialabs.ca/install | bashandnomos initonce. There are zero custom slash commands to memorize, zero prompt templates to maintain, and zero manual handshake steps (nomos hook session-startrunsnomos handshakeautomatically on session boot). You prompt Claude Code, Cursor, Antigravity, or OpenCode in plain English the exact way you already do, while Nomos governs worktree isolation,~24mssingle-file AST checks, and two-phase commits silently under the hood.
⚡ Quick Start (Under 60 Seconds)
1. Install the nomos Binary
curl -fsSL https://sophialabs.ca/install | bash
Installs the SHA-256-verified release binary directly to standard Go binary paths ($GOBIN / $(go env GOPATH)/bin / ~/go/bin; pass NOMOS_VERSION=v4.10.0 to pin a specific release tag). Or on Arch Linux / Omarchy via AUR, or directly from main via the Go toolchain (substrate/ subdirectory module):
yay -S nomos-bin
# or build from source:
CGO_ENABLED=0 go install github.com/mgantlett/nomos/substrate/cmd/nomos@main
To cleanly uninstall at any time:
curl -fsSL https://sophialabs.ca/uninstall | bash
2. Initialize Any Repository
cd your-project
nomos init
nomos init detects your language stack, scaffolds nomos.yaml (validated against nomos.schema.json), installs self-healing Git defense hooks (pre-commit, commit-msg, pre-push), and drops indirect-control agent contracts (AGENTS.md, CLAUDE.md) plus ambient lifecycle hooks (.agents/hooks.json) into your repo.
3. Prompt Your Coding Agent Naturally
You are done with the CLI. Open Claude Code, Cursor, Antigravity, OpenCode, or Windsurf and prompt in plain English:
> "Add TTL cache eviction to Store with unit tests"
Because nomos init injected AGENTS.md / CLAUDE.md and Git defense hooks, your coding agent autonomously executes the Nomos lifecycle under the hood:
# Executed autonomously by your coding agent (not typed by you):
nomos task chore "Add TTL cache eviction" # 1. Agent provisions isolated worktree (worktrees/<repo>-SUB-1)
nomos verify -w worktrees/your-project-SUB-1 # 2. Agent runs 42 AST & DoD gates (self-correcting any failures)
nomos task sync SUB-1 -F .tmp/walkthrough.md # 3. Agent atomically merges to main with a Git Notes audit receipt
🏗️ How It Works in Your Repository
- Indirect Control & Persistent Memory (
nomos init/nomos hook/nomos mem): Your coding agent reads the bootstrappedAGENTS.md/CLAUDE.mdprotocol, runs sub-5ms compiled lifecycle hooks (nomos hook session-start,pre-tool,post-tool), and queries Nomos Mneme (nomos mem recall) for sub-50ms hybrid vector and lexical architectural context before touching code. - Hermetic Worktree Sandbox & Causal Plane DAG (
nomos task): Direct commits onmainfail closed. Tasks separate intent/contract specs (INT-*) from substrate code (SUB-*) in a local causal DAG (nomos task pair,nomos task chore,nomos task dag), and every task executes inside an isolated Git worktree (worktrees/<repo>-<task>) governed by a strict state machine (IDLE → PLAN → EDIT → REVIEW → SYNC → LEARN). - 42-Gate Polyglot AST & Toolchain Verification (
nomos verify): Before any code can be reviewed or merged, Nomos evaluatesgo/ast, embedded.scmS-expression query rules,wazeroWebAssembly linear-memory scanning, pure-Go multiline-aware structural scanners, and native compiler/coverage probes (tsc --noEmit,pytest,cargo check,ruby -c,cmake,gradle/mvn,dotnet build, plus LCOV and Cobertura XML ratchets) across Go, TypeScript/Svelte, Python, Rust, Ruby, C/C++, Java, Kotlin, and C# - catching empty stubs,todo!()/pass/raise NotImplementedErrorshims, skipped-test annotations (t.Skip,@pytest.mark.skip,#[ignore],xit,@Disabled,[Fact(Skip=...)]), functions over60 LOC(400 LOCfile ceiling), cyclomatic complexity spikes (> 15), hardcoded paths, security flaws, and test coverage drops. - 1-Turn Auto-Remediation Loop (
NomosError): When a gate fails,nomos verifyemits a structuredNomosErrorwith the exact file, line, violated law, and remediation instruction so the coding agent fixes its own mistake on the next turn. - Physically Locked Trunk & Atomic 2PC Release (
nomos task sync): Once all 42 gates pass, Nomos fast-forward merges the worktree intomain, attaches a cryptographic Git Notes (refs/notes/nomos/releases) verification receipt, and prunes the sandbox.
🧩 Core Capabilities & Deep-Dive Specifications
| Capability | Canonical CLI Surface | What It Enforces | Architecture Specification |
|---|---|---|---|
| Indirect Agent Control | nomos init, nomos handshake, nomos hook |
Bootstraps agent rules (AGENTS.md, CLAUDE.md), auto-injected session handshakes, additive lifecycle hooks (nomos hook session-start | pre-tool | post-tool at ~4ms cold start with 3-strike loop circuit-breaking), and self-healing Git hooks without locking you into a specific model or IDE. |
agent_tiers_and_indirect_control_spec.md |
| Capability-Flow & Zero-Trust MCP IFC | nomos hook pre-tool | session-start |
Tracks multi-turn compositional taint (CapabilityFlowGraph) across web ingress, local credentials, and release/exfiltration sinks, and enforces zero-trust MCP server allow/block lists, secret payload guards, and cross-server escalation blocks. |
capability_flow_taint_guard_spec.md · zero_trust_mcp_ifc_spec.md |
| Phase Discipline & Worktrees | nomos task chore | pair | create | start | edit | review | dag |
Separates INT-* spec tasks from SUB-* code tasks in a causal DAG wavefront and enforces IDLE → PLAN → EDIT → REVIEW → SYNC → LEARN state transitions inside hermetic worktrees/<repo>-<task> sandboxes. |
nomos_hermetic_worktree_spec.md |
| 42-Gate AST & DoD Engine | nomos verify, nomos verify proof |
Runs 42 statutory Definition of Done (DoD) quality gates across the 7x3 Canonical Invariant Matrix (21 Cells) via Go AST, .scm S-expression query rules, wazero WASM linear-memory scanning, polyglot structural scanners, and native toolchain/coverage probes (tsc, pytest, cargo, cmake, gradle/mvn, dotnet). |
seven_laws_canonical_gate_matrix_spec.md · full_dod_gate_suite_and_polyglot_spec.md |
| Auto-Remediation & NCTE-100 Directives | nomos directive, nomos directive --lint | --lexicon |
Translates gate failures into deterministic JSON/terminal NomosError payloads for 1-turn agent self-correction and enforces NCTE-100 Controlled Technical English across specifications and directives. |
nomos_actionable_error_framework_spec.md · nomos_controlled_technical_english_spec.md |
| Nomos Mneme Memory | nomos mem save | recall | list | dismiss |
Pure-Go SQLite WAL + hybrid 64-dim vector & lexical memory bank (mneme.db) scoped per repository (repo_id) so agents retain architectural decisions across sessions. |
mneme_memory_spec.md |
| Atomic 2PC Sync & Git Notes | nomos task sync, nomos verify proof |
Two-Phase Commit release to main with mandatory walkthrough synthesis and immutable refs/notes/nomos/releases provenance receipts. |
task_lifecycle_cli_spec.md |
| Git Hooks & Sanitized Issues | nomos issue |
Self-healing pre-commit/commit-msg/pre-push defense hooks and zero-leak sanitized diagnostic issue reporting. | git_hooks_and_commit_schema_spec.md |
| Complete CLI & Config Reference | nomos --help |
Full flag-by-flag reference for all commands and Draft 2020-12 nomos.schema.json configuration contracts. |
cli_and_flags_parity_expansion_spec.md · go_ssot_and_json_schema_spec.md |
🛡️ The 7 Laws of Nomos
Every check in nomos verify maps to one of seven compiled architectural laws (full 42-gate matrix in seven_laws_canonical_gate_matrix_spec.md):
| Law | Name | What It Prevents |
|---|---|---|
| 1 | Dual-Core Inversion | Prevents unverified agent execution outside the phase state machine (PhaseDisciplineGate). |
| 2 | Non-Verbal Proof | Rejects conversational "tests pass" claims, // TODO shims, and empty function stubs (AntiShimGate). |
| 3 | Hermetic Worktree | Physically blocks direct commits on main and path escapes outside the task worktree (HermeticWorktreeGate, StagedBoundariesGate). |
| 4 | Single Source of Truth | Eliminates broken documentation links, orphaned specs, and unaligned schemas (BrokenWireGate, ContractParityGate). |
| 5 | Zero Hardcoded Paths | Blocks machine-specific absolute paths (/Users/..., /home/...) and secret literals (ForbiddenLiteralsGate). |
| 6 | Canonical Singularity | Prohibits duplicate CLI aliases, rogue task keys, and filesystem symlinks (ZeroAliasGate, ZeroFilesystemAliasGate). |
| 7 | Fail-Closed Pre-Flight | Enforces strict plane separation, test coverage floors, static analysis, and vulnerability checks (PlaneSeparationGate). |
📊 Verified Benchmarks & Runtime Footprint
Nomos is engineered so deterministic governance adds sub-second overhead on every agent turn while failing closed under adversarial stress (see tracetrial_harness_reliability_spec.md):
| Engineering Metric | Verified Result | Reproducible Proof / Implementation |
|---|---|---|
| 42-Gate Structural & AST Overhead | ~460 ms (~24 ms --fast-file) |
nomos verify structural/AST gate pass across Go/TS/Svelte/Py/Rust/C/JVM/C# (plus project go test/tsc/pytest/cargo/gradle/dotnet runtime) |
| Static Binary Footprint | 19 MB stripped (CGO_ENABLED=0) |
Single Go release binary (-ldflags="-s -w") with embedded modernc.org/sqlite WAL + wazero WASM runtime host; zero host runtime deps |
Adversarial Fail-Closed Suite (VEC-TTB-01..07) |
7/7 vectors blocked in 1.98s |
cleanroom_tracetrial_bench_test.go (go test ./cli -run TestTraceTrialBench) |
| Config & Boundary Tamper Resistance | 0 trunk leaks |
Worktree edits to nomos.yaml fail closed against pinned main; mid-2PC gate panics abort before main fast-forwards |
| Nomos Mneme Hybrid Memory Recall | < 50 ms local query |
64-dim vector + lexical SQLite recall (mneme.db); promotes pattern blueprints only after verified 2PC Git Notes release |
| Open-Core Automated Test Suite | 645 tests across 16 packages + 6 cleanroom suites |
Pure Apache 2.0 local test execution with zero cloud or telemetry dependencies |
Terminal-Bench 2.0 Controlled A/B (Harbor · nomos-harbor · 89 / 89 Tasks)
Across all 89 containerized tasks in [email protected] holding Gemini CLI 0.67.0, vertex_ai/gemini-3.5-flash, and unmodified task timeouts fixed, adding compiled nomos hook pre-tool/post-tool governance lifted single-shot pass@1 from 65.17% (58 / 89) to 70.79% (63 / 89, +5.62 pp, 0 API crashes), and 84.27% (75 / 89, +19.10 pp, pass<=2) when resuming the 26 failed trials with nomos v4.7.0 (--budget-sec wall-clock advisories + interactive/binary stdout guards, cutting timeouts from 24 to 13):
| Arm | Agent Configuration | Score (89 Tasks) |
Lift vs. Control | Timeouts | Public Harbor Hub Trajectories |
|---|---|---|---|---|---|
Pure Stock Control (pass@1) |
Stock Gemini CLI 0.67.0 (zero Nomos hooks) |
58 / 89 (65.17%) |
Baseline | 24 |
49f21995-f52a-4f33-837e-a3f86bbfadd0 |
Nomos Single-Shot (pass@1) |
Gemini CLI 0.67.0 + nomos hook (--container-sandbox) |
63 / 89 (70.79%) |
+5.62 pp (14W / 9L) |
16 |
39059e9a-8236-472a-a43b-ab500146abe1 |
Nomos v4.7.0 Resume (pass<=2) |
v4.7.0 Budget Radar + interactive/binary guards resumed on 26 0.0 trials |
75 / 89 (84.27%) |
+19.10 pp (20W / 3L) |
13 |
6b9f81a5-0750-4242-80f2-0b5d0830355e |
External Harness Reliability (TraceTrial-Bench · arXiv:2610.32285)
Across all 95 containerized tasks in Trial by Trace (TraceTrial-Bench, arXiv:2610.32285) (190 paired Docker runs holding Claude Code v2.1.220 and Gemini 2.5 Flash-Lite fixed), adding compiled ~4ms nomos hook governance lifted Agent deliverables by +15.2% (+78.3% in Context & Continuity), lifted Harness reliability by +2.51 (44.89 → 48.78 Overall, 36W / 30T / 29L), and cut harness_caused failures by -18.2% (55 → 45). See the full 7-pillar paired scorecard and engineering takeaways in tracetrial_harness_reliability_spec.md.
🧭 Open-Core Boundary
Nomos Community Edition is 100% open-source under Apache 2.0 with zero telemetry, zero cloud account requirements, and zero crippled CLI commands. Every single-developer and single-repository governance capability runs locally out of the box (see LICENSE, NOTICE, and agent_tiers_and_indirect_control_spec.md):
| Capability Layer | Nomos Community Edition (Apache 2.0) | SophiaLabs Sovereign Enterprise |
|---|---|---|
Indirect Control for Tier 1 Coding Agents (AGENTS.md, CLAUDE.md, .agents/hooks.json) |
✅ Included | ✅ Included |
42-Gate Polyglot Verification Engine (nomos verify, Go AST + Polyglot Scanners, 7 Laws + DoD) |
✅ Included | ✅ Included |
Causal INT-*/SUB-* DAG, Hermetic Worktrees & 2PC Sync (nomos task, trunk-pinned nomos.yaml, refs/notes/nomos/releases) |
✅ Included | ✅ Included |
Nomos Mneme Hybrid Vector Memory & Sanitized Diagnostic Issues (nomos mem, nomos issue) |
✅ Included | ✅ Included |
Autonomous Tier 2 Coding Agent & Multi-Agent Swarm (nomos code) |
Not Included | 🔒 Enterprise Only |
| Multi-Seat Mesh Sync, Cockpit Control Plane & Hardware Attestation | Not Included | 🔒 Enterprise Only |
📄 License
Licensed under the Apache License, Version 2.0. See LICENSE, NOTICE, and THIRD_PARTY_NOTICES.md for full text and attribution terms.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi