@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
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Canonical scenario fingerprints for the Delivery Map drift detector (Gate E).
3
+ *
4
+ * A fingerprint hashes what changes the MEANING of a variant: sorted tags + ordered
5
+ * step text (+ the dataset row for a @cases variant). Formatting, comments, and
6
+ * scenario order do NOT change it. `--approve` stamps these into the map; a later
7
+ * mismatch drops the group back to review (stale grouping).
8
+ */
9
+ import { ScenarioMetadata } from '../types';
10
+ /**
11
+ * Fingerprint one scenario. Tags are sorted (order is presentation); steps keep
12
+ * their order (order is meaning). Manual scenarios include their procedure
13
+ * comments — for them the comments ARE the test.
14
+ */
15
+ export declare function scenarioFingerprint(sc: ScenarioMetadata, datasetRow?: Record<string, unknown>): string;
16
+ /** Fingerprint of the whole source (all variants) — manifest `sourceFingerprint`. */
17
+ export declare function combinedFingerprint(parts: string[]): string;
18
+ /** Fingerprint of the map's semantic content (groups + dispositions, not stamps). */
19
+ export declare function mapContentFingerprint(groups: unknown, dispositions: unknown): string;
20
+ //# sourceMappingURL=fingerprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../../src/exporters/matrix/fingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAe5C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAQtG;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE3D;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAEpF"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /**
3
+ * Canonical scenario fingerprints for the Delivery Map drift detector (Gate E).
4
+ *
5
+ * A fingerprint hashes what changes the MEANING of a variant: sorted tags + ordered
6
+ * step text (+ the dataset row for a @cases variant). Formatting, comments, and
7
+ * scenario order do NOT change it. `--approve` stamps these into the map; a later
8
+ * mismatch drops the group back to review (stale grouping).
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.scenarioFingerprint = scenarioFingerprint;
45
+ exports.combinedFingerprint = combinedFingerprint;
46
+ exports.mapContentFingerprint = mapContentFingerprint;
47
+ const crypto = __importStar(require("crypto"));
48
+ /** Stable stringify: objects get sorted keys so row column order can't shift the hash. */
49
+ function canonical(value) {
50
+ if (value === null || typeof value !== 'object')
51
+ return JSON.stringify(value);
52
+ if (Array.isArray(value))
53
+ return `[${value.map(canonical).join(',')}]`;
54
+ const obj = value;
55
+ const keys = Object.keys(obj).sort();
56
+ return `{${keys.map((k) => `${JSON.stringify(k)}:${canonical(obj[k])}`).join(',')}}`;
57
+ }
58
+ function sha1(text) {
59
+ return 'sha1:' + crypto.createHash('sha1').update(text, 'utf-8').digest('hex');
60
+ }
61
+ /**
62
+ * Fingerprint one scenario. Tags are sorted (order is presentation); steps keep
63
+ * their order (order is meaning). Manual scenarios include their procedure
64
+ * comments — for them the comments ARE the test.
65
+ */
66
+ function scenarioFingerprint(sc, datasetRow) {
67
+ const body = canonical({
68
+ tags: [...sc.tags].sort(),
69
+ steps: sc.orderedSteps.map((s) => `${s.bucket}:${s.text}`),
70
+ comments: sc.tags.some((t) => t === '@manual' || t.startsWith('@manual:')) ? (sc.comments ?? []) : [],
71
+ row: datasetRow ?? null,
72
+ });
73
+ return sha1(body);
74
+ }
75
+ /** Fingerprint of the whole source (all variants) — manifest `sourceFingerprint`. */
76
+ function combinedFingerprint(parts) {
77
+ return sha1(canonical([...parts].sort()));
78
+ }
79
+ /** Fingerprint of the map's semantic content (groups + dispositions, not stamps). */
80
+ function mapContentFingerprint(groups, dispositions) {
81
+ return sha1(canonical({ groups, dispositions }));
82
+ }
83
+ //# sourceMappingURL=fingerprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../../src/exporters/matrix/fingerprint.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBH,kDAQC;AAGD,kDAEC;AAGD,sDAEC;AAvCD,+CAAiC;AAGjC,0FAA0F;AAC1F,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9E,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACvE,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,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}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Deterministic quality gates for the Test Case & Coverage Matrix
3
+ * (docs/spec/delivery-coverage-matrix-spec.md §6).
4
+ *
5
+ * Severity behavior:
6
+ * error → blocks any render
7
+ * review → blocks the official render; `--preview` renders with a DRAFT watermark
8
+ * warning → prints + renders
9
+ *
10
+ * The gates recompute every signature part from the .feature — the map is never
11
+ * trusted for derivable facts, only for the semantic fields (target/intent/oracle).
12
+ */
13
+ import { CoverageVariant, MatrixFinding } from './types';
14
+ import { BuildInputs } from './build';
15
+ export interface GateContext {
16
+ inputs: BuildInputs;
17
+ variants: CoverageVariant[];
18
+ variantsByVp: Map<string, CoverageVariant[]>;
19
+ }
20
+ export declare function runGates(ctx: GateContext): MatrixFinding[];
21
+ //# sourceMappingURL=gates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../../src/exporters/matrix/gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAyB,MAAM,SAAS,CAAC;AAChF,OAAO,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;CAC9C;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,aAAa,EAAE,CAU1D"}
@@ -0,0 +1,295 @@
1
+ "use strict";
2
+ /**
3
+ * Deterministic quality gates for the Test Case & Coverage Matrix
4
+ * (docs/spec/delivery-coverage-matrix-spec.md §6).
5
+ *
6
+ * Severity behavior:
7
+ * error → blocks any render
8
+ * review → blocks the official render; `--preview` renders with a DRAFT watermark
9
+ * warning → prints + renders
10
+ *
11
+ * The gates recompute every signature part from the .feature — the map is never
12
+ * trusted for derivable facts, only for the semantic fields (target/intent/oracle).
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.runGates = runGates;
16
+ const feature_parser_1 = require("../feature-parser");
17
+ const types_1 = require("./types");
18
+ const build_1 = require("./build");
19
+ function runGates(ctx) {
20
+ const findings = [];
21
+ gateASource(ctx, findings);
22
+ gateBMapping(ctx, findings);
23
+ gateCAggregation(ctx, findings);
24
+ gateDExecutability(ctx, findings);
25
+ gateEDrift(ctx, findings);
26
+ gateGReviewState(ctx, findings);
27
+ gateWWording(ctx, findings);
28
+ return findings;
29
+ }
30
+ // --- Gate A — source quality ------------------------------------------------
31
+ function gateASource(ctx, findings) {
32
+ const { feature, merged } = ctx.inputs;
33
+ if (feature.backgroundWhenSteps.length > 0 || feature.backgroundThenSteps.length > 0) {
34
+ findings.push({
35
+ gate: 'A', severity: 'error',
36
+ message: 'Background contains When/Then steps — setup only; move the action/oracle into scenarios',
37
+ });
38
+ }
39
+ const seen = new Map();
40
+ for (const m of merged) {
41
+ const { vpId } = (0, feature_parser_1.splitVpAndName)(m.feature.name);
42
+ if (!vpId) {
43
+ findings.push({
44
+ gate: 'A', severity: 'error', ref: m.feature.name,
45
+ message: `scenario "${m.feature.name}" has no VP-id prefix — matrix variants must be addressable`,
46
+ });
47
+ continue;
48
+ }
49
+ seen.set(vpId, (seen.get(vpId) ?? 0) + 1);
50
+ const isManual = (0, feature_parser_1.extractTestcaseType)(m.feature.tags) === 'Manual';
51
+ if (m.resolvedExpected.length === 0) {
52
+ findings.push({
53
+ gate: 'A', severity: 'error', ref: vpId,
54
+ message: isManual
55
+ ? `manual scenario ${vpId} has no observable oracle (no Then steps and no Observable/Oracle comment lines)`
56
+ : `scenario ${vpId} has no Then step — a variant without an observable oracle cannot be delivered`,
57
+ });
58
+ }
59
+ }
60
+ for (const [vpId, n] of seen) {
61
+ if (n > 1)
62
+ findings.push({ gate: 'A', severity: 'error', ref: vpId, message: `duplicate VP-id ${vpId} (${n} scenarios)` });
63
+ }
64
+ }
65
+ // --- Gate B — mapping completeness -------------------------------------------
66
+ function gateBMapping(ctx, findings) {
67
+ const { map } = ctx.inputs;
68
+ const { variants, variantsByVp } = ctx;
69
+ // Where each derived variant landed: 0 → unmapped, >1 → double-mapped.
70
+ const owners = new Map();
71
+ for (const g of map.groups) {
72
+ for (const ref of g.variants) {
73
+ const expanded = (0, build_1.expandMapRef)(ref, variantsByVp);
74
+ if (expanded.length === 0) {
75
+ findings.push({
76
+ gate: 'B', severity: 'error', ref: g.id,
77
+ message: `group ${g.id} references ${ref} which matches no scenario/@cases row in the .feature`,
78
+ });
79
+ continue;
80
+ }
81
+ for (const v of expanded) {
82
+ const list = owners.get(v.ref) ?? [];
83
+ list.push(g.id);
84
+ owners.set(v.ref, list);
85
+ }
86
+ }
87
+ }
88
+ for (const [ref, groups] of owners) {
89
+ if (groups.length > 1) {
90
+ findings.push({
91
+ gate: 'B', severity: 'error', ref,
92
+ message: `variant ${ref} belongs to ${groups.length} groups (${groups.join(', ')}) — exactly one required`,
93
+ });
94
+ }
95
+ }
96
+ for (const v of variants) {
97
+ const grouped = owners.has(v.ref);
98
+ const disposed = v.vpId in map.dispositions;
99
+ if (!grouped && !disposed) {
100
+ findings.push({
101
+ gate: 'B', severity: 'error', ref: v.ref,
102
+ message: `variant ${v.ref} is in no group and has no disposition — 100% source disposition is required`,
103
+ });
104
+ }
105
+ if (grouped && disposed) {
106
+ findings.push({
107
+ gate: 'B', severity: 'error', ref: v.ref,
108
+ message: `variant ${v.ref} is grouped AND disposed (${map.dispositions[v.vpId].as}) — pick one`,
109
+ });
110
+ }
111
+ }
112
+ for (const vpId of Object.keys(map.dispositions)) {
113
+ if (!variantsByVp.has(vpId)) {
114
+ findings.push({
115
+ gate: 'B', severity: 'warning', ref: vpId,
116
+ message: `disposition for ${vpId} matches no scenario (stale entry?)`,
117
+ });
118
+ }
119
+ }
120
+ }
121
+ // --- Gate C — aggregation safety ---------------------------------------------
122
+ function gateCAggregation(ctx, findings) {
123
+ const { map } = ctx.inputs;
124
+ const { variantsByVp } = ctx;
125
+ for (const g of map.groups) {
126
+ const vs = g.variants.flatMap((ref) => (0, build_1.expandMapRef)(ref, variantsByVp));
127
+ if (vs.length <= 1)
128
+ continue;
129
+ // Approval IS the QA confirmation of the heuristic parts (oracle family,
130
+ // precondition equivalence, sequence safety) — once approved AND unchanged
131
+ // (fingerprints intact), only the hard signature checks keep firing. A
132
+ // drifted variant re-opens the heuristics (Gate E flips the item to
133
+ // proposed at the same time).
134
+ const stale = vs.some((v) => {
135
+ const stamped = map.fingerprints[v.ref] ?? map.fingerprints[v.vpId];
136
+ return !stamped || stamped !== v.fingerprint;
137
+ });
138
+ const heuristicsConfirmed = g.review === 'approved' && !stale;
139
+ // Hard signature parts — recomputed, never trusted from the map. ERROR on mismatch.
140
+ const hard = [
141
+ ['execution mode', (v) => v.mode],
142
+ ['test layer', (v) => [...v.layers].sort().join('+')],
143
+ ['priority', (v) => v.priority],
144
+ ];
145
+ for (const [label, keyOf] of hard) {
146
+ const distinct = new Set(vs.map(keyOf));
147
+ if (distinct.size > 1) {
148
+ findings.push({
149
+ gate: 'C', severity: 'error', ref: g.id,
150
+ message: `group ${g.id} mixes ${label}s (${[...distinct].join(' vs ')}) — mandatory split`,
151
+ });
152
+ }
153
+ }
154
+ // Heuristic signature parts — REVIEW_REQUIRED (equivalence was inferred, not declared).
155
+ const preProfiles = new Set(vs.map((v) => v.preconditionProfile));
156
+ if (!heuristicsConfirmed && preProfiles.size > 1) {
157
+ findings.push({
158
+ gate: 'C', severity: 'review', ref: g.id,
159
+ message: `group ${g.id} variants have different precondition profiles — confirm the grouping is safe or split`,
160
+ });
161
+ }
162
+ const oracleShapes = new Set(vs.map((v) => v.oracleShape.join(' ; ')));
163
+ if (!heuristicsConfirmed && oracleShapes.size > 1) {
164
+ findings.push({
165
+ gate: 'C', severity: 'review', ref: g.id,
166
+ message: `group ${g.id} variants assert different oracle shapes (${oracleShapes.size} shapes) — confirm they are one oracle family`,
167
+ });
168
+ }
169
+ if (!heuristicsConfirmed && vs.some((v) => v.procedureProfile === 'sequence')) {
170
+ findings.push({
171
+ gate: 'C', severity: 'review', ref: g.id,
172
+ message: `group ${g.id} contains a sequence-sensitive scenario — ordered flows stay solo items unless QA confirms`,
173
+ });
174
+ }
175
+ if (vs.length > types_1.MAX_VARIANTS_PER_ITEM) {
176
+ findings.push({
177
+ gate: 'C', severity: 'warning', ref: g.id,
178
+ message: `group ${g.id} has ${vs.length} variants (> ${types_1.MAX_VARIANTS_PER_ITEM}) — consider splitting for reviewability`,
179
+ });
180
+ }
181
+ }
182
+ }
183
+ // --- Gate D — manual executability -------------------------------------------
184
+ function gateDExecutability(ctx, findings) {
185
+ const { map, testData, feature } = ctx.inputs;
186
+ const { variantsByVp } = ctx;
187
+ for (const g of map.groups) {
188
+ const vs = g.variants.flatMap((ref) => (0, build_1.expandMapRef)(ref, variantsByVp));
189
+ for (const v of vs) {
190
+ const hasPrecondition = v.precondition.length > 0 || feature.backgroundGivenSteps.length > 0;
191
+ if (!hasPrecondition) {
192
+ findings.push({
193
+ gate: 'D', severity: 'error', ref: v.ref,
194
+ message: `${v.ref}: no precondition (no Background, auth tag, or Given) — a tester cannot establish the start state`,
195
+ });
196
+ }
197
+ if (v.trigger.length === 0) {
198
+ findings.push({
199
+ gate: 'D', severity: 'error', ref: v.ref,
200
+ message: `${v.ref}: no action/trigger (no When steps${v.mode === 'manual' ? ' and no Setup/Action comment lines' : ''})`,
201
+ });
202
+ }
203
+ // Oracle emptiness is Gate A (source) — not repeated here.
204
+ }
205
+ }
206
+ // Every {{var}} must resolve — data the tester cannot obtain is not executable.
207
+ for (const [vpId, vs] of variantsByVp) {
208
+ const scenario = ctx.inputs.merged.find((m) => (0, feature_parser_1.splitVpAndName)(m.feature.name).vpId === vpId);
209
+ if (!scenario)
210
+ continue;
211
+ for (const varName of scenario.feature.referencedVars) {
212
+ const inRows = vs.some((v) => v.caseLabel !== undefined); // dataset rows carry their own columns
213
+ if (!inRows && (!testData || !(varName in testData))) {
214
+ findings.push({
215
+ gate: 'D', severity: 'error', ref: vpId,
216
+ message: `${vpId}: {{${varName}}} does not resolve in test-data — the variant is not reproducible`,
217
+ });
218
+ }
219
+ }
220
+ }
221
+ // No template token may survive into a RENDERED cell (review B-04) — this also
222
+ // catches cross-referencing test-data values the one-level resolver couldn't close.
223
+ for (const [, vs] of variantsByVp) {
224
+ for (const v of vs) {
225
+ const rendered = [...v.precondition, ...v.trigger, ...v.oracle, ...v.verification, ...v.data];
226
+ const token = rendered.map((t) => t.match(/\{\{[^}]*\}\}/)).find(Boolean);
227
+ if (token) {
228
+ findings.push({
229
+ gate: 'D', severity: 'error', ref: v.ref,
230
+ message: `${v.ref}: unresolved template token ${token[0]} remains in the rendered output — the export is not deterministic for a tester`,
231
+ });
232
+ }
233
+ }
234
+ }
235
+ }
236
+ // --- Gate E — drift (stale approval) ------------------------------------------
237
+ function gateEDrift(ctx, findings) {
238
+ const { map } = ctx.inputs;
239
+ const { variantsByVp } = ctx;
240
+ for (const g of map.groups) {
241
+ if (g.review !== 'approved')
242
+ continue; // proposed groups are already under review
243
+ for (const ref of g.variants) {
244
+ const vs = (0, build_1.expandMapRef)(ref, variantsByVp);
245
+ for (const v of vs) {
246
+ const stamped = map.fingerprints[v.ref] ?? map.fingerprints[v.vpId];
247
+ if (!stamped) {
248
+ findings.push({
249
+ gate: 'E', severity: 'review', ref: g.id,
250
+ message: `group ${g.id}: ${v.ref} has no stamped fingerprint — run \`sungen delivery --approve\` after review`,
251
+ });
252
+ }
253
+ else if (stamped !== v.fingerprint) {
254
+ findings.push({
255
+ gate: 'E', severity: 'review', ref: g.id,
256
+ message: `group ${g.id}: ${v.ref} changed since approval (fingerprint drift) — re-review the grouping`,
257
+ });
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
263
+ // --- Gate W — controlled-language lint on the map's semantic fields --------------
264
+ /** Patterns that make customer-facing wording read machine-generated (review §10). */
265
+ const WORDING_SMELLS = [
266
+ [/\{\{[^}]*\}\}/, 'an unresolved {{token}}'],
267
+ [/\b(?:Setup|Observable|Oracle):/, 'a generator label (Setup:/Observable:/Oracle:)'],
268
+ [/\bUser (?:fill|click|press|see|wait)\b/i, 'DSL phrasing ("User fill/click/see…") — write plain product language'],
269
+ [/\[[^\]]+\]/, 'a [selector-style] reference — use the visible UI label'],
270
+ ];
271
+ function gateWWording(ctx, findings) {
272
+ for (const g of ctx.inputs.map.groups) {
273
+ for (const [field, text] of [['intent', g.intent], ['oracle', g.oracle]]) {
274
+ for (const [re, what] of WORDING_SMELLS) {
275
+ if (re.test(text)) {
276
+ findings.push({
277
+ gate: 'W', severity: 'warning', ref: g.id,
278
+ message: `group ${g.id} ${field} contains ${what}`,
279
+ });
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ // --- Gate G — review state -----------------------------------------------------
286
+ function gateGReviewState(ctx, findings) {
287
+ const proposed = ctx.inputs.map.groups.filter((g) => g.review !== 'approved');
288
+ if (proposed.length > 0) {
289
+ findings.push({
290
+ gate: 'G', severity: 'review',
291
+ message: `${proposed.length} group(s) still \`proposed\` (${proposed.slice(0, 5).map((g) => g.id).join(', ')}${proposed.length > 5 ? ', …' : ''}) — approve them or render with --preview`,
292
+ });
293
+ }
294
+ }
295
+ //# sourceMappingURL=gates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gates.js","sourceRoot":"","sources":["../../../src/exporters/matrix/gates.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAYH,4BAUC;AApBD,sDAAwE;AACxE,mCAAgF;AAChF,mCAAoD;AAQpD,SAAgB,QAAQ,CAAC,GAAgB;IACvC,MAAM,QAAQ,GAAoB,EAAE,CAAC;IACrC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC3B,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC5B,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAChC,kBAAkB,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ids).
5
+ * Semantic validation against the .feature is the gates' job (gates.ts) — the loader
6
+ * never reads the feature.
7
+ */
8
+ import { DeliveryMap } from './types';
9
+ export interface MapLoadResult {
10
+ map: DeliveryMap | null;
11
+ /** Structural problems — any entry blocks the matrix path (fix the file first). */
12
+ errors: string[];
13
+ }
14
+ /** Path of the map file for a unit directory (qa/<kind>/<screen>) + feature basename. */
15
+ export declare function mapFilePath(unitDir: string, featureBaseName: string): string;
16
+ export declare function loadDeliveryMap(file: string): MapLoadResult;
17
+ /**
18
+ * Write the map back (used by `--approve` to flip review states + stamp fingerprints).
19
+ * Field order is kept stable so approve-diffs stay minimal and reviewable.
20
+ */
21
+ export declare function writeDeliveryMap(file: string, map: DeliveryMap): void;
22
+ //# sourceMappingURL=map-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-loader.d.ts","sourceRoot":"","sources":["../../../src/exporters/matrix/map-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,WAAW,EAA8F,MAAM,SAAS,CAAC;AAQlI,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxB,mFAAmF;IACnF,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAwG3D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAoBrE"}