@yasserkhanorg/e2e-agents 1.8.0 → 1.8.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/README.md +55 -0
- package/dist/agent/plan.d.ts +29 -0
- package/dist/agent/plan.d.ts.map +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +15 -4
- package/dist/cli/commands/generate.js +1 -1
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js +51 -18
- package/dist/cli/commands/plan_crew.d.ts +11 -0
- package/dist/cli/commands/plan_crew.d.ts.map +1 -0
- package/dist/cli/commands/plan_crew.js +149 -0
- package/dist/cli/parse_args.d.ts.map +1 -1
- package/dist/cli/parse_args.js +2 -0
- package/dist/cli/types.d.ts +1 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/usage.d.ts.map +1 -1
- package/dist/cli/usage.js +2 -0
- package/dist/crew/context.d.ts.map +1 -1
- package/dist/esm/api.js +15 -4
- package/dist/esm/cli/commands/generate.js +1 -1
- package/dist/esm/cli/commands/plan.js +52 -19
- package/dist/esm/cli/commands/plan_crew.js +143 -0
- package/dist/esm/cli/parse_args.js +2 -0
- package/dist/esm/cli/usage.js +2 -0
- package/dist/esm/knowledge/route_families.js +2 -2
- package/dist/esm/logger.js +1 -2
- package/dist/esm/mcp-server.js +147 -6
- package/dist/esm/ollama_provider.js +1 -1
- package/dist/esm/provider_factory.js +17 -10
- package/dist/esm/training/enricher.js +4 -3
- package/dist/esm/training/validator.js +2 -1
- package/dist/knowledge/route_families.d.ts.map +1 -1
- package/dist/knowledge/route_families.js +2 -2
- package/dist/logger.d.ts +1 -2
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +1 -2
- package/dist/mcp-server.d.ts +33 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +150 -5
- package/dist/ollama_provider.js +1 -1
- package/dist/provider_factory.d.ts +5 -0
- package/dist/provider_factory.d.ts.map +1 -1
- package/dist/provider_factory.js +17 -10
- package/dist/training/enricher.d.ts.map +1 -1
- package/dist/training/enricher.js +4 -3
- package/dist/training/validator.d.ts.map +1 -1
- package/dist/training/validator.js +2 -1
- package/package.json +4 -3
- package/schemas/plan.schema.json +158 -0
package/README.md
CHANGED
|
@@ -11,6 +11,9 @@ AI-powered E2E test impact analysis, generation, healing, and autonomous QA for
|
|
|
11
11
|
Given a git diff, `e2e-ai-agents` determines which E2E test flows are impacted, identifies coverage gaps, and can generate or heal Playwright tests — all from the CLI. The companion `e2e-qa-agent` goes further: it opens a real browser, explores your app autonomously, and produces a QA report with findings and a release-readiness verdict.
|
|
12
12
|
|
|
13
13
|
**Pipeline:** `impact` → `plan` → `generate` → `heal` → `finalize`
|
|
14
|
+
**Crew (v1.8.0):** `impact` + `cross-impact` + `regression-advisor` → `strategist` → `test-designer` → `generator` → `executor` → `healer`
|
|
15
|
+
|
|
16
|
+
> **How does this compare to other tools?** See [docs/comparison.md](docs/comparison.md) for a detailed analysis against Launchable, Codecov ATS, Qodo, Testsigma, mabl, GitHub Copilot, and others.
|
|
14
17
|
|
|
15
18
|
## Installation
|
|
16
19
|
|
|
@@ -54,6 +57,58 @@ npx e2e-ai-agents llm-health
|
|
|
54
57
|
|
|
55
58
|
`plan` and `suggest` are aliases. `analyze` is a convenience wrapper that runs impact + plan and optionally generation/healing in one invocation. Use `--help` for all available flags.
|
|
56
59
|
|
|
60
|
+
## Multi-Agent Crew (v1.8.0)
|
|
61
|
+
|
|
62
|
+
The Crew orchestrates 10 specialized agents for deep test analysis. While the standard pipeline gives a fast pass/fail gate, the Crew produces structured test designs, cross-family impact maps, and prioritized test strategies.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Quick strategy: impact + strategy recommendations (~$0.10, ~1 min)
|
|
66
|
+
npx e2e-ai-agents crew --workflow quick-check --path /path/to/project --tests-root ./e2e-tests --since origin/master
|
|
67
|
+
|
|
68
|
+
# Full test design without generation (~$0.50-2.00, ~5-40 min)
|
|
69
|
+
npx e2e-ai-agents crew --workflow design-only --path /path/to/project --tests-root ./e2e-tests --since origin/master
|
|
70
|
+
|
|
71
|
+
# End-to-end: design + generate + execute + heal (~$2-5, ~10-60 min)
|
|
72
|
+
npx e2e-ai-agents crew --workflow full-qa --path /path/to/project --tests-root ./e2e-tests --since origin/master
|
|
73
|
+
|
|
74
|
+
# With budget cap and JSON output
|
|
75
|
+
npx e2e-ai-agents crew --workflow design-only --budget-usd 2.00 --json --path /path/to/project --tests-root ./e2e-tests --since origin/master
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### What the Crew Adds Beyond the Pipeline
|
|
79
|
+
|
|
80
|
+
| Capability | Pipeline | Crew |
|
|
81
|
+
|-----------|---------|------|
|
|
82
|
+
| Impact detection | Per-family, isolated | Same + cross-family ripple detection |
|
|
83
|
+
| Test scenarios | Flat `scenariosToAdd` strings | Structured `TestCase[]` with type, preconditions, steps, expected outcome, rationale |
|
|
84
|
+
| Test categories | None | 9: happy-path, edge-case, boundary, negative, state-transition, race-condition, permission, accessibility, performance |
|
|
85
|
+
| Strategy | None | Per-flow approach (full-test / smoke-test / skip) with priority and rationale |
|
|
86
|
+
| Regression awareness | None | Risk scoring from flaky history, calibration data, and file-pattern heuristics |
|
|
87
|
+
|
|
88
|
+
### Programmatic API
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { CrewOrchestrator, ImpactAnalystAgent, StrategistAgent, TestDesignerAgent, CrossImpactAgent, RegressionAdvisorAgent } from '@yasserkhanorg/e2e-agents';
|
|
92
|
+
|
|
93
|
+
const orchestrator = new CrewOrchestrator();
|
|
94
|
+
orchestrator.registerAgent(new ImpactAnalystAgent());
|
|
95
|
+
orchestrator.registerAgent(new CrossImpactAgent());
|
|
96
|
+
orchestrator.registerAgent(new RegressionAdvisorAgent());
|
|
97
|
+
orchestrator.registerAgent(new StrategistAgent());
|
|
98
|
+
orchestrator.registerAgent(new TestDesignerAgent());
|
|
99
|
+
|
|
100
|
+
const result = await orchestrator.run({
|
|
101
|
+
appPath: './webapp',
|
|
102
|
+
testsRoot: './e2e-tests',
|
|
103
|
+
gitSince: 'origin/master',
|
|
104
|
+
workflow: 'design-only',
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
console.log(result.context.testDesigns); // Structured test cases
|
|
108
|
+
console.log(result.context.crossImpacts); // Cross-family links
|
|
109
|
+
console.log(result.context.strategyEntries); // Prioritized strategy
|
|
110
|
+
```
|
|
111
|
+
|
|
57
112
|
## Route-Families Training
|
|
58
113
|
|
|
59
114
|
### What it produces
|
package/dist/agent/plan.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PolicyConfig } from './config.js';
|
|
2
|
+
import type { CrossImpact, Finding, RegressionRisk, StrategyEntry, TestDesign } from '../crew/types.js';
|
|
3
|
+
import type { FlowDecision } from '../validation/output_schema.js';
|
|
2
4
|
export type RecommendedRunSet = 'smoke' | 'targeted' | 'full';
|
|
3
5
|
export type CiAction = 'run-now' | 'must-add-tests' | 'safe-to-merge';
|
|
4
6
|
export interface PolicyEvaluation {
|
|
@@ -28,6 +30,32 @@ export interface CoveredFlowSummary {
|
|
|
28
30
|
coveredBy: string[];
|
|
29
31
|
advisoryScenarios?: string[];
|
|
30
32
|
}
|
|
33
|
+
export interface CrewPlanSummary {
|
|
34
|
+
impactedFlows: number;
|
|
35
|
+
strategyEntries: number;
|
|
36
|
+
testDesigns: number;
|
|
37
|
+
crossImpacts: number;
|
|
38
|
+
highRiskCrossImpacts: number;
|
|
39
|
+
regressionRisks: number;
|
|
40
|
+
findings: number;
|
|
41
|
+
generatedSpecs: number;
|
|
42
|
+
manualReviewEntries: number;
|
|
43
|
+
totalCostUSD: number;
|
|
44
|
+
totalTokens: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CrewPlanInsights {
|
|
47
|
+
workflow: string;
|
|
48
|
+
providerOverride: string;
|
|
49
|
+
summary: CrewPlanSummary;
|
|
50
|
+
impactedFlows: FlowDecision[];
|
|
51
|
+
strategyEntries: StrategyEntry[];
|
|
52
|
+
testDesigns: TestDesign[];
|
|
53
|
+
crossImpacts: CrossImpact[];
|
|
54
|
+
regressionRisks: RegressionRisk[];
|
|
55
|
+
findings: Finding[];
|
|
56
|
+
warnings: string[];
|
|
57
|
+
timings: Record<string, number>;
|
|
58
|
+
}
|
|
31
59
|
export interface PlanReport {
|
|
32
60
|
schemaVersion: '1.0.0';
|
|
33
61
|
runId: string;
|
|
@@ -96,6 +124,7 @@ export interface PlanReport {
|
|
|
96
124
|
commitGeneratedTests?: string;
|
|
97
125
|
openPullRequest?: string;
|
|
98
126
|
};
|
|
127
|
+
crew?: CrewPlanInsights;
|
|
99
128
|
metrics: {
|
|
100
129
|
changedFiles: number;
|
|
101
130
|
impactedFlows: number;
|
package/dist/agent/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/agent/plan.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/agent/plan.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACtG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;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AC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,eAAoB,GAAG,YAAY,CAStF;AAED,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,eAAoB,GAAG,sBAAsB,CAgBjG;AAED,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,sBAAsB,GAAG;IAAE,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA+D7I;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,6BAA6B,GAAG,yBAAyB,CAkBrG"}
|
package/dist/api.js
CHANGED
|
@@ -16,7 +16,7 @@ const git_js_1 = require("./agent/git.js");
|
|
|
16
16
|
const feedback_js_1 = require("./agent/feedback.js");
|
|
17
17
|
const diff_loader_js_1 = require("./engine/diff_loader.js");
|
|
18
18
|
const ai_enrichment_js_1 = require("./engine/ai_enrichment.js");
|
|
19
|
-
const
|
|
19
|
+
const provider_factory_js_1 = require("./provider_factory.js");
|
|
20
20
|
const handoff_js_1 = require("./agent/handoff.js");
|
|
21
21
|
const traceability_ingest_js_1 = require("./agent/traceability_ingest.js");
|
|
22
22
|
const traceability_capture_js_1 = require("./agent/traceability_capture.js");
|
|
@@ -80,11 +80,22 @@ async function recommendTestsAI(options = {}) {
|
|
|
80
80
|
routeFamilies: config.routeFamilies,
|
|
81
81
|
filteredTestFiles: gitResult.filteredTestFiles,
|
|
82
82
|
});
|
|
83
|
-
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
84
83
|
let aiEnrichment;
|
|
85
|
-
|
|
84
|
+
let provider;
|
|
85
|
+
try {
|
|
86
|
+
provider = await provider_factory_js_1.LLMProviderFactory.createFromPreference(config.llm.provider);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
const configuredProvider = config.llm.provider?.trim().toLowerCase();
|
|
90
|
+
const envProvider = process.env.LLM_PROVIDER?.trim().toLowerCase();
|
|
91
|
+
const shouldThrow = Boolean((configuredProvider && configuredProvider !== 'auto') ||
|
|
92
|
+
(envProvider && envProvider !== 'auto'));
|
|
93
|
+
if (shouldThrow) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (provider) {
|
|
86
98
|
const diffs = (0, diff_loader_js_1.loadDiffs)(config.path, config.git.since, gitResult.files);
|
|
87
|
-
const provider = new anthropic_provider_js_1.AnthropicProvider({ apiKey });
|
|
88
99
|
// Collect all known spec paths and scenario details from impacted features
|
|
89
100
|
const specSet = new Set();
|
|
90
101
|
const specDetailsMap = new Map();
|
|
@@ -61,7 +61,7 @@ async function runGenerateCommand(args, config) {
|
|
|
61
61
|
catch {
|
|
62
62
|
console.warn('Could not load API surface catalog. Generation will use generic selectors.');
|
|
63
63
|
}
|
|
64
|
-
const provider = await provider_factory_js_1.LLMProviderFactory.
|
|
64
|
+
const provider = await provider_factory_js_1.LLMProviderFactory.createFromPreference(config.llm.provider);
|
|
65
65
|
console.log(`Generating tests for ${scenarios.length} scenario(s)...`);
|
|
66
66
|
const summary = await (0, runner_js_1.runAgenticGeneration)({
|
|
67
67
|
scenarios,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/plan.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/plan.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAMzD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAE5C,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA2GxJ"}
|
|
@@ -7,6 +7,7 @@ const fs_1 = require("fs");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const plan_builder_js_1 = require("../../engine/plan_builder.js");
|
|
9
9
|
const api_js_1 = require("../../api.js");
|
|
10
|
+
const plan_crew_js_1 = require("./plan_crew.js");
|
|
10
11
|
async function runPlanCommand(args, autoConfig, config) {
|
|
11
12
|
const reportRoot = config.testsRoot || config.path;
|
|
12
13
|
const apiOptions = {
|
|
@@ -43,41 +44,73 @@ async function runPlanCommand(args, autoConfig, config) {
|
|
|
43
44
|
const { aiEnrichment } = result;
|
|
44
45
|
console.log(`AI enrichment: ${aiEnrichment.enrichedFeatures.length} features enriched (${aiEnrichment.tokenUsage.input + aiEnrichment.tokenUsage.output} tokens)`);
|
|
45
46
|
}
|
|
46
|
-
else if (!process.env.ANTHROPIC_API_KEY) {
|
|
47
|
-
console.log('Tip:
|
|
47
|
+
else if (!process.env.ANTHROPIC_API_KEY && !process.env.OPENAI_API_KEY && !process.env.LLM_PROVIDER) {
|
|
48
|
+
console.log('Tip: configure ANTHROPIC_API_KEY, OPENAI_API_KEY, or LLM_PROVIDER to enable AI-powered enrichment');
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
const { plan, planPath, ciSummaryMarkdown, ciSummaryPath } = result;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
let planReport = plan;
|
|
53
|
+
let combinedSummaryMarkdown = ciSummaryMarkdown;
|
|
54
|
+
let crewSummaryPath = '';
|
|
55
|
+
let crewMarkdownPath = '';
|
|
56
|
+
if (args.crew) {
|
|
57
|
+
try {
|
|
58
|
+
const crew = await (0, plan_crew_js_1.runPlanCrewAnalysis)(plan, config, args);
|
|
59
|
+
planReport = {
|
|
60
|
+
...plan,
|
|
61
|
+
crew,
|
|
62
|
+
};
|
|
63
|
+
combinedSummaryMarkdown = (0, plan_crew_js_1.appendCrewToSummary)(ciSummaryMarkdown, crew);
|
|
64
|
+
const artifacts = (0, plan_crew_js_1.writeCrewArtifacts)(reportRoot, crew);
|
|
65
|
+
crewSummaryPath = artifacts.crewSummaryPath;
|
|
66
|
+
crewMarkdownPath = artifacts.crewMarkdownPath;
|
|
67
|
+
(0, fs_1.writeFileSync)(planPath, JSON.stringify(planReport, null, 2), 'utf-8');
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
+
console.warn(`Crew analysis unavailable: ${message}`);
|
|
72
|
+
}
|
|
54
73
|
}
|
|
55
|
-
|
|
74
|
+
(0, plan_builder_js_1.writeCiSummary)(reportRoot, combinedSummaryMarkdown);
|
|
75
|
+
const summaryPath = args.ciCommentPath
|
|
76
|
+
? (0, plan_builder_js_1.writeCiSummary)(reportRoot, combinedSummaryMarkdown, args.ciCommentPath)
|
|
77
|
+
: ciSummaryPath;
|
|
56
78
|
// Compute metrics paths (api already wrote metrics; derive paths for GHA output)
|
|
57
79
|
const metricsEventsPath = (0, path_1.join)(reportRoot, '.e2e-ai-agents/metrics.jsonl');
|
|
58
80
|
const metricsSummaryPath = (0, path_1.join)(reportRoot, '.e2e-ai-agents/metrics-summary.json');
|
|
59
81
|
const ghaOutput = args.githubOutputPath || process.env.GITHUB_OUTPUT;
|
|
60
82
|
if (ghaOutput) {
|
|
61
|
-
(0, fs_1.appendFileSync)(ghaOutput, `run_set=${
|
|
62
|
-
(0, fs_1.appendFileSync)(ghaOutput, `action=${
|
|
63
|
-
(0, fs_1.appendFileSync)(ghaOutput, `confidence=${
|
|
64
|
-
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_mode=${
|
|
65
|
-
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_should_fail=${
|
|
66
|
-
(0, fs_1.appendFileSync)(ghaOutput, `recommended_tests_count=${
|
|
67
|
-
(0, fs_1.appendFileSync)(ghaOutput, `required_new_tests_count=${
|
|
83
|
+
(0, fs_1.appendFileSync)(ghaOutput, `run_set=${planReport.runSet}\n`);
|
|
84
|
+
(0, fs_1.appendFileSync)(ghaOutput, `action=${planReport.decision.action}\n`);
|
|
85
|
+
(0, fs_1.appendFileSync)(ghaOutput, `confidence=${planReport.confidence}\n`);
|
|
86
|
+
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_mode=${planReport.enforcement.mode}\n`);
|
|
87
|
+
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_should_fail=${planReport.enforcement.shouldFail}\n`);
|
|
88
|
+
(0, fs_1.appendFileSync)(ghaOutput, `recommended_tests_count=${planReport.recommendedTests.length}\n`);
|
|
89
|
+
(0, fs_1.appendFileSync)(ghaOutput, `required_new_tests_count=${planReport.requiredNewTests.length}\n`);
|
|
68
90
|
(0, fs_1.appendFileSync)(ghaOutput, `plan_path=${planPath}\n`);
|
|
69
91
|
(0, fs_1.appendFileSync)(ghaOutput, `summary_path=${summaryPath}\n`);
|
|
70
92
|
(0, fs_1.appendFileSync)(ghaOutput, `metrics_events_path=${metricsEventsPath}\n`);
|
|
71
93
|
(0, fs_1.appendFileSync)(ghaOutput, `metrics_summary_path=${metricsSummaryPath}\n`);
|
|
94
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_enabled=${planReport.crew ? 'true' : 'false'}\n`);
|
|
95
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_workflow=${planReport.crew?.workflow || ''}\n`);
|
|
96
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_summary_path=${crewSummaryPath}\n`);
|
|
97
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_markdown_path=${crewMarkdownPath}\n`);
|
|
98
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_impacted_flows=${planReport.crew?.summary.impactedFlows || 0}\n`);
|
|
99
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_strategy_entries=${planReport.crew?.summary.strategyEntries || 0}\n`);
|
|
100
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_test_designs=${planReport.crew?.summary.testDesigns || 0}\n`);
|
|
72
101
|
}
|
|
73
|
-
console.log(`Suggested run set: ${
|
|
74
|
-
console.log(`Decision: ${
|
|
75
|
-
console.log(`Enforcement: ${
|
|
102
|
+
console.log(`Suggested run set: ${planReport.runSet} (confidence ${planReport.confidence})`);
|
|
103
|
+
console.log(`Decision: ${planReport.decision.action} - ${planReport.decision.summary}`);
|
|
104
|
+
console.log(`Enforcement: ${planReport.enforcement.mode} (shouldFail=${planReport.enforcement.shouldFail})`);
|
|
76
105
|
console.log(`Plan data: ${planPath}`);
|
|
77
106
|
console.log(`CI summary: ${summaryPath}`);
|
|
107
|
+
if (planReport.crew) {
|
|
108
|
+
console.log(`Crew workflow: ${planReport.crew.workflow} (impactedFlows=${planReport.crew.summary.impactedFlows}, strategyEntries=${planReport.crew.summary.strategyEntries}, testDesigns=${planReport.crew.summary.testDesigns})`);
|
|
109
|
+
console.log(`Crew summary: ${crewSummaryPath}`);
|
|
110
|
+
}
|
|
78
111
|
console.log(`Plan metrics: ${metricsSummaryPath}`);
|
|
79
|
-
const failOnLegacyFlag = args.failOnMustAddTests &&
|
|
80
|
-
if (failOnLegacyFlag ||
|
|
112
|
+
const failOnLegacyFlag = args.failOnMustAddTests && planReport.decision.action === 'must-add-tests';
|
|
113
|
+
if (failOnLegacyFlag || planReport.enforcement.shouldFail) {
|
|
81
114
|
process.exit(2);
|
|
82
115
|
}
|
|
83
116
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentConfig } from '../../agent/config.js';
|
|
2
|
+
import type { CrewPlanInsights, PlanReport } from '../../agent/plan.js';
|
|
3
|
+
import type { ParsedArgs } from '../types.js';
|
|
4
|
+
export declare function runPlanCrewAnalysis(plan: PlanReport, config: AgentConfig, args: ParsedArgs): Promise<CrewPlanInsights>;
|
|
5
|
+
export declare function buildCrewMarkdown(crew: CrewPlanInsights): string;
|
|
6
|
+
export declare function appendCrewToSummary(baseMarkdown: string, crew: CrewPlanInsights): string;
|
|
7
|
+
export declare function writeCrewArtifacts(reportRoot: string, crew: CrewPlanInsights): {
|
|
8
|
+
crewSummaryPath: string;
|
|
9
|
+
crewMarkdownPath: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=plan_crew.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan_crew.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/plan_crew.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAStE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAgC5C,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkD5H;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAwDhE;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAExF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAC,CAWlI"}
|
|
@@ -0,0 +1,149 @@
|
|
|
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.runPlanCrewAnalysis = runPlanCrewAnalysis;
|
|
6
|
+
exports.buildCrewMarkdown = buildCrewMarkdown;
|
|
7
|
+
exports.appendCrewToSummary = appendCrewToSummary;
|
|
8
|
+
exports.writeCrewArtifacts = writeCrewArtifacts;
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const cross_impact_js_1 = require("../../agents/cross-impact.js");
|
|
12
|
+
const impact_analyst_js_1 = require("../../agents/impact-analyst.js");
|
|
13
|
+
const regression_advisor_js_1 = require("../../agents/regression-advisor.js");
|
|
14
|
+
const strategist_js_1 = require("../../agents/strategist.js");
|
|
15
|
+
const test_designer_js_1 = require("../../agents/test-designer.js");
|
|
16
|
+
const orchestrator_js_1 = require("../../crew/orchestrator.js");
|
|
17
|
+
const VALID_WORKFLOWS = new Set(['full-qa', 'quick-check', 'design-only']);
|
|
18
|
+
function uniqueStrings(values) {
|
|
19
|
+
return Array.from(new Set(values.filter(Boolean)));
|
|
20
|
+
}
|
|
21
|
+
function singleLine(value) {
|
|
22
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
23
|
+
}
|
|
24
|
+
function chooseCrewWorkflow(explicitWorkflow, plan) {
|
|
25
|
+
if (explicitWorkflow && VALID_WORKFLOWS.has(explicitWorkflow)) {
|
|
26
|
+
return explicitWorkflow;
|
|
27
|
+
}
|
|
28
|
+
if (plan.decision.action === 'must-add-tests' || plan.metrics.uncoveredP0P1Flows > 0) {
|
|
29
|
+
return 'design-only';
|
|
30
|
+
}
|
|
31
|
+
return 'quick-check';
|
|
32
|
+
}
|
|
33
|
+
function registerCrewAgents(orchestrator) {
|
|
34
|
+
orchestrator.registerAgent(new impact_analyst_js_1.ImpactAnalystAgent());
|
|
35
|
+
orchestrator.registerAgent(new strategist_js_1.StrategistAgent());
|
|
36
|
+
orchestrator.registerAgent(new test_designer_js_1.TestDesignerAgent());
|
|
37
|
+
orchestrator.registerAgent(new cross_impact_js_1.CrossImpactAgent());
|
|
38
|
+
orchestrator.registerAgent(new regression_advisor_js_1.RegressionAdvisorAgent());
|
|
39
|
+
}
|
|
40
|
+
async function runPlanCrewAnalysis(plan, config, args) {
|
|
41
|
+
const reportRoot = config.testsRoot || config.path;
|
|
42
|
+
const workflow = chooseCrewWorkflow(args.crewWorkflow, plan);
|
|
43
|
+
const normalizedProvider = config.llm.provider?.trim().toLowerCase();
|
|
44
|
+
const providerOverride = normalizedProvider && normalizedProvider !== 'auto' ? normalizedProvider : 'auto';
|
|
45
|
+
const orchestrator = new orchestrator_js_1.CrewOrchestrator();
|
|
46
|
+
registerCrewAgents(orchestrator);
|
|
47
|
+
const result = await orchestrator.run({
|
|
48
|
+
appPath: config.path,
|
|
49
|
+
testsRoot: reportRoot,
|
|
50
|
+
gitSince: args.gitSince || config.git.since,
|
|
51
|
+
routeFamilies: config.routeFamilies,
|
|
52
|
+
apiSurface: config.apiSurface,
|
|
53
|
+
workflow,
|
|
54
|
+
providerOverride: providerOverride === 'auto' ? undefined : providerOverride,
|
|
55
|
+
budgetUSD: args.budgetUSD,
|
|
56
|
+
dryRun: args.dryRun,
|
|
57
|
+
});
|
|
58
|
+
const ctx = result.context;
|
|
59
|
+
const highRiskCrossImpacts = ctx.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
60
|
+
const manualReviewEntries = ctx.strategyEntries.filter((entry) => entry.approach === 'manual-review');
|
|
61
|
+
return {
|
|
62
|
+
workflow,
|
|
63
|
+
providerOverride,
|
|
64
|
+
summary: {
|
|
65
|
+
impactedFlows: ctx.impactedFlows.length,
|
|
66
|
+
strategyEntries: ctx.strategyEntries.length,
|
|
67
|
+
testDesigns: ctx.testDesigns.length,
|
|
68
|
+
crossImpacts: ctx.crossImpacts.length,
|
|
69
|
+
highRiskCrossImpacts: highRiskCrossImpacts.length,
|
|
70
|
+
regressionRisks: ctx.regressionRisks.length,
|
|
71
|
+
findings: ctx.findings.length,
|
|
72
|
+
generatedSpecs: ctx.generatedSpecs.length,
|
|
73
|
+
manualReviewEntries: manualReviewEntries.length,
|
|
74
|
+
totalCostUSD: Number(ctx.usage.totalCost.toFixed(4)),
|
|
75
|
+
totalTokens: ctx.usage.totalTokens,
|
|
76
|
+
},
|
|
77
|
+
impactedFlows: ctx.impactedFlows,
|
|
78
|
+
strategyEntries: ctx.strategyEntries,
|
|
79
|
+
testDesigns: ctx.testDesigns,
|
|
80
|
+
crossImpacts: ctx.crossImpacts,
|
|
81
|
+
regressionRisks: ctx.regressionRisks,
|
|
82
|
+
findings: ctx.findings,
|
|
83
|
+
warnings: uniqueStrings([...ctx.warnings, ...result.warnings]),
|
|
84
|
+
timings: result.timings,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function buildCrewMarkdown(crew) {
|
|
88
|
+
const lines = [
|
|
89
|
+
'### Crew Insights',
|
|
90
|
+
'',
|
|
91
|
+
`Workflow: \`${crew.workflow}\``,
|
|
92
|
+
`Provider override: \`${crew.providerOverride}\``,
|
|
93
|
+
`Impacted flows: **${crew.summary.impactedFlows}**`,
|
|
94
|
+
`Strategy entries: **${crew.summary.strategyEntries}**`,
|
|
95
|
+
`Structured test designs: **${crew.summary.testDesigns}**`,
|
|
96
|
+
`Cross-impacts: **${crew.summary.crossImpacts}** (${crew.summary.highRiskCrossImpacts} high risk)`,
|
|
97
|
+
`Findings: **${crew.summary.findings}**`,
|
|
98
|
+
`Estimated AI cost: **$${crew.summary.totalCostUSD.toFixed(4)}**`,
|
|
99
|
+
];
|
|
100
|
+
if (crew.strategyEntries.length > 0) {
|
|
101
|
+
lines.push('');
|
|
102
|
+
lines.push('Top Strategy Recommendations:');
|
|
103
|
+
for (const entry of crew.strategyEntries.slice(0, 5)) {
|
|
104
|
+
lines.push(`- ${entry.priority} ${entry.flowName} -> ${entry.approach} (${entry.crossImpactRisk} cross-impact risk)`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (crew.testDesigns.length > 0) {
|
|
108
|
+
lines.push('');
|
|
109
|
+
lines.push('Structured Test Designs:');
|
|
110
|
+
for (const design of crew.testDesigns.slice(0, 3)) {
|
|
111
|
+
lines.push(`- ${design.flowName}: ${design.testCases.length} designed test case(s)`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const riskyCrossImpacts = crew.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
115
|
+
if (riskyCrossImpacts.length > 0) {
|
|
116
|
+
lines.push('');
|
|
117
|
+
lines.push('High-Risk Cross-Impacts:');
|
|
118
|
+
for (const entry of riskyCrossImpacts.slice(0, 5)) {
|
|
119
|
+
lines.push(`- ${entry.sourceFamily} -> ${entry.affectedFamily}: ${entry.sharedDependency}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (crew.findings.length > 0) {
|
|
123
|
+
lines.push('');
|
|
124
|
+
lines.push('Crew Findings:');
|
|
125
|
+
for (const finding of crew.findings.slice(0, 5)) {
|
|
126
|
+
lines.push(`- ${finding.severity} ${finding.type}: ${finding.summary}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (crew.warnings.length > 0) {
|
|
130
|
+
lines.push('');
|
|
131
|
+
lines.push('Crew Warnings:');
|
|
132
|
+
for (const warning of crew.warnings.slice(0, 5)) {
|
|
133
|
+
lines.push(`- ${singleLine(warning)}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
function appendCrewToSummary(baseMarkdown, crew) {
|
|
139
|
+
return `${baseMarkdown}\n\n---\n\n${buildCrewMarkdown(crew)}`;
|
|
140
|
+
}
|
|
141
|
+
function writeCrewArtifacts(reportRoot, crew) {
|
|
142
|
+
const outputDir = (0, path_1.join)(reportRoot, '.e2e-ai-agents');
|
|
143
|
+
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
144
|
+
const crewSummaryPath = (0, path_1.join)(outputDir, 'crew-summary.json');
|
|
145
|
+
const crewMarkdownPath = (0, path_1.join)(outputDir, 'crew-summary.md');
|
|
146
|
+
(0, fs_1.writeFileSync)(crewSummaryPath, JSON.stringify(crew, null, 2), 'utf-8');
|
|
147
|
+
(0, fs_1.writeFileSync)(crewMarkdownPath, buildCrewMarkdown(crew), 'utf-8');
|
|
148
|
+
return { crewSummaryPath, crewMarkdownPath };
|
|
149
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_args.d.ts","sourceRoot":"","sources":["../../src/cli/parse_args.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAU,UAAU,EAAC,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,iBAAiB,UAA8D,CAAC;AAE7F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAmBlF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAmBtE;
|
|
1
|
+
{"version":3,"file":"parse_args.d.ts","sourceRoot":"","sources":["../../src/cli/parse_args.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAU,UAAU,EAAC,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,iBAAiB,UAA8D,CAAC;AAE7F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAmBlF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAmBtE;AAiJD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA4EpD"}
|
package/dist/cli/parse_args.js
CHANGED
|
@@ -62,6 +62,7 @@ const FLAGS = {
|
|
|
62
62
|
'--pipeline-parallel': { key: 'pipelineParallel', type: 'boolean' },
|
|
63
63
|
'--pipeline-dry-run': { key: 'pipelineDryRun', type: 'boolean' },
|
|
64
64
|
'--fail-on-must-add-tests': { key: 'failOnMustAddTests', type: 'boolean' },
|
|
65
|
+
'--crew': { key: 'crew', type: 'boolean' },
|
|
65
66
|
'--create-pr': { key: 'createPr', type: 'boolean' },
|
|
66
67
|
'--dry-run': { key: 'dryRun', type: 'boolean' },
|
|
67
68
|
'--generate': { key: 'analyzeGenerate', type: 'boolean' },
|
|
@@ -105,6 +106,7 @@ const FLAGS = {
|
|
|
105
106
|
'--output': { key: 'trainOutput', type: 'string' },
|
|
106
107
|
'--server-path': { key: 'serverPath', type: 'string' },
|
|
107
108
|
'--workflow': { key: 'crewWorkflow', type: 'string' },
|
|
109
|
+
'--crew-workflow': { key: 'crewWorkflow', type: 'string' },
|
|
108
110
|
// -- number flags (with isFinite guard) --
|
|
109
111
|
'--pipeline-scenarios': { key: 'pipelineScenarios', type: 'number' },
|
|
110
112
|
'--time': { key: 'timeLimitMinutes', type: 'number' },
|
package/dist/cli/types.d.ts
CHANGED
package/dist/cli/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEvE,MAAM,MAAM,OAAO,GACf,MAAM,GACJ,QAAQ,GACR,MAAM,GACN,MAAM,GACN,SAAS,GACT,UAAU,GACV,0BAA0B,GAC1B,UAAU,GACV,sBAAsB,GACtB,qBAAqB,GACrB,SAAS,GACT,YAAY,GACZ,OAAO,GACP,MAAM,CAAC;AAEb,MAAM,WAAW,UAAU;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CA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C;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
package/dist/cli/usage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/cli/usage.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/cli/usage.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,IAAI,IAAI,CA2FjC"}
|
package/dist/cli/usage.js
CHANGED
|
@@ -59,6 +59,8 @@ function printUsage() {
|
|
|
59
59
|
' --policy-risky-patterns <globs> Comma-separated risky file globs',
|
|
60
60
|
' --policy-enforcement-mode <mode> advisory | warn | block',
|
|
61
61
|
' --policy-block-actions <actions> Comma-separated CI actions to block/warn',
|
|
62
|
+
' --crew Run Crew enrichment and attach insights to plan output',
|
|
63
|
+
' --crew-workflow <name> full-qa | quick-check | design-only',
|
|
62
64
|
' --ci-comment-path <path> Write CI markdown summary',
|
|
63
65
|
' --github-output <path> Write GitHub Actions outputs',
|
|
64
66
|
' --fail-on-must-add-tests Exit non-zero on must-add-tests decision',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/crew/context.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACrF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/crew/context.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAE,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACrF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AACpF,OAAO,KAAK,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{ loadDiffs } from './engine/diff_loader.js';
|
|
10
10
|
import { enrichImpactWithAI } from './engine/ai_enrichment.js';
|
|
11
|
-
import {
|
|
11
|
+
import { LLMProviderFactory } from './provider_factory.js';
|
|
12
12
|
import { finalizeGeneratedTests } from './agent/handoff.js';
|
|
13
13
|
import { ingestTraceabilityInput, } from './agent/traceability_ingest.js';
|
|
14
14
|
import { captureTraceabilityInput, } from './agent/traceability_capture.js';
|
|
@@ -72,11 +72,22 @@ export async function recommendTestsAI(options = {}) {
|
|
|
72
72
|
routeFamilies: config.routeFamilies,
|
|
73
73
|
filteredTestFiles: gitResult.filteredTestFiles,
|
|
74
74
|
});
|
|
75
|
-
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
76
75
|
let aiEnrichment;
|
|
77
|
-
|
|
76
|
+
let provider;
|
|
77
|
+
try {
|
|
78
|
+
provider = await LLMProviderFactory.createFromPreference(config.llm.provider);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
const configuredProvider = config.llm.provider?.trim().toLowerCase();
|
|
82
|
+
const envProvider = process.env.LLM_PROVIDER?.trim().toLowerCase();
|
|
83
|
+
const shouldThrow = Boolean((configuredProvider && configuredProvider !== 'auto') ||
|
|
84
|
+
(envProvider && envProvider !== 'auto'));
|
|
85
|
+
if (shouldThrow) {
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (provider) {
|
|
78
90
|
const diffs = loadDiffs(config.path, config.git.since, gitResult.files);
|
|
79
|
-
const provider = new AnthropicProvider({ apiKey });
|
|
80
91
|
// Collect all known spec paths and scenario details from impacted features
|
|
81
92
|
const specSet = new Set();
|
|
82
93
|
const specDetailsMap = new Map();
|
|
@@ -58,7 +58,7 @@ export async function runGenerateCommand(args, config) {
|
|
|
58
58
|
catch {
|
|
59
59
|
console.warn('Could not load API surface catalog. Generation will use generic selectors.');
|
|
60
60
|
}
|
|
61
|
-
const provider = await LLMProviderFactory.
|
|
61
|
+
const provider = await LLMProviderFactory.createFromPreference(config.llm.provider);
|
|
62
62
|
console.log(`Generating tests for ${scenarios.length} scenario(s)...`);
|
|
63
63
|
const summary = await runAgenticGeneration({
|
|
64
64
|
scenarios,
|