specweave 1.0.235 → 1.0.239
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 +89 -193
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.d.ts +37 -0
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js +176 -0
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-batch-sync.d.ts +36 -0
- package/dist/plugins/specweave-github/lib/github-batch-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-batch-sync.js +115 -0
- package/dist/plugins/specweave-github/lib/github-batch-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver-v2.d.ts +37 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver-v2.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver-v2.js +56 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver-v2.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-conflict-resolver.d.ts +68 -0
- package/dist/plugins/specweave-github/lib/github-conflict-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-conflict-resolver.js +102 -0
- package/dist/plugins/specweave-github/lib/github-conflict-resolver.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-cross-repo-sync.d.ts +64 -0
- package/dist/plugins/specweave-github/lib/github-cross-repo-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-cross-repo-sync.js +162 -0
- package/dist/plugins/specweave-github/lib/github-cross-repo-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-field-sync.d.ts +50 -0
- package/dist/plugins/specweave-github/lib/github-field-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-field-sync.js +107 -0
- package/dist/plugins/specweave-github/lib/github-field-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-graphql-client.d.ts +53 -0
- package/dist/plugins/specweave-github/lib/github-graphql-client.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-graphql-client.js +138 -0
- package/dist/plugins/specweave-github/lib/github-graphql-client.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-generator.d.ts +40 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-generator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-generator.js +50 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-generator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-parser.d.ts +30 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-parser.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-parser.js +75 -0
- package/dist/plugins/specweave-github/lib/github-issue-body-parser.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-pull-sync.d.ts +94 -0
- package/dist/plugins/specweave-github/lib/github-pull-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-pull-sync.js +232 -0
- package/dist/plugins/specweave-github/lib/github-pull-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-push-sync.d.ts +50 -0
- package/dist/plugins/specweave-github/lib/github-push-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-push-sync.js +114 -0
- package/dist/plugins/specweave-github/lib/github-push-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-rate-limiter.d.ts +53 -0
- package/dist/plugins/specweave-github/lib/github-rate-limiter.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-rate-limiter.js +109 -0
- package/dist/plugins/specweave-github/lib/github-rate-limiter.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.d.ts +21 -0
- package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.js +161 -0
- package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-sync-orchestrator.d.ts +46 -0
- package/dist/plugins/specweave-github/lib/github-sync-orchestrator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-sync-orchestrator.js +99 -0
- package/dist/plugins/specweave-github/lib/github-sync-orchestrator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.d.ts +43 -0
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.js +153 -0
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.js.map +1 -0
- package/dist/plugins/specweave-github/lib/index.d.ts +1 -4
- package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/index.js +1 -4
- package/dist/plugins/specweave-github/lib/index.js.map +1 -1
- package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts +7 -0
- package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.js +15 -0
- package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.js.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-detector.d.ts +10 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-detector.js +36 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-detector.js.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-runner.d.ts +25 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-runner.d.ts.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-runner.js +57 -0
- package/dist/plugins/specweave-testing/lib/playwright-cli-runner.js.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-routing.d.ts +7 -0
- package/dist/plugins/specweave-testing/lib/playwright-routing.d.ts.map +1 -0
- package/dist/plugins/specweave-testing/lib/playwright-routing.js +17 -0
- package/dist/plugins/specweave-testing/lib/playwright-routing.js.map +1 -0
- package/dist/src/cli/commands/auto.d.ts.map +1 -1
- package/dist/src/cli/commands/auto.js +1 -2
- package/dist/src/cli/commands/auto.js.map +1 -1
- package/dist/src/cli/commands/cancel-auto.js +1 -2
- package/dist/src/cli/commands/cancel-auto.js.map +1 -1
- package/dist/src/cli/commands/living-docs.js +2 -2
- package/dist/src/cli/commands/living-docs.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +1 -2
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/core/config/types.d.ts +8 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +3 -0
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/types/sync-profile.d.ts +72 -0
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js +6 -0
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/package.json +2 -2
- package/plugins/specweave/hooks/hooks.json +2 -2
- package/plugins/specweave/hooks/startup-health-check.sh +1 -1
- package/plugins/specweave/hooks/stop-auto-v5.sh +166 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +10 -0
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +21 -1
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +1 -1
- package/plugins/specweave/skills/auto/SKILL.md +71 -251
- package/plugins/specweave/skills/team-build/SKILL.md +370 -0
- package/plugins/specweave/skills/team-merge/SKILL.md +123 -0
- package/plugins/specweave/skills/team-orchestrate/SKILL.md +800 -0
- package/plugins/specweave/skills/team-status/SKILL.md +89 -0
- package/plugins/specweave-github/MULTI-PROJECT-SYNC-ARCHITECTURE.md +94 -8
- package/plugins/specweave-github/commands/sync.md +17 -3
- package/plugins/specweave-github/hooks/github-ac-sync-handler.sh +255 -0
- package/plugins/specweave-github/hooks/github-auto-create-handler.sh +455 -0
- package/plugins/specweave-github/lib/github-ac-comment-poster.js +150 -0
- package/plugins/specweave-github/lib/github-ac-comment-poster.ts +245 -0
- package/plugins/specweave-github/lib/github-batch-sync.js +93 -0
- package/plugins/specweave-github/lib/github-batch-sync.ts +152 -0
- package/plugins/specweave-github/lib/github-board-resolver-v2.js +47 -0
- package/plugins/specweave-github/lib/github-board-resolver-v2.ts +73 -0
- package/plugins/specweave-github/lib/github-conflict-resolver.js +90 -0
- package/plugins/specweave-github/lib/github-conflict-resolver.ts +154 -0
- package/plugins/specweave-github/lib/github-cross-repo-sync.js +168 -0
- package/plugins/specweave-github/lib/github-cross-repo-sync.ts +252 -0
- package/plugins/specweave-github/lib/github-field-sync.js +116 -0
- package/plugins/specweave-github/lib/github-field-sync.ts +165 -0
- package/plugins/specweave-github/lib/github-graphql-client.js +129 -0
- package/plugins/specweave-github/lib/github-graphql-client.ts +181 -0
- package/plugins/specweave-github/lib/github-issue-body-generator.js +30 -0
- package/plugins/specweave-github/lib/github-issue-body-generator.ts +76 -0
- package/plugins/specweave-github/lib/github-issue-body-parser.js +55 -0
- package/plugins/specweave-github/lib/github-issue-body-parser.ts +92 -0
- package/plugins/specweave-github/lib/github-pull-sync.js +185 -0
- package/plugins/specweave-github/lib/github-pull-sync.ts +343 -0
- package/plugins/specweave-github/lib/github-push-sync.js +119 -0
- package/plugins/specweave-github/lib/github-push-sync.ts +174 -0
- package/plugins/specweave-github/lib/github-rate-limiter.js +96 -0
- package/plugins/specweave-github/lib/github-rate-limiter.ts +143 -0
- package/plugins/specweave-github/lib/github-spec-frontmatter-updater.js +117 -0
- package/plugins/specweave-github/lib/github-spec-frontmatter-updater.ts +180 -0
- package/plugins/specweave-github/lib/github-sync-orchestrator.js +84 -0
- package/plugins/specweave-github/lib/github-sync-orchestrator.ts +156 -0
- package/plugins/specweave-github/lib/github-us-auto-closer.js +134 -0
- package/plugins/specweave-github/lib/github-us-auto-closer.ts +226 -0
- package/plugins/specweave-github/lib/index.js +1 -7
- package/plugins/specweave-github/lib/index.ts +1 -4
- package/plugins/specweave-github/skills/github-sync/SKILL.md +76 -4
- package/plugins/specweave-testing/commands/e2e-setup.md +18 -0
- package/plugins/specweave-testing/commands/ui-automate.md +2 -0
- package/plugins/specweave-testing/commands/ui-inspect.md +8 -0
- package/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts +6 -0
- package/plugins/specweave-testing/lib/playwright-ci-defaults.js +14 -0
- package/plugins/specweave-testing/lib/playwright-ci-defaults.ts +24 -0
- package/plugins/specweave-testing/lib/playwright-cli-detector.js +33 -0
- package/plugins/specweave-testing/lib/playwright-cli-detector.ts +48 -0
- package/plugins/specweave-testing/lib/playwright-cli-runner.js +58 -0
- package/plugins/specweave-testing/lib/playwright-cli-runner.ts +80 -0
- package/plugins/specweave-testing/lib/playwright-routing.js +16 -0
- package/plugins/specweave-testing/lib/playwright-routing.ts +38 -0
- package/plugins/specweave-testing/skills/e2e-testing/SKILL.md +38 -0
- package/src/templates/CLAUDE.md.template +7 -0
- package/src/templates/config.json.template +9 -1
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts +0 -51
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/subtask-sync.js +0 -147
- package/dist/plugins/specweave-github/lib/subtask-sync.js.map +0 -1
- package/dist/plugins/specweave-github/lib/task-parser.d.ts +0 -37
- package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/task-parser.js +0 -211
- package/dist/plugins/specweave-github/lib/task-parser.js.map +0 -1
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +0 -56
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +0 -375
- package/dist/plugins/specweave-github/lib/task-sync.js.map +0 -1
- package/plugins/specweave/hooks/validate-completion-conditions.sh +0 -474
- package/plugins/specweave-github/lib/subtask-sync.d.ts +0 -51
- package/plugins/specweave-github/lib/subtask-sync.d.ts.map +0 -1
- package/plugins/specweave-github/lib/subtask-sync.js +0 -154
- package/plugins/specweave-github/lib/subtask-sync.js.map +0 -1
- package/plugins/specweave-github/lib/subtask-sync.ts +0 -225
- package/plugins/specweave-github/lib/task-parser.d.js +0 -0
- package/plugins/specweave-github/lib/task-parser.d.ts +0 -37
- package/plugins/specweave-github/lib/task-parser.d.ts.map +0 -1
- package/plugins/specweave-github/lib/task-parser.js +0 -195
- package/plugins/specweave-github/lib/task-parser.js.map +0 -1
- package/plugins/specweave-github/lib/task-parser.ts +0 -246
- package/plugins/specweave-github/lib/task-sync.d.js +0 -0
- package/plugins/specweave-github/lib/task-sync.d.ts +0 -51
- package/plugins/specweave-github/lib/task-sync.d.ts.map +0 -1
- package/plugins/specweave-github/lib/task-sync.js +0 -415
- package/plugins/specweave-github/lib/task-sync.js.map +0 -1
- package/plugins/specweave-github/lib/task-sync.ts +0 -451
- package/plugins/specweave-github/skills/github-issue-tracker/SKILL.md +0 -496
- /package/plugins/specweave/hooks/{stop-auto.sh → _archive/stop-auto-v4-legacy.sh} +0 -0
- /package/plugins/{specweave-github/lib/subtask-sync.d.js → specweave-testing/lib/playwright-ci-defaults.d.js} +0 -0
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# validate-completion-conditions.sh
|
|
3
|
-
# Validates completion conditions for auto mode (v0.4.0+)
|
|
4
|
-
#
|
|
5
|
-
# Reads session.completionConditions from auto-session.json
|
|
6
|
-
# Validates each condition (build, tests, e2e, lint, types, coverage, custom command)
|
|
7
|
-
# Auto-detects framework-specific commands
|
|
8
|
-
# Implements self-healing for build/lint failures (max 3 retries)
|
|
9
|
-
# Returns exit code 0 if ALL conditions pass, 1 if ANY fail
|
|
10
|
-
#
|
|
11
|
-
# STATUS: NOT YET WIRED into stop-auto.sh
|
|
12
|
-
# This script exists but is never called from the stop hook.
|
|
13
|
-
# stop-auto.sh has its own inline validate_increment() function.
|
|
14
|
-
# This script reads auto-session.json which is not created by current auto.ts.
|
|
15
|
-
# Wiring this into the stop hook pipeline is future work.
|
|
16
|
-
#
|
|
17
|
-
# Usage: validate-completion-conditions.sh <SESSION_FILE> <TRANSCRIPT_PATH>
|
|
18
|
-
|
|
19
|
-
set -e
|
|
20
|
-
|
|
21
|
-
SESSION_FILE="$1"
|
|
22
|
-
TRANSCRIPT_PATH="$2"
|
|
23
|
-
|
|
24
|
-
if [ ! -f "$SESSION_FILE" ]; then
|
|
25
|
-
echo "Session file not found: $SESSION_FILE" >&2
|
|
26
|
-
exit 1
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
# Check if completionConditions exist in session
|
|
30
|
-
HAS_CONDITIONS=$(jq -r 'has("completionConditions")' "$SESSION_FILE" 2>/dev/null || echo "false")
|
|
31
|
-
|
|
32
|
-
if [ "$HAS_CONDITIONS" = "false" ] || [ "$(jq -r '.completionConditions | length' "$SESSION_FILE" 2>/dev/null || echo "0")" = "0" ]; then
|
|
33
|
-
# No completion conditions - pass validation
|
|
34
|
-
exit 0
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
# ============================================================================
|
|
38
|
-
# FRAMEWORK DETECTION
|
|
39
|
-
# Auto-detect build/test/lint commands based on project files
|
|
40
|
-
# ============================================================================
|
|
41
|
-
|
|
42
|
-
detect_framework() {
|
|
43
|
-
if [ -f "package.json" ]; then
|
|
44
|
-
echo "npm"
|
|
45
|
-
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
|
|
46
|
-
echo "python"
|
|
47
|
-
elif [ -f "go.mod" ]; then
|
|
48
|
-
echo "go"
|
|
49
|
-
elif [ -f "Cargo.toml" ]; then
|
|
50
|
-
echo "rust"
|
|
51
|
-
elif [ -f "pom.xml" ]; then
|
|
52
|
-
echo "maven"
|
|
53
|
-
elif [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
|
|
54
|
-
echo "gradle"
|
|
55
|
-
else
|
|
56
|
-
echo "unknown"
|
|
57
|
-
fi
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
detect_command() {
|
|
61
|
-
local condition_type="$1"
|
|
62
|
-
local framework=$(detect_framework)
|
|
63
|
-
|
|
64
|
-
case "$condition_type" in
|
|
65
|
-
build)
|
|
66
|
-
case "$framework" in
|
|
67
|
-
npm)
|
|
68
|
-
if jq -e '.scripts.build' package.json &>/dev/null; then
|
|
69
|
-
echo "npm run build"
|
|
70
|
-
else
|
|
71
|
-
echo "" # No build command
|
|
72
|
-
fi
|
|
73
|
-
;;
|
|
74
|
-
python)
|
|
75
|
-
if [ -f "pyproject.toml" ]; then
|
|
76
|
-
echo "python -m build"
|
|
77
|
-
else
|
|
78
|
-
echo ""
|
|
79
|
-
fi
|
|
80
|
-
;;
|
|
81
|
-
go)
|
|
82
|
-
echo "go build ./..."
|
|
83
|
-
;;
|
|
84
|
-
rust)
|
|
85
|
-
echo "cargo build"
|
|
86
|
-
;;
|
|
87
|
-
maven)
|
|
88
|
-
echo "mvn compile"
|
|
89
|
-
;;
|
|
90
|
-
gradle)
|
|
91
|
-
echo "./gradlew build"
|
|
92
|
-
;;
|
|
93
|
-
*)
|
|
94
|
-
echo ""
|
|
95
|
-
;;
|
|
96
|
-
esac
|
|
97
|
-
;;
|
|
98
|
-
tests)
|
|
99
|
-
case "$framework" in
|
|
100
|
-
npm)
|
|
101
|
-
if jq -e '.scripts.test' package.json &>/dev/null; then
|
|
102
|
-
echo "npm test"
|
|
103
|
-
elif [ -f "vitest.config.ts" ] || [ -f "vitest.config.js" ]; then
|
|
104
|
-
echo "npx vitest run"
|
|
105
|
-
elif [ -f "jest.config.js" ] || [ -f "jest.config.ts" ]; then
|
|
106
|
-
echo "npx jest"
|
|
107
|
-
else
|
|
108
|
-
echo "npm test"
|
|
109
|
-
fi
|
|
110
|
-
;;
|
|
111
|
-
python)
|
|
112
|
-
if [ -f "pytest.ini" ] || grep -q pytest requirements.txt 2>/dev/null; then
|
|
113
|
-
echo "pytest"
|
|
114
|
-
else
|
|
115
|
-
echo "python -m unittest"
|
|
116
|
-
fi
|
|
117
|
-
;;
|
|
118
|
-
go)
|
|
119
|
-
echo "go test ./..."
|
|
120
|
-
;;
|
|
121
|
-
rust)
|
|
122
|
-
echo "cargo test"
|
|
123
|
-
;;
|
|
124
|
-
maven)
|
|
125
|
-
echo "mvn test"
|
|
126
|
-
;;
|
|
127
|
-
gradle)
|
|
128
|
-
echo "./gradlew test"
|
|
129
|
-
;;
|
|
130
|
-
*)
|
|
131
|
-
echo "npm test"
|
|
132
|
-
;;
|
|
133
|
-
esac
|
|
134
|
-
;;
|
|
135
|
-
e2e)
|
|
136
|
-
case "$framework" in
|
|
137
|
-
npm)
|
|
138
|
-
if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
|
|
139
|
-
echo "npx playwright test"
|
|
140
|
-
elif [ -f "cypress.config.ts" ] || [ -f "cypress.config.js" ]; then
|
|
141
|
-
echo "npx cypress run"
|
|
142
|
-
else
|
|
143
|
-
echo ""
|
|
144
|
-
fi
|
|
145
|
-
;;
|
|
146
|
-
*)
|
|
147
|
-
echo ""
|
|
148
|
-
;;
|
|
149
|
-
esac
|
|
150
|
-
;;
|
|
151
|
-
lint)
|
|
152
|
-
case "$framework" in
|
|
153
|
-
npm)
|
|
154
|
-
if jq -e '.scripts.lint' package.json &>/dev/null; then
|
|
155
|
-
echo "npm run lint"
|
|
156
|
-
elif [ -f ".eslintrc.js" ] || [ -f ".eslintrc.json" ] || [ -f "eslint.config.js" ]; then
|
|
157
|
-
echo "npx eslint ."
|
|
158
|
-
else
|
|
159
|
-
echo ""
|
|
160
|
-
fi
|
|
161
|
-
;;
|
|
162
|
-
python)
|
|
163
|
-
if grep -q "black" requirements.txt 2>/dev/null; then
|
|
164
|
-
echo "black --check ."
|
|
165
|
-
elif grep -q "flake8" requirements.txt 2>/dev/null; then
|
|
166
|
-
echo "flake8"
|
|
167
|
-
else
|
|
168
|
-
echo ""
|
|
169
|
-
fi
|
|
170
|
-
;;
|
|
171
|
-
go)
|
|
172
|
-
echo "golangci-lint run"
|
|
173
|
-
;;
|
|
174
|
-
rust)
|
|
175
|
-
echo "cargo clippy"
|
|
176
|
-
;;
|
|
177
|
-
*)
|
|
178
|
-
echo ""
|
|
179
|
-
;;
|
|
180
|
-
esac
|
|
181
|
-
;;
|
|
182
|
-
types)
|
|
183
|
-
case "$framework" in
|
|
184
|
-
npm)
|
|
185
|
-
if [ -f "tsconfig.json" ]; then
|
|
186
|
-
echo "npx tsc --noEmit"
|
|
187
|
-
else
|
|
188
|
-
echo ""
|
|
189
|
-
fi
|
|
190
|
-
;;
|
|
191
|
-
python)
|
|
192
|
-
if grep -q "mypy" requirements.txt 2>/dev/null; then
|
|
193
|
-
echo "mypy ."
|
|
194
|
-
else
|
|
195
|
-
echo ""
|
|
196
|
-
fi
|
|
197
|
-
;;
|
|
198
|
-
*)
|
|
199
|
-
echo ""
|
|
200
|
-
;;
|
|
201
|
-
esac
|
|
202
|
-
;;
|
|
203
|
-
esac
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
# ============================================================================
|
|
207
|
-
# VALIDATION FUNCTIONS
|
|
208
|
-
# ============================================================================
|
|
209
|
-
|
|
210
|
-
validate_build() {
|
|
211
|
-
local auto_heal="$1"
|
|
212
|
-
local max_retries="${2:-3}"
|
|
213
|
-
local cmd=$(detect_command "build")
|
|
214
|
-
|
|
215
|
-
if [ -z "$cmd" ]; then
|
|
216
|
-
echo " ⏭️ No build command detected - skipping" >&2
|
|
217
|
-
return 0
|
|
218
|
-
fi
|
|
219
|
-
|
|
220
|
-
echo " 🔨 Running build: $cmd" >&2
|
|
221
|
-
|
|
222
|
-
local attempt=1
|
|
223
|
-
while [ $attempt -le "$max_retries" ]; do
|
|
224
|
-
if eval "$cmd" >/dev/null 2>&1; then
|
|
225
|
-
echo " ✅ Build passed" >&2
|
|
226
|
-
return 0
|
|
227
|
-
else
|
|
228
|
-
echo " ❌ Build failed (attempt $attempt/$max_retries)" >&2
|
|
229
|
-
|
|
230
|
-
if [ "$auto_heal" = "true" ] && [ $attempt -lt "$max_retries" ]; then
|
|
231
|
-
echo " 🔄 Auto-heal enabled - will retry after LLM fix" >&2
|
|
232
|
-
attempt=$((attempt + 1))
|
|
233
|
-
else
|
|
234
|
-
echo "BLOCK:Build failed after $attempt attempt(s)"
|
|
235
|
-
return 1
|
|
236
|
-
fi
|
|
237
|
-
fi
|
|
238
|
-
done
|
|
239
|
-
|
|
240
|
-
echo "BLOCK:Build failed after $max_retries retries"
|
|
241
|
-
return 1
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
validate_tests() {
|
|
245
|
-
local auto_heal="${1:-false}"
|
|
246
|
-
local max_retries="${2:-1}"
|
|
247
|
-
local cmd=$(detect_command "tests")
|
|
248
|
-
|
|
249
|
-
echo " 🧪 Running tests: $cmd" >&2
|
|
250
|
-
|
|
251
|
-
# Note: Tests don't auto-retry within this script
|
|
252
|
-
# Auto-heal logic is handled by stop-auto.sh's self-healing mechanism
|
|
253
|
-
# This just validates if tests pass or fail
|
|
254
|
-
if ! eval "$cmd" >/dev/null 2>&1; then
|
|
255
|
-
echo "BLOCK:Tests failed - check test output for details"
|
|
256
|
-
return 1
|
|
257
|
-
fi
|
|
258
|
-
|
|
259
|
-
echo " ✅ Tests passed" >&2
|
|
260
|
-
return 0
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
validate_e2e() {
|
|
264
|
-
local cmd=$(detect_command "e2e")
|
|
265
|
-
|
|
266
|
-
if [ -z "$cmd" ]; then
|
|
267
|
-
echo " ⏭️ No E2E framework detected - skipping" >&2
|
|
268
|
-
return 0
|
|
269
|
-
fi
|
|
270
|
-
|
|
271
|
-
echo " 🎭 Running E2E tests: $cmd" >&2
|
|
272
|
-
|
|
273
|
-
if ! eval "$cmd" >/dev/null 2>&1; then
|
|
274
|
-
echo "BLOCK:E2E tests failed"
|
|
275
|
-
return 1
|
|
276
|
-
fi
|
|
277
|
-
|
|
278
|
-
echo " ✅ E2E tests passed" >&2
|
|
279
|
-
return 0
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
validate_lint() {
|
|
283
|
-
local auto_heal="$1"
|
|
284
|
-
local max_retries="${2:-3}"
|
|
285
|
-
local cmd=$(detect_command "lint")
|
|
286
|
-
|
|
287
|
-
if [ -z "$cmd" ]; then
|
|
288
|
-
echo " ⏭️ No lint command detected - skipping" >&2
|
|
289
|
-
return 0
|
|
290
|
-
fi
|
|
291
|
-
|
|
292
|
-
echo " 🧹 Running lint: $cmd" >&2
|
|
293
|
-
|
|
294
|
-
local attempt=1
|
|
295
|
-
while [ $attempt -le "$max_retries" ]; do
|
|
296
|
-
if eval "$cmd" >/dev/null 2>&1; then
|
|
297
|
-
echo " ✅ Lint passed" >&2
|
|
298
|
-
return 0
|
|
299
|
-
else
|
|
300
|
-
echo " ❌ Lint failed (attempt $attempt/$max_retries)" >&2
|
|
301
|
-
|
|
302
|
-
if [ "$auto_heal" = "true" ] && [ $attempt -lt "$max_retries" ]; then
|
|
303
|
-
echo " 🔄 Auto-heal enabled - will retry after LLM fix" >&2
|
|
304
|
-
attempt=$((attempt + 1))
|
|
305
|
-
else
|
|
306
|
-
echo "BLOCK:Lint failed after $attempt attempt(s)"
|
|
307
|
-
return 1
|
|
308
|
-
fi
|
|
309
|
-
fi
|
|
310
|
-
done
|
|
311
|
-
|
|
312
|
-
echo "BLOCK:Lint failed after $max_retries retries"
|
|
313
|
-
return 1
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
validate_types() {
|
|
317
|
-
local auto_heal="$1"
|
|
318
|
-
local max_retries="${2:-3}"
|
|
319
|
-
local cmd=$(detect_command "types")
|
|
320
|
-
|
|
321
|
-
if [ -z "$cmd" ]; then
|
|
322
|
-
echo " ⏭️ No type-checking command detected - skipping" >&2
|
|
323
|
-
return 0
|
|
324
|
-
fi
|
|
325
|
-
|
|
326
|
-
echo " 📘 Running type-check: $cmd" >&2
|
|
327
|
-
|
|
328
|
-
local attempt=1
|
|
329
|
-
while [ $attempt -le "$max_retries" ]; do
|
|
330
|
-
if eval "$cmd" >/dev/null 2>&1; then
|
|
331
|
-
echo " ✅ Type-check passed" >&2
|
|
332
|
-
return 0
|
|
333
|
-
else
|
|
334
|
-
echo " ❌ Type-check failed (attempt $attempt/$max_retries)" >&2
|
|
335
|
-
|
|
336
|
-
if [ "$auto_heal" = "true" ] && [ $attempt -lt "$max_retries" ]; then
|
|
337
|
-
echo " 🔄 Auto-heal enabled - will retry after LLM fix" >&2
|
|
338
|
-
attempt=$((attempt + 1))
|
|
339
|
-
else
|
|
340
|
-
echo "BLOCK:Type-check failed after $attempt attempt(s)"
|
|
341
|
-
return 1
|
|
342
|
-
fi
|
|
343
|
-
fi
|
|
344
|
-
done
|
|
345
|
-
|
|
346
|
-
echo "BLOCK:Type-check failed after $max_retries retries"
|
|
347
|
-
return 1
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
validate_coverage() {
|
|
351
|
-
local threshold="$1"
|
|
352
|
-
local framework=$(detect_framework)
|
|
353
|
-
|
|
354
|
-
# This is simplified - real implementation would parse coverage reports
|
|
355
|
-
echo " 📊 Coverage validation (threshold: ${threshold}%) - NOT YET IMPLEMENTED" >&2
|
|
356
|
-
return 0
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
validate_custom_command() {
|
|
360
|
-
local cmd="$1"
|
|
361
|
-
|
|
362
|
-
echo " ⚡ Running custom command: $cmd" >&2
|
|
363
|
-
|
|
364
|
-
if ! eval "$cmd" >/dev/null 2>&1; then
|
|
365
|
-
echo "BLOCK:Custom command failed: $cmd"
|
|
366
|
-
return 1
|
|
367
|
-
fi
|
|
368
|
-
|
|
369
|
-
echo " ✅ Custom command passed" >&2
|
|
370
|
-
return 0
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
# ============================================================================
|
|
374
|
-
# MAIN VALIDATION LOOP
|
|
375
|
-
# ============================================================================
|
|
376
|
-
|
|
377
|
-
echo "🔍 Validating completion conditions..." >&2
|
|
378
|
-
|
|
379
|
-
# Parse conditions array from session file
|
|
380
|
-
CONDITIONS_JSON=$(jq -r '.completionConditions' "$SESSION_FILE")
|
|
381
|
-
CONDITION_COUNT=$(echo "$CONDITIONS_JSON" | jq -r 'length')
|
|
382
|
-
|
|
383
|
-
echo "Found $CONDITION_COUNT completion condition(s)" >&2
|
|
384
|
-
|
|
385
|
-
# Track failures
|
|
386
|
-
FAILED_CONDITIONS=()
|
|
387
|
-
|
|
388
|
-
# Iterate through each condition
|
|
389
|
-
for i in $(seq 0 $((CONDITION_COUNT - 1))); do
|
|
390
|
-
CONDITION=$(echo "$CONDITIONS_JSON" | jq -r ".[$i]")
|
|
391
|
-
TYPE=$(echo "$CONDITION" | jq -r '.type')
|
|
392
|
-
AUTO_HEAL=$(echo "$CONDITION" | jq -r '.autoHeal // "false"')
|
|
393
|
-
MAX_RETRIES=$(echo "$CONDITION" | jq -r '.maxRetries // "3"')
|
|
394
|
-
THRESHOLD=$(echo "$CONDITION" | jq -r '.threshold // ""')
|
|
395
|
-
CMD=$(echo "$CONDITION" | jq -r '.cmd // ""')
|
|
396
|
-
|
|
397
|
-
echo "" >&2
|
|
398
|
-
echo "Condition $((i + 1))/$CONDITION_COUNT: $TYPE" >&2
|
|
399
|
-
|
|
400
|
-
case "$TYPE" in
|
|
401
|
-
build)
|
|
402
|
-
if ! validate_build "$AUTO_HEAL" "$MAX_RETRIES"; then
|
|
403
|
-
FAILED_CONDITIONS+=("build")
|
|
404
|
-
fi
|
|
405
|
-
;;
|
|
406
|
-
tests)
|
|
407
|
-
if ! validate_tests "$AUTO_HEAL" "$MAX_RETRIES"; then
|
|
408
|
-
FAILED_CONDITIONS+=("tests")
|
|
409
|
-
fi
|
|
410
|
-
;;
|
|
411
|
-
e2e)
|
|
412
|
-
if ! validate_e2e; then
|
|
413
|
-
FAILED_CONDITIONS+=("e2e")
|
|
414
|
-
fi
|
|
415
|
-
;;
|
|
416
|
-
lint)
|
|
417
|
-
if ! validate_lint "$AUTO_HEAL" "$MAX_RETRIES"; then
|
|
418
|
-
FAILED_CONDITIONS+=("lint")
|
|
419
|
-
fi
|
|
420
|
-
;;
|
|
421
|
-
types)
|
|
422
|
-
if ! validate_types "$AUTO_HEAL" "$MAX_RETRIES"; then
|
|
423
|
-
FAILED_CONDITIONS+=("types")
|
|
424
|
-
fi
|
|
425
|
-
;;
|
|
426
|
-
coverage)
|
|
427
|
-
if ! validate_coverage "$THRESHOLD"; then
|
|
428
|
-
FAILED_CONDITIONS+=("coverage:$THRESHOLD%")
|
|
429
|
-
fi
|
|
430
|
-
;;
|
|
431
|
-
e2e-coverage)
|
|
432
|
-
# Similar to coverage
|
|
433
|
-
echo " 🎯 E2E coverage validation - NOT YET IMPLEMENTED" >&2
|
|
434
|
-
;;
|
|
435
|
-
llm-judge)
|
|
436
|
-
# LLM Judge quality assessment
|
|
437
|
-
echo " 🤖 Running LLM Judge quality assessment..." >&2
|
|
438
|
-
|
|
439
|
-
JUDGE_SCRIPT="$(dirname "$0")/llm-judge-validator.sh"
|
|
440
|
-
if [ -f "$JUDGE_SCRIPT" ]; then
|
|
441
|
-
# Extract increment ID from session
|
|
442
|
-
CURRENT_INCREMENT=$(jq -r '.currentIncrement // ""' "$SESSION_FILE")
|
|
443
|
-
|
|
444
|
-
if ! "$JUDGE_SCRIPT" "$CURRENT_INCREMENT" "$TRANSCRIPT_PATH" 2>&1; then
|
|
445
|
-
FAILED_CONDITIONS+=("llm-judge")
|
|
446
|
-
fi
|
|
447
|
-
else
|
|
448
|
-
echo " ⚠️ LLM judge script not found - skipping" >&2
|
|
449
|
-
fi
|
|
450
|
-
;;
|
|
451
|
-
command)
|
|
452
|
-
if ! validate_custom_command "$CMD"; then
|
|
453
|
-
FAILED_CONDITIONS+=("command:$CMD")
|
|
454
|
-
fi
|
|
455
|
-
;;
|
|
456
|
-
*)
|
|
457
|
-
echo " ⚠️ Unknown condition type: $TYPE" >&2
|
|
458
|
-
;;
|
|
459
|
-
esac
|
|
460
|
-
done
|
|
461
|
-
|
|
462
|
-
# Check if any conditions failed
|
|
463
|
-
if [ ${#FAILED_CONDITIONS[@]} -gt 0 ]; then
|
|
464
|
-
echo "" >&2
|
|
465
|
-
echo "❌ ${#FAILED_CONDITIONS[@]} completion condition(s) FAILED:" >&2
|
|
466
|
-
for failed in "${FAILED_CONDITIONS[@]}"; do
|
|
467
|
-
echo " • $failed" >&2
|
|
468
|
-
done
|
|
469
|
-
exit 1
|
|
470
|
-
fi
|
|
471
|
-
|
|
472
|
-
echo "" >&2
|
|
473
|
-
echo "✅ All $CONDITION_COUNT completion conditions passed!" >&2
|
|
474
|
-
exit 0
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subtask synchronization with GitHub issue checkboxes
|
|
3
|
-
* Updates GitHub issue body when subtasks complete
|
|
4
|
-
*/
|
|
5
|
-
export declare class SubtaskSync {
|
|
6
|
-
private client;
|
|
7
|
-
private incrementPath;
|
|
8
|
-
constructor(incrementPath: string, repo?: string);
|
|
9
|
-
/**
|
|
10
|
-
* Update subtask status in GitHub issue
|
|
11
|
-
*/
|
|
12
|
-
updateSubtaskStatus(taskId: string, subtaskId: string, completed: boolean): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Sync all subtasks for a task
|
|
15
|
-
*/
|
|
16
|
-
syncAllSubtasks(taskId: string): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Update checkbox in issue body
|
|
19
|
-
*/
|
|
20
|
-
private updateSubtaskCheckbox;
|
|
21
|
-
/**
|
|
22
|
-
* Check if all subtasks are done
|
|
23
|
-
*/
|
|
24
|
-
private areAllSubtasksDone;
|
|
25
|
-
/**
|
|
26
|
-
* Escape special regex characters
|
|
27
|
-
*/
|
|
28
|
-
private escapeRegex;
|
|
29
|
-
/**
|
|
30
|
-
* Post task completion comment to GitHub issue
|
|
31
|
-
*/
|
|
32
|
-
postTaskCompletionComment(taskId: string, stats: {
|
|
33
|
-
filesModified?: number;
|
|
34
|
-
linesAdded?: number;
|
|
35
|
-
linesDeleted?: number;
|
|
36
|
-
testsAdded?: number;
|
|
37
|
-
actualDuration?: string;
|
|
38
|
-
estimatedDuration?: string;
|
|
39
|
-
summary?: string;
|
|
40
|
-
nextTask?: string;
|
|
41
|
-
progress?: {
|
|
42
|
-
completed: number;
|
|
43
|
-
total: number;
|
|
44
|
-
};
|
|
45
|
-
}): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Update epic issue progress
|
|
48
|
-
*/
|
|
49
|
-
updateEpicProgress(epicIssueNumber: number, completed: number, total: number): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=subtask-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subtask-sync.d.ts","sourceRoot":"","sources":["subtask-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,aAAa,CAAS;gBAElB,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAKhD;;OAEG;IACG,mBAAmB,CACvB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,IAAI,CAAC;IAuChB;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBpD;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoB7B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACG,yBAAyB,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QACL,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACjD,GACA,OAAO,CAAC,IAAI,CAAC;IAuChB;;OAEG;IACG,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAgCnG"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { GitHubClient } from "./github-client";
|
|
2
|
-
import { TaskParser } from "./task-parser";
|
|
3
|
-
class SubtaskSync {
|
|
4
|
-
constructor(incrementPath, repo) {
|
|
5
|
-
this.incrementPath = incrementPath;
|
|
6
|
-
this.client = new GitHubClient(repo);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Update subtask status in GitHub issue
|
|
10
|
-
*/
|
|
11
|
-
async updateSubtaskStatus(taskId, subtaskId, completed) {
|
|
12
|
-
const tasks = TaskParser.parseTasksFile(this.incrementPath);
|
|
13
|
-
const task = tasks.find((t) => t.id === taskId);
|
|
14
|
-
if (!task) {
|
|
15
|
-
throw new Error(`Task ${taskId} not found`);
|
|
16
|
-
}
|
|
17
|
-
if (!task.githubIssue) {
|
|
18
|
-
console.warn(`Task ${taskId} not synced to GitHub. Skipping subtask sync.`);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const issue = await this.client.getIssue(task.githubIssue);
|
|
22
|
-
const updatedBody = this.updateSubtaskCheckbox(
|
|
23
|
-
issue.body,
|
|
24
|
-
subtaskId,
|
|
25
|
-
completed
|
|
26
|
-
);
|
|
27
|
-
await this.client.updateIssueBody(task.githubIssue, updatedBody);
|
|
28
|
-
const allDone = this.areAllSubtasksDone(updatedBody);
|
|
29
|
-
if (allDone) {
|
|
30
|
-
await this.client.addComment(
|
|
31
|
-
task.githubIssue,
|
|
32
|
-
"\u2705 All subtasks completed!"
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
console.log(`\u2705 Updated subtask ${subtaskId} in GitHub issue #${task.githubIssue}`);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Sync all subtasks for a task
|
|
39
|
-
*/
|
|
40
|
-
async syncAllSubtasks(taskId) {
|
|
41
|
-
const tasks = TaskParser.parseTasksFile(this.incrementPath);
|
|
42
|
-
const task = tasks.find((t) => t.id === taskId);
|
|
43
|
-
if (!task || !task.githubIssue || !task.subtasks) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const issue = await this.client.getIssue(task.githubIssue);
|
|
47
|
-
let updatedBody = issue.body;
|
|
48
|
-
for (const subtask of task.subtasks) {
|
|
49
|
-
updatedBody = this.updateSubtaskCheckbox(
|
|
50
|
-
updatedBody,
|
|
51
|
-
subtask.id,
|
|
52
|
-
subtask.completed
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
await this.client.updateIssueBody(task.githubIssue, updatedBody);
|
|
56
|
-
console.log(`\u2705 Synced all subtasks for ${taskId} to GitHub issue #${task.githubIssue}`);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Update checkbox in issue body
|
|
60
|
-
*/
|
|
61
|
-
updateSubtaskCheckbox(body, subtaskId, completed) {
|
|
62
|
-
const checkbox = completed ? "[x]" : "[ ]";
|
|
63
|
-
const idPattern = new RegExp(`^(- \\[[ x]\\]\\s+${this.escapeRegex(subtaskId)}:.+)$`, "m");
|
|
64
|
-
if (idPattern.test(body)) {
|
|
65
|
-
return body.replace(idPattern, (match) => {
|
|
66
|
-
return match.replace(/\[[ x]\]/, checkbox);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return body;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Check if all subtasks are done
|
|
73
|
-
*/
|
|
74
|
-
areAllSubtasksDone(body) {
|
|
75
|
-
const subtaskLines = body.match(/^- \[[ x]\] S-\d+-\d+:.+$/gm);
|
|
76
|
-
if (!subtaskLines || subtaskLines.length === 0) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
return subtaskLines.every((line) => line.includes("[x]"));
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Escape special regex characters
|
|
83
|
-
*/
|
|
84
|
-
escapeRegex(str) {
|
|
85
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Post task completion comment to GitHub issue
|
|
89
|
-
*/
|
|
90
|
-
async postTaskCompletionComment(taskId, stats) {
|
|
91
|
-
const tasks = TaskParser.parseTasksFile(this.incrementPath);
|
|
92
|
-
const task = tasks.find((t) => t.id === taskId);
|
|
93
|
-
if (!task || !task.githubIssue) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const {
|
|
97
|
-
filesModified = 0,
|
|
98
|
-
linesAdded = 0,
|
|
99
|
-
linesDeleted = 0,
|
|
100
|
-
testsAdded = 0,
|
|
101
|
-
actualDuration = "Unknown",
|
|
102
|
-
estimatedDuration = task.estimate,
|
|
103
|
-
summary = "No summary provided",
|
|
104
|
-
nextTask = "None",
|
|
105
|
-
progress
|
|
106
|
-
} = stats;
|
|
107
|
-
const comment = `\u2705 **Task Completed**
|
|
108
|
-
|
|
109
|
-
**Files Modified**: ${filesModified} files (+${linesAdded}/-${linesDeleted} lines)
|
|
110
|
-
**Tests**: ${testsAdded > 0 ? `All passing (${testsAdded} new tests)` : "All passing"}
|
|
111
|
-
**Duration**: ${actualDuration} (estimated: ${estimatedDuration})
|
|
112
|
-
|
|
113
|
-
**What Changed**:
|
|
114
|
-
${summary}
|
|
115
|
-
|
|
116
|
-
**Next Task**: ${nextTask}
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
${progress ? `Progress: ${progress.completed}/${progress.total} tasks (${Math.round(progress.completed / progress.total * 100)}%)` : ""}
|
|
120
|
-
\u{1F916} Posted by SpecWeave`;
|
|
121
|
-
await this.client.addComment(task.githubIssue, comment);
|
|
122
|
-
console.log(`\u2705 Posted completion comment to issue #${task.githubIssue}`);
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Update epic issue progress
|
|
126
|
-
*/
|
|
127
|
-
async updateEpicProgress(epicIssueNumber, completed, total) {
|
|
128
|
-
const epic = await this.client.getIssue(epicIssueNumber);
|
|
129
|
-
const tasks = TaskParser.parseTasksFile(this.incrementPath);
|
|
130
|
-
let updatedBody = epic.body;
|
|
131
|
-
for (const task of tasks) {
|
|
132
|
-
if (task.status === "completed") {
|
|
133
|
-
const taskPattern = new RegExp(`^(- \\[[ x]\\] \\[${this.escapeRegex(task.id)}\\].+)$`, "m");
|
|
134
|
-
if (taskPattern.test(updatedBody)) {
|
|
135
|
-
updatedBody = updatedBody.replace(taskPattern, (match) => {
|
|
136
|
-
return match.replace(/\[[ x]\]/, "[x]");
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
await this.client.updateIssueBody(epicIssueNumber, updatedBody);
|
|
142
|
-
const progressComment = `\u{1F4CA} **Progress Update**
|
|
143
|
-
|
|
144
|
-
${completed}/${total} tasks completed (${Math.round(completed / total * 100)}%)
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
\u{1F916} Updated by SpecWeave`;
|
|
148
|
-
await this.client.addComment(epicIssueNumber, progressComment);
|
|
149
|
-
console.log(`\u2705 Updated epic issue #${epicIssueNumber} progress`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
export {
|
|
153
|
-
SubtaskSync
|
|
154
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subtask-sync.js","sourceRoot":"","sources":["subtask-sync.ts"],"names":[],"mappings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