Exemplar

Governed code review — reference implementation for the FOSS governance stack

What

Exemplar is a CLI and MCP tool that accepts pull request diffs, routes them through multi-stage analysis (security, correctness, style, architecture), and produces verified review reports with full audit trails. Every stage is governed by the FOSS governance stack — not as a demo, but as the product itself. The governance IS the architecture.

The Stack

ConstrainSpecification before code — interviews, boundaries, artifacts
PactContract-first decomposition, typed interfaces, hidden tests
BatonCircuit orchestration — routing, breakers, taint analysis
SentinelProduction monitoring & error attribution via PACT keys
LedgerSchema registry with field-level data classification
ArbiterSix-factor trust scoring and conflict resolution
ChroniclerEvent collection and story assembly from stage boundaries
StigmergyOrganizational pattern discovery via ART neural networks
ApprenticeAdaptive model distillation — shadow to autonomous
KindexPersistent knowledge graph across sessions
CartographerStack adoption — scan existing codebases, draft artifacts
Agent-SafeAuthorization policy language — 2us eval, Ed25519, Merkle
Signet-EvalPreflight red lines and contingency plans, HMAC-signed
SignetSovereign agent identity — encrypted vault, ZK proofs
TesseraSelf-validating documents — SHA-256 chain, Ed25519
BlindDBClient-side encryption — server stores opaque blobs
HermesP2PDecentralized agent messaging — ephemeral by design
TransmogrifierRegister-aware prompt translation — normalize input for optimal LLM output

Architecture

PR Diff --> Intake --> Circuit (Baton) --> [Security, Correctness, Style, Architecture]
                                                 |  each stage
                                             Reviewer Agent (Agent-Safe scoped)
                                                 |
                                             Assessment (Arbiter trust-scored)
                                                 |
                                             Chronicler event --> Stigmergy signal
                                                 |
                                        Merge assessments --> Tessera-sealed report

Numbers

11
components
1979
tests
95
functions
235
types

Components

ComponentGovernance Pattern
schemasPact + Ledger — frozen models, field classifications, StrEnums
configConstrain — YAML validation, fail-fast, constraint boundaries
intakeLedger — diff parsing, field-level classification
circuitBaton — stage routing, circuit breaker, parallel execution
reviewersAgent-Safe + Signet — policy-scoped analysis, credentials
assessorArbiter — trust-weighted merge, conflict resolution
reporterTessera — deterministic output, hash-chain seal
chronicleChronicler — stage-boundary events, correlation keys
learnerApprentice + Stigmergy — shadow comparison, pattern recording
cliPact + Kindex + Cartographer — PACT keys, history, adoption
mcp_serverMCP tools — exemplar_review, exemplar_trust, exemplar_history

Get Started

# clone
git clone https://github.com/wandercom/exemplar.git
cd exemplar

# install
pip install -e .

# run tests
pytest