agent-control-plane 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ source "${HOOK_SCRIPT_DIR}/../tools/bin/flow-config-lib.sh"
7
7
 
8
8
  FLOW_SKILL_DIR="$(cd "${HOOK_SCRIPT_DIR}/.." && pwd)"
9
9
  CONFIG_YAML="$(resolve_flow_config_yaml "${BASH_SOURCE[0]}")"
10
+ PROFILE_ID="$(flow_resolve_adapter_id "${CONFIG_YAML}")"
10
11
  ADAPTER_BIN_DIR="${FLOW_SKILL_DIR}/bin"
11
12
  FLOW_TOOLS_DIR="${FLOW_SKILL_DIR}/tools/bin"
12
13
  REPO_SLUG="$(flow_resolve_repo_slug "${CONFIG_YAML}")"
@@ -15,6 +16,12 @@ STATE_ROOT="$(flow_resolve_state_root "${CONFIG_YAML}")"
15
16
  RUNS_ROOT="$(flow_resolve_runs_root "${CONFIG_YAML}")"
16
17
  BLOCKED_RECOVERY_STATE_DIR="${STATE_ROOT}/blocked-recovery-issues"
17
18
 
19
+ issue_kick_scheduler() {
20
+ ACP_PROJECT_ID="${PROFILE_ID}" \
21
+ AGENT_PROJECT_ID="${PROFILE_ID}" \
22
+ "${FLOW_TOOLS_DIR}/kick-scheduler.sh" "${1:-2}" >/dev/null || true
23
+ }
24
+
18
25
  issue_clear_blocked_recovery_state() {
19
26
  rm -f "${BLOCKED_RECOVERY_STATE_DIR}/${ISSUE_ID}.env" 2>/dev/null || true
20
27
  }
@@ -194,7 +201,7 @@ issue_after_pr_created() {
194
201
  if [[ "$(jq -r '.eligibleForAutoMerge' <<<"$risk_json")" == "true" ]]; then
195
202
  bash "${FLOW_TOOLS_DIR}/agent-github-update-labels" --repo-slug "${REPO_SLUG}" --number "$pr_number" --add agent-automerge >/dev/null || true
196
203
  fi
197
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 5 >/dev/null || true
204
+ issue_kick_scheduler 5
198
205
  }
199
206
 
200
207
  issue_after_reconciled() {
@@ -213,5 +220,5 @@ issue_after_reconciled() {
213
220
  esac
214
221
  fi
215
222
 
216
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 2 >/dev/null || true
223
+ issue_kick_scheduler 2
217
224
  }
@@ -7,6 +7,7 @@ source "${HOOK_SCRIPT_DIR}/../tools/bin/flow-config-lib.sh"
7
7
 
8
8
  FLOW_SKILL_DIR="$(cd "${HOOK_SCRIPT_DIR}/.." && pwd)"
9
9
  CONFIG_YAML="$(resolve_flow_config_yaml "${BASH_SOURCE[0]}")"
10
+ PROFILE_ID="$(flow_resolve_adapter_id "${CONFIG_YAML}")"
10
11
  ADAPTER_BIN_DIR="${FLOW_SKILL_DIR}/bin"
11
12
  FLOW_TOOLS_DIR="${FLOW_SKILL_DIR}/tools/bin"
12
13
  RUNS_ROOT="$(flow_resolve_runs_root "${CONFIG_YAML}")"
@@ -19,6 +20,12 @@ ISSUE_SESSION_PREFIX="$(flow_resolve_issue_session_prefix "${CONFIG_YAML}")"
19
20
  PR_WORKTREE_BRANCH_PREFIX="$(flow_resolve_pr_worktree_branch_prefix "${CONFIG_YAML}")"
20
21
  PR_LANE_OVERRIDE_DIR="${STATE_ROOT}/pr-lane-overrides"
21
22
 
23
+ pr_kick_scheduler() {
24
+ ACP_PROJECT_ID="${PROFILE_ID}" \
25
+ AGENT_PROJECT_ID="${PROFILE_ID}" \
26
+ "${FLOW_TOOLS_DIR}/kick-scheduler.sh" "${1:-2}" >/dev/null || true
27
+ }
28
+
22
29
  pr_best_effort_update_labels() {
23
30
  bash "${FLOW_TOOLS_DIR}/agent-github-update-labels" "$@" >/dev/null 2>&1 || true
24
31
  }
@@ -131,14 +138,14 @@ pr_after_merged() {
131
138
  pr_clear_lane_override "$pr_number"
132
139
  pr_best_effort_update_labels --repo-slug "${REPO_SLUG}" --number "$pr_number" --remove agent-running --remove agent-automerge --remove agent-repair-queued --remove agent-fix-needed --remove agent-manual-fix-override --remove agent-ci-refresh --remove agent-ci-bypassed --remove agent-double-check-1/2 --remove agent-double-check-2/2 --remove agent-human-review --remove agent-human-approved --remove agent-blocked --remove agent-handoff --remove agent-exclusive
133
140
  pr_refresh_linked_issue_checklist "$pr_number"
134
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 5 >/dev/null || true
141
+ pr_kick_scheduler 5
135
142
  }
136
143
 
137
144
  pr_after_closed() {
138
145
  local pr_number="${1:?pr number required}"
139
146
  pr_clear_lane_override "$pr_number"
140
147
  pr_best_effort_update_labels --repo-slug "${REPO_SLUG}" --number "$pr_number" --remove agent-running --remove agent-automerge --remove agent-repair-queued --remove agent-fix-needed --remove agent-manual-fix-override --remove agent-ci-refresh --remove agent-ci-bypassed --remove agent-double-check-1/2 --remove agent-double-check-2/2 --remove agent-human-review --remove agent-human-approved --remove agent-blocked --remove agent-handoff --remove agent-exclusive
141
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 5 >/dev/null || true
148
+ pr_kick_scheduler 5
142
149
  }
143
150
 
144
151
  pr_automerge_allowed() {
@@ -189,7 +196,7 @@ pr_after_double_check_advanced() {
189
196
  pr_set_lane_override "$pr_number" "double-check-${next_stage}"
190
197
  pr_best_effort_update_labels --repo-slug "${REPO_SLUG}" --number "$pr_number" --remove agent-running --remove agent-automerge --remove agent-repair-queued --remove agent-fix-needed --remove agent-manual-fix-override --remove agent-ci-refresh --remove agent-human-review --remove agent-human-approved --remove agent-double-check-1/2 --remove agent-double-check-2/2 --add "$next_label"
191
198
  pr_best_effort_sync_pr_labels "$pr_number"
192
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 5 >/dev/null || true
199
+ pr_kick_scheduler 5
193
200
  }
194
201
 
195
202
  pr_after_updated_branch() {
@@ -221,5 +228,5 @@ pr_after_failed() {
221
228
  }
222
229
 
223
230
  pr_after_reconciled() {
224
- "${FLOW_TOOLS_DIR}/kick-scheduler.sh" 2 >/dev/null || true
231
+ pr_kick_scheduler 2
225
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-control-plane",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Help a repo keep GitHub-driven coding agents running reliably without constant human babysitting",
5
5
  "homepage": "https://github.com/ducminhnguyen0319/agent-control-plane",
6
6
  "bugs": {
@@ -24,6 +24,7 @@
24
24
  "bin",
25
25
  "hooks",
26
26
  "npm/bin",
27
+ "references",
27
28
  "tools/bin",
28
29
  "tools/dashboard/app.js",
29
30
  "tools/dashboard/dashboard_snapshot.py",
@@ -39,7 +40,7 @@
39
40
  "scripts": {
40
41
  "doctor": "node ./npm/bin/agent-control-plane.js doctor",
41
42
  "smoke": "node ./npm/bin/agent-control-plane.js smoke",
42
- "test": "bash tools/tests/test-agent-control-plane-npm-cli.sh && bash tools/tests/test-profile-adopt-skip-anchor-sync-creates-agent-repo-root.sh && bash tools/tests/test-vendored-codex-quota-claude-oauth-only.sh"
43
+ "test": "bash tools/tests/test-agent-control-plane-npm-cli.sh && bash tools/tests/test-agent-project-detached-launch-stable-cwd.sh && bash tools/tests/test-agent-project-claude-session-wrapper-reaps-child-on-term.sh && bash tools/tests/test-agent-project-claude-session-wrapper-does-not-retry-provider-quota.sh && bash tools/tests/test-agent-project-reconcile-issue-provider-quota-schedules-provider-cooldown.sh && bash tools/tests/test-pr-reconcile-hooks-refreshes-recurring-issue-checklist.sh && bash tools/tests/test-issue-reconcile-hooks-kick-scheduler-uses-profile.sh && bash tools/tests/test-profile-adopt-skip-anchor-sync-creates-agent-repo-root.sh && bash tools/tests/test-vendored-codex-quota-claude-oauth-only.sh && bash tools/tests/test-package-smoke-command.sh"
43
44
  },
44
45
  "keywords": [
45
46
  "agents",
@@ -0,0 +1,209 @@
1
+ # Architecture Guide
2
+
3
+ This document explains how `agent-control-plane` is put together as an
4
+ operator-facing system, not just a collection of scripts.
5
+
6
+ ACP has five practical layers:
7
+
8
+ 1. package entrypoint and staging
9
+ 2. profile installation and publication
10
+ 3. runtime supervision and heartbeat scheduling
11
+ 4. worker execution and reconcile
12
+ 5. dashboard and operator visibility
13
+
14
+ If you are reading the repo for the first time, start with the system overview
15
+ diagram below, then jump to the flow you care about most.
16
+
17
+ ## System Overview
18
+
19
+ ```mermaid
20
+ flowchart LR
21
+ User[Operator] --> CLI["npm/bin/agent-control-plane.js"]
22
+
23
+ CLI --> Init["project-init.sh"]
24
+ CLI --> Sync["sync-shared-agent-home.sh"]
25
+ CLI --> RuntimeCtl["project-runtimectl.sh"]
26
+ CLI --> DashboardCmd["serve-dashboard.sh"]
27
+
28
+ Init --> Profiles["Profile registry\n~/.agent-runtime/control-plane/profiles/<id>"]
29
+ Sync --> RuntimeHome["Runtime home\n~/.agent-runtime/runtime-home"]
30
+
31
+ RuntimeCtl --> Supervisor["project-runtime-supervisor.sh"]
32
+ Supervisor --> Bootstrap["project-launchd-bootstrap.sh"]
33
+ Bootstrap --> Heartbeat["heartbeat-safe-auto.sh"]
34
+ Heartbeat --> Scheduler["agent-project-heartbeat-loop"]
35
+
36
+ Scheduler --> IssueWorkers["start-issue-worker.sh"]
37
+ Scheduler --> PRWorkers["start-pr-review-worker.sh\nstart-pr-fix-worker.sh\nstart-pr-merge-repair-worker.sh"]
38
+ IssueWorkers --> Router["run-codex-task.sh"]
39
+ PRWorkers --> Router
40
+
41
+ Router --> Codex["agent-project-run-codex-session"]
42
+ Router --> Claude["agent-project-run-claude-session"]
43
+ Router --> OpenClaw["agent-project-run-openclaw-session"]
44
+
45
+ Codex --> Artifacts["run.env / runner.env /\nresult.env / verification.jsonl"]
46
+ Claude --> Artifacts
47
+ OpenClaw --> Artifacts
48
+
49
+ Artifacts --> Reconcile["reconcile-issue-worker.sh\nreconcile-pr-worker.sh"]
50
+ Reconcile --> GitHub["GitHub issues / PRs / labels / comments"]
51
+ Reconcile --> History["runs/ + history/ + state/"]
52
+
53
+ DashboardCmd --> Snapshot["dashboard_snapshot.py"]
54
+ Snapshot --> Profiles
55
+ Snapshot --> History
56
+ Snapshot --> Browser["Local dashboard browser"]
57
+ ```
58
+
59
+ The important architectural choice is that ACP separates:
60
+
61
+ - package distribution from runtime execution
62
+ - shared engine logic from per-profile config
63
+ - worker execution from reconcile and GitHub side effects
64
+ - operator visibility from the worker CLIs themselves
65
+
66
+ ## Install and Publication Flow
67
+
68
+ This is the path from `npx agent-control-plane ...` to a usable runtime on disk.
69
+
70
+ ```mermaid
71
+ sequenceDiagram
72
+ participant User
73
+ participant CLI as agent-control-plane.js
74
+ participant Stage as staged shared-home
75
+ participant Init as project-init.sh
76
+ participant Scaffold as scaffold-profile.sh
77
+ participant Smoke as profile-smoke.sh
78
+ participant Adopt as profile-adopt.sh
79
+ participant Sync as sync-shared-agent-home.sh
80
+
81
+ User->>CLI: npx agent-control-plane init ...
82
+ CLI->>Stage: copy packaged skill into temp shared-home
83
+ CLI->>Init: forward command with staged env
84
+ Init->>Scaffold: write control-plane.yaml + profile docs
85
+ Init->>Smoke: validate profile contract
86
+ Init->>Adopt: create runtime roots / sync anchor repo / workspace
87
+ Init->>Sync: publish shared runtime into ~/.agent-runtime/runtime-home
88
+ ```
89
+
90
+ Why this split exists:
91
+
92
+ - the npm package is treated as a distribution artifact
93
+ - the real runtime is copied into `~/.agent-runtime/runtime-home`
94
+ - installed profiles live outside the package in
95
+ `~/.agent-runtime/control-plane/profiles/<id>`
96
+ - upgrades are therefore explicit and repeatable instead of depending on a temp
97
+ `npx` cache directory
98
+
99
+ ## Runtime Scheduler Loop
100
+
101
+ This is the heartbeat path ACP follows after `runtime start`.
102
+
103
+ ```mermaid
104
+ flowchart TD
105
+ Start["runtime start"] --> RuntimeCtl["project-runtimectl.sh"]
106
+ RuntimeCtl --> Supervisor["project-runtime-supervisor.sh"]
107
+ Supervisor --> Bootstrap["project-launchd-bootstrap.sh"]
108
+ Bootstrap --> SyncCheck["sync runtime copy if needed"]
109
+ SyncCheck --> Heartbeat["heartbeat-safe-auto.sh"]
110
+ Heartbeat --> Preflight["locks / quota preflight /\nretained-worktree audit"]
111
+ Preflight --> SharedLoop["agent-project-heartbeat-loop"]
112
+
113
+ SharedLoop --> ReconcileCompleted["reconcile completed sessions"]
114
+ SharedLoop --> Capacity["compute capacity / cooldown / pending launches"]
115
+ SharedLoop --> Workflows["select workflow lane from issue + PR state"]
116
+
117
+ Workflows --> IssueImplementation["issue implementation"]
118
+ Workflows --> IssueScheduled["scheduled issue checks"]
119
+ Workflows --> IssueRecovery["blocked recovery"]
120
+ Workflows --> PRReview["PR review"]
121
+ Workflows --> PRFix["PR fix"]
122
+ Workflows --> PRMergeRepair["merge repair"]
123
+ ```
124
+
125
+ Key detail: the shared scheduler owns the control logic around workers:
126
+
127
+ - concurrency and heavy-worker limits
128
+ - cooldown and retry gating
129
+ - resident recurring and scheduled issue lanes
130
+ - launch ordering
131
+ - summary output and queue visibility
132
+
133
+ That is why workers do not need to be "smart" about the entire system. The
134
+ workflow around them carries a lot of the operational burden.
135
+
136
+ ## Worker Session Lifecycle
137
+
138
+ This is the path from one chosen issue or PR to a reconciled outcome.
139
+
140
+ ```mermaid
141
+ flowchart LR
142
+ Pick["heartbeat selects issue or PR"] --> Launch["start-issue-worker.sh\nor start-pr-*.sh"]
143
+ Launch --> Worktree["open or reuse managed worktree"]
144
+ Worktree --> Prompt["render prompt + context files"]
145
+ Prompt --> Route["run-codex-task.sh"]
146
+
147
+ Route --> Backend["Codex / Claude / OpenClaw adapter"]
148
+ Backend --> Session["backend session wrapper"]
149
+ Session --> Output["result.env / comments /\nverification.jsonl / runner.env"]
150
+
151
+ Output --> Reconcile["agent-project-reconcile-issue-session\nor agent-project-reconcile-pr-session"]
152
+ Reconcile --> Labels["update labels / retry state /\nresident metadata / cooldown"]
153
+ Reconcile --> Publish["comment on issue, open PR,\nor leave blocked report"]
154
+ Reconcile --> Archive["archive run into history root"]
155
+ ```
156
+
157
+ The contract here is deliberate:
158
+
159
+ - worker backends focus on producing work and result artifacts
160
+ - reconcile scripts own the final interpretation and GitHub-facing outcome
161
+ - resident metadata and history are updated by the host workflow, not by the
162
+ worker trying to infer the entire system state
163
+
164
+ ## Dashboard Snapshot Pipeline
165
+
166
+ The dashboard is a read-only window into ACP state. It does not own scheduling.
167
+
168
+ ```mermaid
169
+ flowchart LR
170
+ Browser["browser"] --> Server["tools/dashboard/server.py"]
171
+ Server --> API["GET /api/snapshot.json"]
172
+ API --> Snapshot["dashboard_snapshot.py"]
173
+
174
+ Snapshot --> Registry["profile registry"]
175
+ Snapshot --> Config["render-flow-config.sh"]
176
+ Snapshot --> WorkerStatus["agent-project-worker-status"]
177
+ Snapshot --> Runs["runs/ history/ state/"]
178
+
179
+ Registry --> JSON["snapshot payload"]
180
+ Config --> JSON
181
+ WorkerStatus --> JSON
182
+ Runs --> JSON
183
+
184
+ JSON --> UI["dashboard app.js + index.html"]
185
+ ```
186
+
187
+ This means the dashboard reflects the current state of:
188
+
189
+ - installed profiles
190
+ - live and recent runs
191
+ - resident controller metadata
192
+ - provider cooldowns
193
+ - scheduled issue state
194
+ - runtime process status
195
+
196
+ without introducing a second control path that could drift away from the real
197
+ scheduler state.
198
+
199
+ ## Reading Order
200
+
201
+ If you want the shortest path through the architecture:
202
+
203
+ 1. [System Overview](#system-overview)
204
+ 2. [Runtime Scheduler Loop](#runtime-scheduler-loop)
205
+ 3. [Worker Session Lifecycle](#worker-session-lifecycle)
206
+ 4. [Dashboard Snapshot Pipeline](#dashboard-snapshot-pipeline)
207
+
208
+ If you are changing packaging or onboarding, also read
209
+ [Install and Publication Flow](#install-and-publication-flow).
@@ -0,0 +1,127 @@
1
+ # Command Map
2
+
3
+ Run commands from the current isolated checkout for the task.
4
+
5
+ Profile-specific repo roots and repo-local dev/test commands belong in
6
+ `~/.agent-runtime/control-plane/profiles/<id>/README.md`. Resolve the active
7
+ profile first, then use the selected profile's notes for product-repo commands.
8
+
9
+ ## Profile Resolution
10
+
11
+ ```bash
12
+ bash tools/bin/workflow-catalog.sh profiles
13
+ tools/bin/workflow-catalog.sh context
14
+ bash tools/bin/profile-activate.sh --profile-id <id>
15
+ ACP_PROJECT_ID=<id> bash tools/bin/render-flow-config.sh
16
+ ```
17
+
18
+ Use `render-flow-config.sh` when you need the effective repo root, worktree
19
+ root, runtime root, worker backend, or profile-specific script bindings.
20
+ When multiple available profiles exist, set `ACP_PROJECT_ID=<id>` first or use
21
+ `profile-activate.sh --profile-id <id>` before running manual operator
22
+ commands.
23
+
24
+ ## Dependency bootstrap
25
+
26
+ Run dependency bootstrap only from the clean automation baseline for the
27
+ selected profile when you explicitly need to refresh shared dependencies. Do not
28
+ repair shared `node_modules` from inside a worker worktree.
29
+
30
+ For control-plane changes in this repo, prefer focused shell tests over broad
31
+ bootstrap unless the task actually changes dependency behavior.
32
+
33
+ ## Control-Plane Verification
34
+
35
+ ```bash
36
+ bash tools/bin/check-skill-contracts.sh
37
+ bash tools/bin/flow-runtime-doctor.sh
38
+ bash tools/bin/profile-smoke.sh
39
+ bash tools/bin/test-smoke.sh
40
+ bash tools/tests/test-project-init.sh
41
+ bash tools/tests/test-project-init-force-and-skip-sync.sh
42
+ bash tools/tests/test-project-remove.sh
43
+ bash tools/tests/test-project-runtimectl.sh
44
+ bash tools/tests/test-project-runtimectl-missing-profile.sh
45
+ bash tools/tests/test-project-runtimectl-stop-cancels-pending-kick.sh
46
+ bash tools/tests/test-project-runtimectl-start-falls-back-to-bootstrap.sh
47
+ bash tools/tests/test-project-runtimectl-status-supervisor-running.sh
48
+ bash tools/tests/test-project-launchd-bootstrap.sh
49
+ bash tools/tests/test-install-project-launchd.sh
50
+ bash tools/tests/test-uninstall-project-launchd.sh
51
+ bash tools/tests/test-project-runtimectl-launchd.sh
52
+ bash tools/tests/test-dashboard-launchd-bootstrap.sh
53
+ bash tools/tests/test-install-dashboard-launchd.sh
54
+ bash tools/tests/test-render-dashboard-snapshot.sh
55
+ bash tools/tests/test-serve-dashboard.sh
56
+ bash tools/tests/test-control-plane-dashboard-runtime-smoke.sh
57
+ bash tools/tests/test-workflow-catalog.sh
58
+ bash tools/tests/test-render-flow-config.sh
59
+ ```
60
+
61
+ Add or run targeted tests in `tools/tests/` for the changed surface.
62
+
63
+ ## Flow maintenance
64
+
65
+ ```bash
66
+ tools/bin/flow-runtime-doctor.sh
67
+ tools/bin/workflow-catalog.sh list
68
+ tools/bin/workflow-catalog.sh show pr-review
69
+ tools/bin/workflow-catalog.sh profiles
70
+ tools/bin/workflow-catalog.sh context
71
+ tools/bin/profile-activate.sh --profile-id <id>
72
+ tools/bin/project-init.sh --profile-id <id> --repo-slug <owner/repo>
73
+ tools/bin/render-flow-config.sh
74
+ tools/bin/scaffold-profile.sh --profile-id <id> --repo-slug <owner/repo>
75
+ tools/bin/profile-smoke.sh
76
+ tools/bin/test-smoke.sh
77
+ tools/bin/profile-adopt.sh --profile-id <id>
78
+ tools/bin/project-runtimectl.sh status --profile-id <id>
79
+ tools/bin/project-runtimectl.sh stop --profile-id <id>
80
+ tools/bin/project-runtimectl.sh start --profile-id <id>
81
+ tools/bin/project-runtimectl.sh restart --profile-id <id>
82
+ tools/bin/install-project-launchd.sh --profile-id <id>
83
+ tools/bin/uninstall-project-launchd.sh --profile-id <id>
84
+ tools/bin/project-remove.sh --profile-id <id>
85
+ tools/bin/project-remove.sh --profile-id <id> --purge-paths
86
+ tools/bin/sync-shared-agent-home.sh
87
+ python3 tools/bin/render-dashboard-snapshot.py --pretty
88
+ bash tools/bin/serve-dashboard.sh --host 127.0.0.1 --port 8765
89
+ bash tools/bin/install-dashboard-launchd.sh --host 127.0.0.1 --port 8765
90
+ ```
91
+
92
+ Installed profile prompts should live under
93
+ `~/.agent-runtime/control-plane/profiles/<id>/templates/`; generic fallback
94
+ prompts live under `tools/templates/`.
95
+
96
+ ## Dashboard
97
+
98
+ ```bash
99
+ python3 tools/bin/render-dashboard-snapshot.py --pretty
100
+ bash tools/bin/serve-dashboard.sh --host 127.0.0.1 --port 8765
101
+ bash tools/bin/install-dashboard-launchd.sh --host 127.0.0.1 --port 8765
102
+ ```
103
+
104
+ Use the snapshot command for CLI/debug output and the HTTP server for the live
105
+ dashboard at `http://127.0.0.1:8765`. Use the LaunchAgent installer when you
106
+ want the dashboard to come back automatically after macOS restart/login.
107
+
108
+ ## Project Autostart
109
+
110
+ ```bash
111
+ bash tools/bin/install-project-launchd.sh --profile-id <id>
112
+ bash tools/bin/uninstall-project-launchd.sh --profile-id <id>
113
+ ```
114
+
115
+ Use the project installer when one profile should come back automatically after
116
+ macOS restart/login. `project-runtimectl.sh start|stop|status` will detect that
117
+ per-project LaunchAgent automatically once it is installed.
118
+
119
+ ## Repo-Specific Commands
120
+
121
+ After choosing a profile, read `~/.agent-runtime/control-plane/profiles/<id>/README.md` for:
122
+
123
+ - clean automation baseline and retained checkout roots
124
+ - repo-local startup docs such as `AGENTS.md` and OpenSpec paths
125
+ - app/package-specific dev commands
126
+ - isolated smoke and release-rehearsal commands
127
+ - project-specific operator runbooks
@@ -0,0 +1,120 @@
1
+ # Agent Control Plane Map
2
+
3
+ This repository is the shared `agent-control-plane` package. It provides a
4
+ generic engine that can host multiple installed profiles, each with its own repo
5
+ roots, labels, worker preferences, prompts, and project-specific guardrails.
6
+
7
+ ## What Lives Here
8
+
9
+ - `SKILL.md`
10
+ Canonical operating manual for the shared control plane.
11
+ - `~/.agent-runtime/control-plane/profiles/<id>/control-plane.yaml`
12
+ Canonical installed project profile for repo paths, queue labels, limits,
13
+ and script bindings.
14
+ - `~/.agent-runtime/control-plane/profiles/<id>/README.md`
15
+ Repo-specific operator notes, startup docs, and command references for the
16
+ selected profile.
17
+ - `~/.agent-runtime/control-plane/profiles/<id>/templates/`
18
+ Optional installed profile-specific prompt overrides.
19
+ - `assets/workflow-catalog.json`
20
+ Declarative catalog of the workflow lanes this control plane exposes.
21
+ - `bin/`
22
+ Queue, label, and risk logic shared by installed profiles.
23
+ - `hooks/`
24
+ Heartbeat and reconcile hooks shared by installed profiles.
25
+ - `tools/bin/flow-runtime-doctor.sh`
26
+ Reports whether the published source copy and runtime-home copy are in sync.
27
+ - `tools/bin/workflow-catalog.sh`
28
+ Lists workflows, shows workflow details, or prints available profile ids.
29
+ - `tools/bin/render-flow-config.sh`
30
+ Prints the effective operator/runtime config after environment overrides.
31
+ - `tools/bin/run-codex-task.sh`
32
+ Routes the shared worker contract into the backend-specific session wrapper.
33
+ - `tools/bin/agent-project-run-codex-session`
34
+ Launches Codex-backed worker sessions.
35
+ - `tools/bin/agent-project-run-claude-session`
36
+ Launches Claude-backed worker sessions.
37
+ - `tools/bin/agent-project-run-openclaw-session`
38
+ Launches OpenClaw-backed worker sessions.
39
+ - `tools/bin/agent-project-run-opencode-session`
40
+ Placeholder adapter stub for the planned `opencode` backend.
41
+ - `tools/bin/agent-project-run-kilo-session`
42
+ Placeholder adapter stub for the planned `kilo` backend.
43
+ - `tools/bin/project-init.sh`
44
+ Runs scaffold + smoke + adopt + runtime sync for one installed profile.
45
+ - `tools/bin/scaffold-profile.sh`
46
+ Scaffolds a new installed profile, profile notes, and prompt templates in the
47
+ local profile registry.
48
+ - `tools/bin/project-runtimectl.sh`
49
+ Provides `status`, `start`, `stop`, and `restart` for one installed profile.
50
+ - `tools/bin/project-launchd-bootstrap.sh`
51
+ Syncs the runtime copy and runs one profile-scoped heartbeat pass in a
52
+ launchd-safe foreground process for the runtime supervisor.
53
+ - `tools/bin/install-project-launchd.sh`
54
+ Installs a per-user LaunchAgent for one installed profile so its runtime can
55
+ come back automatically after reboot/login.
56
+ - `tools/bin/uninstall-project-launchd.sh`
57
+ Removes the per-project LaunchAgent wrapper and plist for one installed
58
+ profile.
59
+ - `tools/bin/project-remove.sh`
60
+ Removes one installed profile plus ACP-owned runtime state, with optional
61
+ purge of ACP-managed repo/worktree/workspace paths.
62
+ - `tools/bin/profile-smoke.sh`
63
+ Validates available profiles and catches session/branch prefix collisions
64
+ before scheduler use.
65
+ - `tools/bin/test-smoke.sh`
66
+ Runs the main shared-package smoke gates in one operator-facing command.
67
+ - `tools/bin/render-dashboard-snapshot.py`
68
+ Emits a JSON snapshot of active runs, resident controllers, cooldown state,
69
+ queue depth, and scheduled issues across installed profiles.
70
+ - `tools/bin/serve-dashboard.sh`
71
+ Serves the live worker dashboard and `/api/snapshot.json` endpoint for local
72
+ browser-based monitoring.
73
+ - `tools/bin/dashboard-launchd-bootstrap.sh`
74
+ Syncs the runtime copy and launches the dashboard server in a launchd-safe
75
+ foreground process.
76
+ - `tools/bin/install-dashboard-launchd.sh`
77
+ Installs and bootstraps a per-user LaunchAgent so the dashboard returns after
78
+ reboot/login.
79
+ - `tools/bin/profile-adopt.sh`
80
+ Creates runtime roots, installs the selected profile into the local profile
81
+ registry when needed, and syncs the anchor repo plus VS Code workspace for
82
+ live scheduler adoption.
83
+ - `references/`
84
+ Control-plane docs, operator commands, and repository maps.
85
+
86
+ ## What Does Not Live Here
87
+
88
+ - Repo-specific product code.
89
+ - Local scheduler bootstrap and operator docs that belong to a particular
90
+ workstation. Those now live under:
91
+ `~/.agent-runtime/control-plane/workspace`
92
+
93
+ ## Vendored Runtime
94
+
95
+ - Runtime engines are resolved from the current skill root first, then the
96
+ shared/runtime canonical copies when present, while active project profiles
97
+ are resolved from `~/.agent-runtime/control-plane/profiles/`.
98
+ - Project-specific instructions should be loaded from the active profile's
99
+ `README.md` and templates instead of being hardcoded into the shared engine.
100
+
101
+ ## Published Artifacts
102
+
103
+ - Source canonical package copy:
104
+ `$SHARED_AGENT_HOME/skills/openclaw/agent-control-plane`
105
+ - Runtime canonical package copy:
106
+ `~/.agent-runtime/runtime-home/skills/openclaw/agent-control-plane`
107
+
108
+ Published artifacts are rebuilt by `tools/bin/sync-shared-agent-home.sh` as
109
+ concrete copied files, not symlink aliases. Canonical profile configs now live
110
+ outside the repo in `~/.agent-runtime/control-plane/profiles/<id>/control-plane.yaml`.
111
+
112
+ ## Operational Rule
113
+
114
+ When updating the control plane:
115
+
116
+ 1. Change the generic engine in this repo or the selected installed profile in the external registry.
117
+ 2. Keep workstation wrappers thin.
118
+ 3. Repair shared/runtime published copies with `tools/bin/sync-shared-agent-home.sh`.
119
+ 4. Prefer explicit profile docs and copied artifacts over hidden defaults and
120
+ symlink aliases.
@@ -0,0 +1,73 @@
1
+ # Docs Map
2
+
3
+ Canonical documentation sources inside `agent-control-plane`:
4
+
5
+ ## Shared Control-Plane Docs
6
+
7
+ - `SKILL.md`
8
+ Shared operating rules and startup sequence.
9
+ - `README.md`
10
+ Public-facing install, usage, funding, contributing, and security entrypoint.
11
+ - `CHANGELOG.md`
12
+ Public release history for the package and repository.
13
+ - `ROADMAP.md`
14
+ Public product and backend-support roadmap, including current and planned
15
+ worker integrations.
16
+ - `references/architecture.md`
17
+ Architecture walkthrough with system, runtime, worker, and dashboard diagrams.
18
+ - `CONTRIBUTING.md`
19
+ Contributor workflow, legal model, and maintainer expectations.
20
+ - `CLA.md`
21
+ Contributor license agreement used for incoming changes.
22
+ - `CODE_OF_CONDUCT.md`
23
+ Community behavior and moderation expectations.
24
+ - `SECURITY.md`
25
+ Security reporting path and disclosure expectations.
26
+ - `references/control-plane-map.md`
27
+ Ownership map for profiles, scripts, publication copies, and operator tools.
28
+ - `references/commands.md`
29
+ Control-plane operator commands and profile-management entrypoints.
30
+ - `references/release-checklist.md`
31
+ Maintainer release checklist for public package publishing.
32
+ - `.github/release-template.md`
33
+ Reusable markdown template for GitHub release notes.
34
+ - `.github/workflows/ci.yml`
35
+ Public CI workflow used for the README status badge.
36
+ - `.github/workflows/publish.yml`
37
+ Trusted npm publishing workflow used for tag-driven releases with provenance.
38
+ - `references/repo-map.md`
39
+ Layout of the control-plane repository itself.
40
+
41
+ ## Profile-Scoped Docs
42
+
43
+ - `~/.agent-runtime/control-plane/profiles/<id>/README.md`
44
+ Canonical repo-specific startup docs, repo roots, command map, and
45
+ high-risk notes.
46
+ - `~/.agent-runtime/control-plane/profiles/<id>/control-plane.yaml`
47
+ Canonical machine-readable installed profile config.
48
+ - `~/.agent-runtime/control-plane/profiles/<id>/templates/*.md`
49
+ Canonical prompt overrides for issue, PR fix, PR review, or scheduled issue flows.
50
+
51
+ ## Runtime and Publication Docs
52
+
53
+ - `tools/bin/flow-runtime-doctor.sh`
54
+ Sync health for source and runtime copies.
55
+ - `tools/bin/profile-smoke.sh`
56
+ Installed-profile validation before scheduler use.
57
+ - `tools/bin/profile-adopt.sh`
58
+ Local workstation adoption helper.
59
+ - `tools/bin/sync-shared-agent-home.sh`
60
+ Publication repair for shared/runtime copies.
61
+ - `tools/bin/render-dashboard-demo-media.sh`
62
+ Regenerates the README dashboard screenshot and animated walkthrough from a
63
+ real local demo fixture.
64
+ - `tools/bin/render-architecture-infographics.sh`
65
+ Regenerates the architecture infographic PNGs and PDF deck from the local
66
+ HTML source in `tools/architecture/`.
67
+
68
+ ## Rule of Thumb
69
+
70
+ If a piece of guidance is specific to one repo, keep it in
71
+ `~/.agent-runtime/control-plane/profiles/<id>/README.md` or
72
+ `~/.agent-runtime/control-plane/profiles/<id>/templates/` instead of the shared
73
+ control-plane docs.