common-qa-mcp 0.11.0 → 0.13.0

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 (82) hide show
  1. package/dist/adapters/remoteMcp/adapter.js +1 -1
  2. package/dist/adapters/simplifyqa/adapter.d.ts +42 -1
  3. package/dist/adapters/simplifyqa/adapter.d.ts.map +1 -1
  4. package/dist/adapters/simplifyqa/adapter.js +201 -18
  5. package/dist/adapters/simplifyqa/adapter.js.map +1 -1
  6. package/dist/adapters/simplifyqa/executionFailures.d.ts +59 -0
  7. package/dist/adapters/simplifyqa/executionFailures.d.ts.map +1 -0
  8. package/dist/adapters/simplifyqa/executionFailures.js +638 -0
  9. package/dist/adapters/simplifyqa/executionFailures.js.map +1 -0
  10. package/dist/adapters/simplifyqa/failureCategory.d.ts +26 -0
  11. package/dist/adapters/simplifyqa/failureCategory.d.ts.map +1 -0
  12. package/dist/adapters/simplifyqa/failureCategory.js +208 -0
  13. package/dist/adapters/simplifyqa/failureCategory.js.map +1 -0
  14. package/dist/adapters/simplifyqa/failureReport.d.ts +50 -0
  15. package/dist/adapters/simplifyqa/failureReport.d.ts.map +1 -0
  16. package/dist/adapters/simplifyqa/failureReport.js +353 -0
  17. package/dist/adapters/simplifyqa/failureReport.js.map +1 -0
  18. package/dist/adapters/simplifyqa/failureTypes.d.ts +193 -0
  19. package/dist/adapters/simplifyqa/failureTypes.d.ts.map +1 -0
  20. package/dist/adapters/simplifyqa/failureTypes.js +8 -0
  21. package/dist/adapters/simplifyqa/failureTypes.js.map +1 -0
  22. package/dist/adapters/simplifyqa/flow.d.ts +55 -0
  23. package/dist/adapters/simplifyqa/flow.d.ts.map +1 -0
  24. package/dist/adapters/simplifyqa/flow.js +325 -0
  25. package/dist/adapters/simplifyqa/flow.js.map +1 -0
  26. package/dist/adapters/simplifyqa/mapLimit.d.ts +3 -0
  27. package/dist/adapters/simplifyqa/mapLimit.d.ts.map +1 -0
  28. package/dist/adapters/simplifyqa/mapLimit.js +14 -0
  29. package/dist/adapters/simplifyqa/mapLimit.js.map +1 -0
  30. package/dist/adapters/simplifyqa/mapper.d.ts +3 -0
  31. package/dist/adapters/simplifyqa/mapper.d.ts.map +1 -1
  32. package/dist/adapters/simplifyqa/mapper.js +6 -7
  33. package/dist/adapters/simplifyqa/mapper.js.map +1 -1
  34. package/dist/adapters/simplifyqa/planTree.d.ts +31 -0
  35. package/dist/adapters/simplifyqa/planTree.d.ts.map +1 -0
  36. package/dist/adapters/simplifyqa/planTree.js +110 -0
  37. package/dist/adapters/simplifyqa/planTree.js.map +1 -0
  38. package/dist/adapters/simplifyqa/searchEngine.d.ts +237 -0
  39. package/dist/adapters/simplifyqa/searchEngine.d.ts.map +1 -0
  40. package/dist/adapters/simplifyqa/searchEngine.js +1206 -0
  41. package/dist/adapters/simplifyqa/searchEngine.js.map +1 -0
  42. package/dist/adapters/simplifyqa/searchRegistry.d.ts +112 -0
  43. package/dist/adapters/simplifyqa/searchRegistry.d.ts.map +1 -0
  44. package/dist/adapters/simplifyqa/searchRegistry.js +1413 -0
  45. package/dist/adapters/simplifyqa/searchRegistry.js.map +1 -0
  46. package/dist/adapters/simplifyqa/searchResolve.d.ts +84 -0
  47. package/dist/adapters/simplifyqa/searchResolve.d.ts.map +1 -0
  48. package/dist/adapters/simplifyqa/searchResolve.js +319 -0
  49. package/dist/adapters/simplifyqa/searchResolve.js.map +1 -0
  50. package/dist/adapters/simplifyqa/stepRules.d.ts +91 -0
  51. package/dist/adapters/simplifyqa/stepRules.d.ts.map +1 -0
  52. package/dist/adapters/simplifyqa/stepRules.js +228 -0
  53. package/dist/adapters/simplifyqa/stepRules.js.map +1 -0
  54. package/dist/adapters/types.d.ts +14 -1
  55. package/dist/adapters/types.d.ts.map +1 -1
  56. package/dist/domain/types.d.ts +14 -2
  57. package/dist/domain/types.d.ts.map +1 -1
  58. package/dist/initAgents.d.ts.map +1 -1
  59. package/dist/initAgents.js +32 -9
  60. package/dist/initAgents.js.map +1 -1
  61. package/dist/mcpResult.d.ts +19 -0
  62. package/dist/mcpResult.d.ts.map +1 -1
  63. package/dist/mcpResult.js +11 -0
  64. package/dist/mcpResult.js.map +1 -1
  65. package/dist/server.d.ts.map +1 -1
  66. package/dist/server.js +70 -16
  67. package/dist/server.js.map +1 -1
  68. package/dist/tools/discovery.tools.d.ts.map +1 -1
  69. package/dist/tools/discovery.tools.js +36 -10
  70. package/dist/tools/discovery.tools.js.map +1 -1
  71. package/dist/tools/failure.tools.d.ts +14 -0
  72. package/dist/tools/failure.tools.d.ts.map +1 -0
  73. package/dist/tools/failure.tools.js +65 -0
  74. package/dist/tools/failure.tools.js.map +1 -0
  75. package/dist/tools/query.tools.d.ts +20 -0
  76. package/dist/tools/query.tools.d.ts.map +1 -0
  77. package/dist/tools/query.tools.js +310 -0
  78. package/dist/tools/query.tools.js.map +1 -0
  79. package/dist/tools/testcase.tools.d.ts.map +1 -1
  80. package/dist/tools/testcase.tools.js +87 -10
  81. package/dist/tools/testcase.tools.js.map +1 -1
  82. package/package.json +1 -1
@@ -0,0 +1,353 @@
1
+ /**
2
+ * The text `failure_analysis` returns for a SimplifyQA execution, and the screenshots it inlines.
3
+ *
4
+ * The text is two parts. The ANALYSIS CARD is built by code, in the same shape as the in-app
5
+ * assistant's card (ai-assistant `testcase_composer.report_markdown`): counts, "Why … failed",
6
+ * "Failed test cases" / "Failed iterations", and each failed iteration — so the tables are the same
7
+ * every time instead of being re-written by the client's model. The EVIDENCE after it (expected /
8
+ * actual, logs, screenshots) is for the model to write the Why / Fix per cause. Nothing here
9
+ * asserts a root cause.
10
+ */
11
+ import { trimTrace } from './failureCategory.js';
12
+ function truncate(v, n = 240) {
13
+ const s = typeof v === 'string' ? v : JSON.stringify(v);
14
+ return s.length > n ? `${s.slice(0, n - 3)}...` : s;
15
+ }
16
+ /** Consecutive repeats of one log line collapsed to "line (×n)" — retries log the same error. */
17
+ function collapseRepeats(lines) {
18
+ const out = [];
19
+ let n = 0;
20
+ lines.forEach((l, i) => {
21
+ n++;
22
+ if (lines[i + 1] !== l) {
23
+ out.push(n > 1 ? `${l} (×${n})` : l);
24
+ n = 0;
25
+ }
26
+ });
27
+ return out;
28
+ }
29
+ function stepText(s, index, withLogs = true) {
30
+ const where = s.trail ?? (s.reportStep ? `TC step ${s.reportStep}` : `step ${s.seq}`);
31
+ const head = `### ${index + 1}. ${where}${s.reportStep ? ` (report step ${s.reportStep})` : ''} — ${s.description} \`${s.status}\``;
32
+ const lines = [head];
33
+ if (s.objectName || s.actionName) {
34
+ lines.push(`- **Object:** ${s.objectName ?? '-'} · **Action:** ${s.actionName ?? '-'}`);
35
+ }
36
+ if (s.locator)
37
+ lines.push(`- **Locator:** \`${truncate(s.locator, 300)}\``);
38
+ if (s.expected !== undefined)
39
+ lines.push(`- **Expected:** ${truncate(s.expected, 400)}`);
40
+ if (s.actual !== undefined)
41
+ lines.push(`- **Actual:** ${truncate(s.actual, 400)}`);
42
+ if (s.exception)
43
+ lines.push(`- **Exception:** ${truncate(s.exception, 600)}`);
44
+ if (s.errorLines.length) {
45
+ lines.push('- **Failure evidence:**');
46
+ for (const e of s.errorLines.slice(0, 8))
47
+ lines.push(` - ${truncate(e, 500)}`);
48
+ if (s.errorLines.length > 8)
49
+ lines.push(` - … ${s.errorLines.length - 8} more`);
50
+ }
51
+ if (s.testdata?.length) {
52
+ const td = s.testdata
53
+ .map((t) => {
54
+ const name = String(t['paramName'] ?? t['runtimeKey'] ?? 'param');
55
+ const value = t['protected'] ? '***' : String(t['value'] ?? '');
56
+ return `${name}=${value}`;
57
+ })
58
+ .slice(0, 8)
59
+ .join(', ');
60
+ lines.push(`- **Test data:** ${truncate(td, 500)}`);
61
+ }
62
+ if (s.screenshots.length) {
63
+ lines.push('- **Screenshots:**');
64
+ for (const a of s.screenshots.slice(0, 5)) {
65
+ lines.push(` - [${a.name ?? a.originalName ?? 'screenshot'}](${a.absoluteUrl})`);
66
+ }
67
+ }
68
+ if (s.recordedBaseline)
69
+ lines.push(`- **Recorded baseline:** ${s.recordedBaseline}`);
70
+ if (s.executedThumbnail)
71
+ lines.push(`- **Executed thumbnail:** ${s.executedThumbnail}`);
72
+ if (withLogs && s.logs.length) {
73
+ const tail = collapseRepeats(s.logs.slice(-12).map((l) => l.replace(/\s+$/, '')));
74
+ lines.push(`- **Logs (last ${Math.min(12, s.logs.length)} of ${s.logCount}):**`);
75
+ lines.push('```text');
76
+ lines.push(...tail);
77
+ lines.push('```');
78
+ }
79
+ return lines.join('\n');
80
+ }
81
+ /** Screenshots returned inline: one per cause group (its representative's failure screenshot), top
82
+ * groups only — each image costs the client model ~1–1.5k tokens of context. */
83
+ export const MAX_INLINE_IMAGES = 5;
84
+ const MAX_INLINE_IMAGE_BYTES = 1000000;
85
+ /** Which screenshot shows each group's failure: the representative's focus step first, then its
86
+ * other failed steps. Groups without a screenshot are skipped (their links stay in the text). */
87
+ export function pickGroupScreenshots(ctx, max = MAX_INLINE_IMAGES) {
88
+ const byRunId = new Map();
89
+ for (const t of ctx.testcases)
90
+ for (const it of t.failedIterations)
91
+ byRunId.set(it.runId, it);
92
+ const out = [];
93
+ for (const g of ctx.groups) {
94
+ if (out.length >= max)
95
+ break;
96
+ const it = byRunId.get(g.representativeRunId);
97
+ const step = [it?.focus, ...(it?.failedSteps ?? [])].find((s) => s?.screenshots.some((a) => a.absoluteUrl));
98
+ const shot = step?.screenshots.find((a) => a.absoluteUrl);
99
+ if (!step || !shot)
100
+ continue;
101
+ out.push({
102
+ caption: `**Screenshot — cause group ${g.id}:** ${g.representative} · step ${step.displaySeq ?? step.seq} "${truncate(step.description, 120)}"`,
103
+ url: shot.absoluteUrl,
104
+ });
105
+ }
106
+ return out;
107
+ }
108
+ /** A table cell: no pipes or newlines, "—" when empty. */
109
+ function td(v, n = 160) {
110
+ const s = v === undefined || v === null || v === '' ? '—' : truncate(String(v), n);
111
+ return s.replace(/\|/g, '\\|').replace(/\r?\n/g, ' ');
112
+ }
113
+ /** "Failed at": the trail in the test case, with the report's own number. */
114
+ function failedAt(it) {
115
+ const f = it.focus;
116
+ if (!f)
117
+ return it.readError ? 'steps could not be read' : 'never started — no steps were recorded for this run';
118
+ const where = f.trail ?? (f.reportStep ? `TC step ${f.reportStep}` : `step ${f.seq}`);
119
+ const report = f.reportStep && f.trail && f.trail !== `TC step ${f.reportStep}` ? ` (report step ${f.reportStep})` : '';
120
+ return `${where}${report}${it.source === 'run_level' ? ' — last step that ran' : ''}`;
121
+ }
122
+ /** The error shown for an iteration: its step's cause, else the step / run exception. */
123
+ const errorOf = (it) => it.focus?.cause ?? it.focus?.exception ?? it.exception ?? it.readError;
124
+ /** One failed iteration's block inside the card (the in-app card's "Each failed …" block). */
125
+ function iterationCard(it) {
126
+ const name = [it.testcaseCode ?? it.label, it.testcaseName].filter(Boolean).join(' — ');
127
+ const tail = [it.versionName, it.iteration, it.platform, it.group !== undefined ? `cause #${it.group}` : undefined]
128
+ .filter(Boolean).join(' · ');
129
+ const lines = ['', `**${name}**${tail ? ` (${tail})` : ''}`, `**Failed at:** ${failedAt(it)} `];
130
+ if (it.focus?.description)
131
+ lines.push(`**What failed:** ${truncate(it.focus.description, 300)} `);
132
+ const error = errorOf(it);
133
+ if (error)
134
+ lines.push(`**Error:** \`${truncate(error, 400).replace(/`/g, "'")}\` `);
135
+ if (it.source === 'run_level')
136
+ lines.push('No step reported FAILED — the run was marked failed at run level (manual verdict or a stop). ');
137
+ return lines;
138
+ }
139
+ /** Characters of FLOW text across all causes — past it, a cause keeps only its failure window. */
140
+ const FLOW_BUDGET = 24000;
141
+ /** Lines kept around the failure when the budget is spent. */
142
+ const FLOW_TIGHT_LINES = 12;
143
+ /** The whole-test-case context of one representative (flow.ts). `tight` keeps only the lines around
144
+ * the failure. */
145
+ function flowText(it, tight) {
146
+ const f = it.flow;
147
+ if (!f)
148
+ return [];
149
+ if (!f.lines.length)
150
+ return ['#### FLOW', '_No steps were recorded for this run — it never started. The reason is the run / execution exception above._'];
151
+ let lines = f.lines;
152
+ if (tight) {
153
+ const at = lines.findIndex((l) => l.includes('[FAILED'));
154
+ lines = at < 0 ? lines.slice(-FLOW_TIGHT_LINES) : lines.slice(Math.max(0, at - FLOW_TIGHT_LINES + 3), at + 3);
155
+ }
156
+ const out = ['#### FLOW (report step [status] description | test data)', '```text', ...lines.map((l) => truncate(l, 220)), '```'];
157
+ if (tight)
158
+ out.push('_(FLOW cut to the failure to keep the result small.)_');
159
+ if (f.breakdown)
160
+ out.push(`- **Broke down:** ${f.breakdown} — the run broke down at that step.`);
161
+ if (f.notRun?.length)
162
+ out.push('- **Written steps not run** (what the test was going to do next):', ...f.notRun.map((l) => ` - ${l}`));
163
+ if (f.functionCalls)
164
+ out.push(`- **Function calls:** ${f.functionCalls}`);
165
+ if (f.otherIterations?.length)
166
+ out.push('- **Other iterations of this test case:**', ...f.otherIterations.map((l) => ` - ${l}`));
167
+ if (f.warnings.length)
168
+ out.push('- **Warnings from steps that PASSED** (clues, not proof):', ...f.warnings.map((l) => ` - ${l}`));
169
+ return out;
170
+ }
171
+ /** Failed steps given full detail per representative; the rest are one line each. */
172
+ const DETAILED_STEPS = 3;
173
+ /** One failed iteration's full evidence (after the card): flow, expected/actual, logs, screenshots.
174
+ * Logs only for the step that explains the cause (the focus). */
175
+ function iterationEvidence(it, tightFlow = false) {
176
+ const lines = [`### ${it.testcaseCode ?? it.label}${it.iteration ? ` · ${it.iteration}` : ''}${it.group !== undefined ? ` · cause #${it.group}` : ''}`];
177
+ if (it.exception && it.exception !== errorOf(it))
178
+ lines.push(`- **Run exception:** ${truncate(trimTrace(it.exception) ?? it.exception, 400)}`);
179
+ if (it.readError)
180
+ lines.push(`- **Steps could not be read:** ${truncate(it.readError, 300)}`);
181
+ lines.push(...flowText(it, tightFlow));
182
+ it.failedSteps.slice(0, DETAILED_STEPS).forEach((s, i) => {
183
+ lines.push(stepText(s, i, s === it.focus).replace(/^### /, '#### '));
184
+ });
185
+ const rest = it.failedSteps.slice(DETAILED_STEPS);
186
+ if (rest.length) {
187
+ lines.push(`- _${rest.length} more failed step(s): ${truncate(rest.map((s) => `${s.reportStep ?? s.seq} ${s.description}`).join('; '), 400)}_`);
188
+ }
189
+ return lines.join('\n');
190
+ }
191
+ /** How to read the evidence and answer — the in-app assistant's rules for the tester
192
+ * (ai-assistant `_lib/explain.py` _FAILURE_READING / _FAILURE_SHAPE_PROSE), condensed. */
193
+ const TESTER_GUIDE = [
194
+ 'HOW TO ANSWER — as the tester who has to act on this:',
195
+ '(1) Reply with the ANALYSIS CARD — everything this result starts with, up to the first line that is only "---" — exactly as written: same title, tables, rows and columns; never summarise or reword it, and add nothing before it.',
196
+ '(2) Then the ANSWER blocks, one per cause, in the order given: keep every label and the facts already written; replace each "…" with one or two sentences. Nothing else — no extra headings, no paragraphs between or after the blocks.',
197
+ ' - Why: what the test was doing (from the FLOW) and the cause, traced back to the step where it STARTED — which may be well before the failed step (a value entered wrongly, an action that did not take effect, a branch not taken). Name that step by number; quote error text exactly.',
198
+ ' - Whose problem: the test script, the test data, the application, the environment/device, or a manual stop — and how sure the evidence lets you be.',
199
+ ' - Fix: what to change (the step / function / object and what to put there), or the defect to log (title, steps, expected vs actual).',
200
+ ' - Next: rerun, check something, or ask someone.',
201
+ 'READING THE FLOW:',
202
+ ' - "… steps a–b not shown: n steps, all passed …" are steps that ran; "[not run]" lines are what the test was going to do next.',
203
+ ' - CONTROL FLOW IS NOT FAILURE: "[IF → false] … — steps a–b skipped" is the test\'s own branching (a branch not taken is stored as FAILED). Never call it a failed step; raise it only when the skipped steps set up what the real failure needed.',
204
+ ' - "[FAILED · continued]" the run went on; "[FAILED · stopped the run]" it ended there. Later steps failing the same way follow from the first failure — explain it once. "Broke down" = treat that step as the cause of the failures after it.',
205
+ ' - Other iterations that PASSED this step with different data, or earlier calls of the same function that passed, point at this iteration\'s data or state — not at the steps or the function.',
206
+ ' - A step number like 4.2 is step 2 inside the function called at step 4; a function call is not an iteration (ITR-n is the test case run again with other data).',
207
+ ' - Warnings from passed steps are clues, not proof. Do not assert a cause the evidence does not support; say what to check instead.',
208
+ ].join('\n');
209
+ /** The card ends at the first line that is only this — no hidden markers: a terminal shows HTML
210
+ * comments as text, and the model copied them into its answer. */
211
+ export const CARD_END = '---';
212
+ const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
213
+ /** "2026-10-13T22:16:59.43+05:30" → "13 Oct 2026, 10:16 PM", in the time the run recorded (a UTC
214
+ * "…Z" time is shown in IST, the deployment's zone). Anything else is shown as given. */
215
+ export function readableTime(iso) {
216
+ if (!iso)
217
+ return iso;
218
+ let d = new Date(iso);
219
+ if (Number.isNaN(d.getTime()))
220
+ return iso;
221
+ const zone = /([+-])(\d{2}):?(\d{2})$/.exec(iso);
222
+ const offsetMin = zone ? (zone[1] === '-' ? -1 : 1) * (Number(zone[2]) * 60 + Number(zone[3])) : 330;
223
+ d = new Date(d.getTime() + offsetMin * 60000);
224
+ const h = d.getUTCHours();
225
+ return `${d.getUTCDate()} ${MONTHS[d.getUTCMonth()]} ${d.getUTCFullYear()}, ${h % 12 || 12}:${String(d.getUTCMinutes()).padStart(2, '0')} ${h < 12 ? 'AM' : 'PM'}`;
226
+ }
227
+ /** The analysis card's wording per kind — the same headings as the in-app assistant's card. */
228
+ const WORDS = {
229
+ testcase: { eyebrow: 'Test case failure analysis', unit: 'iteration', why: 'Why it failed', failed: 'Iterations failed', each: 'Each failed iteration' },
230
+ suite: { eyebrow: 'Suite failure analysis', unit: 'test case', why: 'Why the suite failed', failed: 'Test cases failed', each: 'Each failed test case' },
231
+ plan: { eyebrow: 'Execution plan failure analysis', unit: 'test case', why: 'Why the execution plan failed', failed: 'Test cases failed', each: 'Each failed test case' },
232
+ };
233
+ const plural = (n, unit) => `${n} ${unit}${n === 1 ? '' : 's'}`;
234
+ /**
235
+ * The analysis card, in the in-app card's shape (ai-assistant `report_markdown`): title, meta,
236
+ * counts; "Why … failed" (`# | Root cause | Test cases`, or `Iterations failed` for a test case);
237
+ * "Failed test cases" (`TC ID | Version | Test case name | Iteration | Report Step No. | Test case
238
+ * step | Failure category`) or "Failed iterations"; passed; each failed iteration. Then, outside the
239
+ * card, the evidence and what the model should add (Why / Fix per cause).
240
+ */
241
+ export function renderExecution(ctx) {
242
+ const e = ctx.execution;
243
+ const type = e.type.toUpperCase();
244
+ const kind = ctx.input.code?.startsWith('TC-') || type === 'TESTCASE'
245
+ ? 'testcase' : type === 'EXECUTIONPLAN' ? 'plan' : 'suite';
246
+ const w = WORDS[kind];
247
+ const c = ctx.counts;
248
+ const iterations = ctx.testcases.flatMap((t) => t.failedIterations);
249
+ const title = kind === 'testcase'
250
+ ? [iterations[0]?.testcaseCode ?? ctx.input.code ?? e.executionTypeCode, iterations[0]?.testcaseName ?? e.executionTypeName].filter(Boolean).join(' — ')
251
+ : e.executionTypeName ?? e.executionTypeCode ?? e.code ?? `execution ${e.id}`;
252
+ const meta = [e.code, e.environment, readableTime(e.endedAt ?? e.startedAt)].filter(Boolean).join(' · ');
253
+ const ran = kind === 'testcase' ? c.runs : c.testcases;
254
+ const passed = kind === 'testcase' ? c.runs - c.failedRuns : c.passedTestcases;
255
+ const failed = kind === 'testcase' ? c.failedRuns : c.failedTestcases;
256
+ const reasons = ctx.groups.length ? `, for ${plural(ctx.groups.length, 'reason')}` : '';
257
+ const card = [
258
+ `**${w.eyebrow}: ${title || `execution ${e.id}`}**`,
259
+ ...(meta ? [meta] : []),
260
+ `${plural(ran, w.unit)} · ${passed} passed · ${failed} failed${reasons}.`,
261
+ ];
262
+ if (e.exception)
263
+ card.push('', `Execution exception: \`${truncate(e.exception, 300).replace(/`/g, "'")}\``);
264
+ if (ctx.groups.length) {
265
+ // Why it failed — one row per cause. The root cause is the category and the failed step's error.
266
+ card.push('', `**${w.why}**`, '');
267
+ if (kind === 'testcase') {
268
+ card.push(`| # | Root cause | ${w.failed} |`, '|---|---|---|');
269
+ for (const g of ctx.groups)
270
+ card.push(`| ${g.id} | ${td(rootCause(g.category, g.cause), 260)} | ${td(g.iterations.join(', '), 300)} |`);
271
+ }
272
+ else {
273
+ card.push('| # | Root cause | Test cases |', '|---|---|---|');
274
+ for (const g of ctx.groups)
275
+ card.push(`| ${g.id} | ${td(rootCause(g.category, g.cause), 260)} | ${g.testcases.length} |`);
276
+ }
277
+ // Every failed iteration, with the report's step number AND the test case's own step.
278
+ if (kind === 'testcase') {
279
+ card.push('', '**Failed iterations**', '', '| Iteration | Report Step No. | Test case step | Failure category |', '|---|---|---|---|');
280
+ for (const it of iterations) {
281
+ card.push(`| ${td(it.iteration ?? it.label)} | ${td(it.focus?.reportStep)} | ${td(it.focus?.trail)} | ${td(it.category)} |`);
282
+ }
283
+ }
284
+ else {
285
+ card.push('', '**Failed test cases**', '', '| TC ID | Version | Test case name | Iteration | Report Step No. | Test case step | Failure category |', '|---|---|---|---|---|---|---|');
286
+ for (const it of iterations) {
287
+ card.push(`| ${td(it.testcaseCode ?? it.label)} | ${td(it.versionName)} | ${td(it.testcaseName, 80)} | ${td(it.iteration)} | `
288
+ + `${td(it.focus?.reportStep)} | ${td(it.focus?.trail)} | ${td(it.category)} |`);
289
+ }
290
+ }
291
+ }
292
+ else {
293
+ card.push('', `No ${w.unit} failed.`);
294
+ }
295
+ if (kind !== 'testcase') {
296
+ card.push('', ctx.passed?.length ? `Passed: ${ctx.passed.join(', ')}.` : `No ${w.unit} passed.`);
297
+ }
298
+ for (const n of ctx.notes)
299
+ card.push('', n);
300
+ if (iterations.length) {
301
+ card.push('', `**${w.each}**`);
302
+ for (const it of iterations)
303
+ card.push(...iterationCard(it));
304
+ }
305
+ const out = [...card, '', CARD_END];
306
+ // The answer's structure, one block per cause: code writes the facts (where, the exact error),
307
+ // the model fills only the "…" — as the in-app card's Why / Fix slots are filled.
308
+ if (ctx.groups.length) {
309
+ const byRun = new Map(iterations.map((it) => [it.runId, it]));
310
+ out.push('', 'ANSWER — fill in every "…" below and keep this structure exactly (labels, order, one block per cause):');
311
+ for (const g of ctx.groups) {
312
+ const rep = byRun.get(g.representativeRunId);
313
+ const who = [...new Set(g.testcases)].join(', ');
314
+ const n = g.iterations.length;
315
+ out.push('', `**Cause #${g.id} — ${g.category ?? 'Unrecognised failure'}** (${who}${n > 1 ? `; ${n} iterations` : ''})`, `- **Where it broke:** ${rep ? failedAt(rep) : '…'}`, `- **What went wrong:** ${rep && errorOf(rep) ? `\`${truncate(errorOf(rep), 300).replace(/`/g, "'")}\`` : '…'}`, '- **Why:** …', '- **Whose problem:** … (test script / test data / application / environment / manual stop) — how sure', '- **Fix:** …', '- **Next:** …');
316
+ }
317
+ }
318
+ if (e.reportUrl)
319
+ out.push('', `Report: ${e.reportUrl}`);
320
+ // Full evidence for ONE iteration per cause — its representative (the in-app analysis does the
321
+ // same): every other iteration of that cause failed the same way and is already a row above.
322
+ const byRunId = new Map(iterations.map((it) => [it.runId, it]));
323
+ const reps = ctx.groups.map((g) => byRunId.get(g.representativeRunId)).filter((x) => !!x);
324
+ if (reps.length) {
325
+ out.push('', '## Evidence — one representative per cause (for writing Why / Fix; do not paste)');
326
+ let flowChars = 0;
327
+ for (const it of reps) {
328
+ const g = ctx.groups.find((x) => x.representativeRunId === it.runId);
329
+ const others = g.iterations.filter((l) => l !== it.label);
330
+ const tight = flowChars > FLOW_BUDGET;
331
+ out.push('', iterationEvidence(it, tight));
332
+ flowChars += flowText(it, tight).join('\n').length;
333
+ if (others.length)
334
+ out.push(`- _Same cause, not repeated: ${truncate(others.join(', '), 300)}_`);
335
+ }
336
+ }
337
+ out.push('', '---', TESTER_GUIDE);
338
+ return out.join('\n');
339
+ }
340
+ /** "Element not found — Step 4.2 "Click Login": No such element found." */
341
+ function rootCause(category, cause) {
342
+ return category && category !== 'Unrecognised failure' ? `${category} — ${cause}` : cause;
343
+ }
344
+ /** The picked screenshots, fetched; any that cannot be fetched are left out (their links stay in
345
+ * the text). */
346
+ export async function failureImages(ctx, fetchImage) {
347
+ const fetched = await Promise.all(pickGroupScreenshots(ctx).map(async (p) => {
348
+ const img = await fetchImage(p.url, MAX_INLINE_IMAGE_BYTES);
349
+ return img ? { caption: p.caption, ...img } : null;
350
+ }));
351
+ return fetched.filter((i) => i !== null);
352
+ }
353
+ //# sourceMappingURL=failureReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failureReport.js","sourceRoot":"","sources":["../../../src/adapters/simplifyqa/failureReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAQjD,SAAS,QAAQ,CAAC,CAAU,EAAE,CAAC,GAAG,GAAG;IACnC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,iGAAiG;AACjG,SAAS,eAAe,CAAC,KAAe;IACtC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACrB,CAAC,EAAE,CAAC;QACJ,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAAC,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,C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193 @@
1
+ /**
2
+ * Failure-analysis types for SimplifyQA executions (executionFailures.ts).
3
+ *
4
+ * This is deliberately EVIDENCE, not a verdict: the harness/LLM reads the failed step(s), logs,
5
+ * screenshots and FLOW and writes the root-cause summary. The tool must not invent a cause.
6
+ */
7
+ export type FailureArtifact = {
8
+ name?: string;
9
+ originalName?: string;
10
+ url: string;
11
+ absoluteUrl: string;
12
+ size?: number;
13
+ fileSize?: string;
14
+ type?: string;
15
+ };
16
+ /** `info` = not an outcome (see stepRules.INFO_STEP_TYPES); `not_executed` = created but never reached. */
17
+ export type FailureStepState = 'passed' | 'failed' | 'skipped' | 'info' | 'not_executed' | 'error' | 'unknown';
18
+ export type FailureStep = {
19
+ /** The step-result row's own id. */
20
+ rowId?: string;
21
+ seq: number;
22
+ reportSeq?: number | string;
23
+ displaySeq?: string;
24
+ /** The number the report/PDF prints (`19.19.8`): displaySeq (automated) or reportSeq (manual). */
25
+ reportStep?: string;
26
+ /** The test case's own step this one sits under (`19`). */
27
+ testcaseStep?: string;
28
+ /** "TC step 19 › Login step 3 › Enter credentials step 8". */
29
+ trail?: string;
30
+ /** For a FUNCTION row: the function's name. */
31
+ functionName?: string;
32
+ /** Why the step failed (first real ERROR line, failed API assertion, or exception). */
33
+ cause?: string;
34
+ /** Failure category from fixed rules ("Element not found", "Assertion failed", …). */
35
+ category?: string;
36
+ description: string;
37
+ status: string;
38
+ state: FailureStepState;
39
+ stepType?: string;
40
+ type?: string;
41
+ parentId?: number;
42
+ stepId?: string;
43
+ expected?: string;
44
+ actual?: string;
45
+ exception?: string;
46
+ /** Lines that look like the real failure (ERROR / exception / validation failed / timeout / …). */
47
+ errorLines: string[];
48
+ /** All execution logs, capped by maxLogLines. */
49
+ logs: string[];
50
+ logCount: number;
51
+ screenshots: FailureArtifact[];
52
+ recordedBaseline?: string;
53
+ recordedThumbnail?: string;
54
+ executedThumbnail?: string;
55
+ testdata?: Array<Record<string, unknown>>;
56
+ networkLogs?: unknown;
57
+ apiData?: unknown;
58
+ defectIds?: unknown;
59
+ selfHealed?: boolean;
60
+ objectName?: string;
61
+ actionName?: string;
62
+ locator?: string;
63
+ };
64
+ /**
65
+ * Whole-execution analysis: `TC-123` / `SU-123` / `PL-123` → its latest (parent) execution, or one
66
+ * named execution. Every failed iteration is analysed; iterations that broke the same way are grouped.
67
+ */
68
+ export type ExecutionFailureInput = {
69
+ /** TC-123 | SU-123 | PL-123. Without `executionId`, the latest execution of it is analysed. */
70
+ code?: string;
71
+ /** Numeric execution id or EX code. When set, ONLY this execution is analysed. */
72
+ executionId?: string;
73
+ includeLogs?: boolean;
74
+ maxLogLines?: number;
75
+ includeScreenshots?: boolean;
76
+ };
77
+ export type FailureIteration = {
78
+ runId: string;
79
+ /** `TC-12 (ITR-2, CHROME)` */
80
+ label: string;
81
+ testcaseCode?: string;
82
+ testcaseName?: string;
83
+ versionName?: string;
84
+ /** This iteration's failure category (its focus step's, else the run exception's). */
85
+ category?: string;
86
+ status: string;
87
+ iteration?: string;
88
+ platform?: string;
89
+ versionId?: string;
90
+ startedAt?: string;
91
+ endedAt?: string;
92
+ durationMs?: number;
93
+ /** Run-level exception (the reason when no step failed, e.g. manual or environment stops). */
94
+ exception?: string;
95
+ /** `step` = a step reported FAILED; `run_level` = the run failed with no failed step. */
96
+ source: 'step' | 'run_level' | 'none';
97
+ /** The failure that explains this iteration (first real failure, or the last step that ran). */
98
+ focus?: FailureStep;
99
+ /** Every real failed step (INFO rows and FUNCTION headings excluded). */
100
+ failedSteps: FailureStep[];
101
+ stepCounts: {
102
+ total: number;
103
+ passed: number;
104
+ failed: number;
105
+ skipped: number;
106
+ notExecuted: number;
107
+ };
108
+ /** Cause group number (see ExecutionFailureContext.groups). */
109
+ group?: number;
110
+ /** The whole-test-case context, for a cause's representative only (see flow.ts). */
111
+ flow?: FailureFlow;
112
+ /** Set when this iteration's steps could not be read. */
113
+ readError?: string;
114
+ };
115
+ /** What a tester reads before judging a failure: the run's flow, what it never reached, how this
116
+ * call / iteration compares with the others, and warnings from steps that passed. */
117
+ export type FailureFlow = {
118
+ lines: string[];
119
+ breakdown?: string;
120
+ notRun?: string[];
121
+ functionCalls?: string;
122
+ /** The same test case's other iterations at this step: passed / failed, with their data. */
123
+ otherIterations?: string[];
124
+ warnings: string[];
125
+ };
126
+ export type FailureTestcaseEntry = {
127
+ executionItemId: string;
128
+ code?: string;
129
+ name?: string;
130
+ versionId?: string;
131
+ versionName?: string;
132
+ stepId?: string;
133
+ /** Plans: where the test case came from (e.g. `SUITE 123`). */
134
+ source?: string;
135
+ iterations: {
136
+ total: number;
137
+ passed: number;
138
+ failed: number;
139
+ other: number;
140
+ };
141
+ failedIterations: FailureIteration[];
142
+ };
143
+ export type FailureGroup = {
144
+ id: number;
145
+ /** Human-readable cause (step + error, or run-level exception). */
146
+ cause: string;
147
+ kind: 'step' | 'run_level';
148
+ /** Failure category of the representative ("Element not found", …). */
149
+ category?: string;
150
+ size: number;
151
+ testcases: string[];
152
+ iterations: string[];
153
+ /** The iteration that carries this group's full evidence (logs/screenshots). */
154
+ representative: string;
155
+ representativeRunId: string;
156
+ };
157
+ export type ExecutionFailureContext = {
158
+ input: {
159
+ code?: string;
160
+ executionId?: string;
161
+ resolvedBy: 'executionId' | 'latest';
162
+ };
163
+ execution: {
164
+ id: string;
165
+ code?: string;
166
+ type: string;
167
+ status: string;
168
+ executionTypeCode?: string;
169
+ executionTypeName?: string;
170
+ /** The execution's environment (`environmentType`). */
171
+ environment?: string;
172
+ childExecution?: boolean;
173
+ startedAt?: string;
174
+ endedAt?: string;
175
+ durationMs?: number;
176
+ exception?: string;
177
+ reportUrl?: string;
178
+ };
179
+ counts: {
180
+ runs: number;
181
+ failedRuns: number;
182
+ analysedRuns: number;
183
+ testcases: number;
184
+ failedTestcases: number;
185
+ passedTestcases: number;
186
+ };
187
+ /** Test case entries whose every iteration passed (codes). */
188
+ passed?: string[];
189
+ groups: FailureGroup[];
190
+ testcases: FailureTestcaseEntry[];
191
+ notes: string[];
192
+ };
193
+ //# sourceMappingURL=failureTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failureTypes.d.ts","sourceRoot":"","sources":["../../../src/adapters/simplifyqa/failureTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,2GAA2G;AAC3G,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/G,MAAM,MAAM,WAAW,GAAG;IACxB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kGAAkG;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAA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B,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,uDAAuD;QACvD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Failure-analysis types for SimplifyQA executions (executionFailures.ts).
3
+ *
4
+ * This is deliberately EVIDENCE, not a verdict: the harness/LLM reads the failed step(s), logs,
5
+ * screenshots and FLOW and writes the root-cause summary. The tool must not invent a cause.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=failureTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failureTypes.js","sourceRoot":"","sources":["../../../src/adapters/simplifyqa/failureTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}