Repository navigation
Kinetic Enforcement Gates
Adam Murphy edited this page Sep 22, 2026
·
3 revisions
In SDCS v1.8.0, repository constraints are not suggestions—they are physical laws of motion enforced across spatial, cognitive, and epistemic defense tiers:
| Defense Tier | Gate | Name | Trigger / Command | Physical Failure Prevented |
|---|---|---|---|---|
| Spatial & Structural | Gate C | Constitutional Immutability | .githooks/pre-commit |
Unauthorized tampering or loosening of spine.md or wiring.yaml. |
| Spatial & Structural | Gate T | Topological Invariant Gate | sdcs verify --topology |
Prohibited AST cross-subsystem imports violating wiring.yaml. |
| Spatial & Structural | Gate P | Blast-Radius Sandbox Guard | sdcs verify --sandbox |
Staging modifications within declared protected_paths. |
| Spatial & Structural | Gate M | Cartography Drift Gate | sdcs map --check |
Commits with untracked new files or orphaned paths in app_map.md. |
| Cognitive & Temporal | Gate S | Working Memory Budget Gate | sdcs verify --state |
Context window amnesia caused by bloated state.md (>350 tokens) & subagent lifecycle. |
| Cognitive & Cache | Gate C-Cache | KV-Cache Prefix Invariance | sdcs verify --cache-invariance |
Cache-busting volatile tokens (timestamps, turn counters) in system prompt prefix. |
| Cognitive & Fleet | Gate W | Secret & PII Sanitizer | sdcs warehouse publish |
Publishing sensitive API keys, tokens, emails, phone numbers, or IPs to central warehouse. |
| Epistemic & Quality | Gate Q | Test Quality & Anti-Mock Gate | sdcs verify --quality |
"Hollow tests" asserting True, assertless test functions, or swallowed exceptions. |
| Epistemic & Toolchain | Gate E | Toolchain & Environment Gate |
sdcs doctor / --env
|
Blaming valid application code for local runtime, interpreter, or toolchain drift. |
| Kinetic Circuit | Breaker | The Circuit Breaker | sdcs verify --cycles |
Alternating period-2 file thrashing ( |
-
Mechanism: Git pre-commit hook checks
git diff --cached --name-onlyforspine.mdandwiring.yaml. -
Enforcement: Aborts commit unless overridden by explicit human environment variable:
export SDCS_ALLOW_CONSTITUTIONAL_MUTATION=1
-
Mechanism: Evaluates Python Abstract Syntax Trees (AST) using Python's native
astmodule (plus polyglot JS/TS support). Does not execute untrusted code or trigger module initializers. -
Contract: Validates every import against
allowed_dependenciesdeclared inwiring.yaml. -
Zero-Argumentation Loop: When an import fails Gate T:
The rejection remains unstaged on disk, forcing the agent to reflect on negative memory and refactor.
# Automatically formats boundary violation into Inverted ADR (## REJ-XXX) # and appends it to decisions.md sdcs verify --topology --append-rejections
-
Mechanism: Verifies staged git modifications against declarative
protected_pathsinwiring.yaml. -
Enforcement: Halts commits attempting to mutate infrastructure, deployment configurations, or protected schemas without explicit authorization (
sdcs verify --sandbox).
-
Mechanism: Statically compares tracked Git repository files against entries in
app_map.md. -
Enforcement: Integrated into
.githooks/pre-commit. Haltsgit commitif new files exist without cartography entries. -
Remediation:
# Check for drift sdcs map --check # Reconcile app_map.md with disk in-stride, preserving developer annotations sdcs map --sync
-
Mechanism: Deterministic token-budget linter verifying token counts and canonical 3-section schema of
state.md. -
Enforcement: Requires
state.md$\le 350$ tokens (or custom ceiling via--max-tokens) and enforces canonical headers:## Current Objective,## Status & Gate Verification,## Immediate Next Action. Also handles ephemeral subagent blackboard lifecycle (sdcs state forkandsdcs state rollup).
- Mechanism: Static AST and regex scanner inspecting code and documentation before publication to the central cognitive warehouse.
-
Enforcement: Automatically redacts Google, OpenAI, GitHub, and AWS API keys, bearer tokens, email addresses, phone numbers, and routable IPv4 addresses (
sdcs verify --warehouseandsdcs warehouse publish).
- Mechanism: Static AST inspector auditing newly created or modified test suites.
-
Enforcement: Halts commits introducing:
-
Rule Q1 (Trivial Assertions): Tests asserting
True,not False, orx is not None. - Rule Q2 (Assertless Tests): Test functions executing code without assertions.
-
Rule Q3 (Swallowed Exceptions): Masking test failures via
try...except Exception: pass. - Rule Q4 (Mock Abuse): Mocks exceeding assertions without invoking the target unit.
-
Rule Q1 (Trivial Assertions): Tests asserting
-
Mechanism: Verifies local Python runtime interpreter, system tools (
git,pytest), and required environment variables declared inwiring.yamlorpyproject.toml. -
Enforcement: Blocks commits if the environment is misconfigured (
sdcs verify --env), and provides comprehensive diagnostic reporting viasdcs doctor.
- Mechanism: Static transition graph analyzer tracking modified file sets across consecutive commits and turns.
-
Enforcement: Detects period-2 alternating thrashing loops (
$A \to B \to A \to B$ ) and isolated single-file thrashing. Trips immediately to prevent agents from burning tokens and introducing Frankenstein patches (sdcs verify --cycles).
- Mechanism: Static token and regex analyzer auditing system prompts, boot instructions, and hydration templates.
-
Enforcement: Rejects cache-busting volatile tokens (ISO timestamps, turn counters like
Turn 4 of 20, process IDs) from being positioned in the static prompt prefix. Guarantees 100% KV-cache hit rate across multi-turn trajectories (sdcs verify --cache-invariance).
- Mechanism: Sandbox execution hook intercepting code changes before kinetic gates and test suites run.
-
Enforcement: Runs local determinist formatters (
ruff --fix,black,prettier,gofmt) using 0 LLM inference tokens, eliminating unnecessary LLM turns caused by trivial style and formatting failures (sdcs repair).
Spec-Driven Cognitive Scaffolding (SDCS v1.8.1) | Author: Adam Murphy | Licensed under MIT
- Home
- Architecture & Ontology
- The 7 Cognitive Pillars
- Kinetic Enforcement Gates
- Lossless Compaction
- Agent Runbooks & SOPs
- CLI Command Reference
- Ontology Lexicon & Glossary
Quick Install
pip install sdcsResources