@yasserkhanorg/e2e-agents 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +168 -0
- package/README.md +620 -0
- package/dist/agent/analysis.d.ts +62 -0
- package/dist/agent/analysis.d.ts.map +1 -0
- package/dist/agent/analysis.js +292 -0
- package/dist/agent/blast_radius.d.ts +4 -0
- package/dist/agent/blast_radius.d.ts.map +1 -0
- package/dist/agent/blast_radius.js +37 -0
- package/dist/agent/cache_utils.d.ts +38 -0
- package/dist/agent/cache_utils.d.ts.map +1 -0
- package/dist/agent/cache_utils.js +67 -0
- package/dist/agent/config.d.ts +148 -0
- package/dist/agent/config.d.ts.map +1 -0
- package/dist/agent/config.js +640 -0
- package/dist/agent/dependency_graph.d.ts +14 -0
- package/dist/agent/dependency_graph.d.ts.map +1 -0
- package/dist/agent/dependency_graph.js +227 -0
- package/dist/agent/feedback.d.ts +55 -0
- package/dist/agent/feedback.d.ts.map +1 -0
- package/dist/agent/feedback.js +257 -0
- package/dist/agent/flags.d.ts +23 -0
- package/dist/agent/flags.d.ts.map +1 -0
- package/dist/agent/flags.js +171 -0
- package/dist/agent/flow_catalog.d.ts +25 -0
- package/dist/agent/flow_catalog.d.ts.map +1 -0
- package/dist/agent/flow_catalog.js +106 -0
- package/dist/agent/flow_mapping.d.ts +10 -0
- package/dist/agent/flow_mapping.d.ts.map +1 -0
- package/dist/agent/flow_mapping.js +84 -0
- package/dist/agent/framework.d.ts +13 -0
- package/dist/agent/framework.d.ts.map +1 -0
- package/dist/agent/framework.js +149 -0
- package/dist/agent/gap_suggestions.d.ts +14 -0
- package/dist/agent/gap_suggestions.d.ts.map +1 -0
- package/dist/agent/gap_suggestions.js +101 -0
- package/dist/agent/generator.d.ts +10 -0
- package/dist/agent/generator.d.ts.map +1 -0
- package/dist/agent/generator.js +115 -0
- package/dist/agent/git.d.ts +11 -0
- package/dist/agent/git.d.ts.map +1 -0
- package/dist/agent/git.js +90 -0
- package/dist/agent/handoff.d.ts +22 -0
- package/dist/agent/handoff.d.ts.map +1 -0
- package/dist/agent/handoff.js +180 -0
- package/dist/agent/impact-analyzer.d.ts +114 -0
- package/dist/agent/impact-analyzer.d.ts.map +1 -0
- package/dist/agent/impact-analyzer.js +557 -0
- package/dist/agent/index.d.ts +21 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +38 -0
- package/dist/agent/model-router.d.ts +57 -0
- package/dist/agent/model-router.d.ts.map +1 -0
- package/dist/agent/model-router.js +154 -0
- package/dist/agent/operational_insights.d.ts +41 -0
- package/dist/agent/operational_insights.d.ts.map +1 -0
- package/dist/agent/operational_insights.js +126 -0
- package/dist/agent/pipeline.d.ts +23 -0
- package/dist/agent/pipeline.d.ts.map +1 -0
- package/dist/agent/pipeline.js +609 -0
- package/dist/agent/plan.d.ts +91 -0
- package/dist/agent/plan.d.ts.map +1 -0
- package/dist/agent/plan.js +331 -0
- package/dist/agent/playwright_report.d.ts +8 -0
- package/dist/agent/playwright_report.d.ts.map +1 -0
- package/dist/agent/playwright_report.js +126 -0
- package/dist/agent/report-generator.d.ts +24 -0
- package/dist/agent/report-generator.d.ts.map +1 -0
- package/dist/agent/report-generator.js +250 -0
- package/dist/agent/report.d.ts +81 -0
- package/dist/agent/report.d.ts.map +1 -0
- package/dist/agent/report.js +147 -0
- package/dist/agent/runner.d.ts +7 -0
- package/dist/agent/runner.d.ts.map +1 -0
- package/dist/agent/runner.js +576 -0
- package/dist/agent/selectors.d.ts +10 -0
- package/dist/agent/selectors.d.ts.map +1 -0
- package/dist/agent/selectors.js +75 -0
- package/dist/agent/spec-bridge.d.ts +101 -0
- package/dist/agent/spec-bridge.d.ts.map +1 -0
- package/dist/agent/spec-bridge.js +273 -0
- package/dist/agent/spec-builder.d.ts +102 -0
- package/dist/agent/spec-builder.d.ts.map +1 -0
- package/dist/agent/spec-builder.js +273 -0
- package/dist/agent/subsystem_risk.d.ts +23 -0
- package/dist/agent/subsystem_risk.d.ts.map +1 -0
- package/dist/agent/subsystem_risk.js +207 -0
- package/dist/agent/telemetry.d.ts +84 -0
- package/dist/agent/telemetry.d.ts.map +1 -0
- package/dist/agent/telemetry.js +220 -0
- package/dist/agent/test_path.d.ts +2 -0
- package/dist/agent/test_path.d.ts.map +1 -0
- package/dist/agent/test_path.js +23 -0
- package/dist/agent/tests.d.ts +18 -0
- package/dist/agent/tests.d.ts.map +1 -0
- package/dist/agent/tests.js +106 -0
- package/dist/agent/traceability.d.ts +22 -0
- package/dist/agent/traceability.d.ts.map +1 -0
- package/dist/agent/traceability.js +183 -0
- package/dist/agent/traceability_capture.d.ts +18 -0
- package/dist/agent/traceability_capture.d.ts.map +1 -0
- package/dist/agent/traceability_capture.js +313 -0
- package/dist/agent/traceability_ingest.d.ts +21 -0
- package/dist/agent/traceability_ingest.d.ts.map +1 -0
- package/dist/agent/traceability_ingest.js +237 -0
- package/dist/agent/utils.d.ts +13 -0
- package/dist/agent/utils.d.ts.map +1 -0
- package/dist/agent/utils.js +152 -0
- package/dist/agent/validators/selector-validator.d.ts +74 -0
- package/dist/agent/validators/selector-validator.d.ts.map +1 -0
- package/dist/agent/validators/selector-validator.js +165 -0
- package/dist/anthropic_provider.d.ts +65 -0
- package/dist/anthropic_provider.d.ts.map +1 -0
- package/dist/anthropic_provider.js +332 -0
- package/dist/api.d.ts +48 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +113 -0
- package/dist/base_provider.d.ts +53 -0
- package/dist/base_provider.d.ts.map +1 -0
- package/dist/base_provider.js +81 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +843 -0
- package/dist/custom_provider.d.ts +20 -0
- package/dist/custom_provider.d.ts.map +1 -0
- package/dist/custom_provider.js +276 -0
- package/dist/e2e-test-gen/index.d.ts +51 -0
- package/dist/e2e-test-gen/index.d.ts.map +1 -0
- package/dist/e2e-test-gen/index.js +57 -0
- package/dist/e2e-test-gen/spec_parser.d.ts +142 -0
- package/dist/e2e-test-gen/spec_parser.d.ts.map +1 -0
- package/dist/e2e-test-gen/spec_parser.js +786 -0
- package/dist/e2e-test-gen/types.d.ts +185 -0
- package/dist/e2e-test-gen/types.d.ts.map +1 -0
- package/dist/e2e-test-gen/types.js +4 -0
- package/dist/esm/agent/analysis.js +287 -0
- package/dist/esm/agent/blast_radius.js +34 -0
- package/dist/esm/agent/cache_utils.js +63 -0
- package/dist/esm/agent/config.js +637 -0
- package/dist/esm/agent/dependency_graph.js +224 -0
- package/dist/esm/agent/feedback.js +253 -0
- package/dist/esm/agent/flags.js +160 -0
- package/dist/esm/agent/flow_catalog.js +103 -0
- package/dist/esm/agent/flow_mapping.js +81 -0
- package/dist/esm/agent/framework.js +145 -0
- package/dist/esm/agent/gap_suggestions.js +98 -0
- package/dist/esm/agent/generator.js +112 -0
- package/dist/esm/agent/git.js +87 -0
- package/dist/esm/agent/handoff.js +177 -0
- package/dist/esm/agent/impact-analyzer.js +548 -0
- package/dist/esm/agent/index.js +22 -0
- package/dist/esm/agent/model-router.js +150 -0
- package/dist/esm/agent/operational_insights.js +123 -0
- package/dist/esm/agent/pipeline.js +605 -0
- package/dist/esm/agent/plan.js +324 -0
- package/dist/esm/agent/playwright_report.js +123 -0
- package/dist/esm/agent/report-generator.js +247 -0
- package/dist/esm/agent/report.js +144 -0
- package/dist/esm/agent/runner.js +572 -0
- package/dist/esm/agent/selectors.js +71 -0
- package/dist/esm/agent/spec-bridge.js +267 -0
- package/dist/esm/agent/spec-builder.js +267 -0
- package/dist/esm/agent/subsystem_risk.js +204 -0
- package/dist/esm/agent/telemetry.js +216 -0
- package/dist/esm/agent/test_path.js +20 -0
- package/dist/esm/agent/tests.js +101 -0
- package/dist/esm/agent/traceability.js +180 -0
- package/dist/esm/agent/traceability_capture.js +310 -0
- package/dist/esm/agent/traceability_ingest.js +234 -0
- package/dist/esm/agent/utils.js +138 -0
- package/dist/esm/agent/validators/selector-validator.js +160 -0
- package/dist/esm/anthropic_provider.js +324 -0
- package/dist/esm/api.js +105 -0
- package/dist/esm/base_provider.js +77 -0
- package/dist/esm/cli.js +841 -0
- package/dist/esm/custom_provider.js +272 -0
- package/dist/esm/e2e-test-gen/index.js +50 -0
- package/dist/esm/e2e-test-gen/spec_parser.js +782 -0
- package/dist/esm/e2e-test-gen/types.js +3 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/logger.js +89 -0
- package/dist/esm/mcp-server.js +465 -0
- package/dist/esm/ollama_provider.js +300 -0
- package/dist/esm/openai_provider.js +242 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/plan-and-test-constants.js +126 -0
- package/dist/esm/provider_factory.js +336 -0
- package/dist/esm/provider_interface.js +23 -0
- package/dist/esm/provider_utils.js +96 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/logger.d.ts +23 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +93 -0
- package/dist/mcp-server.d.ts +35 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +469 -0
- package/dist/ollama_provider.d.ts +65 -0
- package/dist/ollama_provider.d.ts.map +1 -0
- package/dist/ollama_provider.js +308 -0
- package/dist/openai_provider.d.ts +23 -0
- package/dist/openai_provider.d.ts.map +1 -0
- package/dist/openai_provider.js +250 -0
- package/dist/plan-and-test-constants.d.ts +110 -0
- package/dist/plan-and-test-constants.d.ts.map +1 -0
- package/dist/plan-and-test-constants.js +132 -0
- package/dist/provider_factory.d.ts +99 -0
- package/dist/provider_factory.d.ts.map +1 -0
- package/dist/provider_factory.js +341 -0
- package/dist/provider_interface.d.ts +358 -0
- package/dist/provider_interface.d.ts.map +1 -0
- package/dist/provider_interface.js +28 -0
- package/dist/provider_utils.d.ts +39 -0
- package/dist/provider_utils.d.ts.map +1 -0
- package/dist/provider_utils.js +103 -0
- package/package.json +101 -0
- package/schemas/gap.schema.json +18 -0
- package/schemas/impact.schema.json +418 -0
- package/schemas/plan.schema.json +285 -0
- package/schemas/subsystem-risk-map.schema.json +62 -0
- package/schemas/traceability-input.schema.json +122 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
4
|
+
* See LICENSE.txt for license information.
|
|
5
|
+
*
|
|
6
|
+
* Report Generation Engine
|
|
7
|
+
*
|
|
8
|
+
* Generates console, markdown, and JSON reports from impact analysis results.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.generateReports = generateReports;
|
|
12
|
+
const fs_1 = require("fs");
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
/**
|
|
15
|
+
* Generate all requested report formats
|
|
16
|
+
*/
|
|
17
|
+
async function generateReports(analysis, options = {}) {
|
|
18
|
+
const { console: consoleReport = true, markdown = true, json = true, outputDir = './.e2e-ai-agents/reports', } = options;
|
|
19
|
+
if (consoleReport) {
|
|
20
|
+
printConsoleReport(analysis);
|
|
21
|
+
}
|
|
22
|
+
if (markdown || json) {
|
|
23
|
+
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
if (markdown) {
|
|
26
|
+
const mdPath = (0, path_1.join)(outputDir, `impact-${Date.now()}.md`);
|
|
27
|
+
const markdownReport = generateMarkdownReport(analysis);
|
|
28
|
+
(0, fs_1.writeFileSync)(mdPath, markdownReport);
|
|
29
|
+
console.log(`\n📄 Markdown report: ${mdPath}`);
|
|
30
|
+
}
|
|
31
|
+
if (json) {
|
|
32
|
+
const jsonPath = (0, path_1.join)(outputDir, `impact-${Date.now()}.json`);
|
|
33
|
+
(0, fs_1.writeFileSync)(jsonPath, JSON.stringify(analysis, null, 2));
|
|
34
|
+
console.log(`📊 JSON report: ${jsonPath}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// =============================================================================
|
|
38
|
+
// CONSOLE REPORT
|
|
39
|
+
// =============================================================================
|
|
40
|
+
function printConsoleReport(analysis) {
|
|
41
|
+
console.log('\n═══════════════════════════════════════════════════════════════════');
|
|
42
|
+
console.log('📊 CODE IMPACT ANALYSIS REPORT');
|
|
43
|
+
console.log('═══════════════════════════════════════════════════════════════════\n');
|
|
44
|
+
// Summary
|
|
45
|
+
console.log('📈 SUMMARY');
|
|
46
|
+
console.log(` Changed files: ${analysis.totalChanges}`);
|
|
47
|
+
console.log(` Affected flows: ${analysis.affectedFlows.length}`);
|
|
48
|
+
console.log(` Priority breakdown: P0=${analysis.priorityBreakdown.p0}, P1=${analysis.priorityBreakdown.p1}, P2=${analysis.priorityBreakdown.p2}`);
|
|
49
|
+
console.log(` Test coverage: ${analysis.testCoverage.covered}/${analysis.testCoverage.total} flows have tests (${analysis.testCoverage.gaps} gaps)\n`);
|
|
50
|
+
// P0 Flows (Critical)
|
|
51
|
+
const p0Flows = analysis.affectedFlows.filter((f) => f.flow.priority === 'P0');
|
|
52
|
+
if (p0Flows.length > 0) {
|
|
53
|
+
console.log('🔴 CRITICAL (P0) FLOWS AFFECTED:');
|
|
54
|
+
p0Flows.forEach((impact) => {
|
|
55
|
+
console.log(` • ${impact.flow.name} (${impact.flow.id})`);
|
|
56
|
+
console.log(` Confidence: ${impact.confidence}% | Match: ${impact.matchType}`);
|
|
57
|
+
console.log(` Existing tests: ${impact.existingTests.length} ${impact.existingTests.length > 0 ? '✓' : '✗'}`);
|
|
58
|
+
if (impact.testGaps.length > 0) {
|
|
59
|
+
console.log(` ⚠️ Test gaps: ${impact.testGaps.slice(0, 2).join(', ')}${impact.testGaps.length > 2 ? '...' : ''}`);
|
|
60
|
+
}
|
|
61
|
+
console.log(` Affected files: ${impact.affectedFiles.length}`);
|
|
62
|
+
});
|
|
63
|
+
console.log('');
|
|
64
|
+
}
|
|
65
|
+
// P1 Flows (High Priority)
|
|
66
|
+
const p1Flows = analysis.affectedFlows.filter((f) => f.flow.priority === 'P1');
|
|
67
|
+
if (p1Flows.length > 0) {
|
|
68
|
+
console.log('🟡 HIGH PRIORITY (P1) FLOWS AFFECTED:');
|
|
69
|
+
p1Flows.slice(0, 5).forEach((impact) => {
|
|
70
|
+
console.log(` • ${impact.flow.name} (${impact.flow.id})`);
|
|
71
|
+
console.log(` Tests: ${impact.existingTests.length}/${impact.affectedFiles.length} files, Gaps: ${impact.testGaps.length}`);
|
|
72
|
+
});
|
|
73
|
+
if (p1Flows.length > 5) {
|
|
74
|
+
console.log(` ... and ${p1Flows.length - 5} more P1 flows`);
|
|
75
|
+
}
|
|
76
|
+
console.log('');
|
|
77
|
+
}
|
|
78
|
+
// Recommendations
|
|
79
|
+
if (analysis.recommendations.length > 0) {
|
|
80
|
+
console.log('💡 RECOMMENDATIONS:');
|
|
81
|
+
analysis.recommendations.forEach((rec, i) => {
|
|
82
|
+
console.log(` ${i + 1}. ${rec}`);
|
|
83
|
+
});
|
|
84
|
+
console.log('');
|
|
85
|
+
}
|
|
86
|
+
// Action Items
|
|
87
|
+
console.log('🎯 SUGGESTED ACTIONS:');
|
|
88
|
+
if (analysis.hasP0Impact) {
|
|
89
|
+
console.log(' 1. Run P0 flow tests immediately:');
|
|
90
|
+
const p0Tests = p0Flows.flatMap((f) => f.existingTests).filter((t) => t);
|
|
91
|
+
if (p0Tests.length > 0) {
|
|
92
|
+
console.log(` npx playwright test ${p0Tests.slice(0, 3).join(' ')}`);
|
|
93
|
+
if (p0Tests.length > 3) {
|
|
94
|
+
console.log(` ... and ${p0Tests.length - 3} more P0 tests`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
console.log(' ⚠️ No existing P0 tests found - generate tests first:');
|
|
99
|
+
console.log(' npx e2e-ai-agents approve-and-generate --path <app-root> --tests-root <tests-root> --pipeline --pipeline-scenarios 3');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (analysis.testCoverage.gaps > 0) {
|
|
103
|
+
console.log(` 2. Address ${analysis.testCoverage.gaps} test coverage gap(s):`);
|
|
104
|
+
const gapFlows = analysis.affectedFlows.filter((f) => f.testGaps.length > 0).slice(0, 2);
|
|
105
|
+
gapFlows.forEach(() => {
|
|
106
|
+
console.log(' npx e2e-ai-agents approve-and-generate --path <app-root> --tests-root <tests-root> --pipeline --pipeline-scenarios 3');
|
|
107
|
+
});
|
|
108
|
+
if (analysis.testCoverage.gaps > 2) {
|
|
109
|
+
console.log(` # ... and ${analysis.testCoverage.gaps - 2} more flows with gaps`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
console.log('\n═══════════════════════════════════════════════════════════════════\n');
|
|
113
|
+
}
|
|
114
|
+
// =============================================================================
|
|
115
|
+
// MARKDOWN REPORT
|
|
116
|
+
// =============================================================================
|
|
117
|
+
function generateMarkdownReport(analysis) {
|
|
118
|
+
const lines = [];
|
|
119
|
+
lines.push('# Code Impact Analysis Report');
|
|
120
|
+
lines.push('');
|
|
121
|
+
lines.push(`**Generated**: ${new Date(analysis.timestamp).toLocaleString()}`);
|
|
122
|
+
lines.push(`**Git Reference**: ${analysis.gitRef}`);
|
|
123
|
+
lines.push('');
|
|
124
|
+
// Risk Level Badge
|
|
125
|
+
const riskLevel = analysis.hasP0Impact
|
|
126
|
+
? '🔴 **HIGH** (P0 flows affected)'
|
|
127
|
+
: analysis.priorityBreakdown.p1 > 0
|
|
128
|
+
? '🟡 **MEDIUM** (P1 flows affected)'
|
|
129
|
+
: '🟢 **LOW** (Only P2 flows affected)';
|
|
130
|
+
// Executive Summary
|
|
131
|
+
lines.push('## Executive Summary');
|
|
132
|
+
lines.push('');
|
|
133
|
+
lines.push(`- **Changed files**: ${analysis.totalChanges}`);
|
|
134
|
+
lines.push(`- **Affected flows**: ${analysis.affectedFlows.length}`);
|
|
135
|
+
lines.push(`- **Priority**: P0=${analysis.priorityBreakdown.p0}, P1=${analysis.priorityBreakdown.p1}, P2=${analysis.priorityBreakdown.p2}`);
|
|
136
|
+
lines.push(`- **Test coverage**: ${analysis.testCoverage.covered}/${analysis.testCoverage.total} flows have tests (${analysis.testCoverage.gaps} gaps)`);
|
|
137
|
+
lines.push(`- **Risk level**: ${riskLevel}`);
|
|
138
|
+
lines.push('');
|
|
139
|
+
// Critical Flows
|
|
140
|
+
const p0Flows = analysis.affectedFlows.filter((f) => f.flow.priority === 'P0');
|
|
141
|
+
if (p0Flows.length > 0) {
|
|
142
|
+
lines.push('## 🔴 Critical (P0) Flows Affected');
|
|
143
|
+
lines.push('');
|
|
144
|
+
p0Flows.forEach((impact) => {
|
|
145
|
+
lines.push(`### ${impact.flow.name} (\`${impact.flow.id}\`)`);
|
|
146
|
+
lines.push('');
|
|
147
|
+
lines.push(`**Confidence**: ${impact.confidence}%`);
|
|
148
|
+
lines.push(`**Match type**: ${impact.matchType}`);
|
|
149
|
+
lines.push(`**Affected files**: ${impact.affectedFiles.length} file${impact.affectedFiles.length !== 1 ? 's' : ''}`);
|
|
150
|
+
lines.push('');
|
|
151
|
+
lines.push(`**Existing tests**: ${impact.existingTests.length > 0 ? '✓ ' + impact.existingTests.length : '✗ None'}`);
|
|
152
|
+
if (impact.existingTests.length > 0) {
|
|
153
|
+
lines.push('```');
|
|
154
|
+
impact.existingTests.slice(0, 3).forEach((test) => {
|
|
155
|
+
lines.push(test);
|
|
156
|
+
});
|
|
157
|
+
if (impact.existingTests.length > 3) {
|
|
158
|
+
lines.push(`... and ${impact.existingTests.length - 3} more`);
|
|
159
|
+
}
|
|
160
|
+
lines.push('```');
|
|
161
|
+
}
|
|
162
|
+
if (impact.testGaps.length > 0) {
|
|
163
|
+
lines.push('');
|
|
164
|
+
lines.push(`**Test gaps**:`);
|
|
165
|
+
impact.testGaps.slice(0, 3).forEach((gap) => {
|
|
166
|
+
lines.push(`- ${gap}`);
|
|
167
|
+
});
|
|
168
|
+
if (impact.testGaps.length > 3) {
|
|
169
|
+
lines.push(`- ... and ${impact.testGaps.length - 3} more`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
lines.push('');
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// High Priority Flows
|
|
176
|
+
const p1Flows = analysis.affectedFlows.filter((f) => f.flow.priority === 'P1');
|
|
177
|
+
if (p1Flows.length > 0) {
|
|
178
|
+
lines.push('## 🟡 High Priority (P1) Flows Affected');
|
|
179
|
+
lines.push('');
|
|
180
|
+
lines.push('| Flow | ID | Files | Tests | Gaps |');
|
|
181
|
+
lines.push('|------|----| ------|-------|------|');
|
|
182
|
+
p1Flows.slice(0, 10).forEach((impact) => {
|
|
183
|
+
lines.push(`| ${impact.flow.name} | \`${impact.flow.id}\` | ${impact.affectedFiles.length} | ${impact.existingTests.length} | ${impact.testGaps.length} |`);
|
|
184
|
+
});
|
|
185
|
+
if (p1Flows.length > 10) {
|
|
186
|
+
lines.push(`| ... ${p1Flows.length - 10} more | ... | ... | ... | ... |`);
|
|
187
|
+
}
|
|
188
|
+
lines.push('');
|
|
189
|
+
}
|
|
190
|
+
// Recommendations
|
|
191
|
+
if (analysis.recommendations.length > 0) {
|
|
192
|
+
lines.push('## 💡 Recommendations');
|
|
193
|
+
lines.push('');
|
|
194
|
+
analysis.recommendations.forEach((rec, i) => {
|
|
195
|
+
lines.push(`${i + 1}. ${rec}`);
|
|
196
|
+
});
|
|
197
|
+
lines.push('');
|
|
198
|
+
}
|
|
199
|
+
// Action Items
|
|
200
|
+
lines.push('## 🎯 Action Items');
|
|
201
|
+
lines.push('');
|
|
202
|
+
if (analysis.hasP0Impact) {
|
|
203
|
+
lines.push('### Immediate: Run P0 Tests');
|
|
204
|
+
lines.push('');
|
|
205
|
+
const p0Tests = p0Flows.flatMap((f) => f.existingTests).filter((t) => t);
|
|
206
|
+
if (p0Tests.length > 0) {
|
|
207
|
+
lines.push('```bash');
|
|
208
|
+
lines.push(`npx playwright test ${p0Tests.slice(0, 3).join(' ')}`);
|
|
209
|
+
if (p0Tests.length > 3) {
|
|
210
|
+
lines.push(`# ... and ${p0Tests.length - 3} more P0 tests`);
|
|
211
|
+
}
|
|
212
|
+
lines.push('```');
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
lines.push('No existing P0 tests found. Generate tests:');
|
|
216
|
+
lines.push('');
|
|
217
|
+
lines.push('```bash');
|
|
218
|
+
lines.push('npx e2e-ai-agents approve-and-generate --path <app-root> --tests-root <tests-root> --pipeline --pipeline-scenarios 3');
|
|
219
|
+
lines.push('```');
|
|
220
|
+
}
|
|
221
|
+
lines.push('');
|
|
222
|
+
}
|
|
223
|
+
if (analysis.testCoverage.gaps > 0) {
|
|
224
|
+
lines.push('### Generate Missing Tests');
|
|
225
|
+
lines.push('');
|
|
226
|
+
const gapFlows = analysis.affectedFlows.filter((f) => f.testGaps.length > 0).slice(0, 3);
|
|
227
|
+
if (gapFlows.length > 0) {
|
|
228
|
+
lines.push('```bash');
|
|
229
|
+
gapFlows.forEach(() => {
|
|
230
|
+
lines.push('npx e2e-ai-agents approve-and-generate --path <app-root> --tests-root <tests-root> --pipeline --pipeline-scenarios 3');
|
|
231
|
+
});
|
|
232
|
+
if (analysis.testCoverage.gaps > 3) {
|
|
233
|
+
lines.push(`# ... and ${analysis.testCoverage.gaps - 3} more gaps to address`);
|
|
234
|
+
}
|
|
235
|
+
lines.push('```');
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
lines.push('');
|
|
239
|
+
lines.push('---');
|
|
240
|
+
lines.push('');
|
|
241
|
+
lines.push('_This report was generated by the E2E Impact Analysis Agent. To regenerate, run: `npx e2e-ai-agents impact --path <app-root> --tests-root <tests-root>`_');
|
|
242
|
+
return lines.join('\n');
|
|
243
|
+
}
|
|
244
|
+
// =============================================================================
|
|
245
|
+
// JSON REPORT
|
|
246
|
+
// =============================================================================
|
|
247
|
+
/**
|
|
248
|
+
* JSON report is generated directly in generateReports()
|
|
249
|
+
* No additional formatting needed
|
|
250
|
+
*/
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { AgentConfig } from './config.js';
|
|
2
|
+
import type { FlowImpact } from './analysis.js';
|
|
3
|
+
import type { FlowCoverage } from './tests.js';
|
|
4
|
+
import type { DataTestIdSuggestion } from './selectors.js';
|
|
5
|
+
import type { GapTestSuggestion } from './gap_suggestions.js';
|
|
6
|
+
export interface ReportData {
|
|
7
|
+
mode: 'impact' | 'gap';
|
|
8
|
+
changedFiles: string[];
|
|
9
|
+
flows: FlowImpact[];
|
|
10
|
+
coverage: FlowCoverage[];
|
|
11
|
+
gaps: FlowImpact[];
|
|
12
|
+
dataTestIds: DataTestIdSuggestion[];
|
|
13
|
+
testSuggestions?: GapTestSuggestion[];
|
|
14
|
+
suggestedNewTests?: GapTestSuggestion[];
|
|
15
|
+
framework: string;
|
|
16
|
+
testPatterns: string[];
|
|
17
|
+
specPDF?: string;
|
|
18
|
+
warnings: string[];
|
|
19
|
+
flowCatalog?: string;
|
|
20
|
+
recommendedTests?: string[];
|
|
21
|
+
impactModel?: {
|
|
22
|
+
schemaVersion: '1.0.0';
|
|
23
|
+
flowMapping: 'catalog' | 'heuristic';
|
|
24
|
+
testMapping: 'catalog' | 'traceability' | 'heuristic';
|
|
25
|
+
confidenceClass: 'high' | 'medium' | 'low';
|
|
26
|
+
traceability?: {
|
|
27
|
+
source: 'manifest';
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
manifestPath: string;
|
|
30
|
+
manifestFound: boolean;
|
|
31
|
+
manifestTests: number;
|
|
32
|
+
manifestEdges: number;
|
|
33
|
+
matchedFlows: number;
|
|
34
|
+
totalFlows: number;
|
|
35
|
+
matchedTests: number;
|
|
36
|
+
coverageRatio: number;
|
|
37
|
+
};
|
|
38
|
+
dependencyGraph?: {
|
|
39
|
+
source: 'static-dependency-graph';
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
seedFiles: number;
|
|
42
|
+
expandedFiles: number;
|
|
43
|
+
analyzedFiles: number;
|
|
44
|
+
analyzedEdges: number;
|
|
45
|
+
maxDepth: number;
|
|
46
|
+
truncated: boolean;
|
|
47
|
+
};
|
|
48
|
+
subsystemRisk?: {
|
|
49
|
+
source: 'map';
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
mapPath: string;
|
|
52
|
+
mapFound: boolean;
|
|
53
|
+
rulesLoaded: number;
|
|
54
|
+
filesMatched: number;
|
|
55
|
+
ruleMatches: number;
|
|
56
|
+
boostedFlows: number;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
pipeline?: {
|
|
60
|
+
runner: string;
|
|
61
|
+
results: Array<{
|
|
62
|
+
flowId: string;
|
|
63
|
+
flowName: string;
|
|
64
|
+
generatedDir: string;
|
|
65
|
+
generateStatus: string;
|
|
66
|
+
healStatus?: string;
|
|
67
|
+
error?: string;
|
|
68
|
+
}>;
|
|
69
|
+
warnings: string[];
|
|
70
|
+
};
|
|
71
|
+
applied?: {
|
|
72
|
+
patchedFiles: string[];
|
|
73
|
+
generatedTests: string[];
|
|
74
|
+
skippedTests: string[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export declare function writeReport(appRoot: string, config: AgentConfig, data: ReportData): {
|
|
78
|
+
markdownPath: string;
|
|
79
|
+
jsonPath: string;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/agent/report.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.writeReport = writeReport;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const flags_js_1 = require("./flags.js");
|
|
9
|
+
function formatFlow(flow) {
|
|
10
|
+
const reasonText = flow.reasons.length > 0 ? flow.reasons.join('; ') : 'No specific reasons';
|
|
11
|
+
const audienceText = flow.audience && flow.audience.length > 0 ? `\n Audience: ${flow.audience.join(', ')}` : '';
|
|
12
|
+
const flagsText = flow.flags && flow.flags.length > 0 ? `\n Flags: ${(0, flags_js_1.formatFlags)(flow.flags)}` : '';
|
|
13
|
+
const blastText = flow.blastRadius ? `\n Blast radius: ${flow.blastRadius.summary}` : '';
|
|
14
|
+
return `- [${flow.priority}] ${flow.name} (${flow.id})\n Score: ${flow.score}\n Reasons: ${reasonText}\n Files: ${flow.files.join(', ')}${audienceText}${flagsText}${blastText}`;
|
|
15
|
+
}
|
|
16
|
+
function formatGap(flow) {
|
|
17
|
+
return `- [${flow.priority}] ${flow.name} (${flow.id})`;
|
|
18
|
+
}
|
|
19
|
+
function formatSuggestion(suggestion) {
|
|
20
|
+
return `- ${suggestion.file}:${suggestion.line} -> ${suggestion.testId}\n ${suggestion.snippet}`;
|
|
21
|
+
}
|
|
22
|
+
function formatTestSuggestion(suggestion) {
|
|
23
|
+
const source = suggestion.sourceFiles.length > 0 ? suggestion.sourceFiles.join(', ') : 'N/A';
|
|
24
|
+
return `- [${suggestion.priority}] ${suggestion.flowName} (${suggestion.flowId})\n Path: ${suggestion.suggestedTestPath}\n Source files: ${source}\n Why: ${suggestion.rationale}`;
|
|
25
|
+
}
|
|
26
|
+
function flowCounts(flows) {
|
|
27
|
+
return flows.reduce((acc, flow) => {
|
|
28
|
+
if (flow.priority === 'P0')
|
|
29
|
+
acc.p0 += 1;
|
|
30
|
+
else if (flow.priority === 'P1')
|
|
31
|
+
acc.p1 += 1;
|
|
32
|
+
else
|
|
33
|
+
acc.p2 += 1;
|
|
34
|
+
return acc;
|
|
35
|
+
}, { p0: 0, p1: 0, p2: 0 });
|
|
36
|
+
}
|
|
37
|
+
function writeReport(appRoot, config, data) {
|
|
38
|
+
const specsDir = (0, path_1.join)(appRoot, config.artifacts.specsDir);
|
|
39
|
+
const baseDir = (0, path_1.join)(appRoot, '.e2e-ai-agents');
|
|
40
|
+
if (config.artifacts.mode !== 'none') {
|
|
41
|
+
(0, fs_1.mkdirSync)(specsDir, { recursive: true });
|
|
42
|
+
}
|
|
43
|
+
(0, fs_1.mkdirSync)(baseDir, { recursive: true });
|
|
44
|
+
const counts = flowCounts(data.flows);
|
|
45
|
+
const markdownLines = [];
|
|
46
|
+
markdownLines.push(`# ${data.mode === 'impact' ? 'Impact Analysis' : 'Gap Analysis'} Report`);
|
|
47
|
+
markdownLines.push('');
|
|
48
|
+
markdownLines.push(`Framework: ${data.framework}`);
|
|
49
|
+
markdownLines.push(`Test Patterns: ${data.testPatterns.join(', ') || 'None'}`);
|
|
50
|
+
if (data.flowCatalog) {
|
|
51
|
+
markdownLines.push(`Flow Catalog: ${data.flowCatalog}`);
|
|
52
|
+
}
|
|
53
|
+
if (data.impactModel) {
|
|
54
|
+
markdownLines.push(`Impact Model: flow=${data.impactModel.flowMapping} test=${data.impactModel.testMapping} confidence=${data.impactModel.confidenceClass}`);
|
|
55
|
+
if (data.impactModel.traceability) {
|
|
56
|
+
const traceability = data.impactModel.traceability;
|
|
57
|
+
markdownLines.push(`Traceability: enabled=${traceability.enabled} manifestFound=${traceability.manifestFound} matchedFlows=${traceability.matchedFlows}/${traceability.totalFlows} matchedTests=${traceability.matchedTests} coverageRatio=${traceability.coverageRatio}`);
|
|
58
|
+
}
|
|
59
|
+
if (data.impactModel.dependencyGraph) {
|
|
60
|
+
const graph = data.impactModel.dependencyGraph;
|
|
61
|
+
markdownLines.push(`Dependency Graph: enabled=${graph.enabled} seeds=${graph.seedFiles} expanded=${graph.expandedFiles} files=${graph.analyzedFiles} edges=${graph.analyzedEdges} depth=${graph.maxDepth}${graph.truncated ? ' (truncated)' : ''}`);
|
|
62
|
+
}
|
|
63
|
+
if (data.impactModel.subsystemRisk) {
|
|
64
|
+
const subsystemRisk = data.impactModel.subsystemRisk;
|
|
65
|
+
markdownLines.push(`Subsystem Risk: enabled=${subsystemRisk.enabled} mapFound=${subsystemRisk.mapFound} rules=${subsystemRisk.rulesLoaded} filesMatched=${subsystemRisk.filesMatched} ruleMatches=${subsystemRisk.ruleMatches} boostedFlows=${subsystemRisk.boostedFlows}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
markdownLines.push(`Changed Files: ${data.changedFiles.length}`);
|
|
69
|
+
markdownLines.push(`Flows: P0=${counts.p0} P1=${counts.p1} P2=${counts.p2}`);
|
|
70
|
+
if (data.specPDF) {
|
|
71
|
+
markdownLines.push(`Spec PDF: ${data.specPDF}`);
|
|
72
|
+
}
|
|
73
|
+
if (data.warnings.length > 0) {
|
|
74
|
+
markdownLines.push('');
|
|
75
|
+
markdownLines.push('Warnings:');
|
|
76
|
+
markdownLines.push(...data.warnings.map((warning) => `- ${warning}`));
|
|
77
|
+
}
|
|
78
|
+
if (data.flows.length > 0) {
|
|
79
|
+
markdownLines.push('');
|
|
80
|
+
markdownLines.push('Impacted Flows:');
|
|
81
|
+
markdownLines.push(...data.flows.map(formatFlow));
|
|
82
|
+
}
|
|
83
|
+
if (data.gaps.length > 0) {
|
|
84
|
+
markdownLines.push('');
|
|
85
|
+
markdownLines.push('Coverage Gaps (P0/P1 without tests):');
|
|
86
|
+
markdownLines.push(...data.gaps.map(formatGap));
|
|
87
|
+
}
|
|
88
|
+
if (data.recommendedTests && data.recommendedTests.length > 0) {
|
|
89
|
+
markdownLines.push('');
|
|
90
|
+
markdownLines.push('Recommended Tests to Run:');
|
|
91
|
+
markdownLines.push(...data.recommendedTests.map((test) => `- ${test}`));
|
|
92
|
+
}
|
|
93
|
+
if (data.pipeline) {
|
|
94
|
+
markdownLines.push('');
|
|
95
|
+
markdownLines.push('Pipeline Results:');
|
|
96
|
+
markdownLines.push(`- Runner: ${data.pipeline.runner}`);
|
|
97
|
+
for (const result of data.pipeline.results) {
|
|
98
|
+
const status = result.healStatus ? `${result.generateStatus}/${result.healStatus}` : result.generateStatus;
|
|
99
|
+
markdownLines.push(`- ${result.flowId} (${result.flowName}): ${status} -> ${result.generatedDir}`);
|
|
100
|
+
if (result.error) {
|
|
101
|
+
markdownLines.push(` Error: ${result.error}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (data.pipeline.warnings.length > 0) {
|
|
105
|
+
markdownLines.push('Pipeline warnings:');
|
|
106
|
+
markdownLines.push(...data.pipeline.warnings.map((warning) => `- ${warning}`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (data.dataTestIds.length > 0) {
|
|
110
|
+
markdownLines.push('');
|
|
111
|
+
markdownLines.push('data-testid Suggestions:');
|
|
112
|
+
markdownLines.push(...data.dataTestIds.map(formatSuggestion));
|
|
113
|
+
}
|
|
114
|
+
if (data.testSuggestions && data.testSuggestions.length > 0) {
|
|
115
|
+
markdownLines.push('');
|
|
116
|
+
markdownLines.push('Suggested New Tests (Actionable):');
|
|
117
|
+
markdownLines.push(...data.testSuggestions.map(formatTestSuggestion));
|
|
118
|
+
}
|
|
119
|
+
if (data.applied) {
|
|
120
|
+
markdownLines.push('');
|
|
121
|
+
markdownLines.push('Applied Changes:');
|
|
122
|
+
if (data.applied.patchedFiles.length > 0) {
|
|
123
|
+
markdownLines.push(`- Patched files: ${data.applied.patchedFiles.join(', ')}`);
|
|
124
|
+
}
|
|
125
|
+
if (data.applied.generatedTests.length > 0) {
|
|
126
|
+
markdownLines.push(`- Generated tests: ${data.applied.generatedTests.join(', ')}`);
|
|
127
|
+
}
|
|
128
|
+
if (data.applied.skippedTests.length > 0) {
|
|
129
|
+
markdownLines.push(`- Skipped test files: ${data.applied.skippedTests.join(', ')}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const markdownContent = markdownLines.join('\n');
|
|
133
|
+
const reportName = data.mode === 'impact' ? 'impact-plan.md' : 'gap-report.md';
|
|
134
|
+
const markdownPath = (0, path_1.join)(specsDir, reportName);
|
|
135
|
+
if (config.artifacts.mode !== 'none') {
|
|
136
|
+
(0, fs_1.writeFileSync)(markdownPath, markdownContent, 'utf-8');
|
|
137
|
+
}
|
|
138
|
+
const jsonPath = (0, path_1.join)(baseDir, data.mode === 'impact' ? 'impact.json' : 'gap.json');
|
|
139
|
+
const jsonData = data.mode === 'gap'
|
|
140
|
+
? {
|
|
141
|
+
...data,
|
|
142
|
+
suggestedNewTests: data.suggestedNewTests || data.testSuggestions || [],
|
|
143
|
+
}
|
|
144
|
+
: data;
|
|
145
|
+
(0, fs_1.writeFileSync)(jsonPath, JSON.stringify(jsonData, null, 2), 'utf-8');
|
|
146
|
+
return { markdownPath, jsonPath };
|
|
147
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentConfig } from './config.js';
|
|
2
|
+
export interface RunOptions {
|
|
3
|
+
apply: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function runImpact(_config: AgentConfig, _options: RunOptions): Promise<void>;
|
|
6
|
+
export declare function runGap(_config: AgentConfig, _options: RunOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/agent/runner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AA6M7C,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4LzF;AAED,wBAAsB,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4LtF"}
|