qa360 2.2.15 → 2.2.20

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 (46) hide show
  1. package/cli/dist/commands/ai.js +1 -1
  2. package/cli/dist/commands/ask.js +362 -36
  3. package/cli/dist/commands/coverage.js +1 -1
  4. package/cli/dist/commands/crawl.js +1 -1
  5. package/cli/dist/commands/doctor.js +2 -2
  6. package/cli/dist/commands/explain.js +2 -2
  7. package/cli/dist/commands/flakiness.js +1 -1
  8. package/cli/dist/commands/generate.js +1 -1
  9. package/cli/dist/commands/history.js +1 -1
  10. package/cli/dist/commands/monitor.js +3 -3
  11. package/cli/dist/commands/ollama.js +1 -1
  12. package/cli/dist/commands/pack.js +2 -2
  13. package/cli/dist/commands/regression.js +1 -1
  14. package/cli/dist/commands/repair.js +1 -1
  15. package/cli/dist/commands/retry.js +1 -1
  16. package/cli/dist/commands/run.d.ts +1 -1
  17. package/cli/dist/commands/run.js +2 -1
  18. package/cli/dist/commands/secrets.js +1 -1
  19. package/cli/dist/commands/serve.js +1 -1
  20. package/cli/dist/commands/slo.js +1 -1
  21. package/cli/dist/commands/verify.js +1 -1
  22. package/cli/dist/core/ai/ollama-provider.js +3 -15
  23. package/cli/dist/core/core/coverage/analyzer.d.ts +101 -0
  24. package/cli/dist/core/core/coverage/analyzer.js +415 -0
  25. package/cli/dist/core/core/coverage/collector.d.ts +74 -0
  26. package/cli/dist/core/core/coverage/collector.js +459 -0
  27. package/cli/dist/core/core/coverage/config.d.ts +37 -0
  28. package/cli/dist/core/core/coverage/config.js +156 -0
  29. package/cli/dist/core/core/coverage/index.d.ts +11 -0
  30. package/cli/dist/core/core/coverage/index.js +15 -0
  31. package/cli/dist/core/core/coverage/types.d.ts +267 -0
  32. package/cli/dist/core/core/coverage/types.js +6 -0
  33. package/cli/dist/core/core/coverage/vault.d.ts +95 -0
  34. package/cli/dist/core/core/coverage/vault.js +405 -0
  35. package/cli/dist/core/crawler/selector-generator.js +3 -72
  36. package/cli/dist/core/generation/crawler-pack-generator.d.ts +1 -1
  37. package/cli/dist/core/generation/crawler-pack-generator.js +143 -31
  38. package/cli/dist/core/pack/validator.js +2 -2
  39. package/cli/dist/core/pack-v2/migrator.d.ts +0 -5
  40. package/cli/dist/core/pack-v2/migrator.js +6 -81
  41. package/cli/dist/core/pack-v2/validator.js +3 -4
  42. package/cli/dist/core/runner/phase3-runner.js +1 -12
  43. package/cli/dist/utils/config.d.ts +1 -1
  44. package/cli/dist/utils/config.js +11 -5
  45. package/core/package.json +1 -1
  46. package/package.json +3 -2
@@ -0,0 +1,405 @@
1
+ /**
2
+ * Coverage Vault Integration
3
+ *
4
+ * Integrates coverage data storage and retrieval with the Evidence Vault.
5
+ */
6
+ import { promisify } from 'util';
7
+ /**
8
+ * Coverage Vault class
9
+ */
10
+ export class CoverageVault {
11
+ db;
12
+ dbRun;
13
+ dbAll;
14
+ dbGet;
15
+ constructor(db) {
16
+ this.db = db;
17
+ this.dbRun = promisify(db.run.bind(db));
18
+ this.dbAll = promisify(db.all.bind(db));
19
+ this.dbGet = promisify(db.get.bind(db));
20
+ }
21
+ /**
22
+ * Initialize coverage tables
23
+ */
24
+ async initialize() {
25
+ const schema = `
26
+ -- Coverage metrics table
27
+ CREATE TABLE IF NOT EXISTS coverage_metrics (
28
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
29
+ run_id TEXT NOT NULL REFERENCES runs(id) ON DELETE CASCADE,
30
+ gate TEXT NOT NULL,
31
+ file_path TEXT NOT NULL,
32
+ total_lines INTEGER DEFAULT 0,
33
+ covered_lines INTEGER DEFAULT 0,
34
+ branch_coverage REAL DEFAULT 0,
35
+ function_coverage REAL DEFAULT 0,
36
+ line_coverage REAL DEFAULT 0,
37
+ statement_coverage REAL DEFAULT 0,
38
+ total_branches INTEGER DEFAULT 0,
39
+ covered_branches INTEGER DEFAULT 0,
40
+ total_functions INTEGER DEFAULT 0,
41
+ covered_functions INTEGER DEFAULT 0,
42
+ total_statements INTEGER DEFAULT 0,
43
+ covered_statements INTEGER DEFAULT 0,
44
+ uncovered_lines TEXT,
45
+ created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now') * 1000)
46
+ );
47
+
48
+ CREATE INDEX IF NOT EXISTS idx_coverage_metrics_run_id ON coverage_metrics(run_id);
49
+ CREATE INDEX IF NOT EXISTS idx_coverage_metrics_gate ON coverage_metrics(gate);
50
+ CREATE INDEX IF NOT EXISTS idx_coverage_metrics_file_path ON coverage_metrics(file_path);
51
+ CREATE INDEX IF NOT EXISTS idx_coverage_metrics_run_gate ON coverage_metrics(run_id, gate);
52
+
53
+ -- Coverage trends table
54
+ CREATE TABLE IF NOT EXISTS coverage_trends (
55
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
56
+ test_id TEXT NOT NULL,
57
+ file_path TEXT NOT NULL,
58
+ run_id TEXT NOT NULL REFERENCES runs(id) ON DELETE CASCADE,
59
+ coverage_type TEXT NOT NULL,
60
+ coverage_value REAL NOT NULL,
61
+ date INTEGER NOT NULL,
62
+ commit TEXT,
63
+ branch TEXT,
64
+ UNIQUE(test_id, file_path, coverage_type, date)
65
+ );
66
+
67
+ CREATE INDEX IF NOT EXISTS idx_coverage_trends_test_id ON coverage_trends(test_id);
68
+ CREATE INDEX IF NOT EXISTS idx_coverage_trends_file_path ON coverage_trends(file_path);
69
+ CREATE INDEX IF NOT EXISTS idx_coverage_trends_date ON coverage_trends(date);
70
+ CREATE INDEX IF NOT EXISTS idx_coverage_trends_type ON coverage_trends(coverage_type);
71
+
72
+ -- Coverage summary table (aggregate metrics per run)
73
+ CREATE TABLE IF NOT EXISTS coverage_summary (
74
+ run_id TEXT PRIMARY KEY REFERENCES runs(id) ON DELETE CASCADE,
75
+ line_coverage REAL NOT NULL DEFAULT 0,
76
+ branch_coverage REAL NOT NULL DEFAULT 0,
77
+ function_coverage REAL NOT NULL DEFAULT 0,
78
+ statement_coverage REAL NOT NULL DEFAULT 0,
79
+ total_files INTEGER DEFAULT 0,
80
+ files_meeting_threshold INTEGER DEFAULT 0,
81
+ total_lines INTEGER DEFAULT 0,
82
+ covered_lines INTEGER DEFAULT 0,
83
+ thresholds_met INTEGER DEFAULT 1,
84
+ created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now') * 1000)
85
+ );
86
+
87
+ CREATE INDEX IF NOT EXISTS idx_coverage_summary_created_at ON coverage_summary(created_at);
88
+ `;
89
+ const statements = schema
90
+ .split(';')
91
+ .map(s => s.trim())
92
+ .filter(s => s.length > 0);
93
+ for (const statement of statements) {
94
+ await this.dbRun(statement, []);
95
+ }
96
+ }
97
+ /**
98
+ * Store coverage result for a run
99
+ */
100
+ async storeCoverage(runId, result) {
101
+ // Store per-file metrics
102
+ for (const [filePath, fileCoverage] of Object.entries(result.files)) {
103
+ const record = {
104
+ run_id: runId,
105
+ gate: result.gate,
106
+ file_path: filePath,
107
+ total_lines: fileCoverage.totalLines,
108
+ covered_lines: fileCoverage.coveredLines,
109
+ branch_coverage: fileCoverage.branchCoverage,
110
+ function_coverage: fileCoverage.functionCoverage,
111
+ line_coverage: fileCoverage.lineCoverage,
112
+ statement_coverage: fileCoverage.statementCoverage,
113
+ total_branches: fileCoverage.totalBranches,
114
+ covered_branches: fileCoverage.coveredBranches,
115
+ total_functions: fileCoverage.totalFunctions,
116
+ covered_functions: fileCoverage.coveredFunctions,
117
+ total_statements: fileCoverage.totalStatements,
118
+ covered_statements: fileCoverage.coveredStatements,
119
+ uncovered_lines: JSON.stringify(fileCoverage.uncoveredLines),
120
+ created_at: Date.now()
121
+ };
122
+ await this.dbRun(`INSERT INTO coverage_metrics (
123
+ run_id, gate, file_path, total_lines, covered_lines,
124
+ branch_coverage, function_coverage, line_coverage, statement_coverage,
125
+ total_branches, covered_branches, total_functions, covered_functions,
126
+ total_statements, covered_statements, uncovered_lines, created_at
127
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
128
+ record.run_id, record.gate, record.file_path, record.total_lines, record.covered_lines,
129
+ record.branch_coverage, record.function_coverage, record.line_coverage, record.statement_coverage,
130
+ record.total_branches, record.covered_branches, record.total_functions, record.covered_functions,
131
+ record.total_statements, record.covered_statements, record.uncovered_lines, record.created_at
132
+ ]);
133
+ }
134
+ // Store aggregate summary
135
+ await this.storeSummary(runId, result.metrics);
136
+ }
137
+ /**
138
+ * Store coverage summary for a run
139
+ */
140
+ async storeSummary(runId, metrics) {
141
+ await this.dbRun(`INSERT OR REPLACE INTO coverage_summary (
142
+ run_id, line_coverage, branch_coverage, function_coverage, statement_coverage,
143
+ total_files, files_meeting_threshold, total_lines, covered_lines, thresholds_met, created_at
144
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
145
+ runId,
146
+ metrics.lineCoverage,
147
+ metrics.branchCoverage,
148
+ metrics.functionCoverage,
149
+ metrics.statementCoverage,
150
+ metrics.totalFiles,
151
+ metrics.filesMeetingThreshold,
152
+ metrics.totalLines,
153
+ metrics.coveredLines,
154
+ 1, // thresholds_met placeholder
155
+ Date.now()
156
+ ]);
157
+ }
158
+ /**
159
+ * Retrieve coverage for a run
160
+ */
161
+ async getCoverage(runId) {
162
+ const rows = await this.dbAll(`SELECT * FROM coverage_metrics WHERE run_id = ?`, [runId]);
163
+ if (rows.length === 0) {
164
+ return null;
165
+ }
166
+ const files = {};
167
+ let gate = 'unknown';
168
+ for (const row of rows) {
169
+ gate = row.gate;
170
+ files[row.file_path] = {
171
+ path: row.file_path,
172
+ totalLines: row.total_lines,
173
+ coveredLines: row.covered_lines,
174
+ lineCoverage: row.line_coverage,
175
+ totalBranches: row.total_branches,
176
+ coveredBranches: row.covered_branches,
177
+ branchCoverage: row.branch_coverage,
178
+ totalFunctions: row.total_functions,
179
+ coveredFunctions: row.covered_functions,
180
+ functionCoverage: row.function_coverage,
181
+ totalStatements: row.total_statements,
182
+ coveredStatements: row.covered_statements,
183
+ statementCoverage: row.statement_coverage,
184
+ uncoveredLines: JSON.parse(row.uncovered_lines || '[]'),
185
+ partiallyCoveredLines: [],
186
+ branchesByLine: {}
187
+ };
188
+ }
189
+ // Get summary
190
+ const summary = await this.getSummary(runId);
191
+ const metrics = summary || {
192
+ lineCoverage: 0,
193
+ branchCoverage: 0,
194
+ functionCoverage: 0,
195
+ statementCoverage: 0,
196
+ totalFiles: Object.keys(files).length,
197
+ filesWithCoverage: Object.keys(files).length,
198
+ filesMeetingThreshold: 0,
199
+ totalLines: 0,
200
+ coveredLines: 0,
201
+ timestamp: Date.now()
202
+ };
203
+ return {
204
+ source: 'custom',
205
+ gate,
206
+ files,
207
+ metrics,
208
+ format: 'json',
209
+ timestamp: Date.now()
210
+ };
211
+ }
212
+ /**
213
+ * Get coverage summary for a run
214
+ */
215
+ async getSummary(runId) {
216
+ const row = await this.dbGet(`SELECT * FROM coverage_summary WHERE run_id = ?`, [runId]);
217
+ if (!row) {
218
+ return null;
219
+ }
220
+ return {
221
+ lineCoverage: row.line_coverage,
222
+ branchCoverage: row.branch_coverage,
223
+ functionCoverage: row.function_coverage,
224
+ statementCoverage: row.statement_coverage,
225
+ totalFiles: row.total_files,
226
+ filesWithCoverage: row.total_files,
227
+ filesMeetingThreshold: row.files_meeting_threshold,
228
+ totalLines: row.total_lines,
229
+ coveredLines: row.covered_lines,
230
+ timestamp: row.created_at
231
+ };
232
+ }
233
+ /**
234
+ * Get coverage trends for a file
235
+ */
236
+ async getTrends(filePath, coverageType = 'line', limit = 30) {
237
+ const rows = await this.dbAll(`SELECT * FROM coverage_trends
238
+ WHERE file_path = ? AND coverage_type = ?
239
+ ORDER BY date DESC
240
+ LIMIT ?`, [filePath, coverageType, limit]);
241
+ const trends = [];
242
+ for (let i = rows.length - 1; i >= 0; i--) {
243
+ const row = rows[i];
244
+ const prev = i > 0 ? rows[i - 1] : null;
245
+ trends.push({
246
+ runId: row.run_id,
247
+ timestamp: row.date,
248
+ coverage: row.coverage_value,
249
+ type: coverageType,
250
+ change: prev ? row.coverage_value - prev.coverage_value : 0,
251
+ commit: row.commit,
252
+ branch: row.branch
253
+ });
254
+ }
255
+ return trends;
256
+ }
257
+ /**
258
+ * Get overall coverage trends
259
+ */
260
+ async getOverallTrends(coverageType = 'line', limit = 30) {
261
+ const rows = await this.dbAll(`SELECT
262
+ run_id,
263
+ ${coverageType}_coverage as coverage_value,
264
+ created_at as date
265
+ FROM coverage_summary
266
+ ORDER BY date DESC
267
+ LIMIT ?`, [limit]);
268
+ const trends = [];
269
+ for (let i = rows.length - 1; i >= 0; i--) {
270
+ const row = rows[i];
271
+ const prev = i > 0 ? rows[i - 1] : null;
272
+ trends.push({
273
+ runId: row.run_id,
274
+ timestamp: row.date,
275
+ coverage: row.coverage_value,
276
+ type: coverageType,
277
+ change: prev ? row.coverage_value - prev.coverage_value : 0
278
+ });
279
+ }
280
+ return trends;
281
+ }
282
+ /**
283
+ * Get coverage by gate
284
+ */
285
+ async getCoverageByGate(gate, limit = 10) {
286
+ const rows = await this.dbAll(`SELECT
287
+ cs.line_coverage,
288
+ cs.branch_coverage,
289
+ cs.function_coverage,
290
+ cs.statement_coverage,
291
+ cs.total_files,
292
+ cs.files_meeting_threshold,
293
+ cs.total_lines,
294
+ cs.covered_lines,
295
+ cs.created_at as timestamp
296
+ FROM coverage_summary cs
297
+ JOIN runs r ON cs.run_id = r.id
298
+ JOIN gates g ON g.run_id = r.id
299
+ WHERE g.name = ?
300
+ ORDER BY cs.created_at DESC
301
+ LIMIT ?`, [gate, limit]);
302
+ return rows.map(row => ({
303
+ lineCoverage: row.line_coverage,
304
+ branchCoverage: row.branch_coverage,
305
+ functionCoverage: row.function_coverage,
306
+ statementCoverage: row.statement_coverage,
307
+ totalFiles: row.total_files,
308
+ filesWithCoverage: row.total_files,
309
+ filesMeetingThreshold: row.files_meeting_threshold,
310
+ totalLines: row.total_lines,
311
+ coveredLines: row.covered_lines,
312
+ timestamp: row.timestamp
313
+ }));
314
+ }
315
+ /**
316
+ * Get files with lowest coverage
317
+ */
318
+ async getLowestCoverageFiles(limit = 10) {
319
+ const rows = await this.dbAll(`SELECT
320
+ file_path,
321
+ AVG(line_coverage) as avg_coverage,
322
+ gate
323
+ FROM coverage_metrics
324
+ GROUP BY file_path
325
+ ORDER BY avg_coverage ASC
326
+ LIMIT ?`, [limit]);
327
+ return rows.map(row => ({
328
+ filePath: row.file_path,
329
+ coverage: row.avg_coverage,
330
+ gate: row.gate
331
+ }));
332
+ }
333
+ /**
334
+ * Get files with highest coverage
335
+ */
336
+ async getHighestCoverageFiles(limit = 10) {
337
+ const rows = await this.dbAll(`SELECT
338
+ file_path,
339
+ AVG(line_coverage) as avg_coverage,
340
+ gate
341
+ FROM coverage_metrics
342
+ GROUP BY file_path
343
+ ORDER BY avg_coverage DESC
344
+ LIMIT ?`, [limit]);
345
+ return rows.map(row => ({
346
+ filePath: row.file_path,
347
+ coverage: row.avg_coverage,
348
+ gate: row.gate
349
+ }));
350
+ }
351
+ /**
352
+ * Get coverage statistics across all runs
353
+ */
354
+ async getStatistics() {
355
+ const totalRuns = await this.dbGet(`SELECT COUNT(DISTINCT run_id) as count FROM coverage_summary`, []);
356
+ const averages = await this.dbGet(`SELECT
357
+ AVG(line_coverage) as line,
358
+ AVG(branch_coverage) as branch,
359
+ AVG(function_coverage) as function
360
+ FROM coverage_summary`, []);
361
+ const best = await this.dbGet(`SELECT run_id, line_coverage FROM coverage_summary ORDER BY line_coverage DESC LIMIT 1`, []);
362
+ const worst = await this.dbGet(`SELECT run_id, line_coverage FROM coverage_summary ORDER BY line_coverage ASC LIMIT 1`, []);
363
+ return {
364
+ totalRuns: totalRuns?.count || 0,
365
+ averageLineCoverage: averages?.line || 0,
366
+ averageBranchCoverage: averages?.branch || 0,
367
+ averageFunctionCoverage: averages?.function || 0,
368
+ bestCoverage: { runId: best?.run_id || '', coverage: best?.line_coverage || 0 },
369
+ worstCoverage: { runId: worst?.run_id || '', coverage: worst?.line_coverage || 0 }
370
+ };
371
+ }
372
+ /**
373
+ * Delete coverage data for a run
374
+ */
375
+ async deleteCoverage(runId) {
376
+ await this.dbRun(`DELETE FROM coverage_metrics WHERE run_id = ?`, [runId]);
377
+ await this.dbRun(`DELETE FROM coverage_summary WHERE run_id = ?`, [runId]);
378
+ await this.dbRun(`DELETE FROM coverage_trends WHERE run_id = ?`, [runId]);
379
+ }
380
+ /**
381
+ * Get recent coverage changes (comparison with previous run)
382
+ */
383
+ async getRecentChanges(limit = 5) {
384
+ const rows = await this.dbAll(`SELECT
385
+ run_id,
386
+ created_at as timestamp,
387
+ line_coverage
388
+ FROM coverage_summary
389
+ ORDER BY created_at DESC
390
+ LIMIT ?`, [limit * 2] // Get extra to calculate changes
391
+ );
392
+ const result = [];
393
+ for (let i = 0; i < Math.min(rows.length - 1, limit); i++) {
394
+ const current = rows[i];
395
+ const previous = rows[i + 1];
396
+ result.push({
397
+ runId: current.run_id,
398
+ timestamp: current.timestamp,
399
+ lineCoverage: current.line_coverage,
400
+ change: previous ? current.line_coverage - previous.line_coverage : 0
401
+ });
402
+ }
403
+ return result;
404
+ }
405
+ }
@@ -50,12 +50,9 @@ export function generateSelector(element) {
50
50
  if (className && !isGenericClass(className)) {
51
51
  const classes = className.split(' ').filter(c => !isGenericClass(c));
52
52
  if (classes.length > 0) {
53
- // Smart class selection: prioritize meaningful classes
54
- const meaningfulClasses = selectMeaningfulClasses(classes);
55
- const classSelector = meaningfulClasses.map(c => `.${escapeCss(c)}`).join('');
56
- // Limit total selector length
57
- const qualifiedSelector = tagName ? `${tagName}${classSelector}` : classSelector;
58
- return truncateSelector(qualifiedSelector, 200);
53
+ const classSelector = classes.map(c => `.${escapeCss(c)}`).join('');
54
+ // Qualify with tag if available
55
+ return tagName ? `${tagName}${classSelector}` : classSelector;
59
56
  }
60
57
  }
61
58
  // 7. Tag + text content (for buttons, links)
@@ -172,72 +169,6 @@ function isSelectorStable(selector) {
172
169
  function escapeCss(str) {
173
170
  return str.replace(/(["\\])/g, '\\$1').replace(/"/g, '\\"');
174
171
  }
175
- /**
176
- * Select the most meaningful classes from a class list
177
- * Prioritizes: unique identifiers, component names, action-oriented classes
178
- * Deprioritizes: utility classes (spacing, colors, sizing)
179
- */
180
- function selectMeaningfulClasses(classes) {
181
- // Tailwind and other utility class patterns to deprioritize
182
- const utilityPatterns = [
183
- /^(p|m|px|py|pt|pb|pl|pr)-/, // spacing
184
- /^(mt|mb|ml|mr)-/, // margin spacing
185
- /^(text|bg|border)-/, // colors
186
- /^(w|h)-/, // sizing
187
- /^(flex|grid|block|inline)/, // display
188
- /^(justify|items|self)/, // flexbox/grid
189
- /^(rounded|shadow|opacity)/, // styling
190
- /^gap-/, // flex gap
191
- /^(line-)?height-/, // height
192
- /^(font|weight|size)/, // typography
193
- ];
194
- // Score each class by "meaningfulness"
195
- const scored = classes.map(cls => {
196
- let score = 50; // base score
197
- // Bonus: component-like names (contain meaningful words)
198
- if (/[A-Z][a-z]+/.test(cls))
199
- score += 30; // CamelCase components
200
- if (/button|btn|input|form|card|modal|nav|header|footer|sidebar|menu|dropdown/i.test(cls))
201
- score += 25;
202
- // Bonus: contains numbers (likely unique)
203
- if (/\d+/.test(cls))
204
- score += 15;
205
- // Penalty: utility classes
206
- for (const pattern of utilityPatterns) {
207
- if (pattern.test(cls)) {
208
- score -= 40;
209
- break;
210
- }
211
- }
212
- return { class: cls, score };
213
- });
214
- // Sort by score (descending) and take top 5
215
- scored.sort((a, b) => b.score - a.score);
216
- return scored.slice(0, 5).map(s => s.class);
217
- }
218
- /**
219
- * Truncate selector to max length while keeping it valid
220
- * Preserves the most specific parts
221
- */
222
- function truncateSelector(selector, maxLength) {
223
- if (selector.length <= maxLength)
224
- return selector;
225
- // For class-based selectors, remove classes from the middle
226
- const classMatch = selector.match(/^(\w+)((\.[\w-]+)+)$/);
227
- if (classMatch) {
228
- const tag = classMatch[1];
229
- const classes = classMatch[2].split('.').filter(c => c); // Remove empty strings
230
- // Keep first 2 and last 2 classes (most specific)
231
- if (classes.length > 4) {
232
- const kept = [...classes.slice(0, 2), ...classes.slice(-2)];
233
- const truncated = `${tag}.${kept.join('.')}`;
234
- if (truncated.length <= maxLength)
235
- return truncated;
236
- }
237
- }
238
- // Final fallback: just truncate (may not be valid CSS but prevents overflow)
239
- return selector.substring(0, maxLength - 3) + '...';
240
- }
241
172
  /**
242
173
  * Optimize selector for resiliency
243
174
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * QA360 Crawler Pack Generator
3
3
  *
4
- * Crawls a website and generates a complete pack.yml in v2 format
4
+ * Crawls a website and generates a complete pack.yml with E2E tests
5
5
  */
6
6
  import type { CrawlOptions, CrawlResult } from '../crawler/index.js';
7
7
  /**