@ngocsangairvds/vsaf 5.4.7 → 5.5.0

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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/packages/cli/dist/commands/run.d.ts.map +1 -1
  3. package/packages/cli/dist/commands/run.js +16 -2
  4. package/packages/cli/dist/commands/run.js.map +1 -1
  5. package/packages/cli/dist/commands/validate.d.ts.map +1 -1
  6. package/packages/cli/dist/commands/validate.js +7 -1
  7. package/packages/cli/dist/commands/validate.js.map +1 -1
  8. package/packages/core/dist/engine/dag-parser.d.ts.map +1 -1
  9. package/packages/core/dist/engine/dag-parser.js +7 -0
  10. package/packages/core/dist/engine/dag-parser.js.map +1 -1
  11. package/packages/core/dist/engine/expand-workflow.d.ts +8 -0
  12. package/packages/core/dist/engine/expand-workflow.d.ts.map +1 -0
  13. package/packages/core/dist/engine/expand-workflow.js +104 -0
  14. package/packages/core/dist/engine/expand-workflow.js.map +1 -0
  15. package/packages/core/dist/index.d.ts +1 -0
  16. package/packages/core/dist/index.d.ts.map +1 -1
  17. package/packages/core/dist/index.js +4 -2
  18. package/packages/core/dist/index.js.map +1 -1
  19. package/packages/core/dist/providers/default-adapters.d.ts +2 -1
  20. package/packages/core/dist/providers/default-adapters.d.ts.map +1 -1
  21. package/packages/core/dist/providers/default-adapters.js +79 -26
  22. package/packages/core/dist/providers/default-adapters.js.map +1 -1
  23. package/packages/core/dist/schema/workflow-schema.d.ts +4 -0
  24. package/packages/core/dist/schema/workflow-schema.d.ts.map +1 -1
  25. package/packages/core/dist/schema/workflow-schema.js +8 -6
  26. package/packages/core/dist/schema/workflow-schema.js.map +1 -1
  27. package/packages/core/dist/types/workflow.d.ts +2 -0
  28. package/packages/core/dist/types/workflow.d.ts.map +1 -1
  29. package/skills/sdlc/_shared/sonar-viettel/quality-gate.md +7 -0
  30. package/skills/sdlc/discovery/grill/step.md +6 -1
  31. package/skills/sdlc/implement/build-run/step.md +1 -1
  32. package/skills/sdlc/implement/tdd/step.md +9 -0
  33. package/skills/sdlc/pack.yaml +2 -4
  34. package/skills/sdlc/review/fix/SKILL.md +10 -0
  35. package/skills/sdlc/review/fix/step.md +33 -0
  36. package/skills/sdlc/srs/SKILL.md +129 -0
  37. package/skills/sdlc/test-design/cases/step.md +7 -0
  38. package/workflows/sdlc/master-sdlc-headless.yaml +18 -62
  39. package/workflows/sdlc/sdlc-build-headless.yaml +34 -10
  40. package/workflows/sdlc/sdlc-design.yaml +4 -21
  41. package/workflows/sdlc/sdlc-review.yaml +9 -1
  42. package/workflows/sdlc/sdlc-srs.yaml +4 -25
  43. package/skills/sdlc/srs/interface/SKILL.md +0 -10
  44. package/skills/sdlc/srs/interface/step.md +0 -44
  45. package/skills/sdlc/srs/prereq/SKILL.md +0 -10
  46. package/skills/sdlc/srs/prereq/step.md +0 -19
  47. package/skills/sdlc/srs/validate/SKILL.md +0 -10
  48. package/skills/sdlc/srs/validate/step.md +0 -23
  49. package/skills/sdlc/srs/write/SKILL.md +0 -10
  50. package/skills/sdlc/srs/write/step.md +0 -19
@@ -1,73 +1,29 @@
1
1
  name: master-sdlc-headless
2
- description: Full SDLC pipeline (headless implement) — Discovery → PRD → Architecture → SRS → Test Design → Implement (headless) → Review → Feature Complete → Ship
2
+ description: Full SDLC pipeline (headless implement, single-workspace) — Discovery → PRD → Architecture → SRS → Test Design → Implement (headless) → Review → Feature Complete → Ship
3
3
  nodes:
4
4
  - id: discovery
5
- description: Phase — Discovery
6
- bash: |
7
- vsaf run sdlc/sdlc-discovery --args $ARGUMENTS
8
- workspace: false
9
- timeout: 5400000
5
+ workflow: sdlc/sdlc-discovery
10
6
  - id: prd
11
- description: Phase — PRD
12
- bash: |
13
- vsaf run sdlc/sdlc-prd --args $ARGUMENTS
14
- workspace: false
15
- timeout: 5400000
16
- depends_on:
17
- - discovery
7
+ workflow: sdlc/sdlc-prd
8
+ depends_on: [discovery]
18
9
  - id: architecture
19
- description: Phase — Architecture
20
- bash: |
21
- vsaf run sdlc/sdlc-architecture --args $ARGUMENTS
22
- workspace: false
23
- timeout: 5400000
24
- depends_on:
25
- - prd
10
+ workflow: sdlc/sdlc-architecture
11
+ depends_on: [prd]
26
12
  - id: srs
27
- description: Phase — SRS
28
- bash: |
29
- vsaf run sdlc/sdlc-srs --args $ARGUMENTS
30
- workspace: false
31
- timeout: 5400000
32
- depends_on:
33
- - architecture
13
+ workflow: sdlc/sdlc-srs
14
+ depends_on: [architecture]
34
15
  - id: test-design
35
- description: Phase — Test Design
36
- bash: |
37
- vsaf run sdlc/sdlc-test-design --args $ARGUMENTS
38
- workspace: false
39
- timeout: 5400000
40
- depends_on:
41
- - srs
16
+ workflow: sdlc/sdlc-test-design
17
+ depends_on: [srs]
42
18
  - id: implement
43
- description: Phase — Implement (headless, engine-driven)
44
- bash: |
45
- vsaf run sdlc/sdlc-build-headless --args $ARGUMENTS
46
- workspace: false
47
- timeout: 5400000
48
- depends_on:
49
- - test-design
19
+ workflow: sdlc/sdlc-build-headless
20
+ depends_on: [test-design]
50
21
  - id: review
51
- description: Phase — Review
52
- bash: |
53
- vsaf run sdlc/sdlc-review --args $ARGUMENTS
54
- workspace: false
55
- timeout: 5400000
56
- depends_on:
57
- - implement
22
+ workflow: sdlc/sdlc-review
23
+ depends_on: [implement]
58
24
  - id: complete
59
- description: Phase — Feature Complete
60
- bash: |
61
- vsaf run sdlc/sdlc-feature-complete --args $ARGUMENTS
62
- workspace: false
63
- timeout: 5400000
64
- depends_on:
65
- - review
25
+ workflow: sdlc/sdlc-feature-complete
26
+ depends_on: [review]
66
27
  - id: ship
67
- description: Phase — Ship
68
- bash: |
69
- vsaf run sdlc/sdlc-ship --args $ARGUMENTS
70
- workspace: false
71
- timeout: 5400000
72
- depends_on:
73
- - complete
28
+ workflow: sdlc/sdlc-ship
29
+ depends_on: [complete]
@@ -60,9 +60,15 @@ nodes:
60
60
  4. Write the chosen command to `$ARTIFACTS_DIR/run-tests.sh` — a POSIX sh script that runs the
61
61
  FULL test suite from the project root and exits with the test runner's exit code. Make it
62
62
  self-contained and re-runnable, then `chmod +x` it.
63
- 5. Verify once: `sh $ARTIFACTS_DIR/run-tests.sh`. It is FINE if tests fail now (the code isn't
64
- written yet) — you are only proving the toolchain runs. Report one line: host or docker,
65
- and that run-tests.sh is ready.
63
+ 5. Verify once: `sh $ARTIFACTS_DIR/run-tests.sh 2>&1 | tee $ARTIFACTS_DIR/test-baseline.log`.
64
+ It is FINE if tests fail now (the code isn't written yet) — you are proving the toolchain
65
+ runs AND capturing the BASELINE (which tests already fail BEFORE this feature). From that
66
+ log, write `$ARTIFACTS_DIR/test-baseline.txt` with two lines exactly:
67
+ `total=<N>` (total tests the runner executed)
68
+ `failing=<comma-separated fully-qualified failing test names, or empty>`
69
+ (If the runner produced no test summary at all, write `total=0` and note the runner error —
70
+ that itself is a toolchain problem to fix here, not later.) Report one line: host or docker,
71
+ baseline total + failing count, and that run-tests.sh is ready.
66
72
 
67
73
  - id: impl-loop
68
74
  description: Implement 3/4 — TDD one case per turn; run tests IN-LOOP; finish only when GREEN
@@ -84,15 +90,22 @@ nodes:
84
90
  `<promise>IMPL_COMPLETE</promise>` and stop.
85
91
  3. For that one case: write/adjust its test (RED), implement the minimal code to make it pass
86
92
  (GREEN). Keep the change scoped to this case.
87
- 4. Run `sh $ARTIFACTS_DIR/run-tests.sh 2>&1 | tee $ARTIFACTS_DIR/test-output.log`. If ANY test
88
- fails (this case OR a regression in a previously-passing test), FIX it now and re-run until
89
- this case passes and nothing else is broken. Never move on with a failing suite.
93
+ 4. Run the COMPLETE suite: `sh $ARTIFACTS_DIR/run-tests.sh 2>&1 | tee $ARTIFACTS_DIR/test-output.log`
94
+ (never a hand-picked subset). If ANY test fails (this case OR a regression in a
95
+ previously-passing test), FIX it now and re-run until this case passes and nothing else is
96
+ broken. Never move on with a failing suite.
90
97
  5. Tick the line to `- [x]` in `$ARTIFACTS_DIR/impl-progress.md` and append a one-line note.
91
98
 
92
99
  Work on the real project files. Match the project's existing structure, language, and test
93
- framework. Do only the current case — the loop calls you again for the next. CRITICAL: NEVER
94
- emit `<promise>IMPL_COMPLETE</promise>` while any test is failing; the signal means the whole
95
- suite is green.
100
+ framework. Do only the current case — the loop calls you again for the next.
101
+
102
+ COMPLETION BAR — the full suite MUST be GREEN (0 failures, 0 errors) before you emit the
103
+ signal. A test that was ALREADY failing before this feature (see `$ARTIFACTS_DIR/test-baseline.txt`)
104
+ is NOT an excuse to ship red: either fix it, or — if it is genuinely unrelated and out of scope —
105
+ record it under a `## Pre-existing failures (quarantined)` section in impl-progress.md with the
106
+ exact test name + one-line rationale AND exclude it from the run so the suite is green. Do NOT
107
+ leave the suite red without an explicit quarantine entry. CRITICAL: NEVER emit
108
+ `<promise>IMPL_COMPLETE</promise>` while any test is failing; the signal means the whole suite is green.
96
109
  loop:
97
110
  until: IMPL_COMPLETE
98
111
  interactive: false
@@ -110,9 +123,20 @@ nodes:
110
123
  bash: |
111
124
  RT=$ARTIFACTS_DIR/run-tests.sh
112
125
  LOG=$ARTIFACTS_DIR/test-output.log
126
+ BASE=$ARTIFACTS_DIR/test-baseline.txt
113
127
  if [ ! -f "$RT" ]; then echo "[vsaf] test-gate: run-tests.sh missing (env-setup did not run)"; exit 1; fi
114
- echo "[vsaf] test-gate: final verification via run-tests.sh"
128
+ echo "[vsaf] test-gate: final verification via run-tests.sh (FULL suite)"
115
129
  sh "$RT" > "$LOG" 2>&1; code=$?
116
130
  tail -40 "$LOG" 2>/dev/null || true
131
+ # Print the runner's real execution summary so the report is honest (never a subset count).
132
+ SUMMARY=$(grep -iE "Tests run: [0-9]+|[0-9]+ (passed|failed)|BUILD (SUCCESS|FAILURE)|failures=|[0-9]+ tests" "$LOG" 2>/dev/null | tail -6)
133
+ echo "[vsaf] test-gate summary:"; printf '%s\n' "$SUMMARY"
134
+ if [ -f "$BASE" ]; then echo "[vsaf] baseline (pre-feature): $(tr '\n' ' ' < "$BASE")"; fi
135
+ # Anti-false-green: refuse a 0 exit that shows NO evidence the suite actually ran
136
+ # (e.g. a runner that no-op'd or reused stale state). A green must be a proven green.
137
+ if [ "$code" -eq 0 ] && ! printf '%s' "$SUMMARY" | grep -qiE "Tests run: [0-9]+|[0-9]+ passed|[0-9]+ tests|BUILD SUCCESS"; then
138
+ echo "[vsaf] test-gate: FAIL — exit 0 but no test-run summary found; cannot confirm the suite executed. Refusing to false-green."
139
+ exit 1
140
+ fi
117
141
  echo "[vsaf] test-gate exit=$code"
118
142
  exit "$code"
@@ -35,27 +35,10 @@ nodes:
35
35
  - architecture-epics
36
36
  workspace: false
37
37
  command: sdlc-architecture-readiness
38
- - id: srs-prereq
39
- description: SRS 1/4 — input artifacts
38
+ - id: srs
39
+ description: Phase 4 — SRS specification, validation, interface verification (single cohesive skill)
40
+ model: sonnet
40
41
  workspace: false
41
- command: sdlc-srs-prereq
42
+ command: sdlc-srs
42
43
  depends_on:
43
44
  - architecture-readiness
44
- - id: srs-write
45
- description: SRS 2/4 — write SRS
46
- depends_on:
47
- - srs-prereq
48
- workspace: false
49
- command: sdlc-srs-write
50
- - id: srs-validate
51
- description: SRS 3/4 — validate SRS
52
- depends_on:
53
- - srs-write
54
- workspace: false
55
- command: sdlc-srs-validate
56
- - id: srs-interface
57
- description: SRS 4/4 — interface verification + gate
58
- depends_on:
59
- - srs-validate
60
- workspace: false
61
- command: sdlc-srs-interface
@@ -28,9 +28,17 @@ nodes:
28
28
  workspace: false
29
29
  command: sdlc-review-impact
30
30
  - id: review-debate
31
- description: Review 5/5 — debate + gate
31
+ description: Review 5/6 — debate + gate
32
32
  model: haiku
33
33
  depends_on:
34
34
  - review-impact
35
35
  workspace: false
36
36
  command: sdlc-review-debate
37
+ - id: review-fix
38
+ description: Review 6/6 — implement MUST-FIX findings, then re-verify the full suite
39
+ model: sonnet
40
+ permission_mode: bypassPermissions
41
+ depends_on:
42
+ - review-debate
43
+ workspace: false
44
+ command: sdlc-review-fix
@@ -1,29 +1,8 @@
1
1
  name: sdlc-srs
2
- description: 'Phase workflow: SRS step-level execution'
2
+ description: 'Phase workflow: SRS — single cohesive skill (write + 8-dimension validation + interface verification)'
3
3
  nodes:
4
- - id: srs-prereq
5
- description: SRS 1/4 — input artifacts
4
+ - id: srs
5
+ description: Phase 4 — SRS specification, validation, interface verification
6
6
  model: sonnet
7
7
  workspace: false
8
- command: sdlc-srs-prereq
9
- - id: srs-write
10
- description: SRS 2/4 — write SRS
11
- model: haiku
12
- depends_on:
13
- - srs-prereq
14
- workspace: false
15
- command: sdlc-srs-write
16
- - id: srs-validate
17
- description: SRS 3/4 — validate SRS
18
- model: haiku
19
- depends_on:
20
- - srs-write
21
- workspace: false
22
- command: sdlc-srs-validate
23
- - id: srs-interface
24
- description: SRS 4/4 — interface verification + gate
25
- model: haiku
26
- depends_on:
27
- - srs-validate
28
- workspace: false
29
- command: sdlc-srs-interface
8
+ command: sdlc-srs
@@ -1,10 +0,0 @@
1
- ---
2
- name: sdlc-srs-interface
3
- description: "SRS 4/4 — interface verification + output"
4
- version: 1.0.0
5
- author: "@ngocsangairvds/vsaf"
6
- ---
7
-
8
- # SRS 4/4 — interface verification + output
9
-
10
- @include(step.md)
@@ -1,44 +0,0 @@
1
- ### Step 4: Interface Verification
2
-
3
- ```
4
- [SRS] [4/4] Interface verification via GitNexus... ⏳
5
- ```
6
-
7
- Use GitNexus `shape_check` — verify code structure matches SRS assumptions.
8
- Append results to `05-srs.md` §Interface Contracts.
9
-
10
- ```
11
- [SRS] [4/4] Interface verification via GitNexus... ✅
12
- ```
13
-
14
- ## Gate
15
-
16
- Human must approve SRS. Write `## Gate: APPROVED` at the end of the file.
17
-
18
- **Automated mode (opt-in):** when the environment has `VSAF_CI=1` or `VSAF_AUTO_APPROVE=1`, write the Gate yourself as `## Gate: APPROVED (auto · VSAF_CI · rationale: <one line>)` and proceed — the one-line rationale is REQUIRED for audit. Without the env flag, a human must approve (default).
19
-
20
- ## Output
21
-
22
- - `.vsaf/docs/features/{feature-name}/05-srs.md` — SRS document (v4 template format)
23
- - `.vsaf/docs/features/{feature-name}/05-srs-validation-report.md` — Validation report with scores
24
-
25
- ## Phase Exit Protocol
26
-
27
- In PHASE REPORT:
28
- - Output files: `05-srs.md`, `05-srs-validation-report.md`
29
- - Validation score: {overall_score}% ({GO/CONDITIONAL GO/NO-GO})
30
- - Suggestions: [1] Phase 5 Test Design (`/sdlc-test-design`) [2] Save artifacts
31
-
32
- Update `.vsaf/docs/STATUS.md`.
33
-
34
- **Notify the user:**
35
- > Artifacts have been saved. If the session is interrupted, open a new session and run the next phase — data is safe.
36
-
37
- ## Rules
38
-
39
- - Every FR/NFR MUST have a unique traceability ID
40
- - DO NOT use vague language: "should", "might", "optionally" → replace with "MUST", "MUST NOT"
41
- - All terms MUST exist in CONTEXT.md
42
- - Every FR MUST be testable (have clear pass/fail criteria)
43
- - SRS MUST follow the v4 template structure (12 sections)
44
- - ⛔ DO NOT modify `graphify-out/` or `.gitnexus/`
@@ -1,10 +0,0 @@
1
- ---
2
- name: sdlc-srs-prereq
3
- description: "SRS 1/4 — input artifacts"
4
- version: 1.0.0
5
- author: "@ngocsangairvds/vsaf"
6
- ---
7
-
8
- # SRS 1/4 — input artifacts
9
-
10
- @include(step.md)
@@ -1,19 +0,0 @@
1
- ## Phase Entry Protocol
2
-
3
- ```
4
- [SRS] [1/4] Checking input artifacts... ⏳
5
- ```
6
-
7
- 1. Input:
8
- - `.vsaf/docs/features/{feature-name}/02-prd.md`
9
- - `.vsaf/docs/features/{feature-name}/03-adr.md`
10
- - `.vsaf/docs/features/{feature-name}/04-epics.md`
11
- 2. Verify 02-prd.md AND 03-adr.md exist (04-epics.md optional):
12
- - Any required file missing → Ask: "File not found. Have you run Phase 2 (PRD) and Phase 3 (Architecture)?"
13
- 3. Read `.vsaf/docs/STATUS.md`
14
- 4. Read `CONTEXT.md`
15
- 5. Query `graph.json` for code structure + business mapping (if exists)
16
-
17
- ```
18
- [SRS] [1/4] Checking input artifacts... ✅
19
- ```
@@ -1,10 +0,0 @@
1
- ---
2
- name: sdlc-srs-validate
3
- description: "SRS 3/4 — validate SRS"
4
- version: 1.0.0
5
- author: "@ngocsangairvds/vsaf"
6
- ---
7
-
8
- # SRS 3/4 — validate SRS
9
-
10
- @include(step.md)
@@ -1,23 +0,0 @@
1
- ### Step 3: Validate SRS
2
-
3
- ```
4
- [SRS] [3/4] Validating SRS (8 dimensions)... ⏳
5
- ```
6
-
7
- Use `/sdlc-validate-srs` — validate SRS across 8 dimensions with weighted scoring.
8
-
9
- - Scope: single file (`05-srs.md`)
10
- - Cross-validate against: `02-prd.md`, `03-adr.md`
11
- - Output: `.vsaf/docs/features/{feature-name}/05-srs-validation-report.md`
12
-
13
- **Decision handling:**
14
-
15
- | Validation Result | Action |
16
- |---|---|
17
- | **GO** (≥80%, no CRITICAL) | Print score summary, proceed to Step 4 |
18
- | **CONDITIONAL GO** (60-79% or HIGH findings) | Print warnings + finding summary. Ask user: "Proceed despite warnings? (Y/N)" |
19
- | **NO-GO** (<60% or CRITICAL findings) | **STOP.** Print CRITICAL findings. Ask user to fix 05-srs.md and re-run `/sdlc-srs` |
20
-
21
- ```
22
- [SRS] [3/4] Validating SRS (8 dimensions)... ✅
23
- ```
@@ -1,10 +0,0 @@
1
- ---
2
- name: sdlc-srs-write
3
- description: "SRS 2/4 — write SRS"
4
- version: 1.0.0
5
- author: "@ngocsangairvds/vsaf"
6
- ---
7
-
8
- # SRS 2/4 — write SRS
9
-
10
- @include(step.md)
@@ -1,19 +0,0 @@
1
- ### Step 2: Write SRS
2
-
3
- ```
4
- [SRS] [2/4] Writing SRS from PRD + ADR + Epics... ⏳
5
- ```
6
-
7
- Use `/sdlc-write-srs` — write SRS following the v4 template (12 sections) from PRD + Architecture + Epics.
8
-
9
- Input:
10
- - `02-prd.md` as PRD source
11
- - `03-adr.md` as architecture context
12
- - `04-epics.md` as epic breakdown (optional)
13
- - Figma link from `CONTEXT.md` (optional)
14
-
15
- Output: `.vsaf/docs/features/{feature-name}/05-srs.md`
16
-
17
- ```
18
- [SRS] [2/4] Writing SRS from PRD + ADR + Epics... ✅
19
- ```