feat(tooling): dev-orchestrator — OpenSpec + OpenCode dev→QA loop #5
+14
-10
@@ -3,7 +3,6 @@
|
|||||||
# Zero dependencies beyond git, opencode, openspec. No heavy binaries.
|
# Zero dependencies beyond git, opencode, openspec. No heavy binaries.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
||||||
REPO="${DEV_FLOW_REPO:-$(pwd)}"
|
REPO="${DEV_FLOW_REPO:-$(pwd)}"
|
||||||
WORKTREE_ROOT="$REPO/../.worktrees"
|
WORKTREE_ROOT="$REPO/../.worktrees"
|
||||||
|
|
||||||
@@ -57,8 +56,8 @@ cmd_spec() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ── create worktree ──
|
# ── create worktree ──
|
||||||
local branch="$(_wt_branch "$name")"
|
local branch; branch="$(_wt_branch "$name")"
|
||||||
local wt="$(_wt_path "$name")"
|
local wt; wt="$(_wt_path "$name")"
|
||||||
echo "── Creating worktree: $wt [$branch] ──"
|
echo "── Creating worktree: $wt [$branch] ──"
|
||||||
git worktree add -b "$branch" "$wt" HEAD
|
git worktree add -b "$branch" "$wt" HEAD
|
||||||
|
|
||||||
@@ -68,6 +67,7 @@ cmd_spec() {
|
|||||||
(cd "$wt" && npm install --silent 2>&1 | tail -1) || true
|
(cd "$wt" && npm install --silent 2>&1 | tail -1) || true
|
||||||
fi
|
fi
|
||||||
if [ -f "$wt/pyproject.toml" ] || [ -f "$wt/setup.py" ]; then
|
if [ -f "$wt/pyproject.toml" ] || [ -f "$wt/setup.py" ]; then
|
||||||
|
# shellcheck disable=SC1091
|
||||||
(cd "$wt" && [ -d .venv ] || python3 -m venv .venv && . .venv/bin/activate && pip install -e . -q 2>&1 | tail -1) || true
|
(cd "$wt" && [ -d .venv ] || python3 -m venv .venv && . .venv/bin/activate && pip install -e . -q 2>&1 | tail -1) || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ cmd_fill() {
|
|||||||
local name="$1"
|
local name="$1"
|
||||||
_guard
|
_guard
|
||||||
|
|
||||||
local wt="$(_wt_path "$name")"
|
local wt; wt="$(_wt_path "$name")"
|
||||||
[ -d "openspec/changes/$name" ] || _die "spec not found: openspec/changes/$name. Run: dev-orchestrator spec $name"
|
[ -d "openspec/changes/$name" ] || _die "spec not found: openspec/changes/$name. Run: dev-orchestrator spec $name"
|
||||||
|
|
||||||
echo "── AI filling spec from conversation context ──"
|
echo "── AI filling spec from conversation context ──"
|
||||||
@@ -118,10 +118,10 @@ cmd_build() {
|
|||||||
local name="$1"
|
local name="$1"
|
||||||
_guard
|
_guard
|
||||||
|
|
||||||
local wt="$(_wt_path "$name")"
|
local wt; wt="$(_wt_path "$name")"
|
||||||
[ -d "$wt" ] || _die "worktree not found: $wt. Run: dev-orchestrator spec $name"
|
[ -d "$wt" ] || _die "worktree not found: $wt. Run: dev-orchestrator spec $name"
|
||||||
|
|
||||||
local branch="$(_wt_branch "$name")"
|
local branch; branch="$(_wt_branch "$name")"
|
||||||
local max_retries=3
|
local max_retries=3
|
||||||
|
|
||||||
for attempt in $(seq 1 $max_retries); do
|
for attempt in $(seq 1 $max_retries); do
|
||||||
@@ -221,7 +221,7 @@ cmd_status() {
|
|||||||
for wt in "$WORKTREE_ROOT"/*/; do
|
for wt in "$WORKTREE_ROOT"/*/; do
|
||||||
[ -d "$wt" ] || continue
|
[ -d "$wt" ] || continue
|
||||||
local name=$(basename "$wt")
|
local name=$(basename "$wt")
|
||||||
local branch="$(_wt_branch "$name")"
|
local branch; branch="$(_wt_branch "$name")"
|
||||||
local commits="?"
|
local commits="?"
|
||||||
[ -d "$wt/.git" ] && commits=$(cd "$wt" && git rev-list --count "$branch" -- 2>/dev/null || echo "?")
|
[ -d "$wt/.git" ] && commits=$(cd "$wt" && git rev-list --count "$branch" -- 2>/dev/null || echo "?")
|
||||||
commits="${commits:-0}"
|
commits="${commits:-0}"
|
||||||
@@ -247,12 +247,16 @@ cmd_status() {
|
|||||||
cmd_clean() {
|
cmd_clean() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
cd "$REPO"
|
cd "$REPO"
|
||||||
local wt="$(_wt_path "$name")"
|
local wt; wt="$(_wt_path "$name")"
|
||||||
local branch="$(_wt_branch "$name")"
|
local branch; branch="$(_wt_branch "$name")"
|
||||||
|
|
||||||
git worktree remove "$wt" 2>/dev/null || true
|
git worktree remove "$wt" 2>/dev/null || true
|
||||||
git branch -D "$branch" 2>/dev/null || true
|
git branch -D "$branch" 2>/dev/null || true
|
||||||
[ ! -d "$wt" ] && _ok "cleaned $name" || _die "could not remove $wt"
|
if [ ! -d "$wt" ]; then
|
||||||
|
_ok "cleaned $name"
|
||||||
|
else
|
||||||
|
_die "could not remove $wt"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── dispatch ─────────────────────────────────────────────────────
|
# ── dispatch ─────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user