@ngocsangairvds/vsaf 5.4.4 → 5.4.5
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/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
name: sdlc-build-headless
|
|
2
|
-
description: 'Sub-flow:
|
|
2
|
+
description: 'Sub-flow (Archon-style): Implement in a single loop that runs the tests IN-LOOP and finishes only when green. Toolchain provisioned once (Docker when the host lacks it). Acyclic — no on_fail back-edge.'
|
|
3
3
|
provider: claude
|
|
4
4
|
model: sonnet
|
|
5
5
|
nodes:
|
|
6
6
|
- id: impl-prereq
|
|
7
|
-
description: Implement 1/
|
|
7
|
+
description: Implement 1/4 — enumerate test cases into a progress checklist
|
|
8
8
|
model: sonnet
|
|
9
9
|
workspace: false
|
|
10
10
|
timeout: 600000
|
|
@@ -22,118 +22,88 @@ nodes:
|
|
|
22
22
|
|
|
23
23
|
This checklist is the single source of truth for the implementation loop that follows.
|
|
24
24
|
|
|
25
|
-
- id:
|
|
26
|
-
description: Implement 2/
|
|
25
|
+
- id: env-setup
|
|
26
|
+
description: Implement 2/4 — provision the test toolchain ONCE; expose it as run-tests.sh
|
|
27
27
|
model: sonnet
|
|
28
|
+
permission_mode: bypassPermissions
|
|
28
29
|
workspace: false
|
|
29
|
-
timeout:
|
|
30
|
+
timeout: 1800000
|
|
30
31
|
depends_on:
|
|
31
32
|
- impl-prereq
|
|
32
33
|
prompt: |
|
|
33
|
-
|
|
34
|
+
You are a DevOps engineer. Make this project's test suite RUNNABLE, then write ONE reusable
|
|
35
|
+
script the implementation loop will call every iteration. You may run shell commands
|
|
36
|
+
(including docker). Do NOT install anything on the host.
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
3.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
depends_on:
|
|
59
|
-
- impl-loop
|
|
60
|
-
bash: |
|
|
61
|
-
echo "[vsaf] env-check: scanning build/test toolchain…"
|
|
62
|
-
MISS=$ARTIFACTS_DIR/env-missing.txt; : > "$MISS"
|
|
63
|
-
note() { echo "$1" >> "$MISS"; echo " ✗ $1"; }
|
|
64
|
-
if [ -f pom.xml ] || [ -f mvnw ]; then
|
|
65
|
-
echo "project: Maven"
|
|
66
|
-
jv=$(grep -oE '<(java.version|maven.compiler.(target|release))>[0-9]+' pom.xml 2>/dev/null | grep -oE '[0-9]+' | head -1); jv="${jv:-17}"
|
|
67
|
-
echo "required-jdk: $jv"
|
|
68
|
-
if command -v java >/dev/null 2>&1; then
|
|
69
|
-
cur=$(java -version 2>&1 | head -1 | sed -E 's/.*version "([0-9]+).*/\1/')
|
|
70
|
-
[ "$cur" -ge "$jv" ] 2>/dev/null || note "JDK>=${jv} (host has ${cur})"
|
|
71
|
-
else note "JDK ${jv}"; fi
|
|
72
|
-
{ [ -f mvnw ] && [ -f .mvn/wrapper/maven-wrapper.jar ]; } || command -v mvn >/dev/null 2>&1 || note "Maven (mvnw wrapper jar or system mvn)"
|
|
73
|
-
elif [ -f build.gradle ] || [ -f build.gradle.kts ] || [ -f gradlew ]; then
|
|
74
|
-
echo "project: Gradle"
|
|
75
|
-
command -v java >/dev/null 2>&1 || note "JDK"
|
|
76
|
-
[ -f gradlew ] || command -v gradle >/dev/null 2>&1 || note "Gradle"
|
|
77
|
-
elif [ -f package.json ]; then
|
|
78
|
-
echo "project: Node"; command -v node >/dev/null 2>&1 || note "Node.js + npm"
|
|
79
|
-
elif [ -f requirements.txt ] || [ -f pyproject.toml ]; then
|
|
80
|
-
echo "project: Python"; command -v python3 >/dev/null 2>&1 || note "Python 3"
|
|
81
|
-
else
|
|
82
|
-
echo "project: unknown (no pom/gradle/package.json/requirements)"
|
|
83
|
-
fi
|
|
84
|
-
command -v docker >/dev/null 2>&1 && echo "docker: available" || echo "docker: MISSING"
|
|
85
|
-
if [ -s "$MISS" ]; then echo "[vsaf] ── Missing environment ──"; cat "$MISS"; else echo "[vsaf] toolchain complete on host"; fi
|
|
38
|
+
1. Detect the project + required toolchain:
|
|
39
|
+
- Maven: `pom.xml`/`mvnw` (read the required JDK from `<java.version>` or
|
|
40
|
+
`<maven.compiler.target|release>`, default 17). Gradle: `build.gradle*`/`gradlew`.
|
|
41
|
+
Node: `package.json`. Python: `requirements.txt`/`pyproject.toml`.
|
|
42
|
+
2. Check what is missing on the HOST (e.g. `java -version`, `mvn -v`).
|
|
43
|
+
3. Decide dynamically:
|
|
44
|
+
- If the toolchain is present on the host: `run-tests.sh` runs the tests directly
|
|
45
|
+
(Maven `./mvnw test` or `mvn test`; Gradle `./gradlew test`; Node `npm test`;
|
|
46
|
+
Python `pytest`).
|
|
47
|
+
- If a tool is MISSING: build a Docker image with the correct toolchain
|
|
48
|
+
(e.g. `maven:3.9-eclipse-temurin-<jdk>`, `gradle:8-jdk17`, `node:20`, `python:3.11`):
|
|
49
|
+
write `.vsaf/docker/Dockerfile`, run `docker build -t vsaf-build .vsaf/docker`, and make
|
|
50
|
+
`run-tests.sh` run the tests INSIDE the container with the project bind-mounted so the
|
|
51
|
+
code stays on the host, e.g.:
|
|
52
|
+
`docker run --rm -v "$PWD":/work -w /work -v "$HOME/.m2":/root/.m2 vsaf-build <test cmd>`
|
|
53
|
+
- If Docker itself is not installed AND the host lacks the toolchain, make `run-tests.sh`
|
|
54
|
+
print a clear message and `exit 1` (do NOT try to install Docker).
|
|
55
|
+
4. Write the chosen command to `$ARTIFACTS_DIR/run-tests.sh` — a POSIX sh script that runs the
|
|
56
|
+
FULL test suite from the project root and exits with the test runner's exit code. Make it
|
|
57
|
+
self-contained and re-runnable, then `chmod +x` it.
|
|
58
|
+
5. Verify once: `sh $ARTIFACTS_DIR/run-tests.sh`. It is FINE if tests fail now (the code isn't
|
|
59
|
+
written yet) — you are only proving the toolchain runs. Report one line: host or docker,
|
|
60
|
+
and that run-tests.sh is ready.
|
|
86
61
|
|
|
87
|
-
- id:
|
|
88
|
-
description: Implement 4
|
|
62
|
+
- id: impl-loop
|
|
63
|
+
description: Implement 3/4 — TDD one case per turn; run tests IN-LOOP; finish only when GREEN
|
|
89
64
|
model: sonnet
|
|
90
65
|
permission_mode: bypassPermissions
|
|
91
66
|
workspace: false
|
|
92
67
|
timeout: 2400000
|
|
93
68
|
depends_on:
|
|
94
|
-
- env-
|
|
69
|
+
- env-setup
|
|
95
70
|
prompt: |
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
$env-check.output
|
|
71
|
+
Implement the feature by test-driven development. Source of truth:
|
|
72
|
+
`$ARTIFACTS_DIR/impl-progress.md`. Run the tests with `sh $ARTIFACTS_DIR/run-tests.sh`
|
|
73
|
+
(already provisioned by env-setup — it uses Docker automatically if the host lacks the
|
|
74
|
+
toolchain).
|
|
101
75
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`maven:3.9-eclipse-temurin-<jdk>`, `gradle:8-jdk17`, `node:20`, `python:3.11`),
|
|
113
|
-
`docker build -t vsaf-build .vsaf/docker`, then
|
|
114
|
-
`docker run --rm -v "$PWD":/work -w /work [-v "$HOME/.m2":/root/.m2] vsaf-build <test cmd>`.
|
|
115
|
-
If Docker itself is not installed, do NOT try to install it — stop and clearly report
|
|
116
|
-
that Docker Desktop/engine must be installed.
|
|
76
|
+
Steps for THIS turn:
|
|
77
|
+
1. Read `$ARTIFACTS_DIR/impl-progress.md`. Find the FIRST unchecked `- [ ]` case.
|
|
78
|
+
2. If every case is checked `- [x]` AND the full suite is green (step 4), output exactly
|
|
79
|
+
`<promise>IMPL_COMPLETE</promise>` and stop.
|
|
80
|
+
3. For that one case: write/adjust its test (RED), implement the minimal code to make it pass
|
|
81
|
+
(GREEN). Keep the change scoped to this case.
|
|
82
|
+
4. Run `sh $ARTIFACTS_DIR/run-tests.sh 2>&1 | tee $ARTIFACTS_DIR/test-output.log`. If ANY test
|
|
83
|
+
fails (this case OR a regression in a previously-passing test), FIX it now and re-run until
|
|
84
|
+
this case passes and nothing else is broken. Never move on with a failing suite.
|
|
85
|
+
5. Tick the line to `- [x]` in `$ARTIFACTS_DIR/impl-progress.md` and append a one-line note.
|
|
117
86
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
87
|
+
Work on the real project files. Match the project's existing structure, language, and test
|
|
88
|
+
framework. Do only the current case — the loop calls you again for the next. CRITICAL: NEVER
|
|
89
|
+
emit `<promise>IMPL_COMPLETE</promise>` while any test is failing; the signal means the whole
|
|
90
|
+
suite is green.
|
|
91
|
+
loop:
|
|
92
|
+
until: IMPL_COMPLETE
|
|
93
|
+
interactive: false
|
|
94
|
+
max_iterations: 40
|
|
121
95
|
|
|
122
96
|
- id: test-gate
|
|
123
|
-
description: Implement
|
|
97
|
+
description: Implement 4/4 — final deterministic verify (runs the provisioned suite once)
|
|
124
98
|
workspace: false
|
|
125
99
|
depends_on:
|
|
126
|
-
-
|
|
100
|
+
- impl-loop
|
|
127
101
|
bash: |
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
loop:
|
|
137
|
-
on_fail: impl-loop
|
|
138
|
-
max_retries: 3
|
|
139
|
-
inject_error: true
|
|
102
|
+
RT=$ARTIFACTS_DIR/run-tests.sh
|
|
103
|
+
LOG=$ARTIFACTS_DIR/test-output.log
|
|
104
|
+
if [ ! -f "$RT" ]; then echo "[vsaf] test-gate: run-tests.sh missing (env-setup did not run)"; exit 1; fi
|
|
105
|
+
echo "[vsaf] test-gate: final verification via run-tests.sh"
|
|
106
|
+
sh "$RT" > "$LOG" 2>&1; code=$?
|
|
107
|
+
tail -40 "$LOG" 2>/dev/null || true
|
|
108
|
+
echo "[vsaf] test-gate exit=$code"
|
|
109
|
+
exit "$code"
|