@sun-asterisk/sungen 3.2.15 → 3.2.16-beta.2

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 (89) hide show
  1. package/dist/cli/commands/delivery.d.ts.map +1 -1
  2. package/dist/cli/commands/delivery.js +139 -1
  3. package/dist/cli/commands/delivery.js.map +1 -1
  4. package/dist/dashboard/templates/index.html +1 -1
  5. package/dist/exporters/feature-parser.js +1 -1
  6. package/dist/exporters/feature-parser.js.map +1 -1
  7. package/dist/exporters/matrix/build.d.ts +43 -0
  8. package/dist/exporters/matrix/build.d.ts.map +1 -0
  9. package/dist/exporters/matrix/build.js +403 -0
  10. package/dist/exporters/matrix/build.js.map +1 -0
  11. package/dist/exporters/matrix/export.d.ts +49 -0
  12. package/dist/exporters/matrix/export.d.ts.map +1 -0
  13. package/dist/exporters/matrix/export.js +143 -0
  14. package/dist/exporters/matrix/export.js.map +1 -0
  15. package/dist/exporters/matrix/fingerprint.d.ts +20 -0
  16. package/dist/exporters/matrix/fingerprint.d.ts.map +1 -0
  17. package/dist/exporters/matrix/fingerprint.js +83 -0
  18. package/dist/exporters/matrix/fingerprint.js.map +1 -0
  19. package/dist/exporters/matrix/gates.d.ts +21 -0
  20. package/dist/exporters/matrix/gates.d.ts.map +1 -0
  21. package/dist/exporters/matrix/gates.js +295 -0
  22. package/dist/exporters/matrix/gates.js.map +1 -0
  23. package/dist/exporters/matrix/map-loader.d.ts +22 -0
  24. package/dist/exporters/matrix/map-loader.d.ts.map +1 -0
  25. package/dist/exporters/matrix/map-loader.js +191 -0
  26. package/dist/exporters/matrix/map-loader.js.map +1 -0
  27. package/dist/exporters/matrix/render-csv.d.ts +9 -0
  28. package/dist/exporters/matrix/render-csv.d.ts.map +1 -0
  29. package/dist/exporters/matrix/render-csv.js +89 -0
  30. package/dist/exporters/matrix/render-csv.js.map +1 -0
  31. package/dist/exporters/matrix/render-xlsx.d.ts +25 -0
  32. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -0
  33. package/dist/exporters/matrix/render-xlsx.js +362 -0
  34. package/dist/exporters/matrix/render-xlsx.js.map +1 -0
  35. package/dist/exporters/matrix/types.d.ts +175 -0
  36. package/dist/exporters/matrix/types.d.ts.map +1 -0
  37. package/dist/exporters/matrix/types.js +15 -0
  38. package/dist/exporters/matrix/types.js.map +1 -0
  39. package/dist/exporters/matrix/wording.d.ts +45 -0
  40. package/dist/exporters/matrix/wording.d.ts.map +1 -0
  41. package/dist/exporters/matrix/wording.js +150 -0
  42. package/dist/exporters/matrix/wording.js.map +1 -0
  43. package/dist/exporters/scenario-merger.js +1 -1
  44. package/dist/exporters/scenario-merger.js.map +1 -1
  45. package/dist/exporters/spec-parser.js +1 -1
  46. package/dist/exporters/spec-parser.js.map +1 -1
  47. package/dist/exporters/xlsx-report-builder.d.ts +1 -1
  48. package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
  49. package/dist/exporters/xlsx-report-builder.js +3 -3
  50. package/dist/exporters/xlsx-report-builder.js.map +1 -1
  51. package/dist/harness/audit.d.ts.map +1 -1
  52. package/dist/harness/audit.js +6 -1
  53. package/dist/harness/audit.js.map +1 -1
  54. package/dist/harness/capability.d.ts +25 -0
  55. package/dist/harness/capability.d.ts.map +1 -1
  56. package/dist/harness/capability.js +44 -2
  57. package/dist/harness/capability.js.map +1 -1
  58. package/dist/orchestrator/templates/ai-src/commands/create-test.md +1 -1
  59. package/dist/orchestrator/templates/ai-src/commands/delivery.md +144 -120
  60. package/dist/orchestrator/templates/ai-src/config/claude.md +1 -1
  61. package/dist/orchestrator/templates/ai-src/config/copilot.md +1 -1
  62. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +59 -6
  63. package/dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -1
  64. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -0
  65. package/package.json +4 -4
  66. package/src/cli/commands/delivery.ts +169 -2
  67. package/src/dashboard/templates/index.html +1 -1
  68. package/src/exporters/feature-parser.ts +1 -1
  69. package/src/exporters/matrix/build.ts +432 -0
  70. package/src/exporters/matrix/export.ts +134 -0
  71. package/src/exporters/matrix/fingerprint.ts +49 -0
  72. package/src/exporters/matrix/gates.ts +325 -0
  73. package/src/exporters/matrix/map-loader.ts +161 -0
  74. package/src/exporters/matrix/render-csv.ts +91 -0
  75. package/src/exporters/matrix/render-xlsx.ts +356 -0
  76. package/src/exporters/matrix/types.ts +202 -0
  77. package/src/exporters/matrix/wording.ts +157 -0
  78. package/src/exporters/scenario-merger.ts +1 -1
  79. package/src/exporters/spec-parser.ts +1 -1
  80. package/src/exporters/xlsx-report-builder.ts +3 -2
  81. package/src/harness/audit.ts +7 -2
  82. package/src/harness/capability.ts +53 -3
  83. package/src/orchestrator/templates/ai-src/commands/create-test.md +1 -1
  84. package/src/orchestrator/templates/ai-src/commands/delivery.md +144 -120
  85. package/src/orchestrator/templates/ai-src/config/claude.md +1 -1
  86. package/src/orchestrator/templates/ai-src/config/copilot.md +1 -1
  87. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +59 -6
  88. package/src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -1
  89. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -0
@@ -1,21 +1,74 @@
1
1
  ---
2
2
  name: sungen-delivery
3
- description: 'Export Gherkin scenarios + Playwright results CSV test case deliverable. Auto-loaded by delivery command.'
3
+ description: 'Export the Test Case & Coverage Matrix (or the legacy per-scenario CSV) from Gherkin + Playwright results. Auto-loaded by delivery command.'
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
7
  ## Purpose
8
8
 
9
- Export test cases from Sungen screens and flows to a standardized CSV file (format BM-2-901-13) for QA delivery.
9
+ Export test cases from Sungen units to the QA deliverable. Two modes:
10
10
 
11
- **This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source of truth for parsing logic — do NOT re-parse files in AI. Your role is only to:
11
+ - **Matrix (default)** the **Test Case & Coverage Matrix**: one row per *delivery item* (one
12
+ target + one test intent + one oracle family); scenarios / `@cases` rows stay as collapsible
13
+ *coverage variant* sub-rows. Built for review, manual execution, customer hand-off, and
14
+ reporting — no numbered step dumps.
15
+ - **Legacy (`--legacy`/`--full`)** — the classic per-scenario BM-2-901-13 workbook (documented
16
+ in the second half of this skill; unchanged).
12
17
 
13
- 1. Invoke the CLI
14
- 2. Show its output verbatim
15
- 3. Help the user react to pre-flight failures
18
+ **This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source
19
+ of truth for parsing + gating. The AI's only semantic contribution is **proposing the Delivery
20
+ Map** (grouping) — everything else is: invoke the CLI, show output verbatim, help on failures.
16
21
 
17
22
  ---
18
23
 
24
+ ## Matrix mode — the Delivery Map
25
+
26
+ `qa/<screens|flows|api>/<unit>/delivery/<unit>.map.yaml` — committed, AI-proposed
27
+ (`review: proposed`), gate-validated, QA-approved (`sungen delivery --approve` stamps scenario
28
+ fingerprints). Schema + grouping rules live in the delivery command instructions; the normative
29
+ spec is `docs/spec/delivery-coverage-matrix-spec.md`.
30
+
31
+ **Gates** (CLI `--check`): A source (VP-ids unique, oracle present, Background setup-only) ·
32
+ B mapping (every scenario in exactly one group XOR one disposition) · C aggregation (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; **no template token may survive
36
+ into a rendered cell** — test-data cross-references are resolved for display) · E drift
37
+ (fingerprint mismatch → back to review) · G review state (proposed groups block the official
38
+ render; `--preview` renders a DRAFT watermark) · R requirement coverage (spec FR/TR/NFR ids with
39
+ no trace and no `requirements:` status → warning) · W wording lint (map intent/oracle containing
40
+ tokens, `[Selector]` refs, DSL phrasing, or generator labels → warning).
41
+
42
+ **Wording normalization (deterministic, after semantic normalization):** DSL steps render as
43
+ controlled manual-test English without changing meaning — actions in the imperative (`User fill
44
+ [Email] field with X` → `Enter X in the Email field.`), expected results as observable assertions
45
+ (`User see [Jobs] page` → `The Jobs page is displayed.`), preconditions as states (`The user is
46
+ signed out.`). Manual `# Tester verifies:` labels become structured fields: `Setup:` →
47
+ Precondition, `Action:` → Action, `Observable:` → Expected Result, `Oracle:` → a separate
48
+ `Verification method:` line. Sequence-sensitive flows keep event order: actions numbered with
49
+ mid-flow assertions inline as `Verify: …`; only the final Then block is the Expected Result.
50
+ Empty test values render as `(empty)`.
51
+
52
+ **Workbook**: `Testcases` sheet — parent rows + outline-level-1 variant sub-rows for **every**
53
+ item (single-variant included: the sub-row carries the source VP-id, resolved data, and the
54
+ result/evidence entry). Collapse outline for the customer view, expand to execute. Variant Result
55
+ cells have a dropdown (Passed/Failed/Blocked/Pending/N/A) and the parent Result is a **live Excel
56
+ formula** over its children (failed→blocked→pending→partial→passed, e.g. `2/3 Passed · 1 Failed`)
57
+ — a parent can never contradict its variants, even after manual edits. ID + Target columns are
58
+ frozen; dates are ISO (`2026-08-04`). `Coverage` sheet — requirement coverage table (every FR/TR/
59
+ NFR id with an explicit status), target × category grid with explicit `—` gaps, dispositions,
60
+ manifest. CSV is flat with a `Level` column (`item`/`variant`) + a requirement-coverage appendix.
61
+ `delivery_item_count` ≠ progress — variants are the execution metric.
62
+
63
+ **Authoring guidance the matrix rewards** (create-test side): payload/provider matrices (SQLi
64
+ payload lists, OAuth provider sets) belong in `@cases` datasets so each case is an atomic,
65
+ independently-reportable variant; keep dataset `case:` labels short and stable (`CHK-EMAIL-I1`),
66
+ with descriptions in other columns — the label is part of the variant's identity.
67
+
68
+ ---
69
+
70
+ ## Legacy mode (--legacy / --full)
71
+
19
72
  ## Architecture
20
73
 
21
74
  ```
@@ -66,7 +66,7 @@ Use these when repairing GATE/DEPTH findings for the hard viewpoints (cart/detai
66
66
  2. **Stop when** `gateStatus == PASS` AND `findings` empty — or budget exhausted.
67
67
  3. **Never fake a pass.** A shallow `see [Cart] page` does not satisfy `cart-correctness`. If a gap is genuinely cross-screen or needs capabilities the DSL lacks (e.g. capture an element value to compare elsewhere), **report it as a residual gap / flow item** instead of forcing a green gate.
68
68
  4. **EP/data families are OK.** A `duplicates` cluster with `sameDataLikely=false` is an intentional equivalence-partition family (e.g. many invalid-email cases) — keep it; only collapse `sameDataLikely=true` exact duplicates.
69
- 5. **Advisory findings — surface, don't gate.** `MANUAL-REASON-MISMATCH` → fix the scenario's `@manual:Mx` code (so the planner recommends the right driver) during repair. `CAPABILITY-SUGGESTION` → **present it to the user as a next-step option** (e.g. "N @manual could be automated — `sungen capability add api db`?"), **recommend-only — never auto-install**. Neither fails the gate.
69
+ 5. **Advisory findings — surface, don't gate.** `MANUAL-REASON-MISMATCH` → fix the scenario's `@manual:Mx` code (so the planner recommends the right driver) during repair. `CAPABILITY-SUGGESTION` → **present it to the user as a next-step option** (e.g. "N @manual could be automated — `sungen capability add api db`?"), **recommend-only — never auto-install**. `VERIFICATION-OUT-OF-SCOPE (api|db)` → the unit uses `@api`/`@query`/`@requires:api|db` verification the project's recorded **test type** never opted into (E2E/UI-only per `capabilities.yaml`, and the viewpoint doesn't ask for it). During repair: **rewrite the oracle to be UI-observable** (or downgrade the deep check to an `(optional deep check: …)` note); only keep the API/DB verification if the project genuinely tests that layer — then record it (`verification: [ui, api]` / `sungen capability add`). Keep API/DB-in-E2E to the ≤20% band. Neither of these fails the gate.
70
70
 
71
71
  ## Discovery / fallback tree (when input is limited)
72
72
 
@@ -328,6 +328,7 @@ Security: [S1 – admin only]
328
328
  Gate (`SG-W008`, both directions): a `@manual` with Gherkin steps but no `Then` fires — comments (even labeled `Oracle:` lines) can NOT substitute for the missing `Then`. A `@manual` with NO steps ALSO fires when its comments lack ≥1 numbered action line + ≥1 labeled `Observable:`/`Oracle:`/`Expected:` line — prose paragraphs and rationale-only comments export EMPTY Steps/Expected cells.
329
329
  In shape A the observable/oracle lines MUST carry their **label** (`Observable:` / `Oracle:` / `Expected:`) — the delivery parser extracts Expected results **by label**; unlabeled prose all lands in the Steps column and the Expected cell exports EMPTY. And the numbered action steps MUST precede them — without the actions the tester has an oracle but no procedure.
330
330
  **Oracle layer must match the unit** — a screen-unit manual defaults to a **UI oracle**: phrase the expected as what the tester SEES (on-screen message, list/table state after reload). If the business effect IS UI-observable, do NOT cite API responses or DB state as the oracle — "server rejects the request" is verified by *the error message on screen + no new row after reload*, not by reading the API response. Only when the effect has NO UI observation (mail content, stored hash, request count, response-body leak) may the oracle use another layer — then: (a) put the **layer label inside the line**: `Oracle: UI — …` / `Oracle: API — …` / `Oracle: DB — …` so QA knows the tooling needed from the deliverable alone; (b) tag `@manual:M2` so the capability planner recommends the api/db driver; (c) prefer the automation-ready `@requires:api`/`@query` form when the steps are expressible. A deep engineering check may ride along as `(optional deep check: …)` appended to the UI oracle — it must never REPLACE a UI-observable oracle.
331
+ **Respect the project's VERIFICATION SCOPE (the recorded test type).** Read `qa/capabilities.yaml` — the effective scope is `verification:` if set, else derived from `enabled` (`ui` always; `api`/`db` only if that driver is on). If the project is **E2E/UI-only** (no `api`/`db`) **and the test-viewpoint does not ask for API/DB verification**, do **NOT** author `@api`/`@query`/`@requires:api|db` verification — keep the oracle **UI-observable**, or leave the deep check as an `(optional deep check: …)` note. Author API/DB verification only when the scope (or an explicit viewpoint) calls for it, and even then keep the API/DB-in-E2E combination to a **≤20% band** of scenarios (the effects with no UI observation) — never the default. `sungen audit` reports `VERIFICATION-OUT-OF-SCOPE` when a unit uses API/DB verify the project never opted into.
331
332
  Use this comment shape:
332
333
  ```gherkin
333
334
  @high @manual