agent-control-plane 0.2.0 → 0.3.0

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.
Files changed (33) hide show
  1. package/npm/bin/agent-control-plane.js +39 -2
  2. package/package.json +6 -3
  3. package/tools/bin/agent-project-catch-up-merged-prs +1 -0
  4. package/tools/bin/agent-project-cleanup-session +49 -5
  5. package/tools/bin/agent-project-heartbeat-loop +119 -1471
  6. package/tools/bin/agent-project-reconcile-issue-session +66 -105
  7. package/tools/bin/agent-project-reconcile-pr-session +76 -111
  8. package/tools/bin/agent-project-run-claude-session +10 -0
  9. package/tools/bin/agent-project-run-codex-resilient +86 -9
  10. package/tools/bin/agent-project-run-codex-session +16 -5
  11. package/tools/bin/agent-project-run-kilo-session +10 -0
  12. package/tools/bin/agent-project-run-openclaw-session +10 -0
  13. package/tools/bin/agent-project-run-opencode-session +10 -0
  14. package/tools/bin/agent-project-worker-status +10 -7
  15. package/tools/bin/cleanup-worktree.sh +6 -1
  16. package/tools/bin/flow-config-lib.sh +80 -0
  17. package/tools/bin/flow-resident-worker-lib.sh +119 -1
  18. package/tools/bin/flow-shell-lib.sh +24 -0
  19. package/tools/bin/heartbeat-loop-cache-lib.sh +164 -0
  20. package/tools/bin/heartbeat-loop-counting-lib.sh +306 -0
  21. package/tools/bin/heartbeat-loop-pr-strategy-lib.sh +199 -0
  22. package/tools/bin/heartbeat-loop-scheduling-lib.sh +506 -0
  23. package/tools/bin/heartbeat-loop-worker-lib.sh +319 -0
  24. package/tools/bin/heartbeat-recovery-preflight.sh +12 -1
  25. package/tools/bin/heartbeat-safe-auto.sh +14 -3
  26. package/tools/bin/project-launchd-bootstrap.sh +11 -8
  27. package/tools/bin/reconcile-bootstrap-lib.sh +113 -0
  28. package/tools/bin/resident-issue-controller-lib.sh +448 -0
  29. package/tools/bin/resident-issue-queue-status.py +35 -0
  30. package/tools/bin/start-resident-issue-loop.sh +26 -437
  31. package/tools/dashboard/app.js +7 -0
  32. package/tools/dashboard/dashboard_snapshot.py +13 -29
  33. package/SKILL.md +0 -149
package/SKILL.md DELETED
@@ -1,149 +0,0 @@
1
- ---
2
- name: agent-control-plane
3
- description: Use when working on the shared multi-project agent control plane, including scheduler/runtime orchestration, worktree and worker lifecycle, profile onboarding, and cross-project automation flows.
4
- ---
5
-
6
- # Agent Control Plane
7
-
8
- This repository is the canonical `agent-control-plane` package. It owns the
9
- generic scheduler/runtime, worktree lifecycle, profile onboarding, queue/risk
10
- automation, and profile-scoped prompt/template resolution used across multiple
11
- projects.
12
-
13
- Installed project profiles live under
14
- `~/.agent-runtime/control-plane/profiles/<id>/`. Treat the control plane itself
15
- as generic, then load the selected profile's local guidance only when the task
16
- is truly about that project. Integrated project data should stay in that
17
- external profile registry, not inside this repository.
18
-
19
- ## What Lives Here
20
-
21
- - core operating manual in this `SKILL.md`
22
- - installed project profiles in `~/.agent-runtime/control-plane/profiles/*/control-plane.yaml`
23
- - installed profile notes in `~/.agent-runtime/control-plane/profiles/*/README.md`
24
- - workflow catalog in `assets/workflow-catalog.json`
25
- - worker dashboard in `tools/dashboard/` with launcher at `tools/dashboard/dashboard_snapshot.py`
26
- and `tools/bin/serve-dashboard.sh`
27
- - dashboard autostart helpers in `tools/bin/dashboard-launchd-bootstrap.sh` and
28
- `tools/bin/install-dashboard-launchd.sh`
29
- - project autostart helpers in `tools/bin/project-launchd-bootstrap.sh`,
30
- `tools/bin/install-project-launchd.sh`, and
31
- `tools/bin/uninstall-project-launchd.sh`
32
- - queue/label/risk scripts in `bin/`
33
- - heartbeat and reconcile hooks in `hooks/`
34
- - shared runtime wrappers, onboarding tools, and tests in `tools/bin/` and
35
- `tools/tests/`
36
-
37
- The vendored runtime entrypoints used by live schedulers are published from this
38
- checkout into the shared canonical skill copy under
39
- `skills/openclaw/agent-control-plane`, then copied into
40
- `~/.agent-runtime/runtime-home/skills/openclaw/agent-control-plane` by
41
- `tools/bin/sync-shared-agent-home.sh`.
42
-
43
- ## Required Startup Sequence
44
-
45
- Before doing non-trivial work in this repository or on an integrated project:
46
-
47
- 1. Determine the active profile with `AGENT_PROJECT_ID`, `ACP_PROJECT_ID`, or
48
- `tools/bin/render-flow-config.sh`.
49
- 2. Read the selected profile notes in
50
- `~/.agent-runtime/control-plane/profiles/<id>/README.md` when they exist.
51
- 3. Read the selected repo's local startup docs before changing behavior:
52
- `AGENTS.md`, `openspec/AGENT_RULES.md`, `openspec/AGENTS.md`,
53
- `openspec/project.md`, and `openspec/CONVENTIONS.md`.
54
- 4. Use a clean read-only inspection checkout first; move to an isolated
55
- worktree or agent-owned checkout before making non-trivial edits.
56
- 5. If the task changes product behavior, inspect the active OpenSpec changes
57
- before implementation.
58
-
59
- For onboarding a new repository onto the shared control plane:
60
-
61
- 1. Prefer `tools/bin/project-init.sh --profile-id <id> --repo-slug <owner/repo>`
62
- 2. Fill in `~/.agent-runtime/control-plane/profiles/<id>/README.md`
63
- 3. If you need manual control, the underlying steps remain:
64
- `tools/bin/scaffold-profile.sh`, `tools/bin/profile-smoke.sh`,
65
- `tools/bin/profile-adopt.sh`, and `tools/bin/sync-shared-agent-home.sh`
66
-
67
- For runtime control of one installed profile:
68
-
69
- 1. Check state with `tools/bin/project-runtimectl.sh status --profile-id <id>`
70
- 2. Start or ensure runtime with `tools/bin/project-runtimectl.sh start --profile-id <id>`
71
- 3. Stop or recycle runtime with `tools/bin/project-runtimectl.sh stop --profile-id <id>`
72
- 4. Use `tools/bin/project-runtimectl.sh restart --profile-id <id>` for a clean bounce
73
- 5. Use `tools/bin/install-project-launchd.sh --profile-id <id>` when one
74
- profile should survive reboot/login via a per-project LaunchAgent
75
- 6. Remove per-project autostart with
76
- `tools/bin/uninstall-project-launchd.sh --profile-id <id>`
77
- 7. Remove an installed profile with `tools/bin/project-remove.sh --profile-id <id>`
78
-
79
- ## Task Routing
80
-
81
- Pick the smallest matching path and load only the relevant references:
82
-
83
- - Control-plane layout, publication model, and profile ownership:
84
- `references/control-plane-map.md`
85
- - Control-plane operator commands and profile-management entrypoints:
86
- `references/commands.md`
87
- - Control-plane repository layout:
88
- `references/repo-map.md`
89
- - Control-plane docs and profile guidance locations:
90
- `references/docs-map.md`
91
- - Project-specific rules and repo commands:
92
- `~/.agent-runtime/control-plane/profiles/<id>/README.md`
93
-
94
- ## Repo Rules That Matter Most
95
-
96
- - Keep the core engine generic. Put repo-specific behavior behind a profile,
97
- profile templates, or profile-scoped docs instead of hardcoding it into the
98
- shared runtime.
99
- - Follow OpenSpec and the selected repo's local rules before implementing
100
- product behavior changes.
101
- - Do not simplify or change approach without explicit user approval.
102
- - Prefer deterministic wrappers and config-driven routing over special-case
103
- conditionals.
104
- - For any non-trivial write task, use a dedicated agent worktree or another
105
- isolated clean checkout.
106
- - Preserve dirty retained checkouts; continue from a fresh isolated worktree
107
- instead of layering more edits there.
108
- - Prefer canonical docs and profile-local notes over stale audits or incidental
109
- markdown snapshots.
110
- - When updating the control plane itself, repair published copies after the
111
- source change so runtime and source do not drift.
112
-
113
- ## Common Operating Patterns
114
-
115
- ### Analysis and Planning
116
-
117
- - Resolve the active profile first.
118
- - Read `~/.agent-runtime/control-plane/profiles/<id>/README.md` for repo-local context.
119
- - Use `references/docs-map.md` to find the canonical control-plane or
120
- profile-local source instead of scanning random files.
121
-
122
- ### Implementation
123
-
124
- - Keep generic scheduler/runtime changes in the shared engine.
125
- - Put repo-specific prompts, commands, or heuristics in the installed profile
126
- directory under `~/.agent-runtime/control-plane/profiles/<id>/`.
127
- - Keep changes reversible and tightly scoped.
128
-
129
- ### Testing
130
-
131
- - Use `references/commands.md` for control-plane checks.
132
- - Use the selected profile's README for repo-specific dev/test commands.
133
- - Re-run `tools/bin/profile-smoke.sh`, `tools/bin/check-skill-contracts.sh`,
134
- dashboard tests, and targeted shell tests after meaningful control-plane
135
- changes.
136
-
137
- ### Publishing and Runtime Health
138
-
139
- - Use `tools/bin/flow-runtime-doctor.sh` to confirm source/runtime sync.
140
- - Use `tools/bin/sync-shared-agent-home.sh` after changing runtime-facing files.
141
- - Prefer copied published artifacts over symlink aliases.
142
-
143
- ## References
144
-
145
- - `references/control-plane-map.md`
146
- - `references/commands.md`
147
- - `references/repo-map.md`
148
- - `references/docs-map.md`
149
- - `~/.agent-runtime/control-plane/profiles/<id>/README.md`