Governance violations Mneme catches before generation
Concrete examples of the architectural decisions Mneme enforces against. These are not generic lint rules — they are organizational decisions encoded as structured constraints, injected into the agent's context, and checked at the file-write seam before the code exists.
Architecture governance
Layer boundaries, forbidden patterns, deprecated architectures. The decisions that define how the system is shaped — not what it does, but how its parts are allowed to relate.
Forbidden architecture patterns
Rule. Do not access BigQuery directly from frontend routes.
// AI generates inside a Next.js API route
const client = new BigQuery();
Layer boundary violations
Rule. Controllers must not contain business logic.
@app.post("/checkout")
def checkout():
# pricing logic
# tax logic
# inventory logic
Unauthorized framework introduction
Rule. React app standardized on Zustand. No Redux.
import { createStore } from "redux";
Workflow governance
Protected directories, ownership boundaries, migration restrictions, prompt-level policies. The decisions that govern who — or which agent — is allowed to touch what.
Monorepo scope violations
Rule. Billing agent cannot modify the auth package.
# AI agent edits
packages/auth/*
Agent workflow violations
Rule. Codegen agents cannot write directly to production migration folders.
# Agent modifies
db/prod/migrations/*
Prompt-level governance
Rule. Do not generate mock auth implementations.
# User prompt
"Just create a quick fake JWT validator."
Security governance
Unsafe query construction, credential handling, insecure auth patterns. The decisions where a violation is not just architectural debt but a vulnerability the team has already chosen not to ship.
Security policy violations
Rule. No raw SQL string concatenation.
query = f"SELECT * FROM users WHERE id = {user_id}"
Dependency governance
Banned libraries, licensing constraints, version pins, and the supersession history of decisions the team has already revisited. Dependencies are decisions; Mneme treats them as such.
Dependency licensing
Rule. No GPL dependencies.
// AI adds to package.json
"some-gpl-library": "^2.1.0"
ADR supersession violations
Rule. ADR-002: all async jobs use Pub/Sub. (Supersedes an older ADR that allowed Celery.)
from celery import Celery
Platform governance
Observability requirements, infra standards, deployment policies, API contracts. The decisions platform teams ship to keep services consistent across the org.
Infra governance violations
Rule. All infrastructure changes must use Terraform modules.
gcloud compute instances create ...
API contract violations
Rule. Internal APIs must version under /v1/.
@app.route("/users")
Organizational consistency violations
Rule. All services must emit OpenTelemetry traces.
# AI creates a new service with no tracing middleware
def create_app():
app = FastAPI()
return app
The distinction that matters. Mneme injects organizational architectural decisions into AI-assisted generation workflows. The examples above are not static lint rules; they are decisions the team has already made, in the form the agent needs to see them, at the moment it is about to generate.
This is the difference between "we scan for bad code" and "we keep the agent honest about the decisions you've already made." The first is a check after the fact. The second is the layer that makes drift structurally harder.