agent-control-plane 0.3.0 → 0.4.9
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/README.md +69 -19
- package/assets/workflow-catalog.json +1 -1
- package/bin/pr-risk.sh +22 -7
- package/bin/sync-pr-labels.sh +1 -1
- package/hooks/heartbeat-hooks.sh +125 -12
- package/hooks/issue-reconcile-hooks.sh +1 -1
- package/hooks/pr-reconcile-hooks.sh +1 -1
- package/npm/bin/agent-control-plane.js +256 -58
- package/package.json +7 -6
- package/tools/bin/agent-github-update-labels +36 -2
- package/tools/bin/agent-project-catch-up-merged-prs +3 -2
- package/tools/bin/agent-project-publish-issue-pr +6 -3
- package/tools/bin/agent-project-reconcile-issue-session +12 -1
- package/tools/bin/agent-project-reconcile-pr-session +90 -32
- package/tools/bin/agent-project-retry-state +18 -7
- package/tools/bin/agent-project-run-codex-resilient +13 -5
- package/tools/bin/agent-project-sync-source-repo-main +163 -0
- package/tools/bin/flow-config-lib.sh +1203 -60
- package/tools/bin/flow-shell-lib.sh +32 -0
- package/tools/bin/github-core-rate-limit-state.sh +77 -0
- package/tools/bin/github-write-outbox.sh +470 -0
- package/tools/bin/heartbeat-loop-scheduling-lib.sh +7 -7
- package/tools/bin/heartbeat-safe-auto.sh +42 -0
- package/tools/bin/install-project-launchd.sh +17 -2
- package/tools/bin/project-init.sh +21 -1
- package/tools/bin/project-launchd-bootstrap.sh +5 -1
- package/tools/bin/project-runtimectl.sh +46 -2
- package/tools/bin/resident-issue-controller-lib.sh +2 -2
- package/tools/bin/scaffold-profile.sh +61 -3
- package/tools/bin/start-pr-fix-worker.sh +47 -10
- package/tools/bin/start-resident-issue-loop.sh +2 -2
- package/tools/dashboard/app.js +30 -1
- package/tools/dashboard/dashboard_snapshot.py +55 -0
- package/tools/templates/pr-fix-template.md +3 -1
- package/tools/templates/pr-merge-repair-template.md +2 -1
- package/references/architecture.md +0 -217
- package/references/commands.md +0 -128
- package/references/control-plane-map.md +0 -124
- package/references/docs-map.md +0 -73
- package/references/release-checklist.md +0 -65
- package/references/repo-map.md +0 -36
- package/tools/bin/resident-issue-queue-status.py +0 -35
- package/tools/bin/split-retained-slice.sh +0 -124
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
|
|
4
|
-
import argparse
|
|
5
|
-
import json
|
|
6
|
-
import os
|
|
7
|
-
import sys
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ROOT_DIR = Path(__file__).resolve().parents[1]
|
|
12
|
-
DASHBOARD_DIR = ROOT_DIR / "dashboard"
|
|
13
|
-
if str(DASHBOARD_DIR) not in sys.path:
|
|
14
|
-
sys.path.insert(0, str(DASHBOARD_DIR))
|
|
15
|
-
|
|
16
|
-
from issue_queue_state import collect_issue_queue
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def main() -> int:
|
|
20
|
-
parser = argparse.ArgumentParser(description="Render resident issue queue state as JSON.")
|
|
21
|
-
parser.add_argument("--state-root", default=os.environ.get("ACP_STATE_ROOT", "").strip(), help="ACP runtime state root")
|
|
22
|
-
parser.add_argument("--pretty", action="store_true", help="Pretty-print JSON output")
|
|
23
|
-
args = parser.parse_args()
|
|
24
|
-
|
|
25
|
-
if not args.state_root:
|
|
26
|
-
parser.error("--state-root is required")
|
|
27
|
-
|
|
28
|
-
payload = collect_issue_queue(Path(args.state_root).expanduser())
|
|
29
|
-
json.dump(payload, sys.stdout, indent=2 if args.pretty else None, sort_keys=True)
|
|
30
|
-
sys.stdout.write("\n")
|
|
31
|
-
return 0
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if __name__ == "__main__":
|
|
35
|
-
raise SystemExit(main())
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SOURCE_ROOT=""
|
|
5
|
-
TARGET_ROOT=""
|
|
6
|
-
PATHS_FILE=""
|
|
7
|
-
BACKUP_ROOT=""
|
|
8
|
-
MOVE_MODE="false"
|
|
9
|
-
|
|
10
|
-
usage() {
|
|
11
|
-
cat <<'EOF'
|
|
12
|
-
Usage:
|
|
13
|
-
split-retained-slice.sh --source <path> --target <path> --paths-file <file> [options]
|
|
14
|
-
|
|
15
|
-
Copies a curated slice of uncommitted changes from one retained worktree to
|
|
16
|
-
another. Optionally removes that slice from the source after verifying the copy.
|
|
17
|
-
|
|
18
|
-
Options:
|
|
19
|
-
--source <path> Source retained worktree
|
|
20
|
-
--target <path> Target retained worktree
|
|
21
|
-
--paths-file <file> Newline-delimited relative paths to copy
|
|
22
|
-
--backup-root <path> Where to store a safety backup copy (default: mktemp)
|
|
23
|
-
--move Remove the copied paths from the source after verify
|
|
24
|
-
--help Show this help
|
|
25
|
-
EOF
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
while [[ $# -gt 0 ]]; do
|
|
29
|
-
case "$1" in
|
|
30
|
-
--source) SOURCE_ROOT="${2:-}"; shift 2 ;;
|
|
31
|
-
--target) TARGET_ROOT="${2:-}"; shift 2 ;;
|
|
32
|
-
--paths-file) PATHS_FILE="${2:-}"; shift 2 ;;
|
|
33
|
-
--backup-root) BACKUP_ROOT="${2:-}"; shift 2 ;;
|
|
34
|
-
--move) MOVE_MODE="true"; shift ;;
|
|
35
|
-
--help|-h) usage; exit 0 ;;
|
|
36
|
-
*) echo "Unknown argument: $1" >&2; usage >&2; exit 1 ;;
|
|
37
|
-
esac
|
|
38
|
-
done
|
|
39
|
-
|
|
40
|
-
if [[ -z "$SOURCE_ROOT" || -z "$TARGET_ROOT" || -z "$PATHS_FILE" ]]; then
|
|
41
|
-
usage >&2
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
for required_path in "$SOURCE_ROOT" "$TARGET_ROOT" "$PATHS_FILE"; do
|
|
46
|
-
[[ -e "$required_path" ]] || { echo "missing path: $required_path" >&2; exit 1; }
|
|
47
|
-
done
|
|
48
|
-
|
|
49
|
-
if [[ ! -d "$SOURCE_ROOT/.git" && ! -f "$SOURCE_ROOT/.git" ]]; then
|
|
50
|
-
echo "source is not a git checkout: $SOURCE_ROOT" >&2
|
|
51
|
-
exit 1
|
|
52
|
-
fi
|
|
53
|
-
if [[ ! -d "$TARGET_ROOT/.git" && ! -f "$TARGET_ROOT/.git" ]]; then
|
|
54
|
-
echo "target is not a git checkout: $TARGET_ROOT" >&2
|
|
55
|
-
exit 1
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
if [[ -n "$(git -C "$TARGET_ROOT" status --short)" ]]; then
|
|
59
|
-
echo "target worktree must be clean before splitting: $TARGET_ROOT" >&2
|
|
60
|
-
exit 1
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
if [[ -z "$BACKUP_ROOT" ]]; then
|
|
64
|
-
BACKUP_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/retained-slice-backup.XXXXXX")"
|
|
65
|
-
else
|
|
66
|
-
mkdir -p "$BACKUP_ROOT"
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
copy_path() {
|
|
70
|
-
local source_path="${1:?source path required}"
|
|
71
|
-
local dest_root="${2:?destination root required}"
|
|
72
|
-
local rel_path="${3:?relative path required}"
|
|
73
|
-
|
|
74
|
-
if [[ -d "$source_path" ]]; then
|
|
75
|
-
mkdir -p "$(dirname "${dest_root}/${rel_path}")"
|
|
76
|
-
rm -rf "${dest_root}/${rel_path}"
|
|
77
|
-
cp -R "$source_path" "${dest_root}/${rel_path}"
|
|
78
|
-
else
|
|
79
|
-
mkdir -p "$(dirname "${dest_root}/${rel_path}")"
|
|
80
|
-
cp -p "$source_path" "${dest_root}/${rel_path}"
|
|
81
|
-
fi
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
tracked_path_exists() {
|
|
85
|
-
local repo_root="${1:?repo root required}"
|
|
86
|
-
local rel_path="${2:?relative path required}"
|
|
87
|
-
git -C "$repo_root" ls-files --error-unmatch -- "$rel_path" >/dev/null 2>&1
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
while IFS= read -r rel_path || [[ -n "$rel_path" ]]; do
|
|
91
|
-
[[ -n "$rel_path" ]] || continue
|
|
92
|
-
[[ "$rel_path" != \#* ]] || continue
|
|
93
|
-
|
|
94
|
-
source_path="${SOURCE_ROOT}/${rel_path}"
|
|
95
|
-
[[ -e "$source_path" ]] || { echo "source path missing: $rel_path" >&2; exit 1; }
|
|
96
|
-
|
|
97
|
-
copy_path "$source_path" "$BACKUP_ROOT" "$rel_path"
|
|
98
|
-
copy_path "$source_path" "$TARGET_ROOT" "$rel_path"
|
|
99
|
-
|
|
100
|
-
diff -qr "$source_path" "${TARGET_ROOT}/${rel_path}" >/dev/null
|
|
101
|
-
done <"$PATHS_FILE"
|
|
102
|
-
|
|
103
|
-
if [[ "$MOVE_MODE" == "true" ]]; then
|
|
104
|
-
while IFS= read -r rel_path || [[ -n "$rel_path" ]]; do
|
|
105
|
-
[[ -n "$rel_path" ]] || continue
|
|
106
|
-
[[ "$rel_path" != \#* ]] || continue
|
|
107
|
-
|
|
108
|
-
was_tracked="false"
|
|
109
|
-
if tracked_path_exists "$SOURCE_ROOT" "$rel_path"; then
|
|
110
|
-
was_tracked="true"
|
|
111
|
-
git -C "$SOURCE_ROOT" restore --worktree --source=HEAD -- "$rel_path"
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
if [[ "$was_tracked" != "true" && -e "${SOURCE_ROOT}/${rel_path}" ]]; then
|
|
115
|
-
rm -rf "${SOURCE_ROOT:?}/${rel_path}"
|
|
116
|
-
fi
|
|
117
|
-
done <"$PATHS_FILE"
|
|
118
|
-
fi
|
|
119
|
-
|
|
120
|
-
printf 'SOURCE_ROOT=%s\n' "$SOURCE_ROOT"
|
|
121
|
-
printf 'TARGET_ROOT=%s\n' "$TARGET_ROOT"
|
|
122
|
-
printf 'PATHS_FILE=%s\n' "$PATHS_FILE"
|
|
123
|
-
printf 'BACKUP_ROOT=%s\n' "$BACKUP_ROOT"
|
|
124
|
-
printf 'MOVE_MODE=%s\n' "$MOVE_MODE"
|