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_multi_agent_bundle_gate.py
View on GitHub"""Test multi-agent bundle gate transitions and Socratic cadence constraints."""
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 agent_control import ControlPlane, CANONICAL_STATES, InvalidStateTransition
from interview_helpers import stage_interview_answers
from control_plane.constants import (
STATE_INTERVIEW, STATE_DRAFT_PLAN, STATE_MULTI_AGENT_REVIEW, STATE_PLAN_REVIEW, STATE_AWAITING_APPROVAL,
)
def test_draft_plan_and_multi_agent_review_states_exist():
assert STATE_DRAFT_PLAN in CANONICAL_STATES
assert STATE_MULTI_AGENT_REVIEW in CANONICAL_STATES
def test_full_intake_to_approval_lifecycle(tmp_path, monkeypatch):
db_file = tmp_path / "control_plane.db"
cp = ControlPlane(db_path=db_file)
cp.init_db()
task_id = "test-bundle-001"
cp.create_task(task_id=task_id, title="Test Bundle Gate", runtime_tool="antigravity")
# INTAKE -> INTERVIEW
cp.transition(task_id=task_id, to_state=STATE_INTERVIEW, actor="user", reason="1-question-at-a-time interview")
assert cp.get_task(task_id)["state"] == STATE_INTERVIEW
# INTERVIEW -> DRAFT_PLAN
cp.record_plan_mode_entry(task_id=task_id, actor="agent")
stage_interview_answers(cp, task_id)
cp.transition(task_id=task_id, to_state=STATE_DRAFT_PLAN, actor="agent", reason="Compiled draft spec and plan")
assert cp.get_task(task_id)["state"] == STATE_DRAFT_PLAN
# Task 1's artifact gate is intentional: provide real test-local artifacts
# instead of weakening the DRAFT_PLAN review contract.
plan_dir = tmp_path / "docs" / "plans"
plan_dir.mkdir(parents=True)
(plan_dir / f"{task_id}-spec.md").write_text("# Test specification\n", encoding="utf-8")
(plan_dir / f"{task_id}-implementation-plan.md").write_text("# Test implementation plan\n", encoding="utf-8")
# Path A: DRAFT_PLAN -> PLAN_REVIEW -> MULTI_AGENT_REVIEW -> PLAN_REVIEW
# -> AWAITING_APPROVAL. Review outcomes converge before acceptance.
from control_plane.coordinator import TransitionCoordinator
from control_plane.registry import TransitionRegistry
reg = TransitionRegistry.load_default()
inputs = iter(["1", "YES", "1", "4", "YES", "1", "YES"]) # submit[+guidance], request review, external bundle[+guidance], accept[+guidance]
coord = TransitionCoordinator(control_plane=cp, registry=reg, input_fn=lambda prompt: next(inputs))
monkeypatch.setattr(coord, "_resolve_repo_root", lambda: tmp_path)
coord.coordinate_transition(
task_id=task_id,
to_state=STATE_PLAN_REVIEW,
actor="human",
reason="Submit plan for disposition",
interactive=True
)
assert cp.get_task(task_id)["state"] == STATE_PLAN_REVIEW
coord.coordinate_transition(
task_id=task_id,
to_state=STATE_MULTI_AGENT_REVIEW,
actor="human",
reason="User opted for external review bundle",
interactive=True
)
assert cp.get_task(task_id)["state"] == STATE_MULTI_AGENT_REVIEW
cp.record_critic_review(task_id=task_id, iteration=1, model="gpt-5-mini", verdict="PASS", findings="External review passed")
cp.transition(task_id=task_id, to_state=STATE_PLAN_REVIEW, actor="user", reason="External review iterations complete")
coord.coordinate_transition(
task_id=task_id,
to_state=STATE_AWAITING_APPROVAL,
actor="human",
reason="User accepted reviewed plan",
interactive=True
)
assert cp.get_task(task_id)["state"] == STATE_AWAITING_APPROVAL
def test_skip_multi_agent_review_gate(tmp_path, monkeypatch):
db_file = tmp_path / "control_plane.db"
cp = ControlPlane(db_path=db_file)
cp.init_db()
task_id = "test-bundle-002"
cp.create_task(task_id=task_id, title="Test Skip Gate", runtime_tool="claude")
cp.transition(task_id=task_id, to_state=STATE_INTERVIEW, actor="user", reason="Interviewing")
cp.record_plan_mode_entry(task_id=task_id, actor="agent")
stage_interview_answers(cp, task_id)
cp.transition(task_id=task_id, to_state=STATE_DRAFT_PLAN, actor="agent", reason="Draft compiled")
plan_dir = tmp_path / "docs" / "plans"
plan_dir.mkdir(parents=True)
(plan_dir / f"{task_id}-spec.md").write_text("# Test specification\n", encoding="utf-8")
(plan_dir / f"{task_id}-implementation-plan.md").write_text("# Test implementation plan\n", encoding="utf-8")
# Path B: User skips independent review but still passes PLAN_REVIEW.
from control_plane.coordinator import TransitionCoordinator
from control_plane.registry import TransitionRegistry
reg = TransitionRegistry.load_default()
inputs = iter(["1", "YES", "1", "YES"]) # accept-as-is/skip[+guidance], accept plan[+guidance]
coord = TransitionCoordinator(control_plane=cp, registry=reg, input_fn=lambda prompt: next(inputs))
monkeypatch.setattr(coord, "_resolve_repo_root", lambda: tmp_path)
coord.coordinate_transition(
task_id=task_id,
to_state=STATE_PLAN_REVIEW,
actor="human",
reason="User opted to skip independent review",
interactive=True
)
cp.record_review_skip(task_id=task_id, phase="multi_agent_review", actor="user", reason="User opted to skip multi-agent review")
coord.coordinate_transition(
task_id=task_id,
to_state=STATE_AWAITING_APPROVAL,
actor="human",
reason="User accepted unreviewed plan",
interactive=True
)
assert cp.get_task(task_id)["state"] == STATE_AWAITING_APPROVAL
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 |