@sun-asterisk/sungen 3.2.17 → 3.2.18
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/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +23 -0
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +209 -16
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
- package/dist/dashboard/snapshot-builder.js +8 -1
- package/dist/dashboard/snapshot-builder.js.map +1 -1
- package/dist/dashboard/templates/index.html +1 -1
- package/dist/exporters/api-environment.d.ts +11 -0
- package/dist/exporters/api-environment.d.ts.map +1 -0
- package/dist/exporters/api-environment.js +129 -0
- package/dist/exporters/api-environment.js.map +1 -0
- package/dist/exporters/feature-parser.d.ts +16 -1
- package/dist/exporters/feature-parser.d.ts.map +1 -1
- package/dist/exporters/feature-parser.js +21 -2
- package/dist/exporters/feature-parser.js.map +1 -1
- package/dist/exporters/matrix/build.d.ts +70 -0
- package/dist/exporters/matrix/build.d.ts.map +1 -0
- package/dist/exporters/matrix/build.js +516 -0
- package/dist/exporters/matrix/build.js.map +1 -0
- package/dist/exporters/matrix/export.d.ts +50 -0
- package/dist/exporters/matrix/export.d.ts.map +1 -0
- package/dist/exporters/matrix/export.js +152 -0
- package/dist/exporters/matrix/export.js.map +1 -0
- package/dist/exporters/matrix/fingerprint.d.ts +20 -0
- package/dist/exporters/matrix/fingerprint.d.ts.map +1 -0
- package/dist/exporters/matrix/fingerprint.js +83 -0
- package/dist/exporters/matrix/fingerprint.js.map +1 -0
- package/dist/exporters/matrix/gates.d.ts +21 -0
- package/dist/exporters/matrix/gates.d.ts.map +1 -0
- package/dist/exporters/matrix/gates.js +367 -0
- package/dist/exporters/matrix/gates.js.map +1 -0
- package/dist/exporters/matrix/map-loader.d.ts +22 -0
- package/dist/exporters/matrix/map-loader.d.ts.map +1 -0
- package/dist/exporters/matrix/map-loader.js +193 -0
- package/dist/exporters/matrix/map-loader.js.map +1 -0
- package/dist/exporters/matrix/render-csv.d.ts +9 -0
- package/dist/exporters/matrix/render-csv.d.ts.map +1 -0
- package/dist/exporters/matrix/render-csv.js +92 -0
- package/dist/exporters/matrix/render-csv.js.map +1 -0
- package/dist/exporters/matrix/render-xlsx.d.ts +41 -0
- package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -0
- package/dist/exporters/matrix/render-xlsx.js +430 -0
- package/dist/exporters/matrix/render-xlsx.js.map +1 -0
- package/dist/exporters/matrix/types.d.ts +199 -0
- package/dist/exporters/matrix/types.d.ts.map +1 -0
- package/dist/exporters/matrix/types.js +15 -0
- package/dist/exporters/matrix/types.js.map +1 -0
- package/dist/exporters/matrix/wording.d.ts +61 -0
- package/dist/exporters/matrix/wording.d.ts.map +1 -0
- package/dist/exporters/matrix/wording.js +221 -0
- package/dist/exporters/matrix/wording.js.map +1 -0
- package/dist/exporters/scenario-merger.d.ts.map +1 -1
- package/dist/exporters/scenario-merger.js +2 -1
- package/dist/exporters/scenario-merger.js.map +1 -1
- package/dist/exporters/spec-parser.d.ts.map +1 -1
- package/dist/exporters/spec-parser.js +2 -1
- package/dist/exporters/spec-parser.js.map +1 -1
- package/dist/exporters/xlsx-report-builder.d.ts +1 -1
- package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
- package/dist/exporters/xlsx-report-builder.js +3 -3
- package/dist/exporters/xlsx-report-builder.js.map +1 -1
- package/dist/harness/audit.d.ts +10 -0
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +98 -16
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/blindspot.d.ts.map +1 -1
- package/dist/harness/blindspot.js +2 -1
- package/dist/harness/blindspot.js.map +1 -1
- package/dist/harness/capability-plan.d.ts +2 -0
- package/dist/harness/capability-plan.d.ts.map +1 -1
- package/dist/harness/capability-plan.js +17 -4
- package/dist/harness/capability-plan.js.map +1 -1
- package/dist/harness/feedback.d.ts.map +1 -1
- package/dist/harness/feedback.js +3 -2
- package/dist/harness/feedback.js.map +1 -1
- package/dist/harness/flow-check.d.ts.map +1 -1
- package/dist/harness/flow-check.js +2 -1
- package/dist/harness/flow-check.js.map +1 -1
- package/dist/harness/flow-plan.d.ts.map +1 -1
- package/dist/harness/flow-plan.js +3 -2
- package/dist/harness/flow-plan.js.map +1 -1
- package/dist/harness/intent.d.ts.map +1 -1
- package/dist/harness/intent.js +2 -1
- package/dist/harness/intent.js.map +1 -1
- package/dist/harness/journey.d.ts.map +1 -1
- package/dist/harness/journey.js +3 -2
- package/dist/harness/journey.js.map +1 -1
- package/dist/harness/ledger.d.ts.map +1 -1
- package/dist/harness/ledger.js +3 -2
- package/dist/harness/ledger.js.map +1 -1
- package/dist/harness/manifest.d.ts.map +1 -1
- package/dist/harness/manifest.js +4 -3
- package/dist/harness/manifest.js.map +1 -1
- package/dist/harness/parse.d.ts.map +1 -1
- package/dist/harness/parse.js +16 -3
- package/dist/harness/parse.js.map +1 -1
- package/dist/harness/quality-gates.d.ts.map +1 -1
- package/dist/harness/quality-gates.js +2 -1
- package/dist/harness/quality-gates.js.map +1 -1
- package/dist/harness/read-text.d.ts +22 -0
- package/dist/harness/read-text.d.ts.map +1 -0
- package/dist/harness/read-text.js +64 -0
- package/dist/harness/read-text.js.map +1 -0
- package/dist/harness/script-check.d.ts.map +1 -1
- package/dist/harness/script-check.js +3 -2
- package/dist/harness/script-check.js.map +1 -1
- package/dist/harness/sensors.d.ts +13 -1
- package/dist/harness/sensors.d.ts.map +1 -1
- package/dist/harness/sensors.js +63 -20
- package/dist/harness/sensors.js.map +1 -1
- package/dist/harness/spec-coverage.d.ts +5 -0
- package/dist/harness/spec-coverage.d.ts.map +1 -1
- package/dist/harness/spec-coverage.js +17 -7
- package/dist/harness/spec-coverage.js.map +1 -1
- package/dist/harness/trace.d.ts.map +1 -1
- package/dist/harness/trace.js +4 -3
- package/dist/harness/trace.js.map +1 -1
- package/dist/harness/viewpoint-baseline.d.ts +49 -0
- package/dist/harness/viewpoint-baseline.d.ts.map +1 -0
- package/dist/harness/viewpoint-baseline.js +141 -0
- package/dist/harness/viewpoint-baseline.js.map +1 -0
- package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
- package/dist/harness/viewpoint-ledger.js +2 -1
- package/dist/harness/viewpoint-ledger.js.map +1 -1
- package/dist/orchestrator/assets-drift.d.ts +24 -0
- package/dist/orchestrator/assets-drift.d.ts.map +1 -0
- package/dist/orchestrator/assets-drift.js +80 -0
- package/dist/orchestrator/assets-drift.js.map +1 -0
- package/dist/orchestrator/templates/ai-src/commands/create-test.md +24 -0
- package/dist/orchestrator/templates/ai-src/commands/delivery.md +203 -120
- package/dist/orchestrator/templates/ai-src/config/claude.md +1 -1
- package/dist/orchestrator/templates/ai-src/config/copilot.md +1 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +102 -6
- package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +23 -0
- package/package.json +3 -3
- package/src/cli/commands/audit.ts +23 -1
- package/src/cli/commands/delivery.ts +240 -18
- package/src/cli/index.ts +6 -0
- package/src/dashboard/snapshot-builder.ts +8 -1
- package/src/dashboard/templates/index.html +1 -1
- package/src/exporters/api-environment.ts +97 -0
- package/src/exporters/feature-parser.ts +21 -2
- package/src/exporters/matrix/build.ts +551 -0
- package/src/exporters/matrix/export.ts +149 -0
- package/src/exporters/matrix/fingerprint.ts +49 -0
- package/src/exporters/matrix/gates.ts +400 -0
- package/src/exporters/matrix/map-loader.ts +163 -0
- package/src/exporters/matrix/render-csv.ts +94 -0
- package/src/exporters/matrix/render-xlsx.ts +420 -0
- package/src/exporters/matrix/types.ts +226 -0
- package/src/exporters/matrix/wording.ts +221 -0
- package/src/exporters/scenario-merger.ts +2 -1
- package/src/exporters/spec-parser.ts +2 -1
- package/src/exporters/xlsx-report-builder.ts +3 -2
- package/src/harness/audit.ts +104 -18
- package/src/harness/blindspot.ts +2 -1
- package/src/harness/capability-plan.ts +17 -4
- package/src/harness/feedback.ts +3 -2
- package/src/harness/flow-check.ts +2 -1
- package/src/harness/flow-plan.ts +3 -2
- package/src/harness/intent.ts +2 -1
- package/src/harness/journey.ts +3 -2
- package/src/harness/ledger.ts +3 -2
- package/src/harness/manifest.ts +4 -3
- package/src/harness/parse.ts +17 -3
- package/src/harness/quality-gates.ts +2 -1
- package/src/harness/read-text.ts +28 -0
- package/src/harness/script-check.ts +3 -2
- package/src/harness/sensors.ts +55 -8
- package/src/harness/spec-coverage.ts +22 -7
- package/src/harness/trace.ts +4 -3
- package/src/harness/viewpoint-baseline.ts +128 -0
- package/src/harness/viewpoint-ledger.ts +2 -1
- package/src/orchestrator/assets-drift.ts +64 -0
- package/src/orchestrator/templates/ai-src/commands/create-test.md +24 -0
- package/src/orchestrator/templates/ai-src/commands/delivery.md +203 -120
- package/src/orchestrator/templates/ai-src/config/claude.md +1 -1
- package/src/orchestrator/templates/ai-src/config/copilot.md +1 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +102 -6
- package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +23 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.checkAssetsDrift = checkAssetsDrift;
|
|
37
|
+
exports.warnAssetsDrift = warnAssetsDrift;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const package_info_1 = require("../exporters/package-info");
|
|
41
|
+
function checkAssetsDrift(cwd) {
|
|
42
|
+
const manifestPath = path.join(cwd, '.sungen', 'manifest.json');
|
|
43
|
+
if (!fs.existsSync(manifestPath))
|
|
44
|
+
return null; // not a sungen project (yet)
|
|
45
|
+
let manifest;
|
|
46
|
+
try {
|
|
47
|
+
manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null; // unreadable → say nothing
|
|
51
|
+
}
|
|
52
|
+
const recordedVersion = manifest.version ?? '';
|
|
53
|
+
const runningVersion = (0, package_info_1.getPackageVersion)();
|
|
54
|
+
const managed = manifest.managed ?? {};
|
|
55
|
+
const total = Object.keys(managed).length;
|
|
56
|
+
if (!recordedVersion || total === 0)
|
|
57
|
+
return null;
|
|
58
|
+
// A version match is the common case — trust it and skip hashing entirely.
|
|
59
|
+
if (recordedVersion === runningVersion)
|
|
60
|
+
return null;
|
|
61
|
+
let changed = 0;
|
|
62
|
+
for (const rel of Object.keys(managed)) {
|
|
63
|
+
if (!fs.existsSync(path.join(cwd, rel)))
|
|
64
|
+
changed++;
|
|
65
|
+
}
|
|
66
|
+
return { recordedVersion, runningVersion, changed, total };
|
|
67
|
+
}
|
|
68
|
+
/** One line, on stderr so `--json` output stays machine-readable. */
|
|
69
|
+
function warnAssetsDrift(cwd) {
|
|
70
|
+
const drift = checkAssetsDrift(cwd);
|
|
71
|
+
if (!drift)
|
|
72
|
+
return;
|
|
73
|
+
const gray = '\x1b[90m';
|
|
74
|
+
const cyan = '\x1b[36m';
|
|
75
|
+
const reset = '\x1b[0m';
|
|
76
|
+
process.stderr.write(`${gray}note: this project's AI commands/skills were written by sungen ${drift.recordedVersion}, ` +
|
|
77
|
+
`you are running ${drift.runningVersion} — run ${cyan}sungen update${reset}${gray} to refresh them ` +
|
|
78
|
+
`(upgrading the package alone does not).${reset}\n`);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=assets-drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets-drift.js","sourceRoot":"","sources":["../../src/orchestrator/assets-drift.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,4CAwBC;AAGD,0CAWC;AA/DD,uCAAyB;AACzB,2CAA6B;AAC7B,4DAA8D;AAuB9D,SAAgB,gBAAgB,CAAC,GAAW;IAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAChE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC,CAAG,6BAA6B;IAE9E,IAAI,QAAgE,CAAC;IACrE,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,CAAoC,2BAA2B;IAC7E,CAAC;IACD,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;IAC/C,MAAM,cAAc,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,CAAC,eAAe,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjD,2EAA2E;IAC3E,IAAI,eAAe,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAEpD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC7D,CAAC;AAED,qEAAqE;AACrE,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,MAAM,IAAI,GAAG,UAAU,CAAC;IACxB,MAAM,IAAI,GAAG,UAAU,CAAC;IACxB,MAAM,KAAK,GAAG,SAAS,CAAC;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,kEAAkE,KAAK,CAAC,eAAe,IAAI;QAClG,mBAAmB,KAAK,CAAC,cAAc,UAAU,IAAI,gBAAgB,KAAK,GAAG,IAAI,mBAAmB;QACpG,0CAA0C,KAAK,IAAI,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -115,12 +115,16 @@ If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the d
|
|
|
115
115
|
- **Fill test-viewpoint.md first** — I'll help you identify edge cases, known issues, and design decisions for this screen before generating tests
|
|
116
116
|
- **Continue without it** — generate tests from spec and other sources only
|
|
117
117
|
|
|
118
|
+
**A filled `test-viewpoint.md` is an INPUT — never an output.** Do NOT rewrite, re-order, or replace its viewpoint declarations as part of generating tests. It is the yardstick two scored axes measure the suite against (`traceability`, `atomicLedger`): rewrite it to match what you just generated and both read 100% by construction, while any viewpoint you quietly dropped stops being missing from anything. If the declared taxonomy genuinely does not fit the screen, **report the mismatch and ask** — propose the diff (ids added / removed and why) and let the QA decide. `sungen audit` reports `VIEWPOINT-BASELINE-CHANGED` and stops scoring both axes when this file moves, so an unannounced rewrite lowers the score rather than raising it.
|
|
119
|
+
|
|
118
120
|
**Context discovery (prefer an isolated agent).** Reading all sources here can flood this context. **Claude Code:** spawn the **`sungen-discovery`** sub-agent (Task tool, `subagent_type: sungen-discovery`) to read spec/figma/ui/live in isolation and return a **compact discovery report** (sources, completeness, conflicts, recommended route, key facts); use that report instead of pasting raw sources. **Copilot / no sub-agents:** do the reading inline as below.
|
|
119
121
|
{{/cap}}
|
|
120
122
|
{{^cap parallel-subagents}}
|
|
121
123
|
- If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), ask:
|
|
122
124
|
- **1) Fill test-viewpoint.md first** — identify edge cases, known issues, and design decisions before generating tests
|
|
123
125
|
- **2) Continue without it** — generate tests from spec and other sources only
|
|
126
|
+
|
|
127
|
+
**A filled `test-viewpoint.md` is an INPUT — never an output.** Do NOT rewrite, re-order, or replace its viewpoint declarations while generating tests. It is the yardstick two scored axes measure the suite against (`traceability`, `atomicLedger`): rewrite it to match what you just generated and both read 100% by construction, while any viewpoint you quietly dropped stops being missing from anything. If the declared taxonomy genuinely does not fit the screen, **report the mismatch and ask** — propose the diff (ids added / removed and why) and let the QA decide. `sungen audit` reports `VIEWPOINT-BASELINE-CHANGED` and stops scoring both axes when this file moves.
|
|
124
128
|
{{/cap}}
|
|
125
129
|
|
|
126
130
|
**Auto-detect visual source** — do NOT ask the user to pick a source. Instead, check what already exists and use it:
|
|
@@ -256,3 +260,23 @@ If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the d
|
|
|
256
260
|
{{^cap parallel-subagents}}
|
|
257
261
|
**No selectors.yaml** — selectors are generated during `/sungen-run-test`.
|
|
258
262
|
{{/cap}}
|
|
263
|
+
|
|
264
|
+
## Finish — always hand the next step back
|
|
265
|
+
|
|
266
|
+
Do not stop after writing the files. Close every run with, in this order:
|
|
267
|
+
|
|
268
|
+
1. **The traceability check below** — an untagged requirement becomes an uncovered gap at delivery.
|
|
269
|
+
2. **The harness result in one line** — score, gate verdict, and the axis the `SCORE-CAPPED` finding
|
|
270
|
+
names (that finding is the single answer to "how do I raise the score").
|
|
271
|
+
3. **`AskUserQuestion` with the next actions** — never end with prose alone. Offer
|
|
272
|
+
`/sungen:run-test <name>` (recommended once the tiers are written), re-running `create-test` to
|
|
273
|
+
extend, and "Done for now". A run that ends without this leaves the operator guessing.
|
|
274
|
+
|
|
275
|
+
### Requirement traceability
|
|
276
|
+
|
|
277
|
+
Cross-check `requirements/spec.md` against the scenarios you wrote: every `FR-`/`TR-`/`NFR-` id
|
|
278
|
+
must either carry a `@spec:<id>` tag on the scenario that proves it, or be a conscious
|
|
279
|
+
out-of-scope decision you state in the summary. `sungen audit` reports `SPEC-TRACE-IMPLICIT` for
|
|
280
|
+
requirements it could only match by keyword — treat that list as a to-do: add the tag to the
|
|
281
|
+
proving scenario, do not leave the link to inference. Delivery's requirement table follows the
|
|
282
|
+
tag only, so an untagged requirement is later reported as an uncovered gap.
|
|
@@ -1,146 +1,229 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: delivery
|
|
3
|
-
description: "Export Gherkin
|
|
4
|
-
argument-hint: "[
|
|
3
|
+
description: "Export the Test Case & Coverage Matrix (review/manual/customer deliverable) from Gherkin + Playwright results. --legacy exports the classic per-scenario CSV/XLSX."
|
|
4
|
+
argument-hint: "[name...] [--format csv] [--env <locale>] [--legacy] (omit names for all)"
|
|
5
5
|
order: 50
|
|
6
|
-
claude-tools: "Bash, Read, AskUserQuestion"
|
|
6
|
+
claude-tools: "Bash, Read, Write, AskUserQuestion"
|
|
7
7
|
copilot-tools: "[read, execute, edit, vscode/askQuestions]"
|
|
8
|
-
codex-trigger: "Run when the user asks to EXPORT or deliver test cases
|
|
8
|
+
codex-trigger: "Run when the user asks to EXPORT or deliver test cases for QA hand-off. Final step. Do NOT use for creating or running tests."
|
|
9
9
|
---
|
|
10
10
|
## Role
|
|
11
11
|
|
|
12
|
-
You are a **QA Test Delivery Engineer**.
|
|
12
|
+
You are a **QA Test Delivery Engineer**. The deterministic `sungen delivery` CLI does all parsing,
|
|
13
|
+
gating, and rendering. Your job is (1) invoking it, (2) **proposing the Delivery Map** when a unit
|
|
14
|
+
does not have one yet — the one semantic step the CLI cannot do — and (3) walking the user through
|
|
15
|
+
review → approve → official render.
|
|
16
|
+
|
|
17
|
+
## The two delivery modes
|
|
18
|
+
|
|
19
|
+
- **Matrix (default)** — the Test Case & Coverage Matrix: one row per *delivery item* (one target +
|
|
20
|
+
one test intent + one oracle family), with each Gherkin scenario / `@cases` row preserved as a
|
|
21
|
+
collapsible *coverage variant* sub-row. No numbered step dumps. This is the reviewable /
|
|
22
|
+
manually-executable / customer-facing standard.
|
|
23
|
+
- **Legacy (`--legacy`, alias `--full`)** — the classic per-scenario-steps workbook (BM-2-901-13).
|
|
24
|
+
Use it when the user asks for the old format or a project is mid-engagement on it.
|
|
13
25
|
|
|
14
26
|
## Parameters
|
|
15
27
|
|
|
16
28
|
Parse from `$ARGUMENTS`:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **`--
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
- **names** — zero or more screen/flow/api names. Empty → **a sweep of every unit**.
|
|
30
|
+
Strictness follows the scope: a **named** unit that is not ready aborts the run (the user asked
|
|
31
|
+
for that unit); a **sweep** exports every ready unit and skips the rest with an accounted
|
|
32
|
+
"Not exported" list, succeeding as long as something was written. So `/sungen:delivery` with no
|
|
33
|
+
argument is safe in a work-in-progress project — scaffolded units (added but `create-test` not
|
|
34
|
+
run) no longer block the units that are ready.
|
|
35
|
+
- **`--format <xlsx|csv|both>`** — output format. **Default `xlsx` — one artifact only.** Pass
|
|
36
|
+
`--format csv` when the user wants the flat CSV (pipelines/diffing), `--format both` for both.
|
|
37
|
+
- **`--env <locale>`** — sets `SUNGEN_ENV=<locale>` for the run (accept `--locale` as alias).
|
|
38
|
+
- **`--legacy` / `--full`** — pass through to the CLI and skip the map flow entirely.
|
|
26
39
|
|
|
27
40
|
## Steps
|
|
28
41
|
|
|
29
|
-
### 1.
|
|
30
|
-
|
|
31
|
-
{{#cap parallel-subagents}}
|
|
32
|
-
Run via Bash (single command, no extra parsing). Prefer the local `./bin/sungen.js` when it exists — the sungen monorepo ships local-only features the global npm package doesn't have yet (multi-sheet locale aggregation, `.<env>` filename suffix, locale-aware step rendering). Fall back to `npx sungen` in downstream projects.
|
|
33
|
-
{{/cap}}
|
|
34
|
-
{{^cap parallel-subagents}}
|
|
35
|
-
Run via Bash (single command, no extra parsing):
|
|
36
|
-
{{/cap}}
|
|
42
|
+
### 1. Run the CLI once
|
|
37
43
|
|
|
38
44
|
```bash
|
|
39
|
-
# No env — local-first dispatcher:
|
|
40
|
-
{{#cap parallel-subagents}}
|
|
41
|
-
[ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <screens> || npx sungen delivery <screens>
|
|
42
|
-
{{/cap}}
|
|
43
|
-
{{^cap parallel-subagents}}
|
|
44
45
|
[ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <names> || npx sungen delivery <names>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
```
|
|
47
|
+
(prepend `SUNGEN_ENV=<locale>` when `--env` was given; append `--format <fmt>` when the user asked
|
|
48
|
+
for a non-default format; append `--legacy` when requested — then skip to step 5.)
|
|
49
|
+
|
|
50
|
+
Three outcomes per target:
|
|
51
|
+
- **Rendered** → done, go to step 5.
|
|
52
|
+
- **"no delivery map"** → go to step 2 (propose it).
|
|
53
|
+
- **Gate findings / "not approved"** → go to step 4 (review & approve).
|
|
54
|
+
|
|
55
|
+
On a sweep, read the **"Not exported"** list at the end: units marked *not authored yet* need
|
|
56
|
+
`/sungen:create-test` first, the others each printed their own reason above (missing map, gate
|
|
57
|
+
errors, or awaiting approval). Handle them one unit at a time — do not re-run the sweep expecting
|
|
58
|
+
a different result.
|
|
59
|
+
|
|
60
|
+
### 2. Propose the Delivery Map (only when missing or the user asks to regroup)
|
|
61
|
+
|
|
62
|
+
Read the unit's `.feature` (and `requirements/spec.md` for target naming). Write
|
|
63
|
+
`qa/<screens|flows|api>/<unit>/delivery/<unit>.map.yaml`:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
version: 1
|
|
67
|
+
unit: <unit>
|
|
68
|
+
groups:
|
|
69
|
+
- id: DI-<TARGET>-<THEME> # stable kebab id, never renumbered
|
|
70
|
+
target: login.email # ONE target: field/component dot-path, flow phrase, or METHOD /path
|
|
71
|
+
intent: <one behavior/rule this item verifies>
|
|
72
|
+
oracle: <the shared observable Pass/Fail statement>
|
|
73
|
+
dimensions: violated rule — required ×3 · format ×10 · full-width ×2 # see below
|
|
74
|
+
category: normal | abnormal | security | nfr # see the rule below
|
|
75
|
+
review: proposed # ALWAYS proposed — only QA approval flips it
|
|
76
|
+
variants: [VP-VAL-001-B, VP-VAL-001-S] # the scenario ids of THIS project (VP-…, SEC-123, MS-HP-001 —
|
|
77
|
+
# whatever the titles use); a bare id on a @cases scenario = all its rows
|
|
78
|
+
dispositions: # scenarios intentionally NOT delivered as test cases
|
|
79
|
+
VP-DATA-000: { as: excluded, reason: data-setup checklist }
|
|
80
|
+
# as: excluded | blocked | covered_elsewhere | accepted_risk
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Grouping rules (the aggregation signature) — group COMPACTLY.** The matrix exists to be
|
|
84
|
+
substantially shorter than the scenario list, so a reviewer can see missing viewpoints at a
|
|
85
|
+
glance. Merge whenever the cases share ALL of: target · test intent/business rule ·
|
|
86
|
+
precondition/condition · trigger or procedure shape · **the way the expected result is
|
|
87
|
+
determined** (its oracle *family*, not its exact message).
|
|
88
|
+
|
|
89
|
+
- **Oracle family = the determination method, parameterized.** All validation branches of ONE
|
|
90
|
+
field belong to ONE item — required, format, length, character-class are *expected branches*
|
|
91
|
+
(parameters) of "the field shows the validation message defined for the violated rule", shown
|
|
92
|
+
per variant, never separate items.
|
|
93
|
+
- MAY vary inside one item (coverage dimensions, visible on the sub-rows): data values, boundary
|
|
94
|
+
points, **account states** (a seeded/locked/deleted account next to a wrong-password case),
|
|
95
|
+
provider/browser/locale, `@cases` rows, a different trigger with the same oracle (blur vs
|
|
96
|
+
submit), **execution mode** (auto + manual mix — the parent shows `Auto n · Manual m`), and
|
|
97
|
+
**priority** (the item takes the highest; per-variant priorities stay visible).
|
|
98
|
+
- MUST split: different target, different intent/business rule, different way of determining the
|
|
99
|
+
expected result (a field-error family ≠ a session-established family), different test layer
|
|
100
|
+
(`@api`/`@query`), materially different precondition, or a different procedure shape —
|
|
101
|
+
sequence-sensitive flows (re-Given/When after a Then) stay solo. **Different risk classes never
|
|
102
|
+
merge**: XSS and SQL injection are separate items (different risk and determination), even on
|
|
103
|
+
the same field.
|
|
104
|
+
- **Look for these families before settling on a grouping** — they are where under-merging happens:
|
|
105
|
+
| Family | Merge into one item |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Static render | every "element X is visible/has its content on load" scenario of the screen — title, instructions, progress step, buttons present, header/footer |
|
|
108
|
+
| Field validation branches | all rules of ONE field (required · format · length · character class · full-width) |
|
|
109
|
+
| Account/entity states | wrong-credentials · locked · deleted · unverified for the same rejection oracle |
|
|
110
|
+
| Provider / surface sets | the 3 OAuth providers, header+footer, the a11y surfaces of one behaviour |
|
|
111
|
+
| Lifetime / mode pairs | checked vs unchecked, mobile vs desktop, when the oracle is one rule with two branches |
|
|
112
|
+
On a 36-scenario screen, four separate one-variant "renders on load" items should have been one.
|
|
113
|
+
- When unsure, keep items separate — the gates and QA decide, never guess-merge.
|
|
114
|
+
- Every scenario must land in exactly one group **or** one disposition (Gate B enforces 100%
|
|
115
|
+
disposition). Data-setup blocks (`@manual:data-setup`) → `excluded`; SPEC-GAP placeholders →
|
|
116
|
+
`blocked`.
|
|
117
|
+
|
|
118
|
+
**`dimensions:` — the compact coverage digest (required for items with >3 variants).**
|
|
119
|
+
This one short line is what the collapsed parent row shows instead of listing every variant, so a
|
|
120
|
+
reviewer sees *which dimensions* the item covers without expanding it. Name the dimension, then the
|
|
121
|
+
branches with counts:
|
|
122
|
+
- `violated rule — required ×3 · format ×10 · full-width ×2`
|
|
123
|
+
- `account state — wrong password · unregistered · locked · soft-deleted`
|
|
124
|
+
- `submission method — Login button · Enter in Password · Enter in Email`
|
|
125
|
+
|
|
126
|
+
Keep it ≤120 chars (Gate W warns). **YAML caveat:** a bare `: ` inside the value breaks the parse —
|
|
127
|
+
use ` — ` as the label separator (as above) or quote the whole string.
|
|
128
|
+
|
|
129
|
+
**`category` is not free choice for two classes (Gate K checks it):** a group whose variants are
|
|
130
|
+
`VP-SEC-*` MUST be `category: security`, and `VP-NFR-*` MUST be `nfr` — otherwise the Coverage
|
|
131
|
+
sheet's security/nfr column renders empty and the grid reports a gap the unit does not have while
|
|
132
|
+
hiding the work it does have. `normal` vs `abnormal` stays your judgement.
|
|
133
|
+
|
|
134
|
+
**Wording rules for `intent`/`oracle` (customer-facing — Gate W lints these):**
|
|
135
|
+
- Plain product language, present simple, ~10–20 words, one behavior:
|
|
136
|
+
"A user can sign in with valid credentials and is redirected to the Jobs page."
|
|
137
|
+
- Oracle = the observable outcome as a definite assertion ("The Jobs page is displayed and the
|
|
138
|
+
Logout link is visible.") — no `should`, no tester actions.
|
|
139
|
+
- NEVER: `{{tokens}}`, `[Selector]` references, DSL phrasing (`User fill/click/see`), generator
|
|
140
|
+
labels (`Setup:`/`Observable:`/`Oracle:`), or vague verbs (`handles`, `surfaces`) when a precise
|
|
141
|
+
behavior exists. Use the visible UI label (the Login button, the Email field).
|
|
142
|
+
- **Preserve the source meaning exactly** — never strengthen, weaken, or reinterpret an oracle
|
|
143
|
+
(a security assertion especially: if the source says "the password appears ONLY in the HTTPS
|
|
144
|
+
POST body", do not write "no plaintext password on the network").
|
|
145
|
+
|
|
146
|
+
**Requirement coverage (`requirements:` section, optional):** `sungen delivery` scans
|
|
147
|
+
`requirements/spec.md` for FR-/TR-/NFR- ids; ids traced by `@spec:` tags are `covered`, the rest
|
|
148
|
+
are `gap` (Gate R warning). Record the reviewed status for genuine non-gaps:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
requirements:
|
|
152
|
+
TR-007: { status: planned, note: Performance needs Lighthouse-style tooling }
|
|
153
|
+
TR-004: { status: partially_covered, note: client-side covered by VP-SEC-003; hashing needs DB verify }
|
|
154
|
+
# status: covered | partially_covered | covered_elsewhere | planned | gap | not_applicable
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Never write `status: covered` for a requirement no variant traces to** (Gate R flags it). A note
|
|
158
|
+
saying "proven by DI-SEC-CSRF" is prose — nothing detects it when that scenario later changes. If a
|
|
159
|
+
scenario in THIS feature proves the requirement, **add `@spec:<id>` to that scenario** so the trace
|
|
160
|
+
is real, then drop the override (it derives as `covered` on its own). Use `covered_elsewhere` only
|
|
161
|
+
when another suite proves it, and name that suite; `not_applicable` when the spec itself excludes
|
|
162
|
+
the requirement.
|
|
163
|
+
|
|
164
|
+
Then validate and fix any ERROR findings:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
[ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> --check || npx sungen delivery <unit> --check
|
|
54
168
|
```
|
|
55
169
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
**
|
|
89
|
-
- **Fix missing sources** (Recommended) — Print the suggested commands from CLI output and stop. User will run those commands manually, then re-invoke `/sungen:delivery`.
|
|
90
|
-
{{#cap parallel-subagents}}
|
|
91
|
-
- **Continue with available screens** — Re-run as `npx sungen delivery <screens> --continue-on-missing` to skip screens with blocking issues.
|
|
92
|
-
{{/cap}}
|
|
93
|
-
{{^cap parallel-subagents}}
|
|
94
|
-
- **Continue with available targets** — Re-run as `npx sungen delivery <names> --continue-on-missing` to skip targets with blocking issues.
|
|
95
|
-
{{/cap}}
|
|
96
|
-
- **Cancel** — Exit.
|
|
97
|
-
|
|
98
|
-
### 3. Show summary + offer next steps (on success)
|
|
99
|
-
|
|
100
|
-
Forward the CLI's summary table to the user verbatim. Then use `AskUserQuestion`:
|
|
101
|
-
|
|
102
|
-
- **Open a specific CSV** — Help user inspect one of the exported files with Read tool.
|
|
103
|
-
{{#cap parallel-subagents}}
|
|
104
|
-
- **Run tests to refresh results** — Suggest `/sungen:run-test <screen>` to update `test-results/results.json`, then re-run delivery.
|
|
105
|
-
- **Export another screen** — User can run `/sungen:delivery <other-screen>`.
|
|
106
|
-
{{/cap}}
|
|
107
|
-
{{^cap parallel-subagents}}
|
|
108
|
-
- **Run tests to refresh results** — Suggest `/sungen-run-test <name>` to update test results, then re-run delivery.
|
|
109
|
-
- **Export another target** — User can run `/sungen-delivery <other-name>`.
|
|
110
|
-
{{/cap}}
|
|
111
|
-
- **Done** — Exit.
|
|
170
|
+
### 3. Present the grouping for review
|
|
171
|
+
|
|
172
|
+
Show the user a compact summary: item count vs variant count, the groups (id · target · intent ·
|
|
173
|
+
variant count), dispositions, and every remaining `review`-level finding (oracle-shape /
|
|
174
|
+
precondition heuristics — these are exactly what QA must confirm). Then `AskUserQuestion`:
|
|
175
|
+
|
|
176
|
+
- **Approve all groups** (Recommended when the findings look right)
|
|
177
|
+
- **Adjust the grouping** — user names the groups to change; edit the map, re-run `--check`, re-present.
|
|
178
|
+
- **Preview draft first** — `sungen delivery <unit> --preview` (DRAFT watermark), then re-ask.
|
|
179
|
+
- **Cancel**
|
|
180
|
+
|
|
181
|
+
### 4. Approve + official render
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
[ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> --approve || npx sungen delivery <unit> --approve
|
|
185
|
+
[ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> || npx sungen delivery <unit>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`--approve` stamps scenario fingerprints into the map — if the `.feature` changes later, Gate E
|
|
189
|
+
flips the affected groups back to review (drift). Approved + unchanged groups render without
|
|
190
|
+
re-asking.
|
|
191
|
+
|
|
192
|
+
### 5. Show summary + offer next steps
|
|
193
|
+
|
|
194
|
+
Forward the CLI summary verbatim (Items = review rows; **Variants = execution units — progress is
|
|
195
|
+
counted in variants, never items**). Then `AskUserQuestion`:
|
|
196
|
+
|
|
197
|
+
- **Open the workbook** — inspect `qa/deliverables/<unit>-testcases.xlsx` (Testcases sheet:
|
|
198
|
+
collapse outline level 1 for the customer view; Coverage sheet: target × category grid + gaps).
|
|
199
|
+
- **Run tests to refresh results** — `/sungen:run-test <unit>`, then re-run delivery.
|
|
200
|
+
- **Also export CSV** — `sungen delivery <unit> --format csv` (flat `item`/`variant` rows for pipelines).
|
|
201
|
+
- **Export the legacy workbook too** — `sungen delivery <unit> --legacy`.
|
|
202
|
+
- **Done**
|
|
112
203
|
|
|
113
204
|
## Important notes
|
|
114
205
|
|
|
115
|
-
- **Do NOT parse
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- **
|
|
206
|
+
- **Do NOT parse/duplicate what the CLI computes** — gates recompute mode/layer/priority/oracle
|
|
207
|
+
shapes from the `.feature`; the map only carries the semantic fields (target/intent/oracle/
|
|
208
|
+
category/grouping).
|
|
209
|
+
- **Never write `review: approved` yourself** — only `--approve` after the user agreed. Proposing
|
|
210
|
+
with `review: approved` defeats the QA review this format exists for.
|
|
211
|
+
- **Do NOT modify feature/test-data files during delivery** — read-only except the map file.
|
|
212
|
+
- The map is committed and stable: adding a group never renumbers others; deleting scenarios →
|
|
213
|
+
update the map (Gate B lists exactly what's unmapped/stale).
|
|
119
214
|
|
|
120
|
-
## CLI
|
|
215
|
+
## CLI reference
|
|
121
216
|
|
|
122
217
|
```
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{{#cap parallel-subagents}}
|
|
131
|
-
[--continue-on-missing] Skip screens with blocking misses
|
|
132
|
-
{{/cap}}
|
|
133
|
-
{{^cap parallel-subagents}}
|
|
134
|
-
[--continue-on-missing] Skip targets with blocking misses
|
|
135
|
-
{{/cap}}
|
|
136
|
-
|
|
137
|
-
# Locale-aware export (env var, not a CLI flag):
|
|
138
|
-
{{#cap parallel-subagents}}
|
|
139
|
-
SUNGEN_ENV=<locale> sungen delivery [screens...]
|
|
140
|
-
{{/cap}}
|
|
141
|
-
{{^cap parallel-subagents}}
|
|
142
|
-
SUNGEN_ENV=<locale> sungen delivery [names...]
|
|
143
|
-
{{/cap}}
|
|
144
|
-
→ reads <name>.<locale>.yaml overlay, picks <name>-test-result.<locale>.json,
|
|
145
|
-
writes <name>-testcases.<locale>.csv / .xlsx
|
|
218
|
+
sungen delivery [names...] # matrix (default; needs the map) → XLSX only
|
|
219
|
+
--format <xlsx|csv|both> # output format; default xlsx (one artifact)
|
|
220
|
+
--check # gates only — validate the map, write nothing
|
|
221
|
+
--approve [DI-a,DI-b] # flip proposed→approved (+ stamp fingerprints); all groups when bare
|
|
222
|
+
--preview # render despite review findings (DRAFT watermark)
|
|
223
|
+
--legacy | --full # classic per-scenario workbook (no map needed)
|
|
224
|
+
--skip-preflight | --continue-on-missing | --env <env> # as before
|
|
146
225
|
```
|
|
226
|
+
|
|
227
|
+
Outputs: `qa/deliverables/<unit>-testcases.xlsx` (Testcases + Coverage sheets) by default;
|
|
228
|
+
`--format csv` writes `<unit>-testcases.csv` instead (flat, `Level` column `item|variant`),
|
|
229
|
+
`--format both` writes both. Legacy mode writes the classic files instead.
|
|
@@ -30,7 +30,7 @@ You generate 3 files for sungen — a Gherkin compiler that produces Playwright
|
|
|
30
30
|
| `/sungen:create-data-test <name>` | Generate standardized test-data (valid/boundary/invalid + CHK trace) from the Data Factory catalog; no name = all units (asks to confirm) |
|
|
31
31
|
| `/sungen:review <name>` | Score syntax, coverage, viewpoint quality (auto-detects screen or flow) |
|
|
32
32
|
| `/sungen:run-test <name>` | Generate `selectors.yaml`, compile, run, auto-fix (auto-detects screen or flow) |
|
|
33
|
-
| `/sungen:delivery [name...]` | Export
|
|
33
|
+
| `/sungen:delivery [name...]` | Export the Test Case & Coverage Matrix (review/manual/customer deliverable; `--legacy` = classic CSV; all screens if no arg) |
|
|
34
34
|
| `/sungen:locale <name> <locale>` | Bootstrap i18n for a screen — audit selectors, detect locale switch, generate overlay (run before `/sungen:run-test --env <locale>`) |
|
|
35
35
|
|
|
36
36
|
**Screen path:** add-screen → create-test → review → run-test → delivery.
|
|
@@ -30,7 +30,7 @@ You generate 3 files for sungen — a Gherkin compiler that produces Playwright
|
|
|
30
30
|
| `/sungen-create-data-test <name>` | Generate standardized test-data (valid/boundary/invalid + CHK trace) from the Data Factory catalog; no name = all units (asks to confirm) |
|
|
31
31
|
| `/sungen-review <name>` | Score syntax, coverage, viewpoint quality (auto-detects screen or flow) |
|
|
32
32
|
| `/sungen-run-test <name>` | Generate `selectors.yaml`, compile, run, auto-fix (auto-detects screen or flow) |
|
|
33
|
-
| `/sungen-delivery [name...]` | Export
|
|
33
|
+
| `/sungen-delivery [name...]` | Export the Test Case & Coverage Matrix (review/manual/customer deliverable; `--legacy` = classic CSV; all screens if no arg) |
|
|
34
34
|
| `/sungen-locale <name> <locale>` | Bootstrap i18n for a screen — audit selectors, detect locale switch, generate overlay (run before `/sungen-run-test --env <locale>`) |
|
|
35
35
|
|
|
36
36
|
**Screen path:** add-screen → create-test → review → run-test → delivery.
|
|
@@ -1,21 +1,117 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-delivery
|
|
3
|
-
description: 'Export
|
|
3
|
+
description: 'Export the Test Case & Coverage Matrix (or the legacy per-scenario CSV) from Gherkin + Playwright results. Auto-loaded by delivery command.'
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Purpose
|
|
8
8
|
|
|
9
|
-
Export test cases from Sungen
|
|
9
|
+
Export test cases from Sungen units to the QA deliverable. Two modes:
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
- **Matrix (default)** — the **Test Case & Coverage Matrix**: one row per *delivery item* (one
|
|
12
|
+
target + one test intent + one oracle family); scenarios / `@cases` rows stay as collapsible
|
|
13
|
+
*coverage variant* sub-rows. Built for review, manual execution, customer hand-off, and
|
|
14
|
+
reporting — no numbered step dumps.
|
|
15
|
+
- **Legacy (`--legacy`/`--full`)** — the classic per-scenario BM-2-901-13 workbook (documented
|
|
16
|
+
in the second half of this skill; unchanged).
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
**This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source
|
|
19
|
+
of truth for parsing + gating. The AI's only semantic contribution is **proposing the Delivery
|
|
20
|
+
Map** (grouping) — everything else is: invoke the CLI, show output verbatim, help on failures.
|
|
16
21
|
|
|
17
22
|
---
|
|
18
23
|
|
|
24
|
+
## Matrix mode — the Delivery Map
|
|
25
|
+
|
|
26
|
+
`qa/<screens|flows|api>/<unit>/delivery/<unit>.map.yaml` — committed, AI-proposed
|
|
27
|
+
(`review: proposed`), gate-validated, QA-approved (`sungen delivery --approve` stamps scenario
|
|
28
|
+
fingerprints). Schema + grouping rules live in the delivery command instructions; the normative
|
|
29
|
+
spec is `docs/spec/delivery-coverage-matrix-spec.md`.
|
|
30
|
+
|
|
31
|
+
**Gates** (CLI `--check`): A source (VP-ids unique, oracle present, Background setup-only) ·
|
|
32
|
+
B mapping (every scenario in exactly one group XOR one disposition) · C aggregation (test layer
|
|
33
|
+
recomputed and equal within a group — **execution mode and priority are coverage dimensions, not
|
|
34
|
+
splits**: mixed items show `Auto n · Manual m` and take the highest variant priority; heuristic
|
|
35
|
+
oracle-shape/precondition mismatches are review-level, silenced once approved and unchanged) ·
|
|
36
|
+
D executability (precondition · condition+
|
|
37
|
+
data · trigger · oracle all renderable; every `{{var}}` resolves; **no template token may survive
|
|
38
|
+
into a rendered cell** — test-data cross-references are resolved for display) · E drift
|
|
39
|
+
(scenario fingerprint mismatch → back to review; the map's OWN reviewed
|
|
40
|
+
wording/grouping is fingerprinted as `__map__` too, so post-approval edits re-open review) · G review state (proposed groups block the official
|
|
41
|
+
render; `--preview` renders a DRAFT watermark) · K category class (a `VP-SEC-*` variant outside
|
|
42
|
+
`category: security`, or `VP-NFR-*` outside `nfr` → warning: the Coverage grid's column would render
|
|
43
|
+
empty and report a false gap) · R requirement coverage (spec FR/TR/NFR ids with no trace and no
|
|
44
|
+
`requirements:` status → warning; **and a `status: covered` override that no variant traces to** →
|
|
45
|
+
warning: tag the proving scenario `@spec:<id>` instead of asserting it in prose) · W wording lint (map intent/oracle containing
|
|
46
|
+
tokens, `[Selector]` refs, DSL phrasing, or generator labels → warning).
|
|
47
|
+
|
|
48
|
+
**Wording normalization (deterministic, after semantic normalization):** DSL steps render as
|
|
49
|
+
controlled manual-test English without changing meaning — actions in the imperative (`User fill
|
|
50
|
+
[Email] field with X` → `Enter X in the Email field.`), expected results as observable assertions
|
|
51
|
+
(`User see [Jobs] page` → `The Jobs page is displayed.`), preconditions as states (`The user is
|
|
52
|
+
signed out.`). Manual `# Tester verifies:` labels become structured fields: `Setup:` →
|
|
53
|
+
Precondition, `Action:` → Action, `Observable:` → Expected Result, `Oracle:` → a separate
|
|
54
|
+
`Verification method:` line. Sequence-sensitive flows keep event order: actions numbered with
|
|
55
|
+
mid-flow assertions inline as `Verify: …`; only the final Then block is the Expected Result.
|
|
56
|
+
Empty test values render as `(empty)`.
|
|
57
|
+
|
|
58
|
+
**Output format**: **XLSX only by default** (one artifact). `--format csv` writes the flat CSV
|
|
59
|
+
instead; `--format both` writes both.
|
|
60
|
+
|
|
61
|
+
**Scope decides strictness**: a **named** unit that is not ready aborts with exit 1 (pass
|
|
62
|
+
`--continue-on-missing` to tolerate it); a **no-argument sweep** exports every ready unit, lists
|
|
63
|
+
every unit it did not export with the reason, and exits 0 as long as it wrote something — a
|
|
64
|
+
scaffolded unit never blocks the ready ones.
|
|
65
|
+
|
|
66
|
+
**Workbook**: `Testcases` sheet — parent rows + outline-level-1 variant sub-rows for **every**
|
|
67
|
+
item (single-variant included: the sub-row carries the source VP-id, resolved data, and the
|
|
68
|
+
result/evidence entry). Sub-rows are **delta-only**: knowledge common to the whole item
|
|
69
|
+
(precondition, trigger) is written ONCE on the parent; a child repeats only what distinguishes it
|
|
70
|
+
(condition/data, precondition delta, trigger when it differs) plus its own precise oracle and
|
|
71
|
+
execution fields. The parent never carries placeholder text — when triggers differ the cell is
|
|
72
|
+
simply empty and the sub-rows carry them.
|
|
73
|
+
|
|
74
|
+
Parent preconditions are the **intersection** of the variants' and the parent's Action holds the
|
|
75
|
+
**shared leading steps**; each variant renders only its remaining steps, numbered to continue the
|
|
76
|
+
parent's list — so a shared prefix is written once, not repeated on every child. The parent's
|
|
77
|
+
Coverage cell is the map's short `dimensions:` digest (or the variant refs when none is declared),
|
|
78
|
+
never a concatenation of variant titles.
|
|
79
|
+
|
|
80
|
+
Variant Result cells hold exactly one of `Passed`/`Failed`/`Blocked`/`Pending`/`N/A` (dropdown) —
|
|
81
|
+
that vocabulary is the contract: the parent Result and the summary band are **live Excel formulas**
|
|
82
|
+
counting those words, so a parent label is always a composed `n/m Passed …` string (`All N/A` when
|
|
83
|
+
every variant is N/A) and never a bare state word. **`N/A` leaves the denominator.** Evidence and
|
|
84
|
+
Defect ID are separate columns; ID + Target frozen; ISO dates; landscape print with repeated
|
|
85
|
+
header rows.
|
|
86
|
+
|
|
87
|
+
`Coverage` sheet — requirement coverage table (every FR/TR/NFR id with an explicit status),
|
|
88
|
+
target × category grid with explicit `—` gaps, dispositions, manifest. CSV mirrors the same model
|
|
89
|
+
flat with a `Level` column (`item`/`variant`) + a requirement-coverage appendix.
|
|
90
|
+
`delivery_item_count` ≠ progress — variants are the execution metric.
|
|
91
|
+
|
|
92
|
+
**Id schemes**: the `VP-<CAT>-<NNN>` convention is a suggestion, not a requirement — a project's own
|
|
93
|
+
scheme (`SEC-123`, `PER-345`, `MS-HP-001`) is addressed the same way, and the category segment
|
|
94
|
+
(`SEC`, `PER`) still drives Gate K. Requirement ids come from the spec's own bolded declarations
|
|
95
|
+
(`- **REQ-12**: …`), so a project that does not use FR/TR/NFR still gets its coverage table.
|
|
96
|
+
|
|
97
|
+
**Runtime-captured values**: a scenario may produce its own values — `User remember [X] text as
|
|
98
|
+
{{v}}` (compared later) or a capability binding (`@query:`/`@api:`/`@dataFactory:`). These never
|
|
99
|
+
exist in test-data, so Gate D does not ask for them: the capture step renders as an instruction
|
|
100
|
+
(`Note the X text for later (as "v")`) and later references read `the captured v`.
|
|
101
|
+
|
|
102
|
+
**Data fidelity**: invisible test data is made visible, never normalized — `''` → `(empty)`,
|
|
103
|
+
whitespace-only → `(5 spaces)`, padded → `" value "` quoted verbatim. A trim/collapse here would
|
|
104
|
+
silently break the whitespace tests it describes.
|
|
105
|
+
|
|
106
|
+
**Authoring guidance the matrix rewards** (create-test side): payload/provider matrices (SQLi
|
|
107
|
+
payload lists, OAuth provider sets) belong in `@cases` datasets so each case is an atomic,
|
|
108
|
+
independently-reportable variant; keep dataset `case:` labels short and stable (`CHK-EMAIL-I1`),
|
|
109
|
+
with descriptions in other columns — the label is part of the variant's identity.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Legacy mode (--legacy / --full)
|
|
114
|
+
|
|
19
115
|
## Architecture
|
|
20
116
|
|
|
21
117
|
```
|