@open-agent-toolkit/cli 0.0.43 → 0.0.51
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/assets/agents/oat-phase-implementer.md +230 -0
- package/assets/agents/oat-reviewer.md +3 -3
- package/assets/docs/cli-utilities/configuration.md +15 -3
- package/assets/docs/reference/cli-reference.md +17 -14
- package/assets/docs/reference/oat-directory-structure.md +17 -17
- package/assets/docs/workflows/projects/artifacts.md +34 -0
- package/assets/docs/workflows/projects/implementation-execution.md +161 -0
- package/assets/docs/workflows/projects/lifecycle.md +22 -29
- package/assets/docs/workflows/projects/reviews.md +4 -2
- package/assets/docs/workflows/skills/index.md +0 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-doctor/SKILL.md +3 -3
- package/assets/skills/oat-project-implement/SKILL.md +363 -126
- package/assets/skills/oat-project-import-plan/SKILL.md +2 -3
- package/assets/skills/oat-project-next/SKILL.md +11 -12
- package/assets/skills/oat-project-plan/SKILL.md +23 -5
- package/assets/skills/oat-project-plan-writing/SKILL.md +2 -2
- package/assets/skills/oat-project-progress/SKILL.md +29 -35
- package/assets/skills/oat-project-quick-start/SKILL.md +13 -3
- package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +2 -2
- package/assets/templates/implementation.md +8 -3
- package/assets/templates/plan.md +24 -3
- package/assets/templates/state.md +1 -1
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +17 -4
- package/dist/commands/init/tools/index.js +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
- package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.js +1 -1
- package/dist/commands/project/index.d.ts.map +1 -1
- package/dist/commands/project/index.js +3 -1
- package/dist/commands/project/set-mode/index.d.ts +0 -6
- package/dist/commands/project/set-mode/index.d.ts.map +1 -1
- package/dist/commands/project/set-mode/index.js +16 -96
- package/dist/commands/project/validate-plan/index.d.ts +3 -0
- package/dist/commands/project/validate-plan/index.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/index.js +44 -0
- package/dist/commands/project/validate-plan/validate-plan.d.ts +20 -0
- package/dist/commands/project/validate-plan/validate-plan.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/validate-plan.js +77 -0
- package/dist/commands/tools/update/index.d.ts +4 -0
- package/dist/commands/tools/update/index.d.ts.map +1 -1
- package/dist/commands/tools/update/index.js +17 -1
- package/dist/commands/tools/update/update-tools.d.ts +1 -0
- package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
- package/dist/commands/tools/update/update-tools.js +80 -1
- package/dist/config/oat-config.d.ts +1 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +3 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +9 -0
- package/package.json +2 -2
- package/assets/skills/oat-project-subagent-implement/SKILL.md +0 -549
- package/assets/skills/oat-project-subagent-implement/examples/pattern-hill-checkpoint.md +0 -110
- package/assets/skills/oat-project-subagent-implement/examples/pattern-parallel-phases.md +0 -118
- package/assets/skills/oat-project-subagent-implement/scripts/dispatch.sh +0 -133
- package/assets/skills/oat-project-subagent-implement/scripts/reconcile.sh +0 -182
- package/assets/skills/oat-project-subagent-implement/scripts/review-gate.sh +0 -187
- package/assets/skills/oat-project-subagent-implement/tests/fixtures/sample-plan.md +0 -234
- package/assets/skills/oat-project-subagent-implement/tests/test-dry-run.sh +0 -126
- package/assets/skills/oat-project-subagent-implement/tests/test-hill-checkpoint.sh +0 -127
- package/assets/skills/oat-project-subagent-implement/tests/test-reconcile.sh +0 -254
- package/assets/skills/oat-project-subagent-implement/tests/test-review-gate.sh +0 -220
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
oat_status: complete
|
|
3
|
-
oat_ready_for: oat-project-implement
|
|
4
|
-
oat_blockers: []
|
|
5
|
-
oat_last_updated: 2026-02-17
|
|
6
|
-
oat_phase: plan
|
|
7
|
-
oat_phase_status: complete
|
|
8
|
-
oat_plan_hill_phases: ['p04']
|
|
9
|
-
oat_plan_source: test
|
|
10
|
-
oat_generated: false
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Implementation Plan: Sample Multi-Phase Project
|
|
14
|
-
|
|
15
|
-
> Test fixture for orchestration validation.
|
|
16
|
-
|
|
17
|
-
**Goal:** Validate orchestration dispatch, review, and reconcile logic.
|
|
18
|
-
|
|
19
|
-
**Commit Convention:** `feat({scope}): {description}`
|
|
20
|
-
|
|
21
|
-
## Planning Checklist
|
|
22
|
-
|
|
23
|
-
- [x] Confirmed HiLL checkpoints with user
|
|
24
|
-
- [x] Set `oat_plan_hill_phases` in frontmatter
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Phase 1: Data Models
|
|
29
|
-
|
|
30
|
-
### Task p01-t01: Create user model
|
|
31
|
-
|
|
32
|
-
**Files:**
|
|
33
|
-
|
|
34
|
-
- Create: `src/models/user.ts`
|
|
35
|
-
- Create: `src/models/user.test.ts`
|
|
36
|
-
|
|
37
|
-
**Step 1: Define acceptance criteria (RED)**
|
|
38
|
-
|
|
39
|
-
Run: `test -f src/models/user.ts && echo "exists"`
|
|
40
|
-
Expected: File does not exist yet
|
|
41
|
-
|
|
42
|
-
**Step 2: Implement (GREEN)**
|
|
43
|
-
|
|
44
|
-
Create user model with id, name, email fields.
|
|
45
|
-
|
|
46
|
-
**Step 3: Verify**
|
|
47
|
-
|
|
48
|
-
Run: `pnpm test`
|
|
49
|
-
Expected: Tests pass
|
|
50
|
-
|
|
51
|
-
**Step 4: Commit**
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
git add src/models/
|
|
55
|
-
git commit -m "feat(p01-t01): create user model"
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
### Task p01-t02: Create settings model
|
|
61
|
-
|
|
62
|
-
**Files:**
|
|
63
|
-
|
|
64
|
-
- Create: `src/models/settings.ts`
|
|
65
|
-
- Create: `src/models/settings.test.ts`
|
|
66
|
-
|
|
67
|
-
**Step 1: Define acceptance criteria (RED)**
|
|
68
|
-
|
|
69
|
-
Run: `test -f src/models/settings.ts && echo "exists"`
|
|
70
|
-
Expected: File does not exist yet
|
|
71
|
-
|
|
72
|
-
**Step 2: Implement (GREEN)**
|
|
73
|
-
|
|
74
|
-
Create settings model with key, value, scope fields.
|
|
75
|
-
|
|
76
|
-
**Step 3: Verify**
|
|
77
|
-
|
|
78
|
-
Run: `pnpm test`
|
|
79
|
-
Expected: Tests pass
|
|
80
|
-
|
|
81
|
-
**Step 4: Commit**
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
git add src/models/
|
|
85
|
-
git commit -m "feat(p01-t02): create settings model"
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Phase 2: API Routes
|
|
91
|
-
|
|
92
|
-
### Task p02-t01: Create user API endpoint
|
|
93
|
-
|
|
94
|
-
**Files:**
|
|
95
|
-
|
|
96
|
-
- Create: `src/routes/user.ts`
|
|
97
|
-
- Create: `src/routes/user.test.ts`
|
|
98
|
-
|
|
99
|
-
**Step 1: Define acceptance criteria (RED)**
|
|
100
|
-
|
|
101
|
-
Run: `test -f src/routes/user.ts && echo "exists"`
|
|
102
|
-
Expected: File does not exist yet
|
|
103
|
-
|
|
104
|
-
**Step 2: Implement (GREEN)**
|
|
105
|
-
|
|
106
|
-
Create GET/POST endpoints for user CRUD.
|
|
107
|
-
|
|
108
|
-
**Step 3: Verify**
|
|
109
|
-
|
|
110
|
-
Run: `pnpm test`
|
|
111
|
-
Expected: Tests pass
|
|
112
|
-
|
|
113
|
-
**Step 4: Commit**
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
git add src/routes/
|
|
117
|
-
git commit -m "feat(p02-t01): create user API endpoint"
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### Task p02-t02: Create settings API endpoint
|
|
123
|
-
|
|
124
|
-
**Files:**
|
|
125
|
-
|
|
126
|
-
- Create: `src/routes/settings.ts`
|
|
127
|
-
- Create: `src/routes/settings.test.ts`
|
|
128
|
-
|
|
129
|
-
**Step 1: Define acceptance criteria (RED)**
|
|
130
|
-
|
|
131
|
-
Run: `test -f src/routes/settings.ts && echo "exists"`
|
|
132
|
-
Expected: File does not exist yet
|
|
133
|
-
|
|
134
|
-
**Step 2: Implement (GREEN)**
|
|
135
|
-
|
|
136
|
-
Create GET/PUT endpoints for settings management.
|
|
137
|
-
|
|
138
|
-
**Step 3: Verify**
|
|
139
|
-
|
|
140
|
-
Run: `pnpm test`
|
|
141
|
-
Expected: Tests pass
|
|
142
|
-
|
|
143
|
-
**Step 4: Commit**
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
git add src/routes/
|
|
147
|
-
git commit -m "feat(p02-t02): create settings API endpoint"
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Phase 3: Business Logic
|
|
153
|
-
|
|
154
|
-
### Task p03-t01: Implement user validation rules
|
|
155
|
-
|
|
156
|
-
**Files:**
|
|
157
|
-
|
|
158
|
-
- Create: `src/validation/user.ts`
|
|
159
|
-
- Create: `src/validation/user.test.ts`
|
|
160
|
-
|
|
161
|
-
**Step 1: Implement (GREEN)**
|
|
162
|
-
|
|
163
|
-
Create email and name validation.
|
|
164
|
-
|
|
165
|
-
**Step 2: Verify**
|
|
166
|
-
|
|
167
|
-
Run: `pnpm test`
|
|
168
|
-
Expected: Tests pass
|
|
169
|
-
|
|
170
|
-
**Step 3: Commit**
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
git add src/validation/
|
|
174
|
-
git commit -m "feat(p03-t01): implement user validation rules"
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Phase 4: Integration
|
|
180
|
-
|
|
181
|
-
### Task p04-t01: Wire models to routes with validation
|
|
182
|
-
|
|
183
|
-
**Files:**
|
|
184
|
-
|
|
185
|
-
- Modify: `src/routes/user.ts`
|
|
186
|
-
- Modify: `src/models/user.ts`
|
|
187
|
-
- Modify: `src/validation/user.ts`
|
|
188
|
-
|
|
189
|
-
**Step 1: Implement (GREEN)**
|
|
190
|
-
|
|
191
|
-
Connect user model, route, and validation into integrated flow.
|
|
192
|
-
|
|
193
|
-
**Step 2: Verify**
|
|
194
|
-
|
|
195
|
-
Run: `pnpm test`
|
|
196
|
-
Expected: All integration tests pass
|
|
197
|
-
|
|
198
|
-
**Step 3: Commit**
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
git add src/
|
|
202
|
-
git commit -m "feat(p04-t01): wire models to routes with validation"
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Reviews
|
|
208
|
-
|
|
209
|
-
| Scope | Type | Status | Date | Artifact |
|
|
210
|
-
| ----- | ---- | ------- | ---- | -------- |
|
|
211
|
-
| p01 | code | pending | - | - |
|
|
212
|
-
| p02 | code | pending | - | - |
|
|
213
|
-
| p03 | code | pending | - | - |
|
|
214
|
-
| p04 | code | pending | - | - |
|
|
215
|
-
| final | code | pending | - | - |
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Implementation Complete
|
|
220
|
-
|
|
221
|
-
**Summary:**
|
|
222
|
-
|
|
223
|
-
- Phase 1: 2 tasks - Data models
|
|
224
|
-
- Phase 2: 2 tasks - API routes
|
|
225
|
-
- Phase 3: 1 task - Business logic
|
|
226
|
-
- Phase 4: 1 task - Integration
|
|
227
|
-
|
|
228
|
-
**Total: 6 tasks**
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## References
|
|
233
|
-
|
|
234
|
-
- Design: N/A (test fixture)
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Test: Dry-run orchestration on sample multi-phase plan
|
|
3
|
-
#
|
|
4
|
-
# Validates that dispatch.sh correctly parses a sample plan and produces
|
|
5
|
-
# a well-formed dispatch manifest at both phase-level and task-level granularity.
|
|
6
|
-
#
|
|
7
|
-
# Usage: bash tests/test-dry-run.sh
|
|
8
|
-
|
|
9
|
-
set -euo pipefail
|
|
10
|
-
|
|
11
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
12
|
-
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
13
|
-
FIXTURES_DIR="$SCRIPT_DIR/fixtures"
|
|
14
|
-
PLAN_PATH="$FIXTURES_DIR/sample-plan.md"
|
|
15
|
-
PROJECT_PATH="$FIXTURES_DIR"
|
|
16
|
-
|
|
17
|
-
PASS=0
|
|
18
|
-
FAIL=0
|
|
19
|
-
|
|
20
|
-
assert_contains() {
|
|
21
|
-
local label="$1" output="$2" expected="$3"
|
|
22
|
-
if echo "$output" | grep -qF -- "$expected"; then
|
|
23
|
-
echo " PASS: $label"
|
|
24
|
-
PASS=$((PASS + 1))
|
|
25
|
-
else
|
|
26
|
-
echo " FAIL: $label — expected to contain: $expected"
|
|
27
|
-
FAIL=$((FAIL + 1))
|
|
28
|
-
fi
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
assert_not_contains() {
|
|
32
|
-
local label="$1" output="$2" unexpected="$3"
|
|
33
|
-
if echo "$output" | grep -qF -- "$unexpected"; then
|
|
34
|
-
echo " FAIL: $label — should NOT contain: $unexpected"
|
|
35
|
-
FAIL=$((FAIL + 1))
|
|
36
|
-
else
|
|
37
|
-
echo " PASS: $label"
|
|
38
|
-
PASS=$((PASS + 1))
|
|
39
|
-
fi
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
assert_line_count() {
|
|
43
|
-
local label="$1" output="$2" pattern="$3" expected="$4"
|
|
44
|
-
local actual
|
|
45
|
-
actual=$(echo "$output" | grep -c "$pattern" || true)
|
|
46
|
-
if [[ "$actual" -eq "$expected" ]]; then
|
|
47
|
-
echo " PASS: $label (count=$actual)"
|
|
48
|
-
PASS=$((PASS + 1))
|
|
49
|
-
else
|
|
50
|
-
echo " FAIL: $label — expected $expected occurrences of '$pattern', got $actual"
|
|
51
|
-
FAIL=$((FAIL + 1))
|
|
52
|
-
fi
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
echo "=== Test: Dry-Run Dispatch (Phase-Level) ==="
|
|
56
|
-
echo ""
|
|
57
|
-
|
|
58
|
-
PHASE_OUTPUT=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$PLAN_PATH" "$PROJECT_PATH" "test-branch" --unit-granularity phase 2>&1)
|
|
59
|
-
|
|
60
|
-
echo "--- Phase-level manifest ---"
|
|
61
|
-
assert_contains "has dispatch_manifest marker" "$PHASE_OUTPUT" "--- dispatch_manifest ---"
|
|
62
|
-
assert_contains "orchestration_branch is test-branch" "$PHASE_OUTPUT" "orchestration_branch: test-branch"
|
|
63
|
-
assert_contains "unit_granularity is phase" "$PHASE_OUTPUT" "unit_granularity: phase"
|
|
64
|
-
assert_contains "has log_path" "$PHASE_OUTPUT" "log_path:"
|
|
65
|
-
assert_line_count "identifies 4 phases" "$PHASE_OUTPUT" "type: phase" 4
|
|
66
|
-
assert_contains "phase p01 present" "$PHASE_OUTPUT" 'unit_id: "p01"'
|
|
67
|
-
assert_contains "phase p02 present" "$PHASE_OUTPUT" 'unit_id: "p02"'
|
|
68
|
-
assert_contains "phase p03 present" "$PHASE_OUTPUT" 'unit_id: "p03"'
|
|
69
|
-
assert_contains "phase p04 present" "$PHASE_OUTPUT" 'unit_id: "p04"'
|
|
70
|
-
assert_contains "HiLL checkpoints extracted" "$PHASE_OUTPUT" "hill_checkpoints:"
|
|
71
|
-
assert_contains "branch naming pattern" "$PHASE_OUTPUT" "branch_naming:"
|
|
72
|
-
|
|
73
|
-
echo ""
|
|
74
|
-
echo "=== Test: Dry-Run Dispatch (Task-Level) ==="
|
|
75
|
-
echo ""
|
|
76
|
-
|
|
77
|
-
TASK_OUTPUT=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$PLAN_PATH" "$PROJECT_PATH" "test-branch" --unit-granularity task 2>&1)
|
|
78
|
-
|
|
79
|
-
echo "--- Task-level manifest ---"
|
|
80
|
-
assert_contains "unit_granularity is task" "$TASK_OUTPUT" "unit_granularity: task"
|
|
81
|
-
assert_line_count "identifies 6 tasks" "$TASK_OUTPUT" "type: task" 6
|
|
82
|
-
assert_contains "task p01-t01 present" "$TASK_OUTPUT" 'unit_id: "p01-t01"'
|
|
83
|
-
assert_contains "task p01-t02 present" "$TASK_OUTPUT" 'unit_id: "p01-t02"'
|
|
84
|
-
assert_contains "task p02-t01 present" "$TASK_OUTPUT" 'unit_id: "p02-t01"'
|
|
85
|
-
assert_contains "task p02-t02 present" "$TASK_OUTPUT" 'unit_id: "p02-t02"'
|
|
86
|
-
assert_contains "task p03-t01 present" "$TASK_OUTPUT" 'unit_id: "p03-t01"'
|
|
87
|
-
assert_contains "task p04-t01 present" "$TASK_OUTPUT" 'unit_id: "p04-t01"'
|
|
88
|
-
assert_contains "branch naming examples" "$TASK_OUTPUT" "examples:"
|
|
89
|
-
|
|
90
|
-
echo ""
|
|
91
|
-
echo "=== Test: Manifest YAML Structure ==="
|
|
92
|
-
echo ""
|
|
93
|
-
|
|
94
|
-
# Phase-level: tasks: should be block sequence header (no [])
|
|
95
|
-
# When tasks are present, should NOT have "tasks: []" followed by list items
|
|
96
|
-
assert_not_contains "no inline empty array before tasks" "$PHASE_OUTPUT" "tasks: []"
|
|
97
|
-
|
|
98
|
-
# tasks: header (block sequence) should appear for each phase
|
|
99
|
-
assert_line_count "tasks: header per phase" "$PHASE_OUTPUT" " tasks:" 4
|
|
100
|
-
|
|
101
|
-
# Task items should be indented under tasks:
|
|
102
|
-
assert_contains "task item indented under phase" "$PHASE_OUTPUT" ' - "p01-t01"'
|
|
103
|
-
|
|
104
|
-
# Manifest delimiters: open and close markers are present and properly structured
|
|
105
|
-
assert_contains "manifest open marker" "$PHASE_OUTPUT" "--- dispatch_manifest ---"
|
|
106
|
-
# Closing delimiter: should end with bare "---" (from dispatch.sh line after hill_checkpoints)
|
|
107
|
-
LAST_DASHES=$(echo "$PHASE_OUTPUT" | grep -c '^---$' || true)
|
|
108
|
-
if [[ "$LAST_DASHES" -ge 1 ]]; then
|
|
109
|
-
echo " PASS: manifest closing delimiter present"
|
|
110
|
-
PASS=$((PASS + 1))
|
|
111
|
-
else
|
|
112
|
-
echo " FAIL: manifest closing delimiter missing"
|
|
113
|
-
FAIL=$((FAIL + 1))
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
echo ""
|
|
117
|
-
echo "=== Results ==="
|
|
118
|
-
echo "Passed: $PASS"
|
|
119
|
-
echo "Failed: $FAIL"
|
|
120
|
-
|
|
121
|
-
if [[ $FAIL -gt 0 ]]; then
|
|
122
|
-
echo "OVERALL: FAIL"
|
|
123
|
-
exit 1
|
|
124
|
-
else
|
|
125
|
-
echo "OVERALL: PASS"
|
|
126
|
-
fi
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Test: HiLL checkpoint behavior
|
|
3
|
-
#
|
|
4
|
-
# Validates that dispatch.sh correctly extracts oat_plan_hill_phases from
|
|
5
|
-
# plan frontmatter and that the orchestrator can determine checkpoint boundaries.
|
|
6
|
-
#
|
|
7
|
-
# Scenarios:
|
|
8
|
-
# 1. Plan with HiLL at p04 — all phases run, pause after p04 completes
|
|
9
|
-
# 2. Plan with HiLL at p02 — p01-p02 run, pause after p02 completes
|
|
10
|
-
# 3. Plan with no HiLL — default behavior (pause after every phase)
|
|
11
|
-
#
|
|
12
|
-
# Usage: bash tests/test-hill-checkpoint.sh
|
|
13
|
-
|
|
14
|
-
set -euo pipefail
|
|
15
|
-
|
|
16
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
17
|
-
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
18
|
-
FIXTURES_DIR="$SCRIPT_DIR/fixtures"
|
|
19
|
-
PASS=0
|
|
20
|
-
FAIL=0
|
|
21
|
-
|
|
22
|
-
assert_contains() {
|
|
23
|
-
local label="$1" output="$2" expected="$3"
|
|
24
|
-
if echo "$output" | grep -qF -- "$expected"; then
|
|
25
|
-
echo " PASS: $label"
|
|
26
|
-
PASS=$((PASS + 1))
|
|
27
|
-
else
|
|
28
|
-
echo " FAIL: $label — expected to contain: $expected"
|
|
29
|
-
FAIL=$((FAIL + 1))
|
|
30
|
-
fi
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
# ─── Test 1: HiLL at p04 ──────────────────────────────────────────────────
|
|
34
|
-
echo "=== Test 1: HiLL checkpoint at p04 ==="
|
|
35
|
-
echo ""
|
|
36
|
-
|
|
37
|
-
OUTPUT_1=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$FIXTURES_DIR/sample-plan.md" "$FIXTURES_DIR" "test-branch" 2>&1)
|
|
38
|
-
|
|
39
|
-
# Extract HiLL checkpoints line
|
|
40
|
-
HIL_LINE_1=$(echo "$OUTPUT_1" | grep "hill_checkpoints:")
|
|
41
|
-
assert_contains "extracts hill_checkpoints" "$HIL_LINE_1" "hill_checkpoints:"
|
|
42
|
-
# The sample-plan.md has oat_plan_hill_phases: ['p04']
|
|
43
|
-
assert_contains "contains p04 checkpoint" "$HIL_LINE_1" "p04"
|
|
44
|
-
|
|
45
|
-
echo ""
|
|
46
|
-
|
|
47
|
-
# ─── Test 2: HiLL at p02 (modified fixture) ───────────────────────────────
|
|
48
|
-
echo "=== Test 2: HiLL checkpoint at p02 ==="
|
|
49
|
-
echo ""
|
|
50
|
-
|
|
51
|
-
# Create a modified fixture with HiLL at p02
|
|
52
|
-
TMPDIR=$(mktemp -d)
|
|
53
|
-
trap 'rm -rf "$TMPDIR"' EXIT
|
|
54
|
-
|
|
55
|
-
sed -E "s|oat_plan_hill_phases: \[[^]]*\]|oat_plan_hill_phases: ['p02']|" "$FIXTURES_DIR/sample-plan.md" > "$TMPDIR/plan-hil-p02.md"
|
|
56
|
-
|
|
57
|
-
OUTPUT_2=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$TMPDIR/plan-hil-p02.md" "$TMPDIR" "test-branch" 2>&1)
|
|
58
|
-
|
|
59
|
-
HIL_LINE_2=$(echo "$OUTPUT_2" | grep "hill_checkpoints:")
|
|
60
|
-
assert_contains "extracts p02 checkpoint" "$HIL_LINE_2" "p02"
|
|
61
|
-
|
|
62
|
-
echo ""
|
|
63
|
-
|
|
64
|
-
# ─── Test 3: No HiLL phases (empty) ───────────────────────────────────────
|
|
65
|
-
echo "=== Test 3: No HiLL phases (empty array) ==="
|
|
66
|
-
echo ""
|
|
67
|
-
|
|
68
|
-
sed -E "s|oat_plan_hill_phases: \[[^]]*\]|oat_plan_hill_phases: []|" "$FIXTURES_DIR/sample-plan.md" > "$TMPDIR/plan-no-hil.md"
|
|
69
|
-
|
|
70
|
-
OUTPUT_3=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$TMPDIR/plan-no-hil.md" "$TMPDIR" "test-branch" 2>&1)
|
|
71
|
-
|
|
72
|
-
HIL_LINE_3=$(echo "$OUTPUT_3" | grep "hill_checkpoints:")
|
|
73
|
-
assert_contains "extracts empty hill_checkpoints" "$HIL_LINE_3" "hill_checkpoints: []"
|
|
74
|
-
|
|
75
|
-
echo ""
|
|
76
|
-
|
|
77
|
-
# ─── Test 4: Validate partition logic (script-level) ─────────────────────
|
|
78
|
-
echo "=== Test 4: Validate checkpoint partition logic ==="
|
|
79
|
-
echo ""
|
|
80
|
-
|
|
81
|
-
# Parse the dispatch manifest from Test 1 and verify phase ordering
|
|
82
|
-
# The sample plan has 4 phases. With HiLL at p04:
|
|
83
|
-
# Run 1: p01, p02, p03, p04 (all run through checkpoint)
|
|
84
|
-
# Pause: after p04 completes (end of implementation)
|
|
85
|
-
|
|
86
|
-
# Verify all 4 phases are identified in the manifest
|
|
87
|
-
PHASE_COUNT=$(echo "$OUTPUT_1" | grep -c "type: phase" || true)
|
|
88
|
-
if [[ "$PHASE_COUNT" -eq 4 ]]; then
|
|
89
|
-
echo " PASS: all 4 phases identified in manifest"
|
|
90
|
-
PASS=$((PASS + 1))
|
|
91
|
-
else
|
|
92
|
-
echo " FAIL: expected 4 phases, got $PHASE_COUNT"
|
|
93
|
-
FAIL=$((FAIL + 1))
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
# Verify checkpoint info allows orchestrator to partition
|
|
97
|
-
# The orchestrator reads hill_checkpoints and pauses after completing p04
|
|
98
|
-
assert_contains "p01 is in pre-checkpoint run" "$OUTPUT_1" 'unit_id: "p01"'
|
|
99
|
-
assert_contains "p02 is in pre-checkpoint run" "$OUTPUT_1" 'unit_id: "p02"'
|
|
100
|
-
assert_contains "p03 is in pre-checkpoint run" "$OUTPUT_1" 'unit_id: "p03"'
|
|
101
|
-
assert_contains "p04 is identified for post-checkpoint" "$OUTPUT_1" 'unit_id: "p04"'
|
|
102
|
-
|
|
103
|
-
echo ""
|
|
104
|
-
|
|
105
|
-
# ─── Test 5: Multiple HiLL checkpoints ────────────────────────────────────
|
|
106
|
-
echo "=== Test 5: Multiple HiLL checkpoints ==="
|
|
107
|
-
echo ""
|
|
108
|
-
|
|
109
|
-
sed -E "s|oat_plan_hill_phases: \[[^]]*\]|oat_plan_hill_phases: ['p02', 'p04']|" "$FIXTURES_DIR/sample-plan.md" > "$TMPDIR/plan-multi-hil.md"
|
|
110
|
-
|
|
111
|
-
OUTPUT_5=$(bash "$SKILL_DIR/scripts/dispatch.sh" "$TMPDIR/plan-multi-hil.md" "$TMPDIR" "test-branch" 2>&1)
|
|
112
|
-
|
|
113
|
-
HIL_LINE_5=$(echo "$OUTPUT_5" | grep "hill_checkpoints:")
|
|
114
|
-
assert_contains "extracts multiple checkpoints" "$HIL_LINE_5" "p02"
|
|
115
|
-
assert_contains "includes second checkpoint" "$HIL_LINE_5" "p04"
|
|
116
|
-
|
|
117
|
-
echo ""
|
|
118
|
-
echo "=== Results ==="
|
|
119
|
-
echo "Passed: $PASS"
|
|
120
|
-
echo "Failed: $FAIL"
|
|
121
|
-
|
|
122
|
-
if [[ $FAIL -gt 0 ]]; then
|
|
123
|
-
echo "OVERALL: FAIL"
|
|
124
|
-
exit 1
|
|
125
|
-
else
|
|
126
|
-
echo "OVERALL: PASS"
|
|
127
|
-
fi
|