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/test_worktree_manager.py
View on GitHub"""
test_worktree_manager.py -- Contract Tests for Native-First Worktree Routing
==================================================================================
Purpose:
RED contract tests for native-first worktree routing: verifies build_worktree_plan()
prefers a runtime's native worktree capability when confirmed, falls back to the
portable `.worktrees/<task-id>` layout for unknown runtimes, bounds portable
placement under `.worktrees`, and routes cleanup_command() per strategy.
Key Input Dependencies:
- capability_probe.py's probe_runtime() (runtime capability detection).
- worktree_manager.py (module under test) -- build_worktree_plan(),
cleanup_command(), validate_portable_placement().
Key Functions:
- test_codex_prefers_native_worktree_when_capability_is_confirmed()
- test_unknown_runtime_uses_portable_repo_worktree_fallback()
- test_portable_placement_must_remain_under_worktrees()
- test_cleanup_routes_native_and_portable_modes()
"""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from pathlib import Path
import pytest
from capability_probe import _RUNTIME_MARKERS, probe_runtime
@pytest.fixture(autouse=True)
def clean_env(monkeypatch):
for _, markers in _RUNTIME_MARKERS:
for marker in markers:
monkeypatch.delenv(marker, raising=False)
from worktree_manager import (
build_worktree_plan,
cleanup_command,
validate_portable_placement,
STRATEGY_NATIVE,
STRATEGY_PORTABLE,
)
def test_codex_prefers_native_worktree_when_capability_is_confirmed(monkeypatch, tmp_path):
monkeypatch.setenv("CODEX_CLI", "1")
monkeypatch.setenv("CODEX_NATIVE_WORKTREE", "1")
plan = build_worktree_plan("task-1", "feat/task-1", tmp_path, probe_runtime())
assert plan.strategy == STRATEGY_NATIVE
assert plan.activation_guidance
def test_unknown_runtime_uses_portable_repo_worktree_fallback(tmp_path):
capabilities = probe_runtime(runtime_id="unknown")
plan = build_worktree_plan("task-2", "feat/task-2", tmp_path, capabilities)
assert plan.strategy == STRATEGY_PORTABLE
assert plan.path == tmp_path / ".worktrees" / "task-2"
assert "issue-worktree-agent" in plan.fallback_command
def test_portable_placement_must_remain_under_worktrees(tmp_path):
allowed = tmp_path / ".worktrees" / "task-3"
assert validate_portable_placement(allowed, tmp_path) == allowed
with pytest.raises(ValueError, match=r"\.worktrees"):
validate_portable_placement(tmp_path / "outside", tmp_path)
def test_cleanup_routes_native_and_portable_modes():
assert cleanup_command(Path("/tmp/native"), STRATEGY_NATIVE) == ["native-worktree-cleanup", "/tmp/native"]
assert cleanup_command(Path("/tmp/portable"), STRATEGY_PORTABLE)[-1] == "/tmp/portable"
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 |