@sun-asterisk/sungen 3.2.12-beta.2 → 3.2.12-beta.4
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/orchestrator/templates/ai-src/commands/create-data-test.md +4 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-data-factory/SKILL.md +17 -6
- package/package.json +3 -3
- package/src/orchestrator/templates/ai-src/commands/create-data-test.md +4 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-data-factory/SKILL.md +17 -6
|
@@ -90,6 +90,10 @@ Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data lint --screen
|
|
|
90
90
|
|
|
91
91
|
Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data gen --screen <name> || npx sungen data gen --screen <name>`. If `test-data/<name>.yaml` already exists it **merges** the standardized field data in — it **replaces only the field keys it owns and preserves every other key** (create-test's data, flow-namespaced keys, `@cases` datasets, overrides). It asks before merging (in ALL mode after they confirmed, add `--yes`; `--force` skips the prompt). The output is standardized `valid/boundary/invalid` values with `CHK-*` traceability.
|
|
92
92
|
|
|
93
|
+
### 5.5 Validate semantic correctness
|
|
94
|
+
|
|
95
|
+
Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data validate --screen <name> || npx sungen data validate --screen <name>`. This is stronger than lint (coverage): it checks every generated value is **semantically** correct — each `valid`/`boundary` value actually satisfies the constraints, and each synthesized `invalid` value actually violates them (a value in the `valid` set that breaks `maxLength`, or a "below min" case that landed inside the range, is a `VALUE_NOT_VALID` error). Fix any `error`; `INVALID_LOOKS_VALID` warns are a prompt to confirm the value is invalid for a non-length reason (charset/format). Each generated value also carries an `expected: valid|invalid` field in the test-data for traceability.
|
|
96
|
+
|
|
93
97
|
### 6. Weave into scenarios (if create-test already ran)
|
|
94
98
|
|
|
95
99
|
If the `.feature` exists, turn the generated invalid/boundary sets into data-driven `Scenario Outline` + `Examples` (`@cases`) referencing the values — following `sungen-gherkin-syntax`. Otherwise leave the standardized `test-data/<name>.yaml` for `/sungen:run-test` to consume.
|
|
@@ -85,12 +85,15 @@ This is the core discipline: *common is never enough; when blind, think and ask
|
|
|
85
85
|
## Customizing the catalog — `.overwrite` (survives `sungen update`)
|
|
86
86
|
|
|
87
87
|
The shipped `common/` is a floor. Project rules go in `qa/data-factory/common.overwrite.yaml`,
|
|
88
|
-
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`)
|
|
89
|
-
new `id` appends,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`
|
|
93
|
-
|
|
88
|
+
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`) via three explicit
|
|
89
|
+
operations: **EXTEND** (a new `id` appends), **REPLACE** (same `id` wins; `constraints` merge
|
|
90
|
+
key-by-key), **DISABLE** (list ids under `disable:` to drop shipped cases that don't apply — a stale
|
|
91
|
+
target id warns). You can also override `security:` banks and `techniques:` the same way. `sungen
|
|
92
|
+
update` refreshes `common/` but never touches your overlay; a stale entry **warns you to prune it** —
|
|
93
|
+
it never edits your file. Nothing is silently overwritten: **`sungen data provenance`** (and a
|
|
94
|
+
`⟲ .overwrite →` line at `data gen`) shows exactly what your overlay changed, and each overlaid value
|
|
95
|
+
is tagged `via: .overwrite` in the test-data. Prefer a targeted `errorMap`/`constraints` in the
|
|
96
|
+
field-map for per-screen tweaks; use `.overwrite` only for rules that apply project-wide.
|
|
94
97
|
|
|
95
98
|
## Bulk-import fixtures (CSV)
|
|
96
99
|
|
|
@@ -109,6 +112,14 @@ Then `sungen data gen` writes the standardized `test-data/<name>.yaml`. Do not h
|
|
|
109
112
|
generated values — change the field-map or `.overwrite` and re-run (determinism: same input → same
|
|
110
113
|
data).
|
|
111
114
|
|
|
115
|
+
Then run **`sungen data validate`** — the semantic check beyond coverage. It verifies each generated
|
|
116
|
+
value is *correct*, not just *present*: every `valid`/`boundary` value actually satisfies the
|
|
117
|
+
constraints and every synthesized `invalid` value actually violates them. A boundary is expanded to
|
|
118
|
+
**one case per point** (`min / min+1` → two cases; `< min` → min-1, below the minimum), each stamped
|
|
119
|
+
`expected: valid|invalid` in the output. Any `VALUE_NOT_VALID` error means a value labeled valid breaks
|
|
120
|
+
a constraint — fix the field-map/constraints and re-run. This is what stops the "structurally right but
|
|
121
|
+
semantically wrong" data (e.g. a "below minimum length" case that is actually long enough to pass).
|
|
122
|
+
|
|
112
123
|
## Weaving into scenarios
|
|
113
124
|
|
|
114
125
|
When a `.feature` exists, express invalid/boundary sets as data-driven `Scenario Outline` + `Examples`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sun-asterisk/sungen",
|
|
3
|
-
"version": "3.2.12-beta.
|
|
3
|
+
"version": "3.2.12-beta.4",
|
|
4
4
|
"description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/types": "^7.28.5",
|
|
40
40
|
"@cucumber/gherkin": "^37.0.0",
|
|
41
41
|
"@cucumber/messages": "^31.0.0",
|
|
42
|
-
"@sungen/driver-data-factory": "3.2.12-beta.
|
|
43
|
-
"@sungen/driver-ui": "3.2.12-beta.
|
|
42
|
+
"@sungen/driver-data-factory": "3.2.12-beta.4",
|
|
43
|
+
"@sungen/driver-ui": "3.2.12-beta.4",
|
|
44
44
|
"chalk": "^5.6.2",
|
|
45
45
|
"commander": "^14.0.2",
|
|
46
46
|
"dotenv": "^17.2.3",
|
|
@@ -90,6 +90,10 @@ Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data lint --screen
|
|
|
90
90
|
|
|
91
91
|
Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data gen --screen <name> || npx sungen data gen --screen <name>`. If `test-data/<name>.yaml` already exists it **merges** the standardized field data in — it **replaces only the field keys it owns and preserves every other key** (create-test's data, flow-namespaced keys, `@cases` datasets, overrides). It asks before merging (in ALL mode after they confirmed, add `--yes`; `--force` skips the prompt). The output is standardized `valid/boundary/invalid` values with `CHK-*` traceability.
|
|
92
92
|
|
|
93
|
+
### 5.5 Validate semantic correctness
|
|
94
|
+
|
|
95
|
+
Run (local-first): `[ -x ./bin/sungen.js ] && ./bin/sungen.js data validate --screen <name> || npx sungen data validate --screen <name>`. This is stronger than lint (coverage): it checks every generated value is **semantically** correct — each `valid`/`boundary` value actually satisfies the constraints, and each synthesized `invalid` value actually violates them (a value in the `valid` set that breaks `maxLength`, or a "below min" case that landed inside the range, is a `VALUE_NOT_VALID` error). Fix any `error`; `INVALID_LOOKS_VALID` warns are a prompt to confirm the value is invalid for a non-length reason (charset/format). Each generated value also carries an `expected: valid|invalid` field in the test-data for traceability.
|
|
96
|
+
|
|
93
97
|
### 6. Weave into scenarios (if create-test already ran)
|
|
94
98
|
|
|
95
99
|
If the `.feature` exists, turn the generated invalid/boundary sets into data-driven `Scenario Outline` + `Examples` (`@cases`) referencing the values — following `sungen-gherkin-syntax`. Otherwise leave the standardized `test-data/<name>.yaml` for `/sungen:run-test` to consume.
|
|
@@ -85,12 +85,15 @@ This is the core discipline: *common is never enough; when blind, think and ask
|
|
|
85
85
|
## Customizing the catalog — `.overwrite` (survives `sungen update`)
|
|
86
86
|
|
|
87
87
|
The shipped `common/` is a floor. Project rules go in `qa/data-factory/common.overwrite.yaml`,
|
|
88
|
-
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`)
|
|
89
|
-
new `id` appends,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`
|
|
93
|
-
|
|
88
|
+
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`) via three explicit
|
|
89
|
+
operations: **EXTEND** (a new `id` appends), **REPLACE** (same `id` wins; `constraints` merge
|
|
90
|
+
key-by-key), **DISABLE** (list ids under `disable:` to drop shipped cases that don't apply — a stale
|
|
91
|
+
target id warns). You can also override `security:` banks and `techniques:` the same way. `sungen
|
|
92
|
+
update` refreshes `common/` but never touches your overlay; a stale entry **warns you to prune it** —
|
|
93
|
+
it never edits your file. Nothing is silently overwritten: **`sungen data provenance`** (and a
|
|
94
|
+
`⟲ .overwrite →` line at `data gen`) shows exactly what your overlay changed, and each overlaid value
|
|
95
|
+
is tagged `via: .overwrite` in the test-data. Prefer a targeted `errorMap`/`constraints` in the
|
|
96
|
+
field-map for per-screen tweaks; use `.overwrite` only for rules that apply project-wide.
|
|
94
97
|
|
|
95
98
|
## Bulk-import fixtures (CSV)
|
|
96
99
|
|
|
@@ -109,6 +112,14 @@ Then `sungen data gen` writes the standardized `test-data/<name>.yaml`. Do not h
|
|
|
109
112
|
generated values — change the field-map or `.overwrite` and re-run (determinism: same input → same
|
|
110
113
|
data).
|
|
111
114
|
|
|
115
|
+
Then run **`sungen data validate`** — the semantic check beyond coverage. It verifies each generated
|
|
116
|
+
value is *correct*, not just *present*: every `valid`/`boundary` value actually satisfies the
|
|
117
|
+
constraints and every synthesized `invalid` value actually violates them. A boundary is expanded to
|
|
118
|
+
**one case per point** (`min / min+1` → two cases; `< min` → min-1, below the minimum), each stamped
|
|
119
|
+
`expected: valid|invalid` in the output. Any `VALUE_NOT_VALID` error means a value labeled valid breaks
|
|
120
|
+
a constraint — fix the field-map/constraints and re-run. This is what stops the "structurally right but
|
|
121
|
+
semantically wrong" data (e.g. a "below minimum length" case that is actually long enough to pass).
|
|
122
|
+
|
|
112
123
|
## Weaving into scenarios
|
|
113
124
|
|
|
114
125
|
When a `.feature` exists, express invalid/boundary sets as data-driven `Scenario Outline` + `Examples`
|