Enterprise Fleet Governance, Repository-as-Code & Universal AI Agent Engineering Engine
An open governance engine for any repository fleet: your repositories, your fork, your policy.
Praetor manages this repository's declared governance policy. This managed block records adoption state; it is not a verification certificate.
Verification: make verify-all runs the repository's configured
verification cascade.
HISS Audit: praetorctl audit enforces policy, generated-surface
integrity, and the debt ratchet.
Context Sync: praetorctl compile-context --verify verifies every
generated agent context against AGENTS.md.
Documentation: make docs-lint enforces locked Markdown style and the
private scratch-link policy.
Debt Baseline: .standards-baseline.json anchors the debt ratchet at
2 recorded infractions; audit forbids growth.
Praetor is an open governance engine for any repository fleet: you run it against your own repositories or your own fork of it, and its default owner, target framework, review bot and organisation-folder list stay empty until you configure them (framework, forge and topology settings). Built in Go 1.27+, Praetor transforms repository governance into a deterministic, active platform capability by combining Repository-as-Code orchestration, context transpilation across vendor-specific AI tools, and unbypassable HISS (High-Integrity Systems Standard) invariant enforcement.
While traditional repositories suffer from configuration drift and agentic fragmentation, Praetor maintains a single canonical source of truth—AGENTS.md—and compiles it into vendor-specific harnesses (.claude, .cursor/rules/*.mdc, .windsurfrules, .gemini/GEMINI.md, .github/copilot-instructions.md, .codex/rules.md) while ensuring mathematical code quality and debt ratcheting.
Why it matters. Praetor (said PREE-tor; Latin praetor, an elected magistrate of ancient Rome whose rulings set legal precedent) is an open governance engine for any repository fleet: one canonical AGENTS.md per repository, compiled into the instruction files of six coding clients.
What support funds.
- CI time for the Linux, macOS and Windows matrix.
- Keeping rule HISS-21 true: gates, hooks and emitted templates run on all three platforms or skip with a stated reason.
Sponsor on GitHub Sponsors, any amount; no support or priority is sold. Open Collective: pending.
Praetor resolves context compilation and lattice configuration through a single-pass DAG pipeline:
Text description
- Vendor Projections: CLAUDE.md (< 300 LOC), .cursor/rules/*.mdc, .github/copilot-instructions.md, .windsurfrules, .gemini/GEMINI.md, .codex/rules.md.
- Boxes: AGENTS.md (Canonical Source), praetorctl compile-context, .standards.yaml (& .standards.lock), Effective Policy (Lattice Supremum), .devcontainer & Toolchain, praetorctl audit, praetorctl plan, praetorctl gate run, Gate stages, Ed25519 Exit-0 receipt.
- AGENTS.md → praetorctl compile-context → CLAUDE.md.
- praetorctl compile-context → .cursor/rules/*.mdc.
- praetorctl compile-context → .github/copilot-instructions.md.
- praetorctl compile-context → .windsurfrules.
- praetorctl compile-context → .gemini/GEMINI.md.
- praetorctl compile-context → .codex/rules.md.
- .standards.yaml → Effective Policy → .devcontainer & Toolchain.
- Effective Policy → praetorctl audit.
- Effective Policy → praetorctl plan.
- praetorctl gate run → Gate stages → Ed25519 Exit-0 receipt.
- Scenario 1, compile-context: AGENTS.md is transpiled to vendor-specific files. The single source of truth is read. Target-specific files are generated.
- Scenario 2, policy: The lattice resolves standard definitions into effective policy. Manifest and lockfile are merged. Policy applies to the devcontainer toolchain, audit enforcement, and plan previews.
- Scenario 3, gate run: praetorctl gate run executes the gated pipeline. The gate command triggers the verification cascade. A successful run mints a signed receipt.
| Architectural Pillar | Technical Functionality | Primary Tooling |
|---|---|---|
| Universal Context Transpiler | Single canonical AGENTS.md compiled into vendor targets (CLAUDE.md). |
praetorctl compile-context |
| Multi-Transport MCP Server |
stdio, Streamable HTTP, and SSE Model Context Protocol server; every tool result and error passes the prompt-injection neutralizer before it is served (internal/mcp/sanitize.go). |
standards-mcp |
| HISS Lattice Engine | Composable archetypes resolved via Join-Semilattice supremum ("Highest Standard Wins"). | internal/config |
| Hermetic Devcontainers | Reproducible multi-architecture dev environments pre-wiring toolchains and Editor setups. | praetorctl devcontainer |
| Monotonic Debt Ratcheting | Baselined legacy debt with non-increasing debt invariants and touched-file clean rules. | praetorctl baseline |
| Supply Chain Provenance | Signed SLSA v1.0 provenance over every release archive, per-archive Syft SBOMs, and Sigstore Cosign keyless signatures, all attached before the release is published. Build Level 3 is not claimed (releasing guide). | GoReleaser + praetorctl provenance + cosign |
| Dual-Surface Documentation | Material-for-MkDocs human UI paired with a concise /llms.txt index and source-bound /llms-full.txt compatibility map. |
make docs-lint catalog parity |
Praetor enforces the High-Integrity Systems Standard (HISS)—adapting NASA-JPL flight-software rigor to modern Go engineering:
- HISS-01 (Acyclic Control Flow): Recursion is strictly prohibited; call graph must be a DAG.
- HISS-02 (Bounded Loops & Timeouts): Bounded iterations and explicit context deadlines on all network and disk I/O.
-
HISS-04 (Complexity & Function Length Caps): Maximum McCabe cyclomatic complexity
$M \le 10$ , cognitive complexity$\le 15$ , function length$\le 60$ LOC,$\le 50$ executable statements. -
HISS-07 (Zero Unchecked Errors): Zero unchecked error values and zero
.unwrap()or unhandled panic calls in production. - HISS-10 (Zero-Warning Cascade): 5-layer zero-warning cascade from editor to deployment admission controller.
- HISS-15 (3D Testing Discipline): Positive, negative, and boundary tests mandatory for all public APIs.
-
HISS-16 (Canonical Operating Harness): Single canonical
AGENTS.mdharness with unbypassable server-authoritative verification. -
HISS-17 (State Ledger Discipline): Every agent turn reads and updates the local
.workingdirledger instead of re-deriving state from scratch. -
HISS-18 (Diff-Aware CI Efficiency):
praetorctl ci filterclassifies each change so a docs- or state-only diff skips the heavy race and security gates. -
HISS-19 (Reuse Before Writing): One behavior has exactly one implementation;
praetorctl dedupe scanenforces it as a clone and utility-sprawl gate. -
HISS-20 (Replayable Enforcement Evidence): Every coverage claim in
.config/hiss/coverage.yamlis replayed against a fixture corpus in both directions, never merely asserted. - HISS-21 (Platform Neutrality): A gate runs on Linux, macOS and Windows, or skips with a stated reason; a gate that cannot run is not a passing gate.
See the HISS specification for the full invariant catalog, including the supply-chain and memory-safety invariants (HISS-03, 08, 09, 11, 14) this summary omits.
.
├── .agents/skills/ # Canonical agent skills; compile-context projects these byte-for-byte to .agents/plugins/praetor/skills/ for Claude Code
├── .claude/ # Target compilation for Claude Code (CLAUDE.md)
├── .codex/ # Target compilation for OpenAI Codex
├── .config/ # System & linter configurations
├── .cursor/rules/ # Compiled Cursor MDC rulesets
├── .devcontainer/ # Hermetic multi-arch devcontainer definitions
├── .gemini/ # Target compilation for Gemini CLI / Antigravity IDE
├── .github/ # Workflows, Copilot instructions, and release configs
├── .vscode/ # Shared editor settings and launch profiles
├── cmd/ # Go application entrypoints
│ ├── standardsctl/ # Governance CLI (compile, audit, baseline)
│ └── standards-mcp/ # Multi-transport MCP server
├── docker/dev/ # Developer environment container builds
├── docs/ # Dual-Surface MkDocs documentation & assets
│ └── assets/ # Branding assets (banners, logos, icons, favicons)
├── editors/ # VS Code extension; generated Neovim and JetBrains references
├── internal/ # Core Go packages (config, lattice, AST transpiler)
├── lua/ & .nvim.lua # Neovim native governance integrations
├── .needs.yaml # Capability needs written by `make needs-write`
├── .standards.yaml # Primary repository governance specification
├── .standards.lock # Immutable locked dependency & profile state
├── .standards-baseline.json # Debt ratcheting baseline state
├── AGENTS.md # Canonical AI Agent harness (Source of Truth)
├── Makefile # Universal verification & build entrypoint
└── go.mod & go.sum # Go module dependencies (Go 1.27+)
Run the universal verification pipeline across the entire Go codebase and governance rules:
make verify-all
# Run the locked public Markdown and private scratch-link gate alone
make docs-lintThe documentation governance guide
defines the checked inventory, locked rules, CI/adoption contract, and remediation
for private .workingdir/ or .workingdir2/ destinations.
Update agent instructions in AGENTS.md and transpile to all vendor targets (.claude, .cursor, .windsurf, .gemini, .codex, .github):
# Transpile context files
go run ./cmd/standardsctl compile-context
# Assert that all target context files are 100% in sync (CI check)
go run ./cmd/standardsctl compile-context --verifyInspect repository compliance against declared profiles and the HISS baseline:
go run ./cmd/standardsctl auditRecord the current debt once, then check that it never grows:
go run ./cmd/standardsctl baseline --record # scan and write .standards-baseline.json
go run ./cmd/standardsctl baseline --verify # read-only: fail on debt the baseline does not record
go run ./cmd/standardsctl baseline # print the stored snapshot without scanning--record refuses to raise the count unless --allow-increase --reason="<why>"
records why. audit applies the same ratchet and adds the touched-file clean
rule. A rejection lists three violations per class and says how many it hid;
--verify --all-violations lists every one without writing the file. A pass
warns about baseline entries that match nothing in the tree;
audit --max-stale-baseline-entries=N fails past N.
Distributed under the European Union Public Licence 1.2 (EUPL-1.2). See
LICENSE for the full text and REUSE.toml for SPDX
licensing metadata. THIRD-PARTY-NOTICES.md lists the
third-party components the release archives and the container image ship, with their
licenses and upstream notices; both carry it beside LICENSE and LICENSES/.
For open-source projects, standards, and specifications this repository builds upon, see the Credits & Acknowledgements page.
Developed in the open at github.com/tekmora/praetor.