@yasserkhanorg/e2e-agents 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +55 -18
- package/dist/cli/commands/plan_crew.d.ts +17 -0
- package/dist/cli/commands/plan_crew.d.ts.map +1 -0
- package/dist/cli/commands/plan_crew.js +273 -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/esm/api.js +15 -4
- package/dist/esm/cli/commands/generate.js +1 -1
- package/dist/esm/cli/commands/plan.js +56 -19
- package/dist/esm/cli/commands/plan_crew.js +266 -0
- package/dist/esm/cli/parse_args.js +2 -0
- package/dist/esm/cli/usage.js +2 -0
- package/dist/esm/mcp-server.js +147 -6
- package/dist/esm/provider_factory.js +11 -0
- 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/provider_factory.d.ts +5 -0
- package/dist/provider_factory.d.ts.map +1 -1
- package/dist/provider_factory.js +11 -0
- package/package.json +4 -3
- package/schemas/plan.schema.json +158 -0
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.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AO,CAAC,EAAE,yBAAyB,CAAC;CACvC;AAED,MAAM,WAAW,6BAA6B;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAcD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,6BAA6B,GAAG,4BAA4B,CAE1G;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,4BAA4B,GAAG,wBAAwB,CASlG;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;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,CA+GxJ"}
|
|
@@ -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,77 @@ 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
|
+
let crewTestPlanPath = '';
|
|
57
|
+
if (args.crew) {
|
|
58
|
+
try {
|
|
59
|
+
const crew = await (0, plan_crew_js_1.runPlanCrewAnalysis)(plan, config, args);
|
|
60
|
+
planReport = {
|
|
61
|
+
...plan,
|
|
62
|
+
crew,
|
|
63
|
+
};
|
|
64
|
+
combinedSummaryMarkdown = (0, plan_crew_js_1.appendCrewToSummary)(ciSummaryMarkdown, crew, plan);
|
|
65
|
+
const artifacts = (0, plan_crew_js_1.writeCrewArtifacts)(reportRoot, crew, plan);
|
|
66
|
+
crewSummaryPath = artifacts.crewSummaryPath;
|
|
67
|
+
crewMarkdownPath = artifacts.crewMarkdownPath;
|
|
68
|
+
crewTestPlanPath = artifacts.crewTestPlanPath;
|
|
69
|
+
(0, fs_1.writeFileSync)(planPath, JSON.stringify(planReport, null, 2), 'utf-8');
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
73
|
+
console.warn(`Crew analysis unavailable: ${message}`);
|
|
74
|
+
}
|
|
54
75
|
}
|
|
55
|
-
|
|
76
|
+
(0, plan_builder_js_1.writeCiSummary)(reportRoot, combinedSummaryMarkdown);
|
|
77
|
+
const summaryPath = args.ciCommentPath
|
|
78
|
+
? (0, plan_builder_js_1.writeCiSummary)(reportRoot, combinedSummaryMarkdown, args.ciCommentPath)
|
|
79
|
+
: ciSummaryPath;
|
|
56
80
|
// Compute metrics paths (api already wrote metrics; derive paths for GHA output)
|
|
57
81
|
const metricsEventsPath = (0, path_1.join)(reportRoot, '.e2e-ai-agents/metrics.jsonl');
|
|
58
82
|
const metricsSummaryPath = (0, path_1.join)(reportRoot, '.e2e-ai-agents/metrics-summary.json');
|
|
59
83
|
const ghaOutput = args.githubOutputPath || process.env.GITHUB_OUTPUT;
|
|
60
84
|
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=${
|
|
85
|
+
(0, fs_1.appendFileSync)(ghaOutput, `run_set=${planReport.runSet}\n`);
|
|
86
|
+
(0, fs_1.appendFileSync)(ghaOutput, `action=${planReport.decision.action}\n`);
|
|
87
|
+
(0, fs_1.appendFileSync)(ghaOutput, `confidence=${planReport.confidence}\n`);
|
|
88
|
+
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_mode=${planReport.enforcement.mode}\n`);
|
|
89
|
+
(0, fs_1.appendFileSync)(ghaOutput, `enforcement_should_fail=${planReport.enforcement.shouldFail}\n`);
|
|
90
|
+
(0, fs_1.appendFileSync)(ghaOutput, `recommended_tests_count=${planReport.recommendedTests.length}\n`);
|
|
91
|
+
(0, fs_1.appendFileSync)(ghaOutput, `required_new_tests_count=${planReport.requiredNewTests.length}\n`);
|
|
68
92
|
(0, fs_1.appendFileSync)(ghaOutput, `plan_path=${planPath}\n`);
|
|
69
93
|
(0, fs_1.appendFileSync)(ghaOutput, `summary_path=${summaryPath}\n`);
|
|
70
94
|
(0, fs_1.appendFileSync)(ghaOutput, `metrics_events_path=${metricsEventsPath}\n`);
|
|
71
95
|
(0, fs_1.appendFileSync)(ghaOutput, `metrics_summary_path=${metricsSummaryPath}\n`);
|
|
96
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_enabled=${planReport.crew ? 'true' : 'false'}\n`);
|
|
97
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_workflow=${planReport.crew?.workflow || ''}\n`);
|
|
98
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_summary_path=${crewSummaryPath}\n`);
|
|
99
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_markdown_path=${crewMarkdownPath}\n`);
|
|
100
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_test_plan_path=${crewTestPlanPath}\n`);
|
|
101
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_impacted_flows=${planReport.crew?.summary.impactedFlows || 0}\n`);
|
|
102
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_strategy_entries=${planReport.crew?.summary.strategyEntries || 0}\n`);
|
|
103
|
+
(0, fs_1.appendFileSync)(ghaOutput, `crew_test_designs=${planReport.crew?.summary.testDesigns || 0}\n`);
|
|
72
104
|
}
|
|
73
|
-
console.log(`Suggested run set: ${
|
|
74
|
-
console.log(`Decision: ${
|
|
75
|
-
console.log(`Enforcement: ${
|
|
105
|
+
console.log(`Suggested run set: ${planReport.runSet} (confidence ${planReport.confidence})`);
|
|
106
|
+
console.log(`Decision: ${planReport.decision.action} - ${planReport.decision.summary}`);
|
|
107
|
+
console.log(`Enforcement: ${planReport.enforcement.mode} (shouldFail=${planReport.enforcement.shouldFail})`);
|
|
76
108
|
console.log(`Plan data: ${planPath}`);
|
|
77
109
|
console.log(`CI summary: ${summaryPath}`);
|
|
110
|
+
if (planReport.crew) {
|
|
111
|
+
console.log(`Crew workflow: ${planReport.crew.workflow} (impactedFlows=${planReport.crew.summary.impactedFlows}, strategyEntries=${planReport.crew.summary.strategyEntries}, testDesigns=${planReport.crew.summary.testDesigns})`);
|
|
112
|
+
console.log(`Crew summary: ${crewSummaryPath}`);
|
|
113
|
+
console.log(`Crew test plan: ${crewTestPlanPath}`);
|
|
114
|
+
}
|
|
78
115
|
console.log(`Plan metrics: ${metricsSummaryPath}`);
|
|
79
|
-
const failOnLegacyFlag = args.failOnMustAddTests &&
|
|
80
|
-
if (failOnLegacyFlag ||
|
|
116
|
+
const failOnLegacyFlag = args.failOnMustAddTests && planReport.decision.action === 'must-add-tests';
|
|
117
|
+
if (failOnLegacyFlag || planReport.enforcement.shouldFail) {
|
|
81
118
|
process.exit(2);
|
|
82
119
|
}
|
|
83
120
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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, plan?: PlanReport): string;
|
|
6
|
+
export declare function appendCrewToSummary(baseMarkdown: string, crew: CrewPlanInsights, plan?: PlanReport): string;
|
|
7
|
+
/**
|
|
8
|
+
* Build a full structured test plan as a Markdown document.
|
|
9
|
+
* Sections: gap flows first (P0 cases expanded), then covered-flow smoke tests.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildCrewTestPlan(crew: CrewPlanInsights, plan?: PlanReport): string;
|
|
12
|
+
export declare function writeCrewArtifacts(reportRoot: string, crew: CrewPlanInsights, plan?: PlanReport): {
|
|
13
|
+
crewSummaryPath: string;
|
|
14
|
+
crewMarkdownPath: string;
|
|
15
|
+
crewTestPlanPath: string;
|
|
16
|
+
};
|
|
17
|
+
//# 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;AAUtE,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,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAuEnF;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAE3G;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAuHnF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAC,CAa/K"}
|
|
@@ -0,0 +1,273 @@
|
|
|
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.buildCrewTestPlan = buildCrewTestPlan;
|
|
9
|
+
exports.writeCrewArtifacts = writeCrewArtifacts;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const cross_impact_js_1 = require("../../agents/cross-impact.js");
|
|
13
|
+
const impact_analyst_js_1 = require("../../agents/impact-analyst.js");
|
|
14
|
+
const regression_advisor_js_1 = require("../../agents/regression-advisor.js");
|
|
15
|
+
const strategist_js_1 = require("../../agents/strategist.js");
|
|
16
|
+
const test_designer_js_1 = require("../../agents/test-designer.js");
|
|
17
|
+
const orchestrator_js_1 = require("../../crew/orchestrator.js");
|
|
18
|
+
const VALID_WORKFLOWS = new Set(['full-qa', 'quick-check', 'design-only']);
|
|
19
|
+
function uniqueStrings(values) {
|
|
20
|
+
return Array.from(new Set(values.filter(Boolean)));
|
|
21
|
+
}
|
|
22
|
+
function singleLine(value) {
|
|
23
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
24
|
+
}
|
|
25
|
+
function chooseCrewWorkflow(explicitWorkflow, plan) {
|
|
26
|
+
if (explicitWorkflow && VALID_WORKFLOWS.has(explicitWorkflow)) {
|
|
27
|
+
return explicitWorkflow;
|
|
28
|
+
}
|
|
29
|
+
if (plan.decision.action === 'must-add-tests' || plan.metrics.uncoveredP0P1Flows > 0) {
|
|
30
|
+
return 'design-only';
|
|
31
|
+
}
|
|
32
|
+
return 'quick-check';
|
|
33
|
+
}
|
|
34
|
+
function registerCrewAgents(orchestrator) {
|
|
35
|
+
orchestrator.registerAgent(new impact_analyst_js_1.ImpactAnalystAgent());
|
|
36
|
+
orchestrator.registerAgent(new strategist_js_1.StrategistAgent());
|
|
37
|
+
orchestrator.registerAgent(new test_designer_js_1.TestDesignerAgent());
|
|
38
|
+
orchestrator.registerAgent(new cross_impact_js_1.CrossImpactAgent());
|
|
39
|
+
orchestrator.registerAgent(new regression_advisor_js_1.RegressionAdvisorAgent());
|
|
40
|
+
}
|
|
41
|
+
async function runPlanCrewAnalysis(plan, config, args) {
|
|
42
|
+
const reportRoot = config.testsRoot || config.path;
|
|
43
|
+
const workflow = chooseCrewWorkflow(args.crewWorkflow, plan);
|
|
44
|
+
const normalizedProvider = config.llm.provider?.trim().toLowerCase();
|
|
45
|
+
const providerOverride = normalizedProvider && normalizedProvider !== 'auto' ? normalizedProvider : 'auto';
|
|
46
|
+
const orchestrator = new orchestrator_js_1.CrewOrchestrator();
|
|
47
|
+
registerCrewAgents(orchestrator);
|
|
48
|
+
const result = await orchestrator.run({
|
|
49
|
+
appPath: config.path,
|
|
50
|
+
testsRoot: reportRoot,
|
|
51
|
+
gitSince: args.gitSince || config.git.since,
|
|
52
|
+
routeFamilies: config.routeFamilies,
|
|
53
|
+
apiSurface: config.apiSurface,
|
|
54
|
+
workflow,
|
|
55
|
+
providerOverride: providerOverride === 'auto' ? undefined : providerOverride,
|
|
56
|
+
budgetUSD: args.budgetUSD,
|
|
57
|
+
dryRun: args.dryRun,
|
|
58
|
+
});
|
|
59
|
+
const ctx = result.context;
|
|
60
|
+
const highRiskCrossImpacts = ctx.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
61
|
+
const manualReviewEntries = ctx.strategyEntries.filter((entry) => entry.approach === 'manual-review');
|
|
62
|
+
return {
|
|
63
|
+
workflow,
|
|
64
|
+
providerOverride,
|
|
65
|
+
summary: {
|
|
66
|
+
impactedFlows: ctx.impactedFlows.length,
|
|
67
|
+
strategyEntries: ctx.strategyEntries.length,
|
|
68
|
+
testDesigns: ctx.testDesigns.length,
|
|
69
|
+
crossImpacts: ctx.crossImpacts.length,
|
|
70
|
+
highRiskCrossImpacts: highRiskCrossImpacts.length,
|
|
71
|
+
regressionRisks: ctx.regressionRisks.length,
|
|
72
|
+
findings: ctx.findings.length,
|
|
73
|
+
generatedSpecs: ctx.generatedSpecs.length,
|
|
74
|
+
manualReviewEntries: manualReviewEntries.length,
|
|
75
|
+
totalCostUSD: Number(ctx.usage.totalCost.toFixed(4)),
|
|
76
|
+
totalTokens: ctx.usage.totalTokens,
|
|
77
|
+
},
|
|
78
|
+
impactedFlows: ctx.impactedFlows,
|
|
79
|
+
strategyEntries: ctx.strategyEntries,
|
|
80
|
+
testDesigns: ctx.testDesigns,
|
|
81
|
+
crossImpacts: ctx.crossImpacts,
|
|
82
|
+
regressionRisks: ctx.regressionRisks,
|
|
83
|
+
findings: ctx.findings,
|
|
84
|
+
warnings: uniqueStrings([...ctx.warnings, ...result.warnings]),
|
|
85
|
+
timings: result.timings,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function buildCrewMarkdown(crew, plan) {
|
|
89
|
+
const totalCases = crew.testDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
90
|
+
const gapFamilies = new Set((plan?.gapDetails ?? []).map((g) => g.id));
|
|
91
|
+
const gapDesigns = gapFamilies.size > 0
|
|
92
|
+
? crew.testDesigns.filter((td) => Array.from(gapFamilies).some((fam) => td.flowId.startsWith(fam) || td.flowName.toLowerCase().includes(fam.replace(/_/g, ' '))))
|
|
93
|
+
: [];
|
|
94
|
+
const gapCases = gapDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
95
|
+
const gapP0Cases = gapDesigns.reduce((n, td) => n + td.testCases.filter((tc) => tc.priority === 'P0').length, 0);
|
|
96
|
+
const lines = [
|
|
97
|
+
'### Crew Insights',
|
|
98
|
+
'',
|
|
99
|
+
`Workflow: \`${crew.workflow}\``,
|
|
100
|
+
`Impacted flows: **${crew.summary.impactedFlows}**`,
|
|
101
|
+
`Structured test designs: **${crew.summary.testDesigns}** flows, **${totalCases}** test cases`,
|
|
102
|
+
];
|
|
103
|
+
if (gapFamilies.size > 0 && gapDesigns.length > 0) {
|
|
104
|
+
lines.push(`Gap-focused: **${gapDesigns.length}** flows, **${gapCases}** test cases (**${gapP0Cases}** P0)`);
|
|
105
|
+
}
|
|
106
|
+
lines.push(`Cross-impacts: **${crew.summary.crossImpacts}** (${crew.summary.highRiskCrossImpacts} high risk)`, `Estimated AI cost: **$${crew.summary.totalCostUSD.toFixed(4)}**`);
|
|
107
|
+
if (crew.strategyEntries.length > 0) {
|
|
108
|
+
lines.push('');
|
|
109
|
+
lines.push('Top Strategy Recommendations:');
|
|
110
|
+
for (const entry of crew.strategyEntries.slice(0, 5)) {
|
|
111
|
+
lines.push(`- ${entry.priority} ${entry.flowName} -> ${entry.approach} (${entry.crossImpactRisk} cross-impact risk)`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (crew.testDesigns.length > 0) {
|
|
115
|
+
lines.push('');
|
|
116
|
+
lines.push('Structured Test Designs:');
|
|
117
|
+
for (const design of crew.testDesigns.slice(0, 3)) {
|
|
118
|
+
lines.push(`- ${design.flowName}: ${design.testCases.length} designed test case(s)`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const riskyCrossImpacts = crew.crossImpacts.filter((entry) => entry.riskLevel === 'high');
|
|
122
|
+
if (riskyCrossImpacts.length > 0) {
|
|
123
|
+
lines.push('');
|
|
124
|
+
lines.push('High-Risk Cross-Impacts:');
|
|
125
|
+
for (const entry of riskyCrossImpacts.slice(0, 5)) {
|
|
126
|
+
lines.push(`- ${entry.sourceFamily} -> ${entry.affectedFamily}: ${entry.sharedDependency}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (crew.findings.length > 0) {
|
|
130
|
+
lines.push('');
|
|
131
|
+
lines.push('Crew Findings:');
|
|
132
|
+
for (const finding of crew.findings.slice(0, 5)) {
|
|
133
|
+
lines.push(`- ${finding.severity} ${finding.type}: ${finding.summary}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (crew.warnings.length > 0) {
|
|
137
|
+
lines.push('');
|
|
138
|
+
lines.push('Crew Warnings:');
|
|
139
|
+
for (const warning of crew.warnings.slice(0, 5)) {
|
|
140
|
+
lines.push(`- ${singleLine(warning)}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return lines.join('\n');
|
|
144
|
+
}
|
|
145
|
+
function appendCrewToSummary(baseMarkdown, crew, plan) {
|
|
146
|
+
return `${baseMarkdown}\n\n---\n\n${buildCrewMarkdown(crew, plan)}`;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Build a full structured test plan as a Markdown document.
|
|
150
|
+
* Sections: gap flows first (P0 cases expanded), then covered-flow smoke tests.
|
|
151
|
+
*/
|
|
152
|
+
function buildCrewTestPlan(crew, plan) {
|
|
153
|
+
const gapFamilies = new Set((plan?.gapDetails ?? []).map((g) => g.id));
|
|
154
|
+
const totalCases = crew.testDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
155
|
+
// Split designs into gap-related and coverage-expansion
|
|
156
|
+
const gapDesigns = [];
|
|
157
|
+
const coveredDesigns = [];
|
|
158
|
+
for (const td of crew.testDesigns) {
|
|
159
|
+
// Match by flowId prefix against gap family ids
|
|
160
|
+
const isGap = Array.from(gapFamilies).some((fam) => td.flowId.startsWith(fam) || td.flowName.toLowerCase().includes(fam.replace(/_/g, ' ')));
|
|
161
|
+
if (isGap) {
|
|
162
|
+
gapDesigns.push(td);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
coveredDesigns.push(td);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const gapCases = gapDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
169
|
+
const coveredCases = coveredDesigns.reduce((n, td) => n + td.testCases.length, 0);
|
|
170
|
+
const lines = [
|
|
171
|
+
'# Crew Test Plan',
|
|
172
|
+
'',
|
|
173
|
+
`> Auto-generated by e2e-agents crew (\`${crew.workflow}\` workflow)`,
|
|
174
|
+
'',
|
|
175
|
+
'## Summary',
|
|
176
|
+
'',
|
|
177
|
+
`| Metric | Count |`,
|
|
178
|
+
`|--------|-------|`,
|
|
179
|
+
`| Gap flows (missing tests) | ${gapDesigns.length} flows, **${gapCases} test cases** |`,
|
|
180
|
+
`| Covered flows (expansion) | ${coveredDesigns.length} flows, ${coveredCases} test cases |`,
|
|
181
|
+
`| Total | ${crew.testDesigns.length} flows, ${totalCases} test cases |`,
|
|
182
|
+
`| High-risk cross-impacts | ${crew.summary.highRiskCrossImpacts} |`,
|
|
183
|
+
`| AI cost | $${crew.summary.totalCostUSD.toFixed(4)} |`,
|
|
184
|
+
'',
|
|
185
|
+
];
|
|
186
|
+
// Priority action items
|
|
187
|
+
if (gapDesigns.length > 0) {
|
|
188
|
+
lines.push('## Priority: Gap Flows (Missing Tests)');
|
|
189
|
+
lines.push('');
|
|
190
|
+
lines.push('These flows have **no existing E2E coverage** and should be addressed first.');
|
|
191
|
+
lines.push('');
|
|
192
|
+
for (const td of gapDesigns) {
|
|
193
|
+
const strategy = crew.strategyEntries.find((s) => s.flowId === td.flowId);
|
|
194
|
+
const approach = strategy?.approach ?? 'full-test';
|
|
195
|
+
const risk = strategy?.crossImpactRisk ?? 'unknown';
|
|
196
|
+
const p0Cases = td.testCases.filter((tc) => tc.priority === 'P0');
|
|
197
|
+
const p1Cases = td.testCases.filter((tc) => tc.priority === 'P1');
|
|
198
|
+
lines.push(`### ${td.flowName}`);
|
|
199
|
+
lines.push('');
|
|
200
|
+
lines.push(`Strategy: **${approach}** | Cross-impact risk: **${risk}** | ${td.testCases.length} cases (${p0Cases.length} P0, ${p1Cases.length} P1)`);
|
|
201
|
+
lines.push('');
|
|
202
|
+
// Show P0 cases expanded
|
|
203
|
+
if (p0Cases.length > 0) {
|
|
204
|
+
lines.push('**P0 — Must test:**');
|
|
205
|
+
lines.push('');
|
|
206
|
+
for (const tc of p0Cases) {
|
|
207
|
+
lines.push(`- [ ] **${tc.name}** (${tc.type})`);
|
|
208
|
+
if (tc.preconditions.length > 0) {
|
|
209
|
+
lines.push(` - Preconditions: ${tc.preconditions.join('; ')}`);
|
|
210
|
+
}
|
|
211
|
+
lines.push(` - Steps: ${tc.steps.join(' → ')}`);
|
|
212
|
+
lines.push(` - Expected: ${tc.expectedOutcome}`);
|
|
213
|
+
}
|
|
214
|
+
lines.push('');
|
|
215
|
+
}
|
|
216
|
+
// Show P1 as a collapsed checklist
|
|
217
|
+
if (p1Cases.length > 0) {
|
|
218
|
+
lines.push(`<details><summary>P1 — Should test (${p1Cases.length})</summary>`);
|
|
219
|
+
lines.push('');
|
|
220
|
+
for (const tc of p1Cases) {
|
|
221
|
+
lines.push(`- [ ] **${tc.name}** (${tc.type}) — ${tc.expectedOutcome}`);
|
|
222
|
+
}
|
|
223
|
+
lines.push('');
|
|
224
|
+
lines.push('</details>');
|
|
225
|
+
lines.push('');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Covered flow expansion — collapsed by default
|
|
230
|
+
if (coveredDesigns.length > 0) {
|
|
231
|
+
lines.push('## Covered Flows (Regression / Expansion)');
|
|
232
|
+
lines.push('');
|
|
233
|
+
lines.push('These flows already have specs. The test cases below extend coverage for changes in this PR.');
|
|
234
|
+
lines.push('');
|
|
235
|
+
for (const td of coveredDesigns) {
|
|
236
|
+
const strategy = crew.strategyEntries.find((s) => s.flowId === td.flowId);
|
|
237
|
+
const approach = strategy?.approach ?? 'smoke-test';
|
|
238
|
+
const p0Count = td.testCases.filter((tc) => tc.priority === 'P0').length;
|
|
239
|
+
lines.push(`<details><summary><strong>${td.flowName}</strong> — ${approach} | ${td.testCases.length} cases (${p0Count} P0)</summary>`);
|
|
240
|
+
lines.push('');
|
|
241
|
+
for (const tc of td.testCases) {
|
|
242
|
+
lines.push(`- [ ] **${tc.name}** (${tc.priority}, ${tc.type}) — ${tc.expectedOutcome}`);
|
|
243
|
+
}
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push('</details>');
|
|
246
|
+
lines.push('');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Cross-impacts section
|
|
250
|
+
const highRisk = crew.crossImpacts.filter((ci) => ci.riskLevel === 'high');
|
|
251
|
+
if (highRisk.length > 0) {
|
|
252
|
+
lines.push('## High-Risk Cross-Impacts');
|
|
253
|
+
lines.push('');
|
|
254
|
+
lines.push('These cross-family dependencies should be verified during release testing:');
|
|
255
|
+
lines.push('');
|
|
256
|
+
for (const ci of highRisk) {
|
|
257
|
+
lines.push(`- **${ci.sourceFamily}** → **${ci.affectedFamily}**: ${ci.sharedDependency}`);
|
|
258
|
+
}
|
|
259
|
+
lines.push('');
|
|
260
|
+
}
|
|
261
|
+
return lines.join('\n');
|
|
262
|
+
}
|
|
263
|
+
function writeCrewArtifacts(reportRoot, crew, plan) {
|
|
264
|
+
const outputDir = (0, path_1.join)(reportRoot, '.e2e-ai-agents');
|
|
265
|
+
(0, fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
266
|
+
const crewSummaryPath = (0, path_1.join)(outputDir, 'crew-summary.json');
|
|
267
|
+
const crewMarkdownPath = (0, path_1.join)(outputDir, 'crew-summary.md');
|
|
268
|
+
const crewTestPlanPath = (0, path_1.join)(outputDir, 'crew-test-plan.md');
|
|
269
|
+
(0, fs_1.writeFileSync)(crewSummaryPath, JSON.stringify(crew, null, 2), 'utf-8');
|
|
270
|
+
(0, fs_1.writeFileSync)(crewMarkdownPath, buildCrewMarkdown(crew, plan), 'utf-8');
|
|
271
|
+
(0, fs_1.writeFileSync)(crewTestPlanPath, buildCrewTestPlan(crew, plan), 'utf-8');
|
|
272
|
+
return { crewSummaryPath, crewMarkdownPath, crewTestPlanPath };
|
|
273
|
+
}
|
|
@@ -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,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAA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AC,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',
|
package/dist/esm/api.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getChangedFiles } from './agent/git.js';
|
|
|
8
8
|
import { getAdaptiveThresholds } from './agent/feedback.js';
|
|
9
9
|
import { 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,
|