@sun-asterisk/sungen 3.2.16-beta.1 → 3.2.16-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/cli/commands/audit.d.ts.map +1 -1
  2. package/dist/cli/commands/audit.js +6 -0
  3. package/dist/cli/commands/audit.js.map +1 -1
  4. package/dist/cli/commands/delivery.d.ts.map +1 -1
  5. package/dist/cli/commands/delivery.js +67 -20
  6. package/dist/cli/commands/delivery.js.map +1 -1
  7. package/dist/exporters/feature-parser.d.ts +16 -1
  8. package/dist/exporters/feature-parser.d.ts.map +1 -1
  9. package/dist/exporters/feature-parser.js +21 -2
  10. package/dist/exporters/feature-parser.js.map +1 -1
  11. package/dist/exporters/matrix/build.d.ts +27 -2
  12. package/dist/exporters/matrix/build.d.ts.map +1 -1
  13. package/dist/exporters/matrix/build.js +277 -47
  14. package/dist/exporters/matrix/build.js.map +1 -1
  15. package/dist/exporters/matrix/export.d.ts +7 -4
  16. package/dist/exporters/matrix/export.d.ts.map +1 -1
  17. package/dist/exporters/matrix/export.js +22 -6
  18. package/dist/exporters/matrix/export.js.map +1 -1
  19. package/dist/exporters/matrix/gates.d.ts.map +1 -1
  20. package/dist/exporters/matrix/gates.js +112 -3
  21. package/dist/exporters/matrix/gates.js.map +1 -1
  22. package/dist/exporters/matrix/map-loader.d.ts.map +1 -1
  23. package/dist/exporters/matrix/map-loader.js +20 -0
  24. package/dist/exporters/matrix/map-loader.js.map +1 -1
  25. package/dist/exporters/matrix/render-csv.d.ts +3 -2
  26. package/dist/exporters/matrix/render-csv.d.ts.map +1 -1
  27. package/dist/exporters/matrix/render-csv.js +53 -30
  28. package/dist/exporters/matrix/render-csv.js.map +1 -1
  29. package/dist/exporters/matrix/render-xlsx.d.ts +32 -8
  30. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
  31. package/dist/exporters/matrix/render-xlsx.js +215 -83
  32. package/dist/exporters/matrix/render-xlsx.js.map +1 -1
  33. package/dist/exporters/matrix/types.d.ts +53 -7
  34. package/dist/exporters/matrix/types.d.ts.map +1 -1
  35. package/dist/exporters/matrix/types.js +2 -2
  36. package/dist/exporters/matrix/types.js.map +1 -1
  37. package/dist/exporters/matrix/wording.d.ts +61 -0
  38. package/dist/exporters/matrix/wording.d.ts.map +1 -0
  39. package/dist/exporters/matrix/wording.js +221 -0
  40. package/dist/exporters/matrix/wording.js.map +1 -0
  41. package/dist/exporters/scenario-merger.d.ts.map +1 -1
  42. package/dist/exporters/scenario-merger.js +2 -1
  43. package/dist/exporters/scenario-merger.js.map +1 -1
  44. package/dist/exporters/spec-parser.d.ts.map +1 -1
  45. package/dist/exporters/spec-parser.js +2 -1
  46. package/dist/exporters/spec-parser.js.map +1 -1
  47. package/dist/harness/audit.d.ts +6 -0
  48. package/dist/harness/audit.d.ts.map +1 -1
  49. package/dist/harness/audit.js +80 -15
  50. package/dist/harness/audit.js.map +1 -1
  51. package/dist/harness/blindspot.d.ts.map +1 -1
  52. package/dist/harness/blindspot.js +2 -1
  53. package/dist/harness/blindspot.js.map +1 -1
  54. package/dist/harness/capability-plan.d.ts.map +1 -1
  55. package/dist/harness/capability-plan.js +3 -2
  56. package/dist/harness/capability-plan.js.map +1 -1
  57. package/dist/harness/feedback.d.ts.map +1 -1
  58. package/dist/harness/feedback.js +3 -2
  59. package/dist/harness/feedback.js.map +1 -1
  60. package/dist/harness/flow-check.d.ts.map +1 -1
  61. package/dist/harness/flow-check.js +2 -1
  62. package/dist/harness/flow-check.js.map +1 -1
  63. package/dist/harness/flow-plan.d.ts.map +1 -1
  64. package/dist/harness/flow-plan.js +3 -2
  65. package/dist/harness/flow-plan.js.map +1 -1
  66. package/dist/harness/intent.d.ts.map +1 -1
  67. package/dist/harness/intent.js +2 -1
  68. package/dist/harness/intent.js.map +1 -1
  69. package/dist/harness/journey.d.ts.map +1 -1
  70. package/dist/harness/journey.js +3 -2
  71. package/dist/harness/journey.js.map +1 -1
  72. package/dist/harness/ledger.d.ts.map +1 -1
  73. package/dist/harness/ledger.js +3 -2
  74. package/dist/harness/ledger.js.map +1 -1
  75. package/dist/harness/manifest.d.ts.map +1 -1
  76. package/dist/harness/manifest.js +4 -3
  77. package/dist/harness/manifest.js.map +1 -1
  78. package/dist/harness/parse.d.ts.map +1 -1
  79. package/dist/harness/parse.js +16 -3
  80. package/dist/harness/parse.js.map +1 -1
  81. package/dist/harness/quality-gates.d.ts.map +1 -1
  82. package/dist/harness/quality-gates.js +2 -1
  83. package/dist/harness/quality-gates.js.map +1 -1
  84. package/dist/harness/read-text.d.ts +22 -0
  85. package/dist/harness/read-text.d.ts.map +1 -0
  86. package/dist/harness/read-text.js +64 -0
  87. package/dist/harness/read-text.js.map +1 -0
  88. package/dist/harness/script-check.d.ts.map +1 -1
  89. package/dist/harness/script-check.js +3 -2
  90. package/dist/harness/script-check.js.map +1 -1
  91. package/dist/harness/sensors.d.ts +13 -1
  92. package/dist/harness/sensors.d.ts.map +1 -1
  93. package/dist/harness/sensors.js +63 -20
  94. package/dist/harness/sensors.js.map +1 -1
  95. package/dist/harness/spec-coverage.d.ts +5 -0
  96. package/dist/harness/spec-coverage.d.ts.map +1 -1
  97. package/dist/harness/spec-coverage.js +17 -7
  98. package/dist/harness/spec-coverage.js.map +1 -1
  99. package/dist/harness/trace.d.ts.map +1 -1
  100. package/dist/harness/trace.js +4 -3
  101. package/dist/harness/trace.js.map +1 -1
  102. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  103. package/dist/harness/viewpoint-ledger.js +2 -1
  104. package/dist/harness/viewpoint-ledger.js.map +1 -1
  105. package/dist/orchestrator/templates/ai-src/commands/create-test.md +9 -0
  106. package/dist/orchestrator/templates/ai-src/commands/delivery.md +103 -18
  107. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +77 -11
  108. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
  109. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +22 -0
  110. package/package.json +4 -4
  111. package/src/cli/commands/audit.ts +5 -0
  112. package/src/cli/commands/delivery.ts +68 -22
  113. package/src/exporters/feature-parser.ts +21 -2
  114. package/src/exporters/matrix/build.ts +281 -43
  115. package/src/exporters/matrix/export.ts +31 -6
  116. package/src/exporters/matrix/gates.ts +119 -3
  117. package/src/exporters/matrix/map-loader.ts +22 -1
  118. package/src/exporters/matrix/render-csv.ts +53 -30
  119. package/src/exporters/matrix/render-xlsx.ts +216 -85
  120. package/src/exporters/matrix/types.ts +58 -8
  121. package/src/exporters/matrix/wording.ts +221 -0
  122. package/src/exporters/scenario-merger.ts +2 -1
  123. package/src/exporters/spec-parser.ts +2 -1
  124. package/src/harness/audit.ts +84 -16
  125. package/src/harness/blindspot.ts +2 -1
  126. package/src/harness/capability-plan.ts +3 -2
  127. package/src/harness/feedback.ts +3 -2
  128. package/src/harness/flow-check.ts +2 -1
  129. package/src/harness/flow-plan.ts +3 -2
  130. package/src/harness/intent.ts +2 -1
  131. package/src/harness/journey.ts +3 -2
  132. package/src/harness/ledger.ts +3 -2
  133. package/src/harness/manifest.ts +4 -3
  134. package/src/harness/parse.ts +17 -3
  135. package/src/harness/quality-gates.ts +2 -1
  136. package/src/harness/read-text.ts +28 -0
  137. package/src/harness/script-check.ts +3 -2
  138. package/src/harness/sensors.ts +55 -8
  139. package/src/harness/spec-coverage.ts +22 -7
  140. package/src/harness/trace.ts +4 -3
  141. package/src/harness/viewpoint-ledger.ts +2 -1
  142. package/src/orchestrator/templates/ai-src/commands/create-test.md +9 -0
  143. package/src/orchestrator/templates/ai-src/commands/delivery.md +103 -18
  144. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +77 -11
  145. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
  146. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +22 -0
@@ -29,19 +29,85 @@ fingerprints). Schema + grouping rules live in the delivery command instructions
29
29
  spec is `docs/spec/delivery-coverage-matrix-spec.md`.
30
30
 
31
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 (mode/layer/
33
- priority recomputed and equal within a group — heuristic oracle-shape/precondition mismatches are
34
- review-level, silenced once approved and unchanged) · D executability (precondition · condition+
35
- data · trigger · oracle all renderable; every `{{var}}` resolves) · E drift (fingerprint mismatch
36
- → back to review) · G review state (proposed groups block the official render; `--preview` renders
37
- a DRAFT watermark).
38
-
39
- **Workbook**: `Testcases` sheet (parent rows + outline-level-1 variant sub-rows — collapse for the
40
- customer view, expand to execute; result roll-up failed→blocked→not_run→partial→passed, counts like
41
- `7/8 Passed · 1 Failed`) + `Coverage` sheet (target × category grid with explicit `—` gaps,
42
- dispositions, generation manifest). CSV is flat with a `Level` column (`item`/`variant`).
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.
43
90
  `delivery_item_count` ≠ progress — variants are the execution metric.
44
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
+
45
111
  ---
46
112
 
47
113
  ## Legacy mode (--legacy / --full)
@@ -288,6 +288,7 @@ Options: `nth` `exact` `scope` `match` `variant` `frame` `contenteditable` `colu
288
288
 
289
289
  | Tag | Effect |
290
290
  |---|---|
291
+ | `@spec:<id>` | **Traceability**: this scenario proves requirement `<id>` from `requirements/spec.md` (`@spec:FR-003`). Repeatable — a scenario may prove several. Read by `sungen audit` (requirement coverage) and by delivery (the Coverage sheet's requirement table). Without it the link is only inferred from wording and cannot survive an edit. |
291
292
  | `@manual` | Skip in generation |
292
293
  | `@auth:role` | Use auth storage state for role |
293
294
  | `@no-auth` | Disable inherited auth |
@@ -4,6 +4,28 @@ description: 'Use when create-test needs to translate spec.md/Figma/UI into .fea
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
+
8
+ ## Traceability — tag the requirement each scenario proves
9
+
10
+ Every requirement id in `requirements/spec.md` (`FR-`/`TR-`/`NFR-`) must be reachable from a
11
+ scenario, and the link must be **written down, not inferred**:
12
+
13
+ ```gherkin
14
+ @high @spec:FR-003
15
+ Scenario: VP-VAL-002 An email in an invalid format shows the format error
16
+ ```
17
+
18
+ - Put `@spec:<id>` on the scenario that actually proves the requirement; repeat the tag when one
19
+ scenario proves several (`@spec:FR-003 @spec:FR-004`).
20
+ - One requirement may be proved by several scenarios — tag each of them.
21
+ - A requirement you deliberately do not cover here (performance budget, i18n suite, server-side
22
+ concern) needs no tag; record it later in the delivery map's `requirements:` section with a
23
+ status and reason.
24
+ - Why it matters: `sungen audit` also counts a requirement as covered when its keywords merely
25
+ resemble a scenario title, and reports `SPEC-TRACE-IMPLICIT` for those. Delivery's requirement
26
+ table follows **only** the explicit tag — an untagged requirement reads as an uncovered gap in
27
+ the customer-facing coverage sheet even when a scenario does prove it.
28
+
7
29
  ## ⚠️ Gotchas — read before generating
8
30
 
9
31
  - **Field-level test-data follows the Data Factory standard — don't hand-invent values.** When the unit has input fields, the field values (valid / boundary / invalid + error codes) come from the **`sungen-data-factory`** catalog via a field-map + `sungen data gen` (create-test step 5.3), not free-form guessing. Weave the standardized boundary/invalid sets into `@cases` with `CHK-*` trace. This skill still owns scenario structure, viewpoints, and non-field oracles.