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_human_signer_isolation.py
View on GitHub#!/usr/bin/env python
"""
test_human_signer_isolation.py
==============================
Purpose:
Regression tests for the test-suite stand-in human (tests/helpers/human_signer.py).
On 2026-09-24 the agentic-os suite was run from the real repository root; tests
whose ControlPlane had no repo_root made the helper fall back to Path.cwd() and
overwrite the operator's real context/identity/allowed_signers (and
allowed_signers_selftest) with the throwaway test key, silently revoking the
human's Gate 1 enrollment. The helper must never write outside a temp directory
and must never drop lines already present in an allowed_signers file.
Key Input Dependencies:
plugins/agent-agentic-os/skills/running-control-plane/tests/helpers/human_signer.py — TestHuman under test
ssh-keygen (TestHuman generates a throwaway ed25519 key)
Layer: Development / Testing
Functions:
- test_ensure_identity_refuses_real_repo_root
- test_identity_root_is_temp_when_control_plane_has_no_repo_root
- test_ensure_identity_keeps_existing_signers
Usage:
python -m pytest plugins/agent-agentic-os/skills/running-control-plane/tests/test_human_signer_isolation.py
"""
import hashlib
import sys
import tempfile
import uuid
from pathlib import Path
from types import SimpleNamespace
import pytest
_TESTS_DIR = Path(__file__).resolve().parent
if str(_TESTS_DIR) not in sys.path:
sys.path.insert(0, str(_TESTS_DIR))
from helpers.human_signer import TestHuman
REPO_ROOT = Path(__file__).resolve().parents[5]
REAL_IDENTITY = REPO_ROOT / "context" / "identity"
def _digest(folder: Path) -> dict:
"""Hash every allowed_signers* file so any mutation is detectable."""
if not folder.is_dir():
return {}
return {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in sorted(folder.glob("allowed_signers*"))}
@pytest.fixture
def human():
h = TestHuman()
yield h
h.close()
def test_ensure_identity_refuses_real_repo_root(human):
"""Refuses any root outside the temp dir before touching the filesystem, wherever this
checkout lives (a checkout inside $TMPDIR is itself a legitimate disposable root)."""
non_temp = Path("/") / f"agentic-os-not-temp-{uuid.uuid4().hex}"
assert not non_temp.resolve().is_relative_to(Path(tempfile.gettempdir()).resolve())
with pytest.raises(RuntimeError, match="temp"):
human.ensure_identity(non_temp)
assert not non_temp.exists() # refused before any mkdir
before = _digest(REAL_IDENTITY)
if not REPO_ROOT.resolve().is_relative_to(Path(tempfile.gettempdir()).resolve()):
with pytest.raises(RuntimeError, match="temp"):
human.ensure_identity(REPO_ROOT)
assert _digest(REAL_IDENTITY) == before
def test_identity_root_is_temp_when_control_plane_has_no_repo_root(human, monkeypatch):
monkeypatch.chdir(REPO_ROOT)
root = human.identity_root_for(SimpleNamespace())
assert root.resolve().is_relative_to(Path(tempfile.gettempdir()).resolve())
assert not root.resolve().is_relative_to(REPO_ROOT)
def test_ensure_identity_keeps_existing_signers(human, tmp_path):
identity = tmp_path / "context" / "identity"
identity.mkdir(parents=True)
operator = 'operator@control-plane namespaces="control-plane@agentic-os.local" ssh-ed25519 AAAAoperatorkey\n'
(identity / "allowed_signers").write_text(operator, encoding="utf-8")
human.ensure_identity(tmp_path)
text = (identity / "allowed_signers").read_text(encoding="utf-8")
assert operator.strip() in text
assert "test-human@local" in text
def test_test_human_temp_dir_removed_at_exit(tmp_path):
import subprocess
marker = tmp_path / "dir.txt"
code = (
"import sys; sys.path.insert(0, %r)\n"
"from helpers.human_signer import get_test_human\n"
"open(%r, 'w').write(str(get_test_human()._dir))\n"
) % (str(_TESTS_DIR), str(marker))
subprocess.run([sys.executable, "-c", code], check=True, cwd=_TESTS_DIR.parent / "scripts")
assert not Path(marker.read_text()).exists()
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 |