Core โ€“ Deterministic governance rules for AI-generated code (pip installable) CORE, an open-source governance runtime for AI-assisted software development, enforces deterministic constitutional rules to block unsafe AI actions before execution. The tool, available on PyPI, provides auditable consequence chains and separates human-defined specs from machine-enforced layers to prevent architectural violations and unauthorized mutations. Executable constitutional governance for AI-assisted software development.Designed for environments where AI action traceability is not optional. Versioning: SemVer with 2.x denoting an API approaching stability Beta on PyPI ; see the versioning policy. AI coding tools generate code fast. Too fast to stay sane. Without enforcement, AI-assisted codebases accumulate invisible debt โ€” layer violations, broken architectural contracts, files that grow unbounded. And agents, left unconstrained, will eventually do something like this: Agent: "I'll delete the production database to fix this bug" System: Executes. You: ๐Ÿ˜ฑ CORE makes that class of violation impossible โ€” structurally blocked before execution, not detected after the fact. Which surfaces hard-block versus advisory-report is mapped under Current proof status below. Agent: "I'll delete the production database to fix this bug" Constitution: BLOCKED โ€” Violates data.ssot.database primacy System: Execution halted. Violation logged. You: ๐Ÿ˜Œ CORE is a governance runtime that constrains AI agents with machine-enforced constitutional law โ€” enforcing architectural invariants, blocking invalid mutations automatically, and making autonomous workflows auditable and deterministic. LLMs operate inside CORE. Never above it. You don't have to take this on faith. On a clean machine with Docker: git clone https://github.com/DariuszNewecki/CORE.git cd CORE && ./install-core.sh install-core.sh stands up CORE and finishes by running the consequence-chain demo live โ€” no LLM key required. It: - commits a function that violates linkage.assign ids a blocking rule - watches CORE's audit block it - has CORE propose a fix, the governor approve it, and CORE execute it and commit the repair - re-audits to confirm clean - prints the full causal chain it recorded: finding โ†’ proposal โ†’ approval โ†’ execution โ†’ file change Re-run it any time with scripts/demo.sh . Governance is executable. Every enforced action records its lineage. Two consequence chains, pulled live from the CORE database โ€” same schema, two different authorities: Autonomous path โ€” risk-classified as safe, system self-approved FINDING โ†’ workflow.ruff format check src/api/cli/client.py 2026-05-18 05:15:15 UTC PROPOSAL โ†’ 8845daccโ€ฆ fix.format 2026-05-18 05:16:15 UTC APPROVAL โ†’ risk classification.safe auto approval 2026-05-18 05:16:15 UTC EXECUTION โ†’ completed 1.29s 2026-05-18 05:17:18 UTC FILE CHANGE โ†’ +105 / -0 98da9038 โ†’ fca9a971 src/api/cli/client.py 2026-05-18 05:17:19 UTC Human-approval path โ€” governor in the loop FINDING โ†’ purity.docstrings.required src/cli/commands/audit reporter.py 2026-05-15 08:28:29 UTC PROPOSAL โ†’ a4363a81โ€ฆ fix.docstrings 2026-05-16 13:39:34 UTC APPROVAL โ†’ principal.governor cli admin 2026-05-16 13:53:32 UTC EXECUTION โ†’ completed 24.5s 2026-05-16 13:55:48 UTC FILE CHANGE โ†’ +26 / -0 5a123426 โ†’ 71fde489 src/cli/commands/audit reporter.py 2026-05-16 13:55:49 UTC Both chains are queryable end-to-end from proposal consequences and blackboard entries . The constitution decides which authority applies; the schema is identical. Reproduce them yourself with the Consequence-chain query https://dariusznewecki.github.io/CORE/proof-index/ consequence-chain-query in the Proof Index. CORE separates responsibility across four repository layers โ€” three enforced as constitutional law, and Specs human intent . This separation is enforced as law โ€” not convention. Where humans define what the system is for and why decisions were made. Contains architectural papers, northstar documents, user requirements, architectural decision records, and planning documents. This is the entry point for anyone trying to understand CORE before reading its implementation. .specs/ is read by humans and searchable by CORE's semantic layer. It is never written by CORE itself. Defines what is allowed, required, or forbidden. Contains machine-readable constitutional rules, enforcement mappings, phase-aware governance models, and the authority hierarchy Meta โ†’ Constitution โ†’ Policy โ†’ Code . Mind never executes. Mind never mutates. Mind defines law. Reads constitutional constraints, orchestrates autonomous reasoning, and records every decision with a traceable audit trail. Every operation follows a structured phase pipeline: INTERPRET โ†’ PLAN โ†’ GENERATE โ†’ VALIDATE โ†’ STYLE CHECK โ†’ EXECUTE Will never bypasses Body. Will never rewrites Mind. Deterministic, atomic components: analyzers, evaluators, file operations, git services, test runners, CLI commands. Body performs mutations. Body does not judge. Body does not govern. Every autonomous operation is governed by the same constitutional loop: php flowchart TD A "๐ŸŸข GOAL\nHUMAN INTENT" -- B "๐Ÿ“‚ CONTEXT\nRepo state โ€ข knowledge โ€ข history" B -- C "๐Ÿ”’ CONSTRAINTS\nImmutable rules\n215 rules โ€ข 15 engines" C -- D "๐Ÿ—บ๏ธ PLAN\nStep-by-step reasoning\nRule-aware plan" D -- E "โœจ GENERATE\nCode โ€ข changes โ€ข tool calls" E -- F "โœ… VALIDATE\nDeterministic checks\nAST โ€ข semantic โ€ข intent โ€ข style" F -- |Pass| G "โ–ถ๏ธ EXECUTE\nApply compliant changes" F -- |Fail| H "๐Ÿ”„ REMEDIATE\nRepair violation\nAutonomy Ladder" H -- E G -- I "โœ“ SUCCESS\nChanges committed" subgraph "SAFETY HALT" direction TB J "๐Ÿšจ CONSTITUTIONAL VIOLATION\nโ†’ HARD HALT\n+ FULL AUDIT LOG" end E -.- |Any violation| J F -.- |Any violation| J classDef phase fill: f8f9fa,stroke: 495057,stroke-width:2px classDef constraint fill: d1e7ff,stroke: 0d6efd,stroke-width:2.5px classDef validate fill: fff3cd,stroke: ffc107,stroke-width:2.5px classDef halt fill: ffebee,stroke: dc3545,stroke-width:3px class A,B,D,E,G,I phase class C constraint class F validate class J halt Within CORE: - No file outside an autonomy lane can be modified - No structural rule can be bypassed silently - No atomic action can execute outside the governed executor inline authorization is deferred to the auditโ†’consequence loop - Decisions are phase-aware and logged with decision traces audit persistence is best-effort โ€” see Current proof status - No agent can amend constitutional law If a blocking rule fails, execution halts with no partial state. Reporting and advisory rules surface findings and continue โ€” what blocks versus what reports depends on the mode. CORE's guarantee semantics are split across modes by design. This is the honest map of what each surface does, so a single binary claim "CORE blocks violations" is not mistaken for the whole picture: | Surface | Mode | Behaviour | |---|---|---| .intent/ writes | hard invariant | blocked โ€” the governance directory is immutable to all components | | Constitutional rules | always-blocking | block a commit regardless of strict mode | | Policy rules | strict vs. default | block only when strict mode=True ; otherwise report | | Capability tier | advisory today | reports a "would-deny" signal; does not yet block ADR-079 | | Stateless CI GitHub Action | rule subset | skips knowledge gate + llm gate they need DB / LLM state and reports the skip | | Action audit trail | best-effort | recorded when the DB write succeeds; a write-action failure is surfaced AUDIT GAP , not silent | The hard invariants and constitutional rules block unconditionally; the policy, capability, and stateless tiers are weaker by design and labelled here so the boundary is legible rather than implied. | Primitive | Purpose | |---|---| | Document | Persisted, validated artifact | | Rule | Atomic normative statement | | Phase | When the rule is evaluated | | Authority | Who may define or amend it | Enforcement strengths: Blocking ยท Reporting ยท Advisory | Engine | Method | |---|---| ast gate | Deterministic structural analysis AST | regex gate | Pattern-based text enforcement | glob gate | Path and boundary enforcement | cli gate | CLI surface and command-shape enforcement | artifact gate | Declared-vs-discovered artifact completeness | workflow gate | Phase-sequencing and coverage checks | knowledge gate | Responsibility and ownership validation | action gate | Atomic-action invariants | passive gate | Substrate-enforced rules DB/runtime marker | taxonomy gate | Capability-id โ†” atomic-action coherence ADR-079 D9 | contracts gate | Cross-cutting data-contract coherence context-level; ADR-102 | llm gate | LLM-assisted semantic checks | IntentGuard | Runtime write authorization not audit | Runtime Gate per .specs/papers/CORE-Gate.md , kept here for visibility. Deterministic when possible. LLM only when necessary. 215 rules across 51 rule documents. 209 are mapped to enforcement engines; 6 test-quality rules are still pending mappings. "Mapped" means engine-bound โ€” not enforced in every mode: stateless CI skips knowledge gate and llm gate , which need the knowledge graph and an LLM provider. CORE progresses through defined levels. Each adds capability while remaining constitutionally bounded. A0 โ€” Self-Awareness โœ… Knows what it is and where it lives A1 โ€” Self-Healing โœ… Fixes known structural issues automatically A2 โ€” Governed Generation โœ… Natural language โ†’ constitutionally aligned code A3 โ€” Governed Autonomy โœ… Daemon finds, proposes, and fixes violations unattended โ† current A4 โ€” Self-Replication ๐Ÿ”ฎ Writes CORE.NG from its own understanding of itself | Dependency | Version | |---|---| | Python | 3.12+ | | PostgreSQL | โ‰ฅ 14 | | Qdrant | latest | | Docker | for services | | Poetry | for deps | Honest status โ€” what works today.CORE governsitselfend to end the demo above , and audits any repo thathas aโ€” in CI via the .intent/ constitution GitHub Action , or locally with core-admin code audit --offline inside that repo. pip install core-runtime gives you the core-admin CLI. Govern your own repo BYOR :from the CORE source tree, two commands bootstrap a fitted constitution. 1 core-admin project onboard