agent-control-plane 0.1.6 → 0.1.7
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.
- package/package.json +3 -2
- package/references/architecture.md +209 -0
- package/references/commands.md +127 -0
- package/references/control-plane-map.md +120 -0
- package/references/docs-map.md +73 -0
- package/references/release-checklist.md +67 -0
- package/references/repo-map.md +36 -0
- package/tools/bin/test-smoke.sh +59 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-control-plane",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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-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.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Release Checklist
|
|
2
|
+
|
|
3
|
+
Maintainer checklist for shipping a new public package release of
|
|
4
|
+
`agent-control-plane`.
|
|
5
|
+
|
|
6
|
+
## Pre-Release
|
|
7
|
+
|
|
8
|
+
- confirm `git status` is clean
|
|
9
|
+
- confirm `package.json` version is intentional
|
|
10
|
+
- review `CHANGELOG.md` and prepare release notes from
|
|
11
|
+
`.github/release-template.md`
|
|
12
|
+
- refresh README demo media if the dashboard UI changed:
|
|
13
|
+
`bash tools/bin/render-dashboard-demo-media.sh`
|
|
14
|
+
- review `README.md`, `SECURITY.md`, `CONTRIBUTING.md`, and `CLA.md` for stale
|
|
15
|
+
links or policy text
|
|
16
|
+
- if a public GitHub repo now exists, set or verify the `homepage`,
|
|
17
|
+
`repository`, and `bugs` URLs in `package.json`
|
|
18
|
+
- make sure sponsor links still point to the intended maintainer identity
|
|
19
|
+
- confirm the intended license is still `MIT`
|
|
20
|
+
|
|
21
|
+
## Verification
|
|
22
|
+
|
|
23
|
+
Run the core checks:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bash tools/tests/test-package-public-metadata.sh
|
|
27
|
+
bash tools/tests/test-package-funding-metadata.sh
|
|
28
|
+
bash tools/tests/test-contribution-docs.sh
|
|
29
|
+
bash tools/tests/test-agent-control-plane-npm-cli.sh
|
|
30
|
+
bash tools/bin/test-smoke.sh
|
|
31
|
+
npm pack --dry-run
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Publish
|
|
35
|
+
|
|
36
|
+
Recommended release flow uses npm trusted publishing from GitHub Actions, so you
|
|
37
|
+
do not have to enter an OTP during every local publish.
|
|
38
|
+
|
|
39
|
+
One-time setup:
|
|
40
|
+
|
|
41
|
+
- configure `agent-control-plane` for npm trusted publishing from
|
|
42
|
+
`ducminhnguyen0319/agent-control-plane`
|
|
43
|
+
- verify the publish workflow file is `.github/workflows/publish.yml`
|
|
44
|
+
- keep npm package publishing policy on the stricter setting you want after
|
|
45
|
+
trusted publishing is working
|
|
46
|
+
|
|
47
|
+
Per-release command flow:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm version <patch|minor|major>
|
|
51
|
+
git push origin main --follow-tags
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then:
|
|
55
|
+
|
|
56
|
+
- watch `.github/workflows/publish.yml` for the npm publish run
|
|
57
|
+
- create or update a GitHub release using `.github/release-template.md`
|
|
58
|
+
- update `CHANGELOG.md` if the final shipped notes differ from the draft
|
|
59
|
+
|
|
60
|
+
## Post-Release
|
|
61
|
+
|
|
62
|
+
- verify `npx agent-control-plane@latest help` works from a clean shell
|
|
63
|
+
- verify the npm package shows provenance for the new version
|
|
64
|
+
- verify `npm fund` shows the expected sponsor link
|
|
65
|
+
- verify the repo README, sponsor button, and package metadata all point to the
|
|
66
|
+
same maintainer identity
|
|
67
|
+
- announce the release where relevant
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Repository Map
|
|
2
|
+
|
|
3
|
+
This file maps the `agent-control-plane` repository itself.
|
|
4
|
+
|
|
5
|
+
## Core Layout
|
|
6
|
+
|
|
7
|
+
- `SKILL.md`
|
|
8
|
+
Shared operating manual for the control plane.
|
|
9
|
+
- `assets/`
|
|
10
|
+
Workflow catalog and static non-profile assets.
|
|
11
|
+
- `bin/`
|
|
12
|
+
Queue, label, and risk scripts shared by installed profiles.
|
|
13
|
+
- `hooks/`
|
|
14
|
+
Heartbeat and reconcile hooks shared by installed profiles.
|
|
15
|
+
- `tools/bin/`
|
|
16
|
+
Runtime wrappers, onboarding helpers, publication utilities, and doctor tools.
|
|
17
|
+
- `tools/templates/`
|
|
18
|
+
Generic fallback prompts used when a profile does not override a template.
|
|
19
|
+
- `tools/tests/`
|
|
20
|
+
Shell regression coverage for control-plane behavior.
|
|
21
|
+
- `references/`
|
|
22
|
+
Control-plane docs, operator commands, and repository maps.
|
|
23
|
+
|
|
24
|
+
## Operator Surfaces
|
|
25
|
+
|
|
26
|
+
- `tools/bin/render-flow-config.sh`
|
|
27
|
+
Effective config viewer for the selected profile.
|
|
28
|
+
- `tools/bin/profile-smoke.sh`
|
|
29
|
+
Installed-profile validation and collision detection.
|
|
30
|
+
- `tools/bin/profile-adopt.sh`
|
|
31
|
+
Local runtime/bootstrap helper for onboarding a profile onto a workstation.
|
|
32
|
+
- `tools/bin/sync-shared-agent-home.sh`
|
|
33
|
+
Publication repair for shared/runtime copies.
|
|
34
|
+
|
|
35
|
+
Installed profiles live outside this repo under
|
|
36
|
+
`~/.agent-runtime/control-plane/profiles/<id>/`.
|
package/tools/bin/test-smoke.sh
CHANGED
|
@@ -13,13 +13,14 @@ Run the main smoke gates for the shared agent-control-plane package in one comma
|
|
|
13
13
|
|
|
14
14
|
Steps:
|
|
15
15
|
1. check-skill-contracts.sh
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
16
|
+
2. profile-smoke.sh against a temporary scaffolded profile registry
|
|
17
|
+
3. project-runtimectl.sh status against a temporary scaffolded profile
|
|
18
18
|
|
|
19
19
|
Environment overrides:
|
|
20
20
|
ACP_TEST_SMOKE_CHECK_CONTRACTS_SCRIPT
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
ACP_TEST_SMOKE_PROFILE_SMOKE_SCRIPT
|
|
22
|
+
ACP_TEST_SMOKE_RUNTIMECTL_SCRIPT
|
|
23
|
+
ACP_TEST_SMOKE_SCAFFOLD_PROFILE_SCRIPT
|
|
23
24
|
EOF
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -31,8 +32,9 @@ while [[ $# -gt 0 ]]; do
|
|
|
31
32
|
done
|
|
32
33
|
|
|
33
34
|
check_contracts_script="${ACP_TEST_SMOKE_CHECK_CONTRACTS_SCRIPT:-${FLOW_SKILL_DIR}/tools/bin/check-skill-contracts.sh}"
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
profile_smoke_script="${ACP_TEST_SMOKE_PROFILE_SMOKE_SCRIPT:-${FLOW_SKILL_DIR}/tools/bin/profile-smoke.sh}"
|
|
36
|
+
runtimectl_script="${ACP_TEST_SMOKE_RUNTIMECTL_SCRIPT:-${FLOW_SKILL_DIR}/tools/bin/project-runtimectl.sh}"
|
|
37
|
+
scaffold_profile_script="${ACP_TEST_SMOKE_SCAFFOLD_PROFILE_SCRIPT:-${FLOW_SKILL_DIR}/tools/bin/scaffold-profile.sh}"
|
|
36
38
|
|
|
37
39
|
run_step() {
|
|
38
40
|
local label="${1:?label required}"
|
|
@@ -57,7 +59,56 @@ run_step() {
|
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
run_step "check-skill-contracts" bash "${check_contracts_script}"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
|
|
63
|
+
run_profile_smoke_fixture() (
|
|
64
|
+
set -euo pipefail
|
|
65
|
+
local tmpdir=""
|
|
66
|
+
local profile_home=""
|
|
67
|
+
|
|
68
|
+
tmpdir="$(mktemp -d)"
|
|
69
|
+
trap 'rm -rf "${tmpdir}"' EXIT
|
|
70
|
+
profile_home="${tmpdir}/profiles"
|
|
71
|
+
|
|
72
|
+
bash "${scaffold_profile_script}" \
|
|
73
|
+
--profile-home "${profile_home}" \
|
|
74
|
+
--profile-id smoke-alpha \
|
|
75
|
+
--repo-slug example/smoke-alpha >/dev/null
|
|
76
|
+
|
|
77
|
+
ACP_PROFILE_REGISTRY_ROOT="${profile_home}" \
|
|
78
|
+
bash "${profile_smoke_script}" --profile-id smoke-alpha >/dev/null
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
run_runtimectl_fixture() (
|
|
82
|
+
set -euo pipefail
|
|
83
|
+
local tmpdir=""
|
|
84
|
+
local profile_home=""
|
|
85
|
+
local runtime_root=""
|
|
86
|
+
local profile_id="smoke-runtime"
|
|
87
|
+
local output=""
|
|
88
|
+
|
|
89
|
+
tmpdir="$(mktemp -d)"
|
|
90
|
+
trap 'rm -rf "${tmpdir}"' EXIT
|
|
91
|
+
profile_home="${tmpdir}/profiles"
|
|
92
|
+
runtime_root="${tmpdir}/runtime/${profile_id}"
|
|
93
|
+
|
|
94
|
+
bash "${scaffold_profile_script}" \
|
|
95
|
+
--profile-home "${profile_home}" \
|
|
96
|
+
--profile-id "${profile_id}" \
|
|
97
|
+
--repo-slug example/${profile_id} \
|
|
98
|
+
--agent-root "${runtime_root}" \
|
|
99
|
+
--agent-repo-root "${runtime_root}/repo" \
|
|
100
|
+
--worktree-root "${runtime_root}/worktrees" >/dev/null
|
|
101
|
+
|
|
102
|
+
output="$(
|
|
103
|
+
ACP_PROFILE_REGISTRY_ROOT="${profile_home}" \
|
|
104
|
+
bash "${runtimectl_script}" status --profile-id "${profile_id}"
|
|
105
|
+
)"
|
|
106
|
+
|
|
107
|
+
grep -q "^PROFILE_ID=${profile_id}\$" <<<"${output}"
|
|
108
|
+
grep -q '^RUNTIME_STATUS=' <<<"${output}"
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
run_step "profile-smoke" run_profile_smoke_fixture
|
|
112
|
+
run_step "project-runtimectl" run_runtimectl_fixture
|
|
62
113
|
|
|
63
114
|
printf 'SMOKE_TEST_STATUS=ok\n'
|