richfrem/agent-plugins-skills / plugins/agent-agentic-os/.apm/skills/running-control-plane
running-control-plane
FlaggedCRITICAL INTAKE GATEWAY: use at the start of any non-trivial engineering task, feature, refactor, multi-file bugfix, work package or new idea, including requests to explore, brainstorm, build, fix or change something, before planning or code changes. Enforces read-only discovery, 1-3 structured questions with defaults, control-plane registration and the immutable four-pillar TASK_SPEC.md. Also runs the rest of the control plane: health ("run health check", "check os metrics", "system monitor", event bus, locks, memory, "is my signing identity ready" status check), transition simulation ("dry run transition", "simulate transition", "check edge X -> Y"), worktree selection, and gating on/off ("disable the control plane", "turn off the push guard", "stop gating my commits"). Not for project setup or key creation (use setting-up-agentic-os) or improving skills (use improving-skills-in-lab).
tests/test_control_plane_ports.py
View on GitHub"""
test_control_plane_ports.py — Dependency-Direction Invariant Check (issue-524, Step 2)
========================================================================================
Purpose:
Verifies control_plane/ports.py declares pure interfaces with zero infrastructure
imports, per docs/plans/issue-524-spec.md's dependency-direction invariant (DoD item 5,
Section 5 Step 2): domain/policy code must not import sqlite3, subprocess, hashlib,
time-based I/O, or concrete filesystem/model-catalog storage. This test statically
inspects the module's import statements via `ast`, rather than trusting a manual read,
so a future edit that accidentally reintroduces a banned import fails loudly.
Key Input Dependencies:
- plugins/agent-agentic-os/skills/running-control-plane/scripts/control_plane/ports.py (module under test)
Key Functions:
- test_ports_module_has_no_banned_infrastructure_imports()
- test_ports_module_is_importable_standalone()
- test_all_port_classes_are_abstract()
"""
import ast
import sys
from pathlib import Path
import pytest
SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "scripts"
if str(SCRIPTS_DIR) not in sys.path:
sys.path.insert(0, str(SCRIPTS_DIR))
BANNED_MODULES = {"sqlite3", "subprocess", "hashlib", "time", "os"}
PORTS_FILE = SCRIPTS_DIR / "control_plane" / "ports.py"
def _collect_imported_module_names(source: str) -> set:
"""Parses Python source and returns the set of top-level module names imported."""
tree = ast.parse(source)
names = set()
for node in ast.walk(tree):
if isinstance(node, ast.Import):
for alias in node.names:
names.add(alias.name.split(".")[0])
elif isinstance(node, ast.ImportFrom):
if node.module:
names.add(node.module.split(".")[0])
return names
def test_ports_module_has_no_banned_infrastructure_imports():
"""control_plane/ports.py must import only stdlib abc/typing/pathlib — never sqlite3,
subprocess, hashlib, time, or os (filesystem side-effects belong in adapters)."""
source = PORTS_FILE.read_text(encoding="utf-8")
imported = _collect_imported_module_names(source)
violations = imported & BANNED_MODULES
assert not violations, f"control_plane/ports.py imports banned infrastructure modules: {violations}"
def test_ports_module_is_importable_standalone():
"""The ports module must import cleanly on its own, with no side effects requiring a
live database, filesystem state, or network access."""
from control_plane import ports # noqa: F401 — import success is the assertion
assert hasattr(ports, "PersistencePort")
assert hasattr(ports, "FilesystemPort")
assert hasattr(ports, "CryptoPort")
assert hasattr(ports, "ClockPort")
assert hasattr(ports, "ModelCatalogPort")
def test_all_port_classes_are_abstract():
"""Every port interface must be a true ABC that cannot be instantiated directly —
proves each interface still has at least one unimplemented abstract method."""
from control_plane import ports
for cls in (ports.PersistencePort, ports.FilesystemPort, ports.CryptoPort,
ports.ClockPort, ports.ModelCatalogPort):
with pytest.raises(TypeError):
cls()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |