@sun-asterisk/sungen 3.2.15 → 3.2.16-beta.1
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/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +138 -1
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/dashboard/templates/index.html +1 -1
- package/dist/exporters/feature-parser.js +1 -1
- package/dist/exporters/feature-parser.js.map +1 -1
- package/dist/exporters/matrix/build.d.ts +36 -0
- package/dist/exporters/matrix/build.d.ts.map +1 -0
- package/dist/exporters/matrix/build.js +267 -0
- package/dist/exporters/matrix/build.js.map +1 -0
- package/dist/exporters/matrix/export.d.ts +47 -0
- package/dist/exporters/matrix/export.d.ts.map +1 -0
- package/dist/exporters/matrix/export.js +136 -0
- package/dist/exporters/matrix/export.js.map +1 -0
- package/dist/exporters/matrix/fingerprint.d.ts +20 -0
- package/dist/exporters/matrix/fingerprint.d.ts.map +1 -0
- package/dist/exporters/matrix/fingerprint.js +83 -0
- package/dist/exporters/matrix/fingerprint.js.map +1 -0
- package/dist/exporters/matrix/gates.d.ts +21 -0
- package/dist/exporters/matrix/gates.d.ts.map +1 -0
- package/dist/exporters/matrix/gates.js +258 -0
- package/dist/exporters/matrix/gates.js.map +1 -0
- package/dist/exporters/matrix/map-loader.d.ts +22 -0
- package/dist/exporters/matrix/map-loader.d.ts.map +1 -0
- package/dist/exporters/matrix/map-loader.js +173 -0
- package/dist/exporters/matrix/map-loader.js.map +1 -0
- package/dist/exporters/matrix/render-csv.d.ts +8 -0
- package/dist/exporters/matrix/render-csv.d.ts.map +1 -0
- package/dist/exporters/matrix/render-csv.js +69 -0
- package/dist/exporters/matrix/render-csv.js.map +1 -0
- package/dist/exporters/matrix/render-xlsx.d.ts +17 -0
- package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -0
- package/dist/exporters/matrix/render-xlsx.js +298 -0
- package/dist/exporters/matrix/render-xlsx.js.map +1 -0
- package/dist/exporters/matrix/types.d.ts +153 -0
- package/dist/exporters/matrix/types.d.ts.map +1 -0
- package/dist/exporters/matrix/types.js +15 -0
- package/dist/exporters/matrix/types.js.map +1 -0
- package/dist/exporters/scenario-merger.js +1 -1
- package/dist/exporters/scenario-merger.js.map +1 -1
- package/dist/exporters/spec-parser.js +1 -1
- package/dist/exporters/spec-parser.js.map +1 -1
- package/dist/exporters/xlsx-report-builder.d.ts +1 -1
- package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
- package/dist/exporters/xlsx-report-builder.js +3 -3
- package/dist/exporters/xlsx-report-builder.js.map +1 -1
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +6 -1
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/capability.d.ts +25 -0
- package/dist/harness/capability.d.ts.map +1 -1
- package/dist/harness/capability.js +44 -2
- package/dist/harness/capability.js.map +1 -1
- package/dist/orchestrator/templates/ai-src/commands/create-test.md +1 -1
- package/dist/orchestrator/templates/ai-src/commands/delivery.md +118 -120
- package/dist/orchestrator/templates/ai-src/config/claude.md +1 -1
- package/dist/orchestrator/templates/ai-src/config/copilot.md +1 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +36 -6
- package/dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -0
- package/package.json +4 -4
- package/src/cli/commands/delivery.ts +168 -2
- package/src/dashboard/templates/index.html +1 -1
- package/src/exporters/feature-parser.ts +1 -1
- package/src/exporters/matrix/build.ts +294 -0
- package/src/exporters/matrix/export.ts +124 -0
- package/src/exporters/matrix/fingerprint.ts +49 -0
- package/src/exporters/matrix/gates.ts +284 -0
- package/src/exporters/matrix/map-loader.ts +142 -0
- package/src/exporters/matrix/render-csv.ts +71 -0
- package/src/exporters/matrix/render-xlsx.ts +289 -0
- package/src/exporters/matrix/types.ts +176 -0
- package/src/exporters/scenario-merger.ts +1 -1
- package/src/exporters/spec-parser.ts +1 -1
- package/src/exporters/xlsx-report-builder.ts +3 -2
- package/src/harness/audit.ts +7 -2
- package/src/harness/capability.ts +53 -3
- package/src/orchestrator/templates/ai-src/commands/create-test.md +1 -1
- package/src/orchestrator/templates/ai-src/commands/delivery.md +118 -120
- package/src/orchestrator/templates/ai-src/config/claude.md +1 -1
- package/src/orchestrator/templates/ai-src/config/copilot.md +1 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +36 -6
- package/src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Build the matrix model: derive atomic coverage variants from the merged
|
|
4
|
+
* feature/spec view, assemble delivery items per the Delivery Map, attach
|
|
5
|
+
* per-variant Playwright results, and roll parents up (derived only — Gate F
|
|
6
|
+
* is structural: there is no independent parent result input).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.deriveVariants = deriveVariants;
|
|
10
|
+
exports.rollUp = rollUp;
|
|
11
|
+
exports.expandMapRef = expandMapRef;
|
|
12
|
+
exports.buildMatrix = buildMatrix;
|
|
13
|
+
const scenario_merger_1 = require("../scenario-merger");
|
|
14
|
+
const feature_parser_1 = require("../feature-parser");
|
|
15
|
+
const result_variants_1 = require("../result-variants");
|
|
16
|
+
const test_data_resolver_1 = require("../test-data-resolver");
|
|
17
|
+
const fingerprint_1 = require("./fingerprint");
|
|
18
|
+
const types_1 = require("./types");
|
|
19
|
+
const gates_1 = require("./gates");
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Variant derivation
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
/** Collapse `{{var}}` placeholders so data values become parameters, not shape. */
|
|
24
|
+
function normalizeShape(text) {
|
|
25
|
+
return text.replace(/\{\{[^}]*\}\}/g, '{{*}}').replace(/\s+/g, ' ').trim();
|
|
26
|
+
}
|
|
27
|
+
function deriveLayers(tags) {
|
|
28
|
+
const layers = new Set(['ui']);
|
|
29
|
+
if (tags.some((t) => t === '@api' || t.startsWith('@api:') || t === '@requires:api'))
|
|
30
|
+
layers.add('api');
|
|
31
|
+
if (tags.some((t) => t.startsWith('@query') || t === '@requires:db'))
|
|
32
|
+
layers.add('db');
|
|
33
|
+
return Array.from(layers);
|
|
34
|
+
}
|
|
35
|
+
/** 'simple' single G*→W*→T* pass; 'sequence' when the flow re-enters Given/When after a Then. */
|
|
36
|
+
function deriveProcedureProfile(m) {
|
|
37
|
+
if ((0, feature_parser_1.extractTestcaseType)(m.feature.tags) === 'Manual')
|
|
38
|
+
return 'manual';
|
|
39
|
+
const order = m.feature.orderedSteps.map((s) => s.bucket);
|
|
40
|
+
let seenThen = false;
|
|
41
|
+
for (const bucket of order) {
|
|
42
|
+
if (bucket === 'then')
|
|
43
|
+
seenThen = true;
|
|
44
|
+
else if (seenThen)
|
|
45
|
+
return 'sequence'; // action/setup after an assertion → ordered flow
|
|
46
|
+
}
|
|
47
|
+
return 'simple';
|
|
48
|
+
}
|
|
49
|
+
function manualReason(tags) {
|
|
50
|
+
const t = tags.find((x) => x.startsWith('@manual:'));
|
|
51
|
+
return t ? t.slice('@manual:'.length) : undefined;
|
|
52
|
+
}
|
|
53
|
+
/** Resolve `{{var}}` refs of a scenario into display `key: value` pairs. */
|
|
54
|
+
function resolveDataPairs(vars, testData, row) {
|
|
55
|
+
const pairs = [];
|
|
56
|
+
if (row) {
|
|
57
|
+
for (const [k, v] of Object.entries(row)) {
|
|
58
|
+
if (k.startsWith('__') || k === 'case' || k === 'name' || k === 'label')
|
|
59
|
+
continue;
|
|
60
|
+
pairs.push(`${k}: ${String(v)}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const v of vars) {
|
|
64
|
+
const val = row && v in row ? undefined : testData?.[v]; // row columns already listed
|
|
65
|
+
if (val !== undefined)
|
|
66
|
+
pairs.push(`${v}: ${val}`);
|
|
67
|
+
}
|
|
68
|
+
return pairs;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Derive every atomic coverage variant of the unit (one per scenario, or one per
|
|
72
|
+
* `@cases` dataset row). Exported separately so the gates + the map-proposal
|
|
73
|
+
* support tooling see the same universe the builder does.
|
|
74
|
+
*/
|
|
75
|
+
function deriveVariants(inputs) {
|
|
76
|
+
const { merged, testData, results } = inputs;
|
|
77
|
+
const variants = [];
|
|
78
|
+
for (const m of merged) {
|
|
79
|
+
const { vpId, category1 } = (0, feature_parser_1.splitVpAndName)(m.feature.name);
|
|
80
|
+
if (!vpId)
|
|
81
|
+
continue; // Gate A reports it — no variant can be addressed without a VP-id
|
|
82
|
+
const tags = m.feature.tags;
|
|
83
|
+
const mode = (0, feature_parser_1.extractTestcaseType)(tags) === 'Manual' ? 'manual' : 'auto';
|
|
84
|
+
const authRole = (0, feature_parser_1.extractAuthRole)(tags);
|
|
85
|
+
const vpCategory = vpId.replace(/^VP-/, '').replace(/-\d+[a-zA-Z]?$/, '');
|
|
86
|
+
// Manual procedure comes from the parsed comment block; auto from Gherkin buckets.
|
|
87
|
+
const manual = mode === 'manual' && m.feature.comments?.length
|
|
88
|
+
? (0, scenario_merger_1.parseManualComments)(m.feature.comments)
|
|
89
|
+
: null;
|
|
90
|
+
// A pure-render check (Given + Then only) is triggered by the page load itself —
|
|
91
|
+
// that IS its action, not a Gate-D executability gap.
|
|
92
|
+
const rawTrigger = manual ? manual.steps.map((s) => s.text) : m.feature.rawWhenSteps;
|
|
93
|
+
const triggerSteps = rawTrigger.length > 0 ? rawTrigger : ['(on page load)'];
|
|
94
|
+
const oracleSteps = m.resolvedExpected.map((s) => s.text);
|
|
95
|
+
const preconditionProfile = [
|
|
96
|
+
authRole ?? '-',
|
|
97
|
+
m.feature.extendsName ?? '-',
|
|
98
|
+
...m.feature.rawGivenSteps.map(normalizeShape),
|
|
99
|
+
].join(' | ');
|
|
100
|
+
const precondition = [
|
|
101
|
+
...(authRole ? [authRole === 'no-auth' ? 'Not authenticated' : `Authenticated as ${authRole}`] : []),
|
|
102
|
+
...m.feature.rawGivenSteps,
|
|
103
|
+
];
|
|
104
|
+
const base = {
|
|
105
|
+
vpId,
|
|
106
|
+
vpCategory,
|
|
107
|
+
priority: (0, feature_parser_1.extractPriority)(tags),
|
|
108
|
+
mode: mode,
|
|
109
|
+
manualReason: manualReason(tags),
|
|
110
|
+
layers: deriveLayers(tags),
|
|
111
|
+
traces: tags.filter((t) => t.startsWith('@spec:')).map((t) => t.slice('@spec:'.length)),
|
|
112
|
+
triggerShape: triggerSteps.map(normalizeShape),
|
|
113
|
+
oracleShape: oracleSteps.map(normalizeShape),
|
|
114
|
+
preconditionProfile,
|
|
115
|
+
precondition,
|
|
116
|
+
procedureProfile: deriveProcedureProfile(m),
|
|
117
|
+
};
|
|
118
|
+
const rows = (0, result_variants_1.getCasesDatasetRows)(m, testData ?? undefined);
|
|
119
|
+
if (rows) {
|
|
120
|
+
// One variant per dataset row; results matched per row label by the shared resolver.
|
|
121
|
+
const resultVariants = (0, result_variants_1.resolveResultVariants)(m, results ?? null, testData ?? undefined);
|
|
122
|
+
const resultByLabel = new Map(resultVariants.map((rv) => [rv.nameSuffix.replace(/^ — /, ''), rv.result]));
|
|
123
|
+
rows.forEach((row, i) => {
|
|
124
|
+
const label = String(row.case ?? row.name ?? row.label ?? `row ${i + 1}`);
|
|
125
|
+
variants.push({
|
|
126
|
+
...base,
|
|
127
|
+
ref: `${vpId}#${label}`,
|
|
128
|
+
caseLabel: label,
|
|
129
|
+
title: `${category1} — ${label}`,
|
|
130
|
+
condition: label,
|
|
131
|
+
data: resolveDataPairs(m.feature.referencedVars, testData, row),
|
|
132
|
+
trigger: triggerSteps.map((s) => (0, test_data_resolver_1.substituteTestDataVars)(s, { ...(testData ?? {}), ...rowAsStrings(row) })),
|
|
133
|
+
oracle: oracleSteps.map((s) => (0, test_data_resolver_1.substituteTestDataVars)(s, { ...(testData ?? {}), ...rowAsStrings(row) })),
|
|
134
|
+
fingerprint: (0, fingerprint_1.scenarioFingerprint)(m.feature, row),
|
|
135
|
+
result: resultByLabel.get(label),
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
variants.push({
|
|
141
|
+
...base,
|
|
142
|
+
ref: vpId,
|
|
143
|
+
title: category1,
|
|
144
|
+
condition: category1,
|
|
145
|
+
data: resolveDataPairs(m.feature.referencedVars, testData),
|
|
146
|
+
trigger: triggerSteps.map((s) => (0, test_data_resolver_1.substituteTestDataVars)(s, testData ?? {})),
|
|
147
|
+
oracle: oracleSteps.map((s) => (0, test_data_resolver_1.substituteTestDataVars)(s, testData ?? {})),
|
|
148
|
+
fingerprint: (0, fingerprint_1.scenarioFingerprint)(m.feature),
|
|
149
|
+
result: (0, result_variants_1.resolveResultVariants)(m, results ?? null, testData ?? undefined)[0]?.result,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return variants;
|
|
154
|
+
}
|
|
155
|
+
function rowAsStrings(row) {
|
|
156
|
+
const out = {};
|
|
157
|
+
for (const [k, v] of Object.entries(row))
|
|
158
|
+
out[k] = String(v);
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
// Item assembly + roll-up
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
function classifyResult(r) {
|
|
165
|
+
if (!r)
|
|
166
|
+
return 'notRun';
|
|
167
|
+
if (r.status === 'passed')
|
|
168
|
+
return 'passed';
|
|
169
|
+
if (r.status === 'failed' || r.status === 'timedOut')
|
|
170
|
+
return 'failed';
|
|
171
|
+
if (r.status === 'interrupted')
|
|
172
|
+
return 'blocked';
|
|
173
|
+
return 'notRun'; // skipped / unknown
|
|
174
|
+
}
|
|
175
|
+
/** Derived parent result — precedence: failed → blocked → not_run → partial → passed. */
|
|
176
|
+
function rollUp(variants) {
|
|
177
|
+
const counts = { passed: 0, failed: 0, blocked: 0, notRun: 0 };
|
|
178
|
+
for (const v of variants)
|
|
179
|
+
counts[classifyResult(v.result)]++;
|
|
180
|
+
const run = counts.passed + counts.failed + counts.blocked;
|
|
181
|
+
let result;
|
|
182
|
+
if (counts.failed > 0)
|
|
183
|
+
result = 'failed';
|
|
184
|
+
else if (counts.blocked > 0)
|
|
185
|
+
result = 'blocked';
|
|
186
|
+
else if (run === 0)
|
|
187
|
+
result = 'not_run';
|
|
188
|
+
else if (counts.notRun > 0)
|
|
189
|
+
result = 'partial';
|
|
190
|
+
else
|
|
191
|
+
result = 'passed';
|
|
192
|
+
return { result, counts };
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Expand one map variant ref to concrete variant refs:
|
|
196
|
+
* a bare VP-id whose scenario has a dataset means ALL its rows.
|
|
197
|
+
*/
|
|
198
|
+
function expandMapRef(ref, variantsByVp) {
|
|
199
|
+
if (ref.includes('#')) {
|
|
200
|
+
const [vp] = ref.split('#');
|
|
201
|
+
return (variantsByVp.get(vp) ?? []).filter((v) => v.ref === ref);
|
|
202
|
+
}
|
|
203
|
+
return variantsByVp.get(ref) ?? [];
|
|
204
|
+
}
|
|
205
|
+
function buildMatrix(inputs) {
|
|
206
|
+
const { unit, map, transformerVersion } = inputs;
|
|
207
|
+
const variants = deriveVariants(inputs);
|
|
208
|
+
const variantsByVp = new Map();
|
|
209
|
+
for (const v of variants) {
|
|
210
|
+
const list = variantsByVp.get(v.vpId) ?? [];
|
|
211
|
+
list.push(v);
|
|
212
|
+
variantsByVp.set(v.vpId, list);
|
|
213
|
+
}
|
|
214
|
+
const findings = (0, gates_1.runGates)({ inputs, variants, variantsByVp });
|
|
215
|
+
const stale = new Set(findings.filter((f) => f.gate === 'E' && f.ref).map((f) => f.ref));
|
|
216
|
+
const items = map.groups.map((g) => {
|
|
217
|
+
const groupVariants = g.variants.flatMap((ref) => expandMapRef(ref, variantsByVp));
|
|
218
|
+
const { result, counts } = rollUp(groupVariants);
|
|
219
|
+
const first = groupVariants[0];
|
|
220
|
+
const triggerShapes = new Set(groupVariants.map((v) => v.triggerShape.join(' ; ')));
|
|
221
|
+
return {
|
|
222
|
+
id: g.id,
|
|
223
|
+
target: g.target,
|
|
224
|
+
intent: g.intent,
|
|
225
|
+
oracle: g.oracle,
|
|
226
|
+
category: g.category,
|
|
227
|
+
// A stale (drifted) group presents as proposed regardless of its stored state.
|
|
228
|
+
review: stale.has(g.id) ? 'proposed' : g.review,
|
|
229
|
+
priority: first?.priority ?? 'Normal',
|
|
230
|
+
mode: first?.mode ?? 'auto',
|
|
231
|
+
layers: Array.from(new Set(groupVariants.flatMap((v) => v.layers))),
|
|
232
|
+
traces: Array.from(new Set(groupVariants.flatMap((v) => v.traces))),
|
|
233
|
+
precondition: first?.precondition ?? [],
|
|
234
|
+
trigger: triggerShapes.size === 1 ? (first?.trigger ?? []) : ['(per variant)'],
|
|
235
|
+
variants: groupVariants,
|
|
236
|
+
result,
|
|
237
|
+
resultCounts: counts,
|
|
238
|
+
};
|
|
239
|
+
});
|
|
240
|
+
const dispositions = Object.entries(map.dispositions).map(([vpId, d]) => ({
|
|
241
|
+
vpId,
|
|
242
|
+
title: variantsByVp.get(vpId)?.[0]?.title ?? '',
|
|
243
|
+
as: d.as,
|
|
244
|
+
reason: d.reason ?? '',
|
|
245
|
+
}));
|
|
246
|
+
const variantCount = items.reduce((a, i) => a + i.variants.length, 0);
|
|
247
|
+
const approved = items.every((i) => i.review === 'approved')
|
|
248
|
+
&& !findings.some((f) => f.severity === 'error' || f.severity === 'review');
|
|
249
|
+
return {
|
|
250
|
+
unit,
|
|
251
|
+
formNo: map.formNo ?? 'BM-2-901-13',
|
|
252
|
+
items,
|
|
253
|
+
dispositions,
|
|
254
|
+
findings,
|
|
255
|
+
manifest: {
|
|
256
|
+
unit,
|
|
257
|
+
transformerVersion,
|
|
258
|
+
sourceFingerprint: (0, fingerprint_1.combinedFingerprint)(variants.map((v) => v.fingerprint)),
|
|
259
|
+
mapFingerprint: (0, fingerprint_1.mapContentFingerprint)(map.groups, map.dispositions),
|
|
260
|
+
approvalState: approved ? 'approved' : 'draft',
|
|
261
|
+
itemCount: items.length,
|
|
262
|
+
variantCount,
|
|
263
|
+
thresholds: { maxVariantsPerItem: types_1.MAX_VARIANTS_PER_ITEM },
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/exporters/matrix/build.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA6FH,wCAkFC;AAqBD,wBAWC;AAMD,oCAMC;AAED,kCAmEC;AA7RD,wDAAyE;AACzE,sDAK2B;AAC3B,wDAAgF;AAChF,8DAA+D;AAC/D,+CAAgG;AAChG,mCASiB;AACjB,mCAAmC;AAEnC,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,mFAAmF;AACnF,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7E,CAAC;AAED,SAAS,YAAY,CAAC,IAAc;IAClC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,eAAe,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAA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AqB,EAAE;SAC1D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matrix export orchestration — the piece `sungen delivery` calls.
|
|
3
|
+
*
|
|
4
|
+
* Composes the existing parsing seams (feature-parser, spec-parser, test-data,
|
|
5
|
+
* playwright report) with the map loader, builder, gates, and renderers. All
|
|
6
|
+
* inputs arrive as resolved paths so the CLI's discovery logic stays the single
|
|
7
|
+
* owner of unit-kind layout rules.
|
|
8
|
+
*/
|
|
9
|
+
import { DeliveryMap, MatrixFinding, MatrixModel } from './types';
|
|
10
|
+
export interface MatrixTargetPaths {
|
|
11
|
+
cwd: string;
|
|
12
|
+
/** Feature basename — names the deliverable files. */
|
|
13
|
+
unit: string;
|
|
14
|
+
/** Display label (flow/… prefix for flows). */
|
|
15
|
+
label: string;
|
|
16
|
+
featureFile: string;
|
|
17
|
+
testDataFile: string;
|
|
18
|
+
specFile: string;
|
|
19
|
+
resultsPath: string | null;
|
|
20
|
+
mapFile: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MatrixLoadResult {
|
|
23
|
+
model?: MatrixModel;
|
|
24
|
+
map?: DeliveryMap;
|
|
25
|
+
/** No map file → the caller prints the guidance path (AI proposal or --legacy). */
|
|
26
|
+
mapMissing?: boolean;
|
|
27
|
+
/** Structural map problems (bad YAML/shape) — fix the file before anything else. */
|
|
28
|
+
mapErrors: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare function loadMatrixModel(paths: MatrixTargetPaths): MatrixLoadResult;
|
|
31
|
+
export declare const hasErrors: (f: MatrixFinding[]) => boolean;
|
|
32
|
+
export declare const hasReview: (f: MatrixFinding[]) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Stamp fingerprints + flip groups to `approved` (all groups, or just `groupIds`).
|
|
35
|
+
* Refuses when gate ERRORs remain — an invalid map must not be frozen as approved.
|
|
36
|
+
* Returns the findings so the caller reports what blocked or what was approved.
|
|
37
|
+
*/
|
|
38
|
+
export declare function approveMatrix(paths: MatrixTargetPaths, groupIds?: string[]): {
|
|
39
|
+
findings: MatrixFinding[];
|
|
40
|
+
approved: string[];
|
|
41
|
+
};
|
|
42
|
+
/** Render + write both artifacts. Caller has already enforced the gate policy. */
|
|
43
|
+
export declare function writeMatrixDeliverables(paths: MatrixTargetPaths, model: MatrixModel): Promise<{
|
|
44
|
+
csvPath: string;
|
|
45
|
+
xlsxPath: string;
|
|
46
|
+
}>;
|
|
47
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/exporters/matrix/export.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oFAAoF;IACpF,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAsB1E;AAED,eAAO,MAAM,SAAS,GAAI,GAAG,aAAa,EAAE,KAAG,OAAgD,CAAC;AAChG,eAAO,MAAM,SAAS,GAAI,GAAG,aAAa,EAAE,KAAG,OAAiD,CAAC;AAEjG;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAqC9H;AAED,kFAAkF;AAClF,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAK1I"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Matrix export orchestration — the piece `sungen delivery` calls.
|
|
4
|
+
*
|
|
5
|
+
* Composes the existing parsing seams (feature-parser, spec-parser, test-data,
|
|
6
|
+
* playwright report) with the map loader, builder, gates, and renderers. All
|
|
7
|
+
* inputs arrive as resolved paths so the CLI's discovery logic stays the single
|
|
8
|
+
* owner of unit-kind layout rules.
|
|
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.hasReview = exports.hasErrors = void 0;
|
|
45
|
+
exports.loadMatrixModel = loadMatrixModel;
|
|
46
|
+
exports.approveMatrix = approveMatrix;
|
|
47
|
+
exports.writeMatrixDeliverables = writeMatrixDeliverables;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const feature_parser_1 = require("../feature-parser");
|
|
50
|
+
const spec_parser_1 = require("../spec-parser");
|
|
51
|
+
const test_data_resolver_1 = require("../test-data-resolver");
|
|
52
|
+
const playwright_report_parser_1 = require("../playwright-report-parser");
|
|
53
|
+
const scenario_merger_1 = require("../scenario-merger");
|
|
54
|
+
const package_info_1 = require("../package-info");
|
|
55
|
+
const csv_exporter_1 = require("../csv-exporter");
|
|
56
|
+
const xlsx_exporter_1 = require("../xlsx-exporter");
|
|
57
|
+
const map_loader_1 = require("./map-loader");
|
|
58
|
+
const build_1 = require("./build");
|
|
59
|
+
const render_xlsx_1 = require("./render-xlsx");
|
|
60
|
+
const render_csv_1 = require("./render-csv");
|
|
61
|
+
function loadMatrixModel(paths) {
|
|
62
|
+
const { map, errors } = (0, map_loader_1.loadDeliveryMap)(paths.mapFile);
|
|
63
|
+
if (!map) {
|
|
64
|
+
return errors.length === 0 ? { mapMissing: true, mapErrors: [] } : { mapErrors: errors };
|
|
65
|
+
}
|
|
66
|
+
const feature = (0, feature_parser_1.parseFeatureMetadata)(paths.featureFile);
|
|
67
|
+
const spec = (0, spec_parser_1.parseSpecFile)(paths.specFile);
|
|
68
|
+
const merged = (0, scenario_merger_1.mergeFeatureAndSpec)(feature, spec);
|
|
69
|
+
const testData = fs.existsSync(paths.testDataFile) ? (0, test_data_resolver_1.loadTestData)(paths.testDataFile, process.env.SUNGEN_ENV ?? null) : null;
|
|
70
|
+
const results = paths.resultsPath ? (0, playwright_report_parser_1.loadPlaywrightReport)(paths.resultsPath) : null;
|
|
71
|
+
const model = (0, build_1.buildMatrix)({
|
|
72
|
+
unit: paths.unit,
|
|
73
|
+
feature,
|
|
74
|
+
merged,
|
|
75
|
+
testData,
|
|
76
|
+
results,
|
|
77
|
+
map,
|
|
78
|
+
transformerVersion: (0, package_info_1.getPackageVersion)(),
|
|
79
|
+
});
|
|
80
|
+
return { model, map, mapErrors: [] };
|
|
81
|
+
}
|
|
82
|
+
const hasErrors = (f) => f.some((x) => x.severity === 'error');
|
|
83
|
+
exports.hasErrors = hasErrors;
|
|
84
|
+
const hasReview = (f) => f.some((x) => x.severity === 'review');
|
|
85
|
+
exports.hasReview = hasReview;
|
|
86
|
+
/**
|
|
87
|
+
* Stamp fingerprints + flip groups to `approved` (all groups, or just `groupIds`).
|
|
88
|
+
* Refuses when gate ERRORs remain — an invalid map must not be frozen as approved.
|
|
89
|
+
* Returns the findings so the caller reports what blocked or what was approved.
|
|
90
|
+
*/
|
|
91
|
+
function approveMatrix(paths, groupIds) {
|
|
92
|
+
const { map, errors } = (0, map_loader_1.loadDeliveryMap)(paths.mapFile);
|
|
93
|
+
if (!map)
|
|
94
|
+
throw new Error(errors.length > 0 ? `map is invalid:\n - ${errors.join('\n - ')}` : `no delivery map at ${paths.mapFile}`);
|
|
95
|
+
const feature = (0, feature_parser_1.parseFeatureMetadata)(paths.featureFile);
|
|
96
|
+
const spec = (0, spec_parser_1.parseSpecFile)(paths.specFile);
|
|
97
|
+
const merged = (0, scenario_merger_1.mergeFeatureAndSpec)(feature, spec);
|
|
98
|
+
const testData = fs.existsSync(paths.testDataFile) ? (0, test_data_resolver_1.loadTestData)(paths.testDataFile, process.env.SUNGEN_ENV ?? null) : null;
|
|
99
|
+
const model = (0, build_1.buildMatrix)({
|
|
100
|
+
unit: paths.unit, feature, merged, testData, results: null, map,
|
|
101
|
+
transformerVersion: (0, package_info_1.getPackageVersion)(),
|
|
102
|
+
});
|
|
103
|
+
const blocking = model.findings.filter((f) => f.severity === 'error');
|
|
104
|
+
if (blocking.length > 0)
|
|
105
|
+
return { findings: blocking, approved: [] };
|
|
106
|
+
const variants = (0, build_1.deriveVariants)({ feature, merged, testData, results: null });
|
|
107
|
+
const byRef = new Map(variants.map((v) => [v.ref, v]));
|
|
108
|
+
const byVp = new Map();
|
|
109
|
+
for (const v of variants) {
|
|
110
|
+
const list = byVp.get(v.vpId) ?? [];
|
|
111
|
+
list.push(v);
|
|
112
|
+
byVp.set(v.vpId, list);
|
|
113
|
+
}
|
|
114
|
+
const approved = [];
|
|
115
|
+
for (const g of map.groups) {
|
|
116
|
+
if (groupIds && groupIds.length > 0 && !groupIds.includes(g.id))
|
|
117
|
+
continue;
|
|
118
|
+
for (const ref of g.variants) {
|
|
119
|
+
const expanded = ref.includes('#') ? [byRef.get(ref)].filter(Boolean) : (byVp.get(ref) ?? []);
|
|
120
|
+
for (const v of expanded)
|
|
121
|
+
map.fingerprints[v.ref] = v.fingerprint;
|
|
122
|
+
}
|
|
123
|
+
g.review = 'approved';
|
|
124
|
+
approved.push(g.id);
|
|
125
|
+
}
|
|
126
|
+
(0, map_loader_1.writeDeliveryMap)(paths.mapFile, map);
|
|
127
|
+
return { findings: model.findings.filter((f) => f.severity !== 'error'), approved };
|
|
128
|
+
}
|
|
129
|
+
/** Render + write both artifacts. Caller has already enforced the gate policy. */
|
|
130
|
+
async function writeMatrixDeliverables(paths, model) {
|
|
131
|
+
const csvPath = (0, csv_exporter_1.writeCsv)(paths.cwd, paths.unit, (0, render_csv_1.renderMatrixCsv)(model));
|
|
132
|
+
const wb = (0, render_xlsx_1.renderMatrixXlsx)(model, (0, package_info_1.getPackageVersion)());
|
|
133
|
+
const xlsxPath = await (0, xlsx_exporter_1.writeXlsx)(paths.cwd, paths.unit, wb);
|
|
134
|
+
return { csvPath, xlsxPath };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/exporters/matrix/export.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCH,0CAsBC;AAUD,sCAqCC;AAGD,0DAKC;AAlHD,uCAAyB;AACzB,sDAAyD;AACzD,gDAA+C;AAC/C,8DAAqD;AACrD,0EAAmE;AACnE,wDAAyD;AACzD,kDAAoD;AACpD,kDAA2C;AAC3C,oDAA6C;AAC7C,6CAAiE;AACjE,mCAAsD;AACtD,+CAAiD;AACjD,6CAA+C;AAyB/C,SAAgB,eAAe,CAAC,KAAwB;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,4BAAe,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAC3F,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,qCAAoB,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACx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D,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IACD,IAAA,6BAAgB,EAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;AACtF,CAAC;AAED,kFAAkF;AAC3E,KAAK,UAAU,uBAAuB,CAAC,KAAwB,EAAE,KAAkB;IACxF,MAAM,OAAO,GAAG,IAAA,uBAAQ,EAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAC,CAAC;IACxE,MAAM,EAAE,GAAG,IAAA,8BAAgB,EAAC,KAAK,EAAE,IAAA,gCAAiB,GAAE,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAS,EAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -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 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,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QACrG,GAAG,EAAE,UAAU,IAAI,IAAI;KACxB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED,qFAAqF;AACrF,SAAgB,mBAAmB,CAAC,KAAe;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,qFAAqF;AACrF,SAAgB,qBAAqB,CAAC,MAAe,EAAE,YAAqB;IAC1E,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -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,CAS1D"}
|