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).
scripts/control_plane/implementation.py
View on GitHub"""
control_plane/implementation.py -- Implementation Task Ledger Validation
=============================================================================
Purpose:
Validation for the machine-readable implementation task ledger: a fenced JSON
block under a "## Implementation Task Ledger" heading in a plan document, where
every entry must be marked COMPLETE with non-empty evidence and at least one
artifact path that actually exists inside the repository root.
Key Input Dependencies:
- The plan document at `plan_path` (must contain LEDGER_HEADING followed by a
fenced ```json block of ledger entries).
- `repo_root` -- used to resolve and bound-check each entry's artifact paths.
Key Functions:
- LEDGER_HEADING -- the exact markdown heading the ledger's fenced JSON follows.
- _load_entries() -- parses and structurally validates the fenced JSON ledger.
- validate_implementation_ledger() -- returns a denial reason string unless every
ledger entry is COMPLETE with evidence and existing, in-repo artifacts; None
on success.
"""
import json
from pathlib import Path
from typing import Any, Dict, Optional
LEDGER_HEADING = "## Implementation Task Ledger"
def _load_entries(plan_path: Path) -> list[Dict[str, Any]]:
text = plan_path.read_text(encoding="utf-8")
heading_start = text.find(LEDGER_HEADING)
if heading_start < 0:
raise ValueError(f"{plan_path.name} is missing the '{LEDGER_HEADING}' section")
fenced_start = text.find("```json", heading_start)
if fenced_start < 0:
raise ValueError(f"{plan_path.name} ledger must contain a fenced JSON block")
payload_start = fenced_start + len("```json")
fenced_end = text.find("```", payload_start)
if fenced_end < 0:
raise ValueError(f"{plan_path.name} ledger JSON block is not closed")
entries = json.loads(text[payload_start:fenced_end].strip())
if not isinstance(entries, list) or not entries:
raise ValueError("implementation ledger must be a non-empty JSON list")
if not all(isinstance(entry, dict) for entry in entries):
raise ValueError("every implementation ledger entry must be a JSON object")
return entries
def validate_implementation_ledger(plan_path: Path, repo_root: Path) -> Optional[str]:
"""Return a denial reason unless every planned implementation item is proven complete."""
try:
entries = _load_entries(plan_path)
except (OSError, ValueError, json.JSONDecodeError) as exc:
return f"Implementation ledger invalid: {exc}"
root = repo_root.resolve()
for entry in entries:
task_id = str(entry.get("id", "")).strip() or "<unnamed>"
if entry.get("status") != "COMPLETE":
return f"Implementation task '{task_id}' is not COMPLETE."
evidence = entry.get("evidence")
if not isinstance(evidence, str) or not evidence.strip():
return f"Implementation task '{task_id}' is missing completion evidence."
artifacts = entry.get("artifacts")
if not isinstance(artifacts, list) or not artifacts:
return f"Implementation task '{task_id}' must list one or more artifacts."
for artifact in artifacts:
if not isinstance(artifact, str) or not artifact.strip():
return f"Implementation task '{task_id}' contains an invalid artifact path."
candidate = (root / artifact).resolve()
try:
candidate.relative_to(root)
except ValueError:
return f"Implementation task '{task_id}' artifact escapes repository root: {artifact}"
if not candidate.exists():
return f"Implementation task '{task_id}' artifact is missing: {artifact}"
return None
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 |