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_implementation_ledger.py
View on GitHub"""Tests for the plan-to-implementation completeness contract."""
import json
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))
from control_plane.implementation import validate_implementation_ledger
from agent_control import ControlPlane
from control_plane import policy
from control_plane.constants import (
STATE_VERIFY_EXIT, STATE_RETROSPECTIVE,
)
def _plan(entries):
payload = json.dumps(entries, indent=2)
return f"# Implementation plan\n\n## Implementation Task Ledger\n```json\n{payload}\n```\n"
def test_incomplete_ledger_is_rejected_even_when_artifact_exists(tmp_path):
artifact = tmp_path / "implemented.py"
artifact.write_text("# implemented\n", encoding="utf-8")
plan = tmp_path / "implementation-plan.md"
plan.write_text(
_plan([{
"id": "task-1",
"status": "PENDING",
"artifacts": ["implemented.py"],
"evidence": "pytest -q",
}]),
encoding="utf-8",
)
error = validate_implementation_ledger(plan, tmp_path)
assert error is not None
assert "task-1" in error
assert "COMPLETE" in error
def test_complete_ledger_requires_evidence_and_existing_artifacts(tmp_path):
artifact = tmp_path / "implemented.py"
artifact.write_text("# implemented\n", encoding="utf-8")
plan = tmp_path / "implementation-plan.md"
plan.write_text(
_plan([{
"id": "task-1",
"status": "COMPLETE",
"artifacts": ["implemented.py"],
"evidence": "pytest -q tests/test_implemented.py",
}]),
encoding="utf-8",
)
assert validate_implementation_ledger(plan, tmp_path) is None
def test_verify_exit_policy_uses_the_ledger_gate(tmp_path):
context = tmp_path / "context"
context.mkdir()
cp = ControlPlane(db_path=context / "control_plane.db")
cp.repo_root = tmp_path
cp.create_task("ledger-task", "Ledger gate", "codex")
plan = tmp_path / "docs" / "plans" / "ledger-task-implementation-plan.md"
plan.parent.mkdir(parents=True)
plan.write_text(
_plan([{
"id": "task-1",
"status": "PENDING",
"artifacts": ["docs/plans/ledger-task-implementation-plan.md"],
"evidence": "pytest -q",
}]),
encoding="utf-8",
)
ctx = cp._build_transition_policy_ctx(
"ledger-task", cp.get_task("ledger-task"), STATE_VERIFY_EXIT, STATE_RETROSPECTIVE
)
with pytest.raises(policy.PolicyViolation, match="not COMPLETE"):
policy.evaluate_check("implementation_completeness", ctx)
@pytest.mark.parametrize(
"entry, expected",
[
({"id": "task-1", "status": "COMPLETE", "artifacts": [], "evidence": "pytest"}, "artifacts"),
({"id": "task-1", "status": "COMPLETE", "artifacts": ["missing.py"], "evidence": "pytest"}, "missing"),
({"id": "task-1", "status": "COMPLETE", "artifacts": ["ok.py"], "evidence": ""}, "evidence"),
],
)
def test_ledger_rejects_missing_completion_proof(tmp_path, entry, expected):
(tmp_path / "ok.py").write_text("# ok\n", encoding="utf-8")
plan = tmp_path / "implementation-plan.md"
plan.write_text(_plan([entry]), encoding="utf-8")
error = validate_implementation_ledger(plan, tmp_path)
assert error is not None
assert expected in error
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 | Unverified | 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 |