@sun-asterisk/sungen 3.1.2-beta.122 → 3.1.2-beta.124
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 +2 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/context.d.ts.map +1 -1
- package/dist/cli/commands/context.js +2 -1
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +2 -1
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/ledger.d.ts.map +1 -1
- package/dist/cli/commands/ledger.js +4 -2
- package/dist/cli/commands/ledger.js.map +1 -1
- package/dist/cli/commands/manifest.d.ts.map +1 -1
- package/dist/cli/commands/manifest.js +2 -1
- package/dist/cli/commands/manifest.js.map +1 -1
- package/dist/cli/commands/repair.d.ts.map +1 -1
- package/dist/cli/commands/repair.js +2 -1
- package/dist/cli/commands/repair.js.map +1 -1
- package/dist/cli/commands/script-check.d.ts.map +1 -1
- package/dist/cli/commands/script-check.js +2 -1
- package/dist/cli/commands/script-check.js.map +1 -1
- package/dist/cli/commands/trace.d.ts.map +1 -1
- package/dist/cli/commands/trace.js +2 -1
- package/dist/cli/commands/trace.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +3 -3
- package/dist/orchestrator/templates/ai-instructions/claude-skill-api-design.md +4 -4
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +1 -1
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +3 -3
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +4 -4
- package/dist/orchestrator/templates/specs-api.d.ts +2 -0
- package/dist/orchestrator/templates/specs-api.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-api.js +16 -3
- package/dist/orchestrator/templates/specs-api.js.map +1 -1
- package/dist/orchestrator/templates/specs-api.ts +15 -5
- package/package.json +2 -2
- package/src/cli/commands/audit.ts +2 -1
- package/src/cli/commands/context.ts +3 -2
- package/src/cli/commands/generate.ts +2 -1
- package/src/cli/commands/ledger.ts +4 -2
- package/src/cli/commands/manifest.ts +2 -1
- package/src/cli/commands/repair.ts +3 -2
- package/src/cli/commands/script-check.ts +2 -1
- package/src/cli/commands/trace.ts +2 -1
- package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +1 -1
- package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +3 -3
- package/src/orchestrator/templates/ai-instructions/claude-skill-api-design.md +4 -4
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +1 -1
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +3 -3
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +4 -4
- package/src/orchestrator/templates/specs-api.ts +15 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwFpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwFpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqC3D"}
|
|
@@ -141,10 +141,11 @@ function registerAuditCommand(program) {
|
|
|
141
141
|
.description('Harness: measure test-design quality (viewpoint gate, depth, balance, duplicates, traceability)')
|
|
142
142
|
.option('-s, --screen <name>', 'Screen or flow name to audit')
|
|
143
143
|
.option('--api <name>', 'API-first area or api flow to audit (e.g. orders, flows/signup)')
|
|
144
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
144
145
|
.option('--json', 'Output the raw JSON report')
|
|
145
146
|
.action((options) => {
|
|
146
147
|
try {
|
|
147
|
-
const name = options.screen || options.api;
|
|
148
|
+
const name = options.screen || options.api || options.area;
|
|
148
149
|
if (!name)
|
|
149
150
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
150
151
|
const dir = findScreenDir(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,oDAqCC;AA5HD,2CAA6B;AAC7B,uCAAyB;AACzB,+CAA4D;AAE5D,SAAS,aAAa,CAAC,IAAY;IACjC,+FAA+F;IAC/F,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;QAC/C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAU,uCAAuC;KAC7F,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,UAAU;QAAE,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,GAAG,CAAC,KAAa,EAAE,KAAK,GAAG,EAAE;IACpC,MAAM,CAAC,GAAG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AAC,GAAG,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;gBAClE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;YACD,kEAAkE;YAClE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwC7D"}
|
|
@@ -50,10 +50,11 @@ function registerContextCommand(program) {
|
|
|
50
50
|
.option('-s, --screen <name>', 'Screen name')
|
|
51
51
|
.option('--flow <name>', 'Flow name (resolved as flows/<name>)')
|
|
52
52
|
.option('--api <name>', 'API-first area or api flow (resolved as api/<name>)')
|
|
53
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
53
54
|
.option('--json', 'Print the raw JSON')
|
|
54
55
|
.action(async (o) => {
|
|
55
56
|
try {
|
|
56
|
-
const unitId = o.api ? `api/${o.api}` : o.flow ? `flows/${o.flow}` : o.screen;
|
|
57
|
+
const unitId = (o.api || o.area) ? `api/${o.api || o.area}` : o.flow ? `flows/${o.flow}` : o.screen;
|
|
57
58
|
if (!unitId)
|
|
58
59
|
throw new Error('Provide --screen <name>, --flow <name>, or --api <area>.');
|
|
59
60
|
const cwd = process.cwd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/cli/commands/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/cli/commands/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,wDAwCC;AAlDD,uCAAyB;AACzB,2CAA6B;AAC7B,4EAA2E;AAE3E;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,qFAAqF,CAAC;SAClG,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC;SAC5C,MAAM,CAAC,eAAe,EAAE,sCAAsC,CAAC;SAC/D,MAAM,CAAC,cAAc,EAAE,qDAAqD,CAAC;SAC7E,MAAM,CAAC,eAAe,EAAE,oDAAoD,CAAC;SAC7E,MAAM,CAAC,QAAQ,EAAE,oBAAoB,CAAC;SACtC,MAAM,CAAC,KAAK,EAAE,CAAkF,EAAE,EAAE;QACnG,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,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C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0FpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0FpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyI9D"}
|
|
@@ -120,6 +120,7 @@ function registerGenerateCommand(program) {
|
|
|
120
120
|
.option('-s, --screen <name>', 'Generate tests for a specific screen')
|
|
121
121
|
.option('--flow <name>', 'Generate tests for a specific flow')
|
|
122
122
|
.option('--api <name>', 'Generate tests for an API-first area or api flow (e.g. orders, flows/signup)')
|
|
123
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
123
124
|
.option('--all', 'Generate tests for all screens, flows, and API areas')
|
|
124
125
|
.option('--framework <name>', 'Override the platform driver (else read from qa/capabilities.yaml)')
|
|
125
126
|
.option('--inline-data', 'Hardcode test data at compile time instead of runtime loading')
|
|
@@ -127,7 +128,7 @@ function registerGenerateCommand(program) {
|
|
|
127
128
|
try {
|
|
128
129
|
const screenName = options.screen;
|
|
129
130
|
const flowName = options.flow;
|
|
130
|
-
const apiName = options.api;
|
|
131
|
+
const apiName = options.api || options.area;
|
|
131
132
|
// Find feature files
|
|
132
133
|
let featureFiles;
|
|
133
134
|
let qaSourceDir;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,0DAyIC;AAlOD,2CAA6B;AAC7B,uCAAyB;AACzB,mFAA+E;AAC/E,uEAA2E;AAC3E,2DAAgE;AAChE,0DAAiE;AACjE,0DAA8E;AAC9E,yDAA8G;AAE9G;;GAEG;AACH,SAAS,gBAAgB,CAAC,GAAW;IACnC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAEtC,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC5C,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7D,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,UAAkB;IACnD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAA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
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiE5D"}
|
|
@@ -11,6 +11,7 @@ function registerLedgerCommand(program) {
|
|
|
11
11
|
.description('Append a step event to the ledger')
|
|
12
12
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
13
13
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
14
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
14
15
|
.requiredOption('--step <name>', 'Step name (discovery | viewpoint | gherkin | audit | repair:1 ...)')
|
|
15
16
|
.option('--run <id>', 'Run id — groups all phases of one create-test invocation (else auto-segmented by time gap)')
|
|
16
17
|
.option('--model <id>', 'Model id')
|
|
@@ -20,7 +21,7 @@ function registerLedgerCommand(program) {
|
|
|
20
21
|
.option('--note <text>', 'Free note')
|
|
21
22
|
.action((o) => {
|
|
22
23
|
try {
|
|
23
|
-
const name = o.screen || o.api;
|
|
24
|
+
const name = o.screen || o.api || o.area;
|
|
24
25
|
if (!name)
|
|
25
26
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
26
27
|
(0, ledger_1.recordEvent)(name, {
|
|
@@ -38,11 +39,12 @@ function registerLedgerCommand(program) {
|
|
|
38
39
|
.description('Summarise ledger + efficiency verdicts (pulls audit score if present)')
|
|
39
40
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
40
41
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
42
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
41
43
|
.option('--all-runs', 'Aggregate ALL runs (default: latest run only)')
|
|
42
44
|
.option('--json', 'Output raw JSON')
|
|
43
45
|
.action((o) => {
|
|
44
46
|
try {
|
|
45
|
-
const name = o.screen || o.api;
|
|
47
|
+
const name = o.screen || o.api || o.area;
|
|
46
48
|
if (!name)
|
|
47
49
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
48
50
|
const r = (0, ledger_1.buildReport)(name, { allRuns: o.allRuns });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../src/cli/commands/ledger.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../src/cli/commands/ledger.ts"],"names":[],"mappings":";;AAGA,sDAiEC;AAnED,iDAAgE;AAEhE,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,+DAA+D,CAAC,CAAC;IAEhF,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;SACpD,MAAM,CAAC,cAAc,EAAE,4CAA4C,CAAC;SACpE,MAAM,CAAC,eAAe,EAAE,oDAAoD,CAAC;SAC7E,cAAc,CAAC,eAAe,EAAE,oEAAoE,CAAC;SACrG,MAAM,CAAC,YAAY,EAAE,4FAA4F,CAAC;SAClH,MAAM,CAAC,cAAc,EAAE,UAAU,CAAC;SAClC,MAAM,CAAC,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SACjE,MAAM,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC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,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2C9D"}
|
|
@@ -51,11 +51,12 @@ function registerManifestCommand(program) {
|
|
|
51
51
|
.description('Spec-fingerprint manifest: build a scenario↔spec-section map, or diff to plan keep/regenerate/retire')
|
|
52
52
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
53
53
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
54
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
54
55
|
.option('--diff', 'Compare current spec vs stored manifest → change plan')
|
|
55
56
|
.option('--json', 'Output raw JSON')
|
|
56
57
|
.action((options) => {
|
|
57
58
|
try {
|
|
58
|
-
const name = options.screen || options.api;
|
|
59
|
+
const name = options.screen || options.api || options.area;
|
|
59
60
|
if (!name)
|
|
60
61
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
61
62
|
const dir = findScreenDir(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/cli/commands/manifest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8C5D"}
|
|
@@ -48,10 +48,11 @@ function registerRepairCommand(program) {
|
|
|
48
48
|
.description('Propose concrete fixes for a unit from its audit findings + test failures (capability fix catalog)')
|
|
49
49
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
50
50
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
51
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
51
52
|
.option('--json', 'Output raw JSON')
|
|
52
53
|
.action((o) => {
|
|
53
54
|
try {
|
|
54
|
-
const name = o.screen || o.api;
|
|
55
|
+
const name = o.screen || o.api || o.area;
|
|
55
56
|
if (!name)
|
|
56
57
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
57
58
|
const cwd = process.cwd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/cli/commands/repair.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/cli/commands/repair.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,sDA8CC;AAvDD,uCAAyB;AACzB,2CAA6B;AA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AM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;oBAC/E,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;YACD,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;gBAC1B,CAAC,CAAC,sCAAsC,CAAC,CAAC;gBAC1C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;oBAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,CAAC,CAAC,EAAE,CAAC,CAAC;QACR,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/script-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"script-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/script-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+CjE"}
|
|
@@ -43,10 +43,11 @@ function registerScriptCheckCommand(program) {
|
|
|
43
43
|
.description('Verify the generated Playwright spec is a faithful 1:1 of the Gherkin feature (no hand-edit / stale drift)')
|
|
44
44
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
45
45
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
46
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
46
47
|
.option('--json', 'Output raw JSON')
|
|
47
48
|
.action(async (options) => {
|
|
48
49
|
try {
|
|
49
|
-
const name = options.screen || options.api;
|
|
50
|
+
const name = options.screen || options.api || options.area;
|
|
50
51
|
if (!name)
|
|
51
52
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
52
53
|
const screen = path.join(process.cwd(), 'qa', 'screens', name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-check.js","sourceRoot":"","sources":["../../../src/cli/commands/script-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"script-check.js","sourceRoot":"","sources":["../../../src/cli/commands/script-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,gEA+CC;AAnDD,2CAA6B;AAC7B,uCAAyB;AACzB,6DAA4D;AAE5D,SAAgB,0BAA0B,CAAC,OAAgB;IACzD,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,4GAA4G,CAAC;SACzH,MAAM,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;SACpD,MAAM,CAAC,cAAc,EAAE,4CAA4C,CAAC;SACpE,MAAM,CAAC,eAAe,EAAE,oDAAoD,CAAC;SAC7E,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;SACnC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC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version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyD3D"}
|
|
@@ -43,11 +43,12 @@ function registerTraceCommand(program) {
|
|
|
43
43
|
.description('Visualise the executed test-design process (workflow/skill steps, repair loops), find bottlenecks, and show where to focus human review')
|
|
44
44
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
45
45
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
46
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
46
47
|
.option('--json', 'Output raw JSON')
|
|
47
48
|
.option('--mermaid', 'Print only the Mermaid flowchart')
|
|
48
49
|
.action((options) => {
|
|
49
50
|
try {
|
|
50
|
-
const name = options.screen || options.api;
|
|
51
|
+
const name = options.screen || options.api || options.area;
|
|
51
52
|
if (!name)
|
|
52
53
|
throw new Error('Provide --screen <name> (or --api <area>)');
|
|
53
54
|
const screen = path.join(process.cwd(), 'qa', 'screens', name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/cli/commands/trace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/cli/commands/trace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,oDAyDC;AA7DD,2CAA6B;AAC7B,uCA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X,CAAC,CAAC,EAAE,CAAC,CAAC;QACR,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -27,7 +27,7 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
|
|
|
27
27
|
|
|
28
28
|
## API unit mode (driver-api)
|
|
29
29
|
|
|
30
|
-
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps below: `sungen context --
|
|
30
|
+
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps below: `sungen context --area <name>` (discover) → API viewpoint overview → generate `@api`/`@cases`/flow/`@concurrent`/`@query` scenarios → **`sungen audit --area <name>` gate + the `sungen-reviewer` sub-agent + repair loop to businessDepth ≥ 0.7** → record + trace. Then jump to the "Converge" next-step options (recommend `/sungen:run-test <name>`). The capture / viewpoint-group / selector steps do **not** apply.
|
|
31
31
|
|
|
32
32
|
## Steps
|
|
33
33
|
|
|
@@ -37,15 +37,15 @@ Skip this pre-flight when `--env` matches the base locale (no overlay needed in
|
|
|
37
37
|
If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM). Instead:
|
|
38
38
|
|
|
39
39
|
1. **Resolve the datasource** — ensure the `kind: api` datasource's `base_url` + auth are wired in `qa/datasources.yaml` + `.env.qa` (the `${X_URL}` key from `sungen api init`). A `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
|
|
40
|
-
2. **Compile**: `[ -x ./bin/sungen.js ] && ./bin/sungen.js generate --
|
|
40
|
+
2. **Compile**: `[ -x ./bin/sungen.js ] && ./bin/sungen.js generate --area <name> || npx sungen generate --area <name>` → `specs/generated/api/<name>/`.
|
|
41
41
|
3. **Run**: `npx playwright test specs/generated/api/<name>/<name>.spec.ts` (per-spec JSON results, as below).
|
|
42
42
|
4. **Auto-fix** (no selectors — the failure classes differ): use `sungen-error-mapping`.
|
|
43
43
|
- **401/403** → wire `@hybrid` + `@auth:<role>` (reuse the UI session) or the catalog `Bearer :token` header; suggest `sungen makeauth <role>`.
|
|
44
44
|
- **datasource/base_url unresolved** → set the `${X_URL}` key in `.env.qa`.
|
|
45
45
|
- **missing/empty bound param** → trace `{{var}}` to test-data or a prior `@api` response; fill it.
|
|
46
|
-
- **`expect.status` mismatch** → reconcile against `apis.yaml`/spec (the catalog is the oracle); **never hand-edit the generated spec** (re-`generate --
|
|
46
|
+
- **`expect.status` mismatch** → reconcile against `apis.yaml`/spec (the catalog is the oracle); **never hand-edit the generated spec** (re-`generate --area` instead).
|
|
47
47
|
- **flaky** → enforce self-cleaning flows, per-row isolation (`@cases`), `@concurrent` caps.
|
|
48
|
-
5. **Integrity + trace** — `sungen script-check --
|
|
48
|
+
5. **Integrity + trace** — `sungen script-check --area <name>` (verify the spec is a 1:1 of the Gherkin; on DRIFT re-`generate --area`, never hand-edit) and `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Then report + offer next steps.
|
|
49
49
|
|
|
50
50
|
## Pre-run (phased — per `sungen-selector-fix` skill)
|
|
51
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-api-design
|
|
3
|
-
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --
|
|
3
|
+
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --area gate + reviewer + repair to a high businessDepth (≥0.7). Use when create-test/run-test detects an api unit (no selectors, no visual capture).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API design loop (driver-api · Orchestration + Harness)
|
|
@@ -10,7 +10,7 @@ Use this when the unit is **api-first** — `qa/api/<area>/` or `qa/api/flows/<f
|
|
|
10
10
|
## The loop (mirror of /sungen:design, API-native)
|
|
11
11
|
|
|
12
12
|
### 1. Discover (no capture)
|
|
13
|
-
Run `sungen context --
|
|
13
|
+
Run `sungen context --area <name>` — it reads the catalog and prints the **endpoints** + the **generation units** (one `matrix` unit per endpoint, an `async` unit per mutating endpoint, a `flow` unit for an api flow). Read `qa/api/<name>/requirements/spec.md` if present. No `apis.yaml` yet? → `sungen api import <openapi|csv>` or `sungen api add --area <name>` first.
|
|
14
14
|
|
|
15
15
|
### 2. API viewpoint overview (by method-profile)
|
|
16
16
|
For each endpoint, cover its viewpoints — severity-weighted by method:
|
|
@@ -29,7 +29,7 @@ Bands: **~70%** success+failure matrix · **~20%** flows (auth/CRUD chains) · *
|
|
|
29
29
|
- **Idempotency**: `@api:<name> @concurrent:N` + `expect {{name.ok_count}} is 1`, cross-checked with `@query` (the DB is the oracle).
|
|
30
30
|
|
|
31
31
|
### 4. Gate + repair (always — businessDepth ≥ 0.7 is the bar)
|
|
32
|
-
Run `sungen audit --
|
|
32
|
+
Run `sungen audit --area <name>`; read `gateStatus` + `findings`. Then the **semantic reviewer** (sungen-reviewer sub-agent, API criteria). Repair **both** (budget 3 rounds), re-audit until PASS:
|
|
33
33
|
|
|
34
34
|
| Finding | Repair |
|
|
35
35
|
|---|---|
|
|
@@ -41,7 +41,7 @@ Run `sungen audit --api <name>`; read `gateStatus` + `findings`. Then the **sema
|
|
|
41
41
|
Stop when the gate PASSes + businessDepth ≥ 0.7, or the budget is exhausted → report residual gaps honestly (mark genuinely-unautomatable cases `@manual` with an oracle). Never fake a pass.
|
|
42
42
|
|
|
43
43
|
### 5. Record + converge
|
|
44
|
-
`sungen manifest --
|
|
44
|
+
`sungen manifest --area <name>` (reuse) and ledger each phase; show the trace + the HUMAN-LOOP FOCUS. (Integrity `script-check`/`trace` for api: see run-test.)
|
|
45
45
|
|
|
46
46
|
## Rules
|
|
47
47
|
- **No HTTP, no selectors** — only `.feature` + the reviewed `apis.yaml` + `test-data`.
|
|
@@ -22,7 +22,7 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
22
22
|
|
|
23
23
|
## API unit mode (driver-api)
|
|
24
24
|
|
|
25
|
-
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps: `sungen context --
|
|
25
|
+
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps: `sungen context --area <name>` (discover) → API viewpoint overview → generate `@api`/`@cases`/flow/`@concurrent`/`@query` scenarios → **`sungen audit --area <name>` gate + reviewer + repair loop to businessDepth ≥ 0.7** → record + trace. Then recommend `/sungen-run-test <name>`. The capture / viewpoint-group / selector steps do **not** apply.
|
|
26
26
|
|
|
27
27
|
## Steps
|
|
28
28
|
|
|
@@ -36,10 +36,10 @@ Skip when `--env` matches the base locale.
|
|
|
36
36
|
|
|
37
37
|
If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM):
|
|
38
38
|
1. **Resolve the datasource** — `base_url` + auth wired in `qa/datasources.yaml` + `.env.qa` (`${X_URL}` from `sungen api init`); a `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
|
|
39
|
-
2. **Compile**: `npx sungen generate --
|
|
39
|
+
2. **Compile**: `npx sungen generate --area <name>` → `specs/generated/api/<name>/`.
|
|
40
40
|
3. **Run**: `npx playwright test specs/generated/api/<name>/<name>.spec.ts`.
|
|
41
|
-
4. **Auto-fix** (use `sungen-error-mapping`): 401/403 → `@hybrid`+`@auth` or `Bearer :token` header (`sungen makeauth`); base_url unresolved → set `${X_URL}`; missing param → trace `{{var}}` to test-data/a prior `@api` response; `expect.status` mismatch → reconcile against `apis.yaml` (re-`generate --
|
|
42
|
-
5. **Integrity + trace** — `sungen script-check --
|
|
41
|
+
4. **Auto-fix** (use `sungen-error-mapping`): 401/403 → `@hybrid`+`@auth` or `Bearer :token` header (`sungen makeauth`); base_url unresolved → set `${X_URL}`; missing param → trace `{{var}}` to test-data/a prior `@api` response; `expect.status` mismatch → reconcile against `apis.yaml` (re-`generate --area`, never hand-edit the spec); flaky → self-clean + `@concurrent` caps.
|
|
42
|
+
5. **Integrity + trace** — `sungen script-check --area <name>` (1:1; on DRIFT re-`generate --area`, never hand-edit the spec) + `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Report + offer next steps.
|
|
43
43
|
|
|
44
44
|
## Pre-run (phased — per `sungen-selector-fix` skill)
|
|
45
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-api-design
|
|
3
|
-
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --
|
|
3
|
+
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --area gate + reviewer + repair to a high businessDepth (≥0.7). Use when create-test/run-test detects an api unit (no selectors, no visual capture).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API design loop (driver-api · Orchestration + Harness)
|
|
@@ -10,7 +10,7 @@ Use this when the unit is **api-first** — `qa/api/<area>/` or `qa/api/flows/<f
|
|
|
10
10
|
## The loop (mirror of /sungen:design, API-native)
|
|
11
11
|
|
|
12
12
|
### 1. Discover (no capture)
|
|
13
|
-
Run `sungen context --
|
|
13
|
+
Run `sungen context --area <name>` — it reads the catalog and prints the **endpoints** + the **generation units** (one `matrix` unit per endpoint, an `async` unit per mutating endpoint, a `flow` unit for an api flow). Read `qa/api/<name>/requirements/spec.md` if present. No `apis.yaml` yet? → `sungen api import <openapi|csv>` or `sungen api add --area <name>` first.
|
|
14
14
|
|
|
15
15
|
### 2. API viewpoint overview (by method-profile)
|
|
16
16
|
For each endpoint, cover its viewpoints — severity-weighted by method:
|
|
@@ -29,7 +29,7 @@ Bands: **~70%** success+failure matrix · **~20%** flows (auth/CRUD chains) · *
|
|
|
29
29
|
- **Idempotency**: `@api:<name> @concurrent:N` + `expect {{name.ok_count}} is 1`, cross-checked with `@query` (the DB is the oracle).
|
|
30
30
|
|
|
31
31
|
### 4. Gate + repair (always — businessDepth ≥ 0.7 is the bar)
|
|
32
|
-
Run `sungen audit --
|
|
32
|
+
Run `sungen audit --area <name>`; read `gateStatus` + `findings`. Then the **semantic reviewer** (sungen-reviewer sub-agent, API criteria). Repair **both** (budget 3 rounds), re-audit until PASS:
|
|
33
33
|
|
|
34
34
|
| Finding | Repair |
|
|
35
35
|
|---|---|
|
|
@@ -41,7 +41,7 @@ Run `sungen audit --api <name>`; read `gateStatus` + `findings`. Then the **sema
|
|
|
41
41
|
Stop when the gate PASSes + businessDepth ≥ 0.7, or the budget is exhausted → report residual gaps honestly (mark genuinely-unautomatable cases `@manual` with an oracle). Never fake a pass.
|
|
42
42
|
|
|
43
43
|
### 5. Record + converge
|
|
44
|
-
`sungen manifest --
|
|
44
|
+
`sungen manifest --area <name>` (reuse) and ledger each phase; show the trace + the HUMAN-LOOP FOCUS. (Integrity `script-check`/`trace` for api: see run-test.)
|
|
45
45
|
|
|
46
46
|
## Rules
|
|
47
47
|
- **No HTTP, no selectors** — only `.feature` + the reviewed `apis.yaml` + `test-data`.
|
|
@@ -11,6 +11,7 @@ declare class ApiClient {
|
|
|
11
11
|
method: string;
|
|
12
12
|
path: string;
|
|
13
13
|
body?: unknown;
|
|
14
|
+
encoding?: 'json' | 'form' | 'multipart';
|
|
14
15
|
headers?: Record<string, string>;
|
|
15
16
|
datasource?: string;
|
|
16
17
|
}, params?: Record<string, any>, opts?: {
|
|
@@ -32,6 +33,7 @@ declare class ApiClient {
|
|
|
32
33
|
method: string;
|
|
33
34
|
path: string;
|
|
34
35
|
body?: unknown;
|
|
36
|
+
encoding?: 'json' | 'form' | 'multipart';
|
|
35
37
|
headers?: Record<string, string>;
|
|
36
38
|
datasource?: string;
|
|
37
39
|
}, params?: Record<string, any>, n?: number, opts?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-api.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-api.ts"],"names":[],"mappings":"AAmDA,cAAM,SAAS;IACb,OAAO,CAAC,OAAO,CAA8C;IAE7D,OAAO,CAAC,GAAG;IAWX;;;;;OAKG;IACG,IAAI,CACR,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,
|
|
1
|
+
{"version":3,"file":"specs-api.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-api.ts"],"names":[],"mappings":"AAmDA,cAAM,SAAS;IACb,OAAO,CAAC,OAAO,CAA8C;IAE7D,OAAO,CAAC,GAAG;IAWX;;;;;OAKG;IACG,IAAI,CACR,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG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EAAE,CAAC;KACpB,CAAC;CAYH;AAED,eAAO,MAAM,GAAG,WAAkB,CAAC"}
|
|
@@ -106,9 +106,22 @@ class ApiClient {
|
|
|
106
106
|
// catalog headers; :param tokens bind at runtime — raw (no URL-encoding, unlike the path)
|
|
107
107
|
for (const [k, v] of Object.entries(req.headers || {}))
|
|
108
108
|
headers[k] = String(v).replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
|
|
109
|
-
|
|
109
|
+
// Body: substitute `:param` into the body template (object values), then encode per `encoding`.
|
|
110
|
+
let body;
|
|
110
111
|
if (req.body !== undefined && req.body !== null) {
|
|
111
|
-
|
|
112
|
+
body = JSON.parse(JSON.stringify(req.body).replace(/":([A-Za-z_][A-Za-z0-9_]*)"/g, (_m, p) => JSON.stringify(params[p] ?? null)));
|
|
113
|
+
}
|
|
114
|
+
// Map the wire format to the right Playwright option (#345): json → data (application/json,
|
|
115
|
+
// default), form → form (application/x-www-form-urlencoded), multipart → multipart (form-data).
|
|
116
|
+
const bodyOpt = {};
|
|
117
|
+
if (body !== undefined) {
|
|
118
|
+
const enc = req.encoding ?? 'json';
|
|
119
|
+
if (enc === 'form')
|
|
120
|
+
bodyOpt.form = body;
|
|
121
|
+
else if (enc === 'multipart')
|
|
122
|
+
bodyOpt.multipart = body;
|
|
123
|
+
else
|
|
124
|
+
bodyOpt.data = body;
|
|
112
125
|
}
|
|
113
126
|
// Playwright APIRequestContext: same runner/report/retries as UI tests. @hybrid passes
|
|
114
127
|
// `storageState` (the @auth role's saved session) so the request shares the browser's
|
|
@@ -120,7 +133,7 @@ class ApiClient {
|
|
|
120
133
|
...(opts.storageState ? { storageState: opts.storageState } : {}),
|
|
121
134
|
});
|
|
122
135
|
try {
|
|
123
|
-
const res = await ctx.fetch(urlPath, { method: req.method, ...
|
|
136
|
+
const res = await ctx.fetch(urlPath, { method: req.method, ...bodyOpt });
|
|
124
137
|
const text = await res.text();
|
|
125
138
|
let parsed = text;
|
|
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EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM;YAC9C,aAAa;YACb,QAAQ,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;SACzC,CAAC;IACJ,CAAC;CACF;AAEY,QAAA,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -71,7 +71,7 @@ class ApiClient {
|
|
|
71
71
|
*/
|
|
72
72
|
async call(
|
|
73
73
|
label: string,
|
|
74
|
-
req: { method: string; path: string; body?: unknown; headers?: Record<string, string>; datasource?: string },
|
|
74
|
+
req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
|
|
75
75
|
params: Record<string, any> = {},
|
|
76
76
|
opts: { storageState?: string } = {},
|
|
77
77
|
): Promise<{ status: number; ok: boolean; body: any; headers: Record<string, string> }> {
|
|
@@ -84,9 +84,19 @@ class ApiClient {
|
|
|
84
84
|
// catalog headers; :param tokens bind at runtime — raw (no URL-encoding, unlike the path)
|
|
85
85
|
for (const [k, v] of Object.entries(req.headers || {}))
|
|
86
86
|
headers[k] = String(v).replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
|
|
87
|
-
|
|
87
|
+
// Body: substitute `:param` into the body template (object values), then encode per `encoding`.
|
|
88
|
+
let body: any;
|
|
88
89
|
if (req.body !== undefined && req.body !== null) {
|
|
89
|
-
|
|
90
|
+
body = JSON.parse(JSON.stringify(req.body).replace(/":([A-Za-z_][A-Za-z0-9_]*)"/g, (_m, p) => JSON.stringify(params[p] ?? null)));
|
|
91
|
+
}
|
|
92
|
+
// Map the wire format to the right Playwright option (#345): json → data (application/json,
|
|
93
|
+
// default), form → form (application/x-www-form-urlencoded), multipart → multipart (form-data).
|
|
94
|
+
const bodyOpt: Record<string, unknown> = {};
|
|
95
|
+
if (body !== undefined) {
|
|
96
|
+
const enc = req.encoding ?? 'json';
|
|
97
|
+
if (enc === 'form') bodyOpt.form = body;
|
|
98
|
+
else if (enc === 'multipart') bodyOpt.multipart = body;
|
|
99
|
+
else bodyOpt.data = body;
|
|
90
100
|
}
|
|
91
101
|
|
|
92
102
|
// Playwright APIRequestContext: same runner/report/retries as UI tests. @hybrid passes
|
|
@@ -99,7 +109,7 @@ class ApiClient {
|
|
|
99
109
|
...(opts.storageState ? { storageState: opts.storageState } : {}),
|
|
100
110
|
});
|
|
101
111
|
try {
|
|
102
|
-
const res = await ctx.fetch(urlPath, { method: req.method, ...
|
|
112
|
+
const res = await ctx.fetch(urlPath, { method: req.method, ...bodyOpt });
|
|
103
113
|
const text = await res.text();
|
|
104
114
|
let parsed: any = text;
|
|
105
115
|
try { parsed = text ? JSON.parse(text) : null; } catch { /* non-JSON → keep text */ }
|
|
@@ -118,7 +128,7 @@ class ApiClient {
|
|
|
118
128
|
*/
|
|
119
129
|
async callN(
|
|
120
130
|
label: string,
|
|
121
|
-
req: { method: string; path: string; body?: unknown; headers?: Record<string, string>; datasource?: string },
|
|
131
|
+
req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
|
|
122
132
|
params: Record<string, any> = {},
|
|
123
133
|
n = 1,
|
|
124
134
|
opts: { storageState?: string } = {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sun-asterisk/sungen",
|
|
3
|
-
"version": "3.1.2-beta.
|
|
3
|
+
"version": "3.1.2-beta.124",
|
|
4
4
|
"description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=18.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sungen/driver-ui": "3.1.2-beta.
|
|
36
|
+
"@sungen/driver-ui": "3.1.2-beta.124",
|
|
37
37
|
"@anthropic-ai/sdk": "^0.71.0",
|
|
38
38
|
"@babel/parser": "^7.28.5",
|
|
39
39
|
"@babel/traverse": "^7.28.5",
|
|
@@ -92,10 +92,11 @@ export function registerAuditCommand(program: Command): void {
|
|
|
92
92
|
.description('Harness: measure test-design quality (viewpoint gate, depth, balance, duplicates, traceability)')
|
|
93
93
|
.option('-s, --screen <name>', 'Screen or flow name to audit')
|
|
94
94
|
.option('--api <name>', 'API-first area or api flow to audit (e.g. orders, flows/signup)')
|
|
95
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
95
96
|
.option('--json', 'Output the raw JSON report')
|
|
96
97
|
.action((options) => {
|
|
97
98
|
try {
|
|
98
|
-
const name = options.screen || options.api;
|
|
99
|
+
const name = options.screen || options.api || options.area;
|
|
99
100
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
100
101
|
const dir = findScreenDir(name);
|
|
101
102
|
if (!dir) throw new Error(`Not found: qa/screens/${name}, qa/flows/${name}, or qa/api/${name}`);
|
|
@@ -16,10 +16,11 @@ export function registerContextCommand(program: Command): void {
|
|
|
16
16
|
.option('-s, --screen <name>', 'Screen name')
|
|
17
17
|
.option('--flow <name>', 'Flow name (resolved as flows/<name>)')
|
|
18
18
|
.option('--api <name>', 'API-first area or api flow (resolved as api/<name>)')
|
|
19
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
19
20
|
.option('--json', 'Print the raw JSON')
|
|
20
|
-
.action(async (o: { screen?: string; flow?: string; api?: string; json?: boolean }) => {
|
|
21
|
+
.action(async (o: { screen?: string; flow?: string; api?: string; area?: string; json?: boolean }) => {
|
|
21
22
|
try {
|
|
22
|
-
const unitId = o.api ? `api/${o.api}` : o.flow ? `flows/${o.flow}` : o.screen;
|
|
23
|
+
const unitId = (o.api || o.area) ? `api/${o.api || o.area}` : o.flow ? `flows/${o.flow}` : o.screen;
|
|
23
24
|
if (!unitId) throw new Error('Provide --screen <name>, --flow <name>, or --api <area>.');
|
|
24
25
|
const cwd = process.cwd();
|
|
25
26
|
const result = await discoverUnitContext(unitId, cwd);
|
|
@@ -95,6 +95,7 @@ export function registerGenerateCommand(program: Command): void {
|
|
|
95
95
|
.option('-s, --screen <name>', 'Generate tests for a specific screen')
|
|
96
96
|
.option('--flow <name>', 'Generate tests for a specific flow')
|
|
97
97
|
.option('--api <name>', 'Generate tests for an API-first area or api flow (e.g. orders, flows/signup)')
|
|
98
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
98
99
|
.option('--all', 'Generate tests for all screens, flows, and API areas')
|
|
99
100
|
.option('--framework <name>', 'Override the platform driver (else read from qa/capabilities.yaml)')
|
|
100
101
|
.option('--inline-data', 'Hardcode test data at compile time instead of runtime loading')
|
|
@@ -102,7 +103,7 @@ export function registerGenerateCommand(program: Command): void {
|
|
|
102
103
|
try {
|
|
103
104
|
const screenName = options.screen;
|
|
104
105
|
const flowName = options.flow;
|
|
105
|
-
const apiName = options.api;
|
|
106
|
+
const apiName = options.api || options.area;
|
|
106
107
|
|
|
107
108
|
// Find feature files
|
|
108
109
|
let featureFiles: string[];
|
|
@@ -11,6 +11,7 @@ export function registerLedgerCommand(program: Command): void {
|
|
|
11
11
|
.description('Append a step event to the ledger')
|
|
12
12
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
13
13
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
14
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
14
15
|
.requiredOption('--step <name>', 'Step name (discovery | viewpoint | gherkin | audit | repair:1 ...)')
|
|
15
16
|
.option('--run <id>', 'Run id — groups all phases of one create-test invocation (else auto-segmented by time gap)')
|
|
16
17
|
.option('--model <id>', 'Model id')
|
|
@@ -20,7 +21,7 @@ export function registerLedgerCommand(program: Command): void {
|
|
|
20
21
|
.option('--note <text>', 'Free note')
|
|
21
22
|
.action((o) => {
|
|
22
23
|
try {
|
|
23
|
-
const name = o.screen || o.api;
|
|
24
|
+
const name = o.screen || o.api || o.area;
|
|
24
25
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
25
26
|
recordEvent(name, {
|
|
26
27
|
step: o.step, runId: o.run, model: o.model, tokensIn: o.tokensIn, tokensOut: o.tokensOut, ms: o.ms, note: o.note,
|
|
@@ -37,11 +38,12 @@ export function registerLedgerCommand(program: Command): void {
|
|
|
37
38
|
.description('Summarise ledger + efficiency verdicts (pulls audit score if present)')
|
|
38
39
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
39
40
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
41
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
40
42
|
.option('--all-runs', 'Aggregate ALL runs (default: latest run only)')
|
|
41
43
|
.option('--json', 'Output raw JSON')
|
|
42
44
|
.action((o) => {
|
|
43
45
|
try {
|
|
44
|
-
const name = o.screen || o.api;
|
|
46
|
+
const name = o.screen || o.api || o.area;
|
|
45
47
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
46
48
|
const r = buildReport(name, { allRuns: o.allRuns });
|
|
47
49
|
if (o.json) { console.log(JSON.stringify(r, null, 2)); return; }
|
|
@@ -17,11 +17,12 @@ export function registerManifestCommand(program: Command): void {
|
|
|
17
17
|
.description('Spec-fingerprint manifest: build a scenario↔spec-section map, or diff to plan keep/regenerate/retire')
|
|
18
18
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
19
19
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
20
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
20
21
|
.option('--diff', 'Compare current spec vs stored manifest → change plan')
|
|
21
22
|
.option('--json', 'Output raw JSON')
|
|
22
23
|
.action((options) => {
|
|
23
24
|
try {
|
|
24
|
-
const name = options.screen || options.api;
|
|
25
|
+
const name = options.screen || options.api || options.area;
|
|
25
26
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
26
27
|
const dir = findScreenDir(name);
|
|
27
28
|
if (!dir) throw new Error(`Not found: qa/screens|flows|api/${name}`);
|
|
@@ -14,10 +14,11 @@ export function registerRepairCommand(program: Command): void {
|
|
|
14
14
|
.description('Propose concrete fixes for a unit from its audit findings + test failures (capability fix catalog)')
|
|
15
15
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
16
16
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
17
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
17
18
|
.option('--json', 'Output raw JSON')
|
|
18
|
-
.action((o: { screen?: string; api?: string; json?: boolean }) => {
|
|
19
|
+
.action((o: { screen?: string; api?: string; area?: string; json?: boolean }) => {
|
|
19
20
|
try {
|
|
20
|
-
const name = o.screen || o.api;
|
|
21
|
+
const name = o.screen || o.api || o.area;
|
|
21
22
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
22
23
|
const cwd = process.cwd();
|
|
23
24
|
// Capability-resolution id + the generated dir, per kind.
|
|
@@ -9,10 +9,11 @@ export function registerScriptCheckCommand(program: Command): void {
|
|
|
9
9
|
.description('Verify the generated Playwright spec is a faithful 1:1 of the Gherkin feature (no hand-edit / stale drift)')
|
|
10
10
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
11
11
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
12
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
12
13
|
.option('--json', 'Output raw JSON')
|
|
13
14
|
.action(async (options) => {
|
|
14
15
|
try {
|
|
15
|
-
const name = options.screen || options.api;
|
|
16
|
+
const name = options.screen || options.api || options.area;
|
|
16
17
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
17
18
|
const screen = path.join(process.cwd(), 'qa', 'screens', name);
|
|
18
19
|
const flow = path.join(process.cwd(), 'qa', 'flows', name);
|
|
@@ -9,11 +9,12 @@ export function registerTraceCommand(program: Command): void {
|
|
|
9
9
|
.description('Visualise the executed test-design process (workflow/skill steps, repair loops), find bottlenecks, and show where to focus human review')
|
|
10
10
|
.option('-s, --screen <name>', 'Screen or flow name')
|
|
11
11
|
.option('--api <name>', 'API-first area or api flow (qa/api/<name>)')
|
|
12
|
+
.option('--area <name>', 'Alias of --api — an API-first area (qa/api/<name>)')
|
|
12
13
|
.option('--json', 'Output raw JSON')
|
|
13
14
|
.option('--mermaid', 'Print only the Mermaid flowchart')
|
|
14
15
|
.action((options) => {
|
|
15
16
|
try {
|
|
16
|
-
const name = options.screen || options.api;
|
|
17
|
+
const name = options.screen || options.api || options.area;
|
|
17
18
|
if (!name) throw new Error('Provide --screen <name> (or --api <area>)');
|
|
18
19
|
const screen = path.join(process.cwd(), 'qa', 'screens', name);
|
|
19
20
|
const flow = path.join(process.cwd(), 'qa', 'flows', name);
|
|
@@ -27,7 +27,7 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
|
|
|
27
27
|
|
|
28
28
|
## API unit mode (driver-api)
|
|
29
29
|
|
|
30
|
-
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps below: `sungen context --
|
|
30
|
+
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps below: `sungen context --area <name>` (discover) → API viewpoint overview → generate `@api`/`@cases`/flow/`@concurrent`/`@query` scenarios → **`sungen audit --area <name>` gate + the `sungen-reviewer` sub-agent + repair loop to businessDepth ≥ 0.7** → record + trace. Then jump to the "Converge" next-step options (recommend `/sungen:run-test <name>`). The capture / viewpoint-group / selector steps do **not** apply.
|
|
31
31
|
|
|
32
32
|
## Steps
|
|
33
33
|
|
|
@@ -37,15 +37,15 @@ Skip this pre-flight when `--env` matches the base locale (no overlay needed in
|
|
|
37
37
|
If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM). Instead:
|
|
38
38
|
|
|
39
39
|
1. **Resolve the datasource** — ensure the `kind: api` datasource's `base_url` + auth are wired in `qa/datasources.yaml` + `.env.qa` (the `${X_URL}` key from `sungen api init`). A `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
|
|
40
|
-
2. **Compile**: `[ -x ./bin/sungen.js ] && ./bin/sungen.js generate --
|
|
40
|
+
2. **Compile**: `[ -x ./bin/sungen.js ] && ./bin/sungen.js generate --area <name> || npx sungen generate --area <name>` → `specs/generated/api/<name>/`.
|
|
41
41
|
3. **Run**: `npx playwright test specs/generated/api/<name>/<name>.spec.ts` (per-spec JSON results, as below).
|
|
42
42
|
4. **Auto-fix** (no selectors — the failure classes differ): use `sungen-error-mapping`.
|
|
43
43
|
- **401/403** → wire `@hybrid` + `@auth:<role>` (reuse the UI session) or the catalog `Bearer :token` header; suggest `sungen makeauth <role>`.
|
|
44
44
|
- **datasource/base_url unresolved** → set the `${X_URL}` key in `.env.qa`.
|
|
45
45
|
- **missing/empty bound param** → trace `{{var}}` to test-data or a prior `@api` response; fill it.
|
|
46
|
-
- **`expect.status` mismatch** → reconcile against `apis.yaml`/spec (the catalog is the oracle); **never hand-edit the generated spec** (re-`generate --
|
|
46
|
+
- **`expect.status` mismatch** → reconcile against `apis.yaml`/spec (the catalog is the oracle); **never hand-edit the generated spec** (re-`generate --area` instead).
|
|
47
47
|
- **flaky** → enforce self-cleaning flows, per-row isolation (`@cases`), `@concurrent` caps.
|
|
48
|
-
5. **Integrity + trace** — `sungen script-check --
|
|
48
|
+
5. **Integrity + trace** — `sungen script-check --area <name>` (verify the spec is a 1:1 of the Gherkin; on DRIFT re-`generate --area`, never hand-edit) and `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Then report + offer next steps.
|
|
49
49
|
|
|
50
50
|
## Pre-run (phased — per `sungen-selector-fix` skill)
|
|
51
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-api-design
|
|
3
|
-
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --
|
|
3
|
+
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --area gate + reviewer + repair to a high businessDepth (≥0.7). Use when create-test/run-test detects an api unit (no selectors, no visual capture).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API design loop (driver-api · Orchestration + Harness)
|
|
@@ -10,7 +10,7 @@ Use this when the unit is **api-first** — `qa/api/<area>/` or `qa/api/flows/<f
|
|
|
10
10
|
## The loop (mirror of /sungen:design, API-native)
|
|
11
11
|
|
|
12
12
|
### 1. Discover (no capture)
|
|
13
|
-
Run `sungen context --
|
|
13
|
+
Run `sungen context --area <name>` — it reads the catalog and prints the **endpoints** + the **generation units** (one `matrix` unit per endpoint, an `async` unit per mutating endpoint, a `flow` unit for an api flow). Read `qa/api/<name>/requirements/spec.md` if present. No `apis.yaml` yet? → `sungen api import <openapi|csv>` or `sungen api add --area <name>` first.
|
|
14
14
|
|
|
15
15
|
### 2. API viewpoint overview (by method-profile)
|
|
16
16
|
For each endpoint, cover its viewpoints — severity-weighted by method:
|
|
@@ -29,7 +29,7 @@ Bands: **~70%** success+failure matrix · **~20%** flows (auth/CRUD chains) · *
|
|
|
29
29
|
- **Idempotency**: `@api:<name> @concurrent:N` + `expect {{name.ok_count}} is 1`, cross-checked with `@query` (the DB is the oracle).
|
|
30
30
|
|
|
31
31
|
### 4. Gate + repair (always — businessDepth ≥ 0.7 is the bar)
|
|
32
|
-
Run `sungen audit --
|
|
32
|
+
Run `sungen audit --area <name>`; read `gateStatus` + `findings`. Then the **semantic reviewer** (sungen-reviewer sub-agent, API criteria). Repair **both** (budget 3 rounds), re-audit until PASS:
|
|
33
33
|
|
|
34
34
|
| Finding | Repair |
|
|
35
35
|
|---|---|
|
|
@@ -41,7 +41,7 @@ Run `sungen audit --api <name>`; read `gateStatus` + `findings`. Then the **sema
|
|
|
41
41
|
Stop when the gate PASSes + businessDepth ≥ 0.7, or the budget is exhausted → report residual gaps honestly (mark genuinely-unautomatable cases `@manual` with an oracle). Never fake a pass.
|
|
42
42
|
|
|
43
43
|
### 5. Record + converge
|
|
44
|
-
`sungen manifest --
|
|
44
|
+
`sungen manifest --area <name>` (reuse) and ledger each phase; show the trace + the HUMAN-LOOP FOCUS. (Integrity `script-check`/`trace` for api: see run-test.)
|
|
45
45
|
|
|
46
46
|
## Rules
|
|
47
47
|
- **No HTTP, no selectors** — only `.feature` + the reviewed `apis.yaml` + `test-data`.
|
|
@@ -22,7 +22,7 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
22
22
|
|
|
23
23
|
## API unit mode (driver-api)
|
|
24
24
|
|
|
25
|
-
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps: `sungen context --
|
|
25
|
+
If the unit is **api-first** (`qa/api/<name>/` or `qa/api/flows/<name>/`), the design loop differs — **no visual capture, no selectors**; the contract is the named-endpoint catalog. **Follow the `sungen-api-design` skill end-to-end** instead of the screen/flow steps: `sungen context --area <name>` (discover) → API viewpoint overview → generate `@api`/`@cases`/flow/`@concurrent`/`@query` scenarios → **`sungen audit --area <name>` gate + reviewer + repair loop to businessDepth ≥ 0.7** → record + trace. Then recommend `/sungen-run-test <name>`. The capture / viewpoint-group / selector steps do **not** apply.
|
|
26
26
|
|
|
27
27
|
## Steps
|
|
28
28
|
|
|
@@ -36,10 +36,10 @@ Skip when `--env` matches the base locale.
|
|
|
36
36
|
|
|
37
37
|
If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM):
|
|
38
38
|
1. **Resolve the datasource** — `base_url` + auth wired in `qa/datasources.yaml` + `.env.qa` (`${X_URL}` from `sungen api init`); a `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
|
|
39
|
-
2. **Compile**: `npx sungen generate --
|
|
39
|
+
2. **Compile**: `npx sungen generate --area <name>` → `specs/generated/api/<name>/`.
|
|
40
40
|
3. **Run**: `npx playwright test specs/generated/api/<name>/<name>.spec.ts`.
|
|
41
|
-
4. **Auto-fix** (use `sungen-error-mapping`): 401/403 → `@hybrid`+`@auth` or `Bearer :token` header (`sungen makeauth`); base_url unresolved → set `${X_URL}`; missing param → trace `{{var}}` to test-data/a prior `@api` response; `expect.status` mismatch → reconcile against `apis.yaml` (re-`generate --
|
|
42
|
-
5. **Integrity + trace** — `sungen script-check --
|
|
41
|
+
4. **Auto-fix** (use `sungen-error-mapping`): 401/403 → `@hybrid`+`@auth` or `Bearer :token` header (`sungen makeauth`); base_url unresolved → set `${X_URL}`; missing param → trace `{{var}}` to test-data/a prior `@api` response; `expect.status` mismatch → reconcile against `apis.yaml` (re-`generate --area`, never hand-edit the spec); flaky → self-clean + `@concurrent` caps.
|
|
42
|
+
5. **Integrity + trace** — `sungen script-check --area <name>` (1:1; on DRIFT re-`generate --area`, never hand-edit the spec) + `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Report + offer next steps.
|
|
43
43
|
|
|
44
44
|
## Pre-run (phased — per `sungen-selector-fix` skill)
|
|
45
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-api-design
|
|
3
|
-
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --
|
|
3
|
+
description: The API-first design loop for an api unit (qa/api/<area> or qa/api/flows/<flow>) — discover the catalog, lay out the API viewpoints, generate @api/@cases/flow/@concurrent scenarios, then drive the sungen audit --area gate + reviewer + repair to a high businessDepth (≥0.7). Use when create-test/run-test detects an api unit (no selectors, no visual capture).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API design loop (driver-api · Orchestration + Harness)
|
|
@@ -10,7 +10,7 @@ Use this when the unit is **api-first** — `qa/api/<area>/` or `qa/api/flows/<f
|
|
|
10
10
|
## The loop (mirror of /sungen:design, API-native)
|
|
11
11
|
|
|
12
12
|
### 1. Discover (no capture)
|
|
13
|
-
Run `sungen context --
|
|
13
|
+
Run `sungen context --area <name>` — it reads the catalog and prints the **endpoints** + the **generation units** (one `matrix` unit per endpoint, an `async` unit per mutating endpoint, a `flow` unit for an api flow). Read `qa/api/<name>/requirements/spec.md` if present. No `apis.yaml` yet? → `sungen api import <openapi|csv>` or `sungen api add --area <name>` first.
|
|
14
14
|
|
|
15
15
|
### 2. API viewpoint overview (by method-profile)
|
|
16
16
|
For each endpoint, cover its viewpoints — severity-weighted by method:
|
|
@@ -29,7 +29,7 @@ Bands: **~70%** success+failure matrix · **~20%** flows (auth/CRUD chains) · *
|
|
|
29
29
|
- **Idempotency**: `@api:<name> @concurrent:N` + `expect {{name.ok_count}} is 1`, cross-checked with `@query` (the DB is the oracle).
|
|
30
30
|
|
|
31
31
|
### 4. Gate + repair (always — businessDepth ≥ 0.7 is the bar)
|
|
32
|
-
Run `sungen audit --
|
|
32
|
+
Run `sungen audit --area <name>`; read `gateStatus` + `findings`. Then the **semantic reviewer** (sungen-reviewer sub-agent, API criteria). Repair **both** (budget 3 rounds), re-audit until PASS:
|
|
33
33
|
|
|
34
34
|
| Finding | Repair |
|
|
35
35
|
|---|---|
|
|
@@ -41,7 +41,7 @@ Run `sungen audit --api <name>`; read `gateStatus` + `findings`. Then the **sema
|
|
|
41
41
|
Stop when the gate PASSes + businessDepth ≥ 0.7, or the budget is exhausted → report residual gaps honestly (mark genuinely-unautomatable cases `@manual` with an oracle). Never fake a pass.
|
|
42
42
|
|
|
43
43
|
### 5. Record + converge
|
|
44
|
-
`sungen manifest --
|
|
44
|
+
`sungen manifest --area <name>` (reuse) and ledger each phase; show the trace + the HUMAN-LOOP FOCUS. (Integrity `script-check`/`trace` for api: see run-test.)
|
|
45
45
|
|
|
46
46
|
## Rules
|
|
47
47
|
- **No HTTP, no selectors** — only `.feature` + the reviewed `apis.yaml` + `test-data`.
|
|
@@ -71,7 +71,7 @@ class ApiClient {
|
|
|
71
71
|
*/
|
|
72
72
|
async call(
|
|
73
73
|
label: string,
|
|
74
|
-
req: { method: string; path: string; body?: unknown; headers?: Record<string, string>; datasource?: string },
|
|
74
|
+
req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
|
|
75
75
|
params: Record<string, any> = {},
|
|
76
76
|
opts: { storageState?: string } = {},
|
|
77
77
|
): Promise<{ status: number; ok: boolean; body: any; headers: Record<string, string> }> {
|
|
@@ -84,9 +84,19 @@ class ApiClient {
|
|
|
84
84
|
// catalog headers; :param tokens bind at runtime — raw (no URL-encoding, unlike the path)
|
|
85
85
|
for (const [k, v] of Object.entries(req.headers || {}))
|
|
86
86
|
headers[k] = String(v).replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, p) => String(params[p] ?? ''));
|
|
87
|
-
|
|
87
|
+
// Body: substitute `:param` into the body template (object values), then encode per `encoding`.
|
|
88
|
+
let body: any;
|
|
88
89
|
if (req.body !== undefined && req.body !== null) {
|
|
89
|
-
|
|
90
|
+
body = JSON.parse(JSON.stringify(req.body).replace(/":([A-Za-z_][A-Za-z0-9_]*)"/g, (_m, p) => JSON.stringify(params[p] ?? null)));
|
|
91
|
+
}
|
|
92
|
+
// Map the wire format to the right Playwright option (#345): json → data (application/json,
|
|
93
|
+
// default), form → form (application/x-www-form-urlencoded), multipart → multipart (form-data).
|
|
94
|
+
const bodyOpt: Record<string, unknown> = {};
|
|
95
|
+
if (body !== undefined) {
|
|
96
|
+
const enc = req.encoding ?? 'json';
|
|
97
|
+
if (enc === 'form') bodyOpt.form = body;
|
|
98
|
+
else if (enc === 'multipart') bodyOpt.multipart = body;
|
|
99
|
+
else bodyOpt.data = body;
|
|
90
100
|
}
|
|
91
101
|
|
|
92
102
|
// Playwright APIRequestContext: same runner/report/retries as UI tests. @hybrid passes
|
|
@@ -99,7 +109,7 @@ class ApiClient {
|
|
|
99
109
|
...(opts.storageState ? { storageState: opts.storageState } : {}),
|
|
100
110
|
});
|
|
101
111
|
try {
|
|
102
|
-
const res = await ctx.fetch(urlPath, { method: req.method, ...
|
|
112
|
+
const res = await ctx.fetch(urlPath, { method: req.method, ...bodyOpt });
|
|
103
113
|
const text = await res.text();
|
|
104
114
|
let parsed: any = text;
|
|
105
115
|
try { parsed = text ? JSON.parse(text) : null; } catch { /* non-JSON → keep text */ }
|
|
@@ -118,7 +128,7 @@ class ApiClient {
|
|
|
118
128
|
*/
|
|
119
129
|
async callN(
|
|
120
130
|
label: string,
|
|
121
|
-
req: { method: string; path: string; body?: unknown; headers?: Record<string, string>; datasource?: string },
|
|
131
|
+
req: { method: string; path: string; body?: unknown; encoding?: 'json' | 'form' | 'multipart'; headers?: Record<string, string>; datasource?: string },
|
|
122
132
|
params: Record<string, any> = {},
|
|
123
133
|
n = 1,
|
|
124
134
|
opts: { storageState?: string } = {},
|