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_audit_map_debt.py
View on GitHub"""
Purpose:
Unit tests for audit_map_debt.py: markdown entry parsing and
expired/repeat OPEN-entry evaluation logic.
Key Input Dependencies:
- audit_map_debt.py (in ../scripts/, imported directly)
"""
import sys
import tempfile
from pathlib import Path
# Bootstrap path to include scripts
REPO_ROOT = Path(__file__).resolve().parents[5]
SKILL_DIR = Path(__file__).resolve().parent.parent
SCRIPT_DIR = SKILL_DIR / "scripts"
sys.path.insert(0, str(SCRIPT_DIR))
# Import the functions we built
from audit_map_debt import parse_debt_entries, evaluate_debt
def test_parse_debt_entries_with_valid_file():
"""parse_debt_entries splits '---'-separated sections and maps '- Key: Value' lines into dicts."""
content = """
# Map Debt
- Logged: 2026-07-01
- Artifact: test_file.py
- Friction: Test friction
- Why not fixed: Deferred
- Recommended fix: Fix it
- Evidence: None
- Severity: M
- Repeat: NO
- Status: OPEN
---
- Logged: 2026-06-15
- Artifact: another_file.py
- Friction: Old friction
- Why not fixed: Deferred
- Recommended fix: Fix it
- Evidence: None
- Severity: L
- Repeat: YES
- Status: RESOLVED
"""
with tempfile.NamedTemporaryFile("w", delete=False) as f:
f.write(content)
temp_path = f.name
try:
entries = parse_debt_entries(Path(temp_path))
assert len(entries) == 2
# Verify first entry parsing
assert entries[0]["Logged"] == "2026-07-01"
assert entries[0]["Artifact"] == "test_file.py"
assert entries[0]["Repeat"] == "NO"
assert entries[0]["Status"] == "OPEN"
# Verify second entry parsing
assert entries[1]["Logged"] == "2026-06-15"
assert entries[1]["Repeat"] == "YES"
assert entries[1]["Status"] == "RESOLVED"
finally:
Path(temp_path).unlink()
def test_evaluate_debt_passes_with_fresh_open_entries():
"""An OPEN entry logged only 2 days before today produces no errors."""
entries = [
{
"Logged": "2026-07-02",
"Artifact": "file.py",
"Repeat": "NO",
"Status": "OPEN",
"Friction": "Minor issue"
}
]
errors = evaluate_debt(entries, today_str="2026-07-04")
assert len(errors) == 0
def test_evaluate_debt_fails_with_expired_open_entry():
"""An OPEN entry logged more than 14 days before today produces an EXPIRED error."""
entries = [
{
"Logged": "2026-06-15",
"Artifact": "file.py",
"Repeat": "NO",
"Status": "OPEN",
"Friction": "Stale issue"
}
]
errors = evaluate_debt(entries, today_str="2026-07-04")
assert len(errors) == 1
assert "EXPIRED" in errors[0]
assert "file.py" in errors[0]
def test_evaluate_debt_fails_with_repeat_open_entry():
"""An OPEN entry with Repeat=YES produces a REPEAT error regardless of age."""
entries = [
{
"Logged": "2026-07-03",
"Artifact": "file.py",
"Repeat": "YES",
"Status": "OPEN",
"Friction": "Repeated issue"
}
]
errors = evaluate_debt(entries, today_str="2026-07-04")
assert len(errors) == 1
assert "REPEAT" in errors[0]
assert "file.py" in errors[0]
def test_evaluate_debt_passes_with_resolved_expired_or_repeat_entries():
"""A RESOLVED entry produces no errors even if it is both expired and Repeat=YES."""
entries = [
{
"Logged": "2026-06-15",
"Artifact": "file.py",
"Repeat": "YES",
"Status": "RESOLVED",
"Friction": "Old issue"
}
]
errors = evaluate_debt(entries, today_str="2026-07-04")
assert len(errors) == 0
def test_parse_debt_entries_with_markdown_table():
"""parse_debt_entries parses standard 8-column markdown tables seamlessly."""
table_content = """# Map Debt Ledger
| ID | Title | Status | Severity | Repeat | First Seen | Description | Resolution Commit |
|---|---|---|---|---|---|---|---|
| DEBT-20260831-01 | Inline Python fallback | RESOLVED | Tier 0 | NO | 2026-08-31 | Description here | commit123 |
| DEBT-20260901-01 | Stale debt | OPEN | Tier 1 | YES | 2026-06-01 | Another issue | |
"""
with tempfile.NamedTemporaryFile("w", delete=False) as f:
f.write(table_content)
temp_path = f.name
try:
entries = parse_debt_entries(Path(temp_path))
assert len(entries) == 2
assert entries[0]["ID"] == "DEBT-20260831-01"
assert entries[0]["Status"] == "RESOLVED"
assert entries[1]["Repeat"] == "YES"
assert entries[1]["Status"] == "OPEN"
errors = evaluate_debt(entries, today_str="2026-07-01")
assert len(errors) == 2 # expired and repeat
finally:
Path(temp_path).unlink(missing_ok=True)
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 |