agentic-qe 1.9.3 → 1.9.4
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/CHANGELOG.md +54 -0
- package/README.md +30 -5
- package/config/.env.otel.example +25 -0
- package/config/OTEL-QUICK-REFERENCE.md +137 -0
- package/config/README-OTEL.md +222 -0
- package/config/alerting-rules.yml +518 -0
- package/config/docker-compose.otel.yml +187 -0
- package/config/grafana/dashboards/agentic-qe-overview.json +286 -0
- package/config/grafana/provisioning/dashboards/dashboards.yml +19 -0
- package/config/grafana/provisioning/datasources/datasources.yml +53 -0
- package/config/otel-collector-config.yaml.example +145 -0
- package/config/prometheus.yml.example +106 -0
- package/dist/alerting/AlertManager.d.ts +120 -0
- package/dist/alerting/AlertManager.d.ts.map +1 -0
- package/dist/alerting/AlertManager.js +345 -0
- package/dist/alerting/AlertManager.js.map +1 -0
- package/dist/alerting/FeedbackRouter.d.ts +98 -0
- package/dist/alerting/FeedbackRouter.d.ts.map +1 -0
- package/dist/alerting/FeedbackRouter.js +331 -0
- package/dist/alerting/FeedbackRouter.js.map +1 -0
- package/dist/alerting/StrategyApplicator.d.ts +120 -0
- package/dist/alerting/StrategyApplicator.d.ts.map +1 -0
- package/dist/alerting/StrategyApplicator.js +299 -0
- package/dist/alerting/StrategyApplicator.js.map +1 -0
- package/dist/alerting/index.d.ts +68 -0
- package/dist/alerting/index.d.ts.map +1 -0
- package/dist/alerting/index.js +112 -0
- package/dist/alerting/index.js.map +1 -0
- package/dist/alerting/types.d.ts +118 -0
- package/dist/alerting/types.d.ts.map +1 -0
- package/dist/alerting/types.js +11 -0
- package/dist/alerting/types.js.map +1 -0
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +12 -7
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/core/memory/IPatternStore.d.ts +209 -0
- package/dist/core/memory/IPatternStore.d.ts.map +1 -0
- package/dist/core/memory/IPatternStore.js +15 -0
- package/dist/core/memory/IPatternStore.js.map +1 -0
- package/dist/core/memory/MigrationTools.d.ts +192 -0
- package/dist/core/memory/MigrationTools.d.ts.map +1 -0
- package/dist/core/memory/MigrationTools.js +615 -0
- package/dist/core/memory/MigrationTools.js.map +1 -0
- package/dist/core/memory/NeuralEnhancement.d.ts +154 -0
- package/dist/core/memory/NeuralEnhancement.d.ts.map +1 -0
- package/dist/core/memory/NeuralEnhancement.js +598 -0
- package/dist/core/memory/NeuralEnhancement.js.map +1 -0
- package/dist/core/memory/PatternStoreFactory.d.ts +143 -0
- package/dist/core/memory/PatternStoreFactory.d.ts.map +1 -0
- package/dist/core/memory/PatternStoreFactory.js +370 -0
- package/dist/core/memory/PatternStoreFactory.js.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -1
- package/dist/core/memory/RealAgentDBAdapter.js +28 -20
- package/dist/core/memory/RealAgentDBAdapter.js.map +1 -1
- package/dist/core/memory/RuVectorPatternStore.d.ts +198 -0
- package/dist/core/memory/RuVectorPatternStore.d.ts.map +1 -0
- package/dist/core/memory/RuVectorPatternStore.js +605 -0
- package/dist/core/memory/RuVectorPatternStore.js.map +1 -0
- package/dist/core/memory/SelfHealingMonitor.d.ts +186 -0
- package/dist/core/memory/SelfHealingMonitor.d.ts.map +1 -0
- package/dist/core/memory/SelfHealingMonitor.js +451 -0
- package/dist/core/memory/SelfHealingMonitor.js.map +1 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts +62 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.js +97 -0
- package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
- package/dist/core/memory/index.d.ts +11 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +36 -1
- package/dist/core/memory/index.js.map +1 -1
- package/dist/reasoning/RuVectorReasoningAdapter.d.ts +232 -0
- package/dist/reasoning/RuVectorReasoningAdapter.d.ts.map +1 -0
- package/dist/reasoning/RuVectorReasoningAdapter.js +585 -0
- package/dist/reasoning/RuVectorReasoningAdapter.js.map +1 -0
- package/dist/reasoning/index.d.ts +2 -0
- package/dist/reasoning/index.d.ts.map +1 -1
- package/dist/reasoning/index.js +6 -1
- package/dist/reasoning/index.js.map +1 -1
- package/dist/reporting/ResultAggregator.d.ts +107 -0
- package/dist/reporting/ResultAggregator.d.ts.map +1 -0
- package/dist/reporting/ResultAggregator.js +435 -0
- package/dist/reporting/ResultAggregator.js.map +1 -0
- package/dist/reporting/index.d.ts +48 -0
- package/dist/reporting/index.d.ts.map +1 -0
- package/dist/reporting/index.js +154 -0
- package/dist/reporting/index.js.map +1 -0
- package/dist/reporting/reporters/ControlLoopReporter.d.ts +128 -0
- package/dist/reporting/reporters/ControlLoopReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/ControlLoopReporter.js +417 -0
- package/dist/reporting/reporters/ControlLoopReporter.js.map +1 -0
- package/dist/reporting/reporters/HumanReadableReporter.d.ts +140 -0
- package/dist/reporting/reporters/HumanReadableReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/HumanReadableReporter.js +524 -0
- package/dist/reporting/reporters/HumanReadableReporter.js.map +1 -0
- package/dist/reporting/reporters/JSONReporter.d.ts +193 -0
- package/dist/reporting/reporters/JSONReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/JSONReporter.js +324 -0
- package/dist/reporting/reporters/JSONReporter.js.map +1 -0
- package/dist/reporting/reporters/index.d.ts +14 -0
- package/dist/reporting/reporters/index.d.ts.map +1 -0
- package/dist/reporting/reporters/index.js +19 -0
- package/dist/reporting/reporters/index.js.map +1 -0
- package/dist/reporting/types.d.ts +427 -0
- package/dist/reporting/types.d.ts.map +1 -0
- package/dist/reporting/types.js +12 -0
- package/dist/reporting/types.js.map +1 -0
- package/package.json +9 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Reporting Module
|
|
4
|
+
*
|
|
5
|
+
* Complete output generation and reporting system for quality check results.
|
|
6
|
+
* Supports multiple output formats and provides result aggregation capabilities.
|
|
7
|
+
*
|
|
8
|
+
* @module reporting
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
+
};
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.ReporterFactory = exports.ControlLoopReporter = exports.JSONReporter = exports.HumanReadableReporter = exports.ResultAggregator = void 0;
|
|
49
|
+
exports.generateAllReports = generateAllReports;
|
|
50
|
+
exports.writeReports = writeReports;
|
|
51
|
+
exports.quickReport = quickReport;
|
|
52
|
+
// Core types
|
|
53
|
+
__exportStar(require("./types"), exports);
|
|
54
|
+
// Result aggregation
|
|
55
|
+
var ResultAggregator_1 = require("./ResultAggregator");
|
|
56
|
+
Object.defineProperty(exports, "ResultAggregator", { enumerable: true, get: function () { return ResultAggregator_1.ResultAggregator; } });
|
|
57
|
+
// Reporters
|
|
58
|
+
var reporters_1 = require("./reporters");
|
|
59
|
+
Object.defineProperty(exports, "HumanReadableReporter", { enumerable: true, get: function () { return reporters_1.HumanReadableReporter; } });
|
|
60
|
+
Object.defineProperty(exports, "JSONReporter", { enumerable: true, get: function () { return reporters_1.JSONReporter; } });
|
|
61
|
+
Object.defineProperty(exports, "ControlLoopReporter", { enumerable: true, get: function () { return reporters_1.ControlLoopReporter; } });
|
|
62
|
+
const HumanReadableReporter_1 = require("./reporters/HumanReadableReporter");
|
|
63
|
+
const JSONReporter_1 = require("./reporters/JSONReporter");
|
|
64
|
+
const ControlLoopReporter_1 = require("./reporters/ControlLoopReporter");
|
|
65
|
+
class ReporterFactory {
|
|
66
|
+
/**
|
|
67
|
+
* Create reporter by format
|
|
68
|
+
*/
|
|
69
|
+
static create(format, config) {
|
|
70
|
+
const fullConfig = {
|
|
71
|
+
format,
|
|
72
|
+
detailLevel: config?.detailLevel || 'detailed',
|
|
73
|
+
useColors: config?.useColors,
|
|
74
|
+
includeTimestamps: config?.includeTimestamps,
|
|
75
|
+
includeMetadata: config?.includeMetadata,
|
|
76
|
+
outputPath: config?.outputPath,
|
|
77
|
+
prettyPrint: config?.prettyPrint
|
|
78
|
+
};
|
|
79
|
+
switch (format) {
|
|
80
|
+
case 'human':
|
|
81
|
+
return new HumanReadableReporter_1.HumanReadableReporter(fullConfig);
|
|
82
|
+
case 'json':
|
|
83
|
+
return new JSONReporter_1.JSONReporter(fullConfig);
|
|
84
|
+
case 'control-loop':
|
|
85
|
+
return new ControlLoopReporter_1.ControlLoopReporter(fullConfig);
|
|
86
|
+
case 'html':
|
|
87
|
+
case 'markdown':
|
|
88
|
+
throw new Error(`Reporter format '${format}' is not yet implemented`);
|
|
89
|
+
default:
|
|
90
|
+
throw new Error(`Unknown reporter format: ${format}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Create all reporters
|
|
95
|
+
*/
|
|
96
|
+
static createAll(config) {
|
|
97
|
+
const reporters = new Map();
|
|
98
|
+
reporters.set('human', this.create('human', config));
|
|
99
|
+
reporters.set('json', this.create('json', config));
|
|
100
|
+
reporters.set('control-loop', this.create('control-loop', config));
|
|
101
|
+
return reporters;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get available formats
|
|
105
|
+
*/
|
|
106
|
+
static getAvailableFormats() {
|
|
107
|
+
return ['human', 'json', 'control-loop'];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Validate format
|
|
111
|
+
*/
|
|
112
|
+
static isValidFormat(format) {
|
|
113
|
+
return this.getAvailableFormats().includes(format);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.ReporterFactory = ReporterFactory;
|
|
117
|
+
async function generateAllReports(results, config) {
|
|
118
|
+
const reporters = ReporterFactory.createAll(config);
|
|
119
|
+
const outputs = new Map();
|
|
120
|
+
for (const [format, reporter] of reporters) {
|
|
121
|
+
const output = reporter.report(results);
|
|
122
|
+
const resolvedOutput = output instanceof Promise ? await output : output;
|
|
123
|
+
outputs.set(format, resolvedOutput);
|
|
124
|
+
}
|
|
125
|
+
return outputs;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Convenience function to write reports to files
|
|
129
|
+
*/
|
|
130
|
+
const fs = __importStar(require("fs-extra"));
|
|
131
|
+
const path = __importStar(require("path"));
|
|
132
|
+
async function writeReports(results, outputDir, config) {
|
|
133
|
+
await fs.ensureDir(outputDir);
|
|
134
|
+
const outputs = await generateAllReports(results, config);
|
|
135
|
+
const filePaths = new Map();
|
|
136
|
+
for (const [format, reportOutput] of outputs) {
|
|
137
|
+
const extension = format === 'human' ? 'txt' : format === 'control-loop' ? 'json' : format;
|
|
138
|
+
const fileName = `quality-report-${results.executionId}.${extension}`;
|
|
139
|
+
const filePath = path.join(outputDir, fileName);
|
|
140
|
+
await fs.writeFile(filePath, reportOutput.content, 'utf8');
|
|
141
|
+
filePaths.set(format, filePath);
|
|
142
|
+
}
|
|
143
|
+
return filePaths;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Quick report generation helper
|
|
147
|
+
*/
|
|
148
|
+
async function quickReport(results, format = 'human') {
|
|
149
|
+
const reporter = ReporterFactory.create(format);
|
|
150
|
+
const output = reporter.report(results);
|
|
151
|
+
const resolvedOutput = output instanceof Promise ? await output : output;
|
|
152
|
+
return resolvedOutput.content;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reporting/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GH,gDAcC;AAQD,oCAoBC;AAKD,kCAKC;AA9JD,aAAa;AACb,0CAAwB;AAExB,qBAAqB;AACrB,uDAAuE;AAA9D,oHAAA,gBAAgB,OAAA;AAEzB,YAAY;AACZ,yCAMqB;AALnB,kHAAA,qBAAqB,OAAA;A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E,YAAY,CAAC,IAAI,OAAO,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3F,MAAM,QAAQ,GAAG,kBAAkB,OAAO,CAAC,WAAW,IAAI,SAAS,EAAE,CAAC;QACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEhD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3D,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW,CAAC,OAA0B,EAAE,SAAuB,OAAO;IAC1F,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,cAAc,GAAG,MAAM,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACzE,OAAO,cAAc,CAAC,OAAO,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Loop Reporter
|
|
3
|
+
*
|
|
4
|
+
* Generates machine-readable feedback for automated control systems,
|
|
5
|
+
* CI/CD pipelines, and decision-making engines. Provides actionable
|
|
6
|
+
* signals, threshold violations, and recommended actions.
|
|
7
|
+
*
|
|
8
|
+
* @module reporting/reporters/ControlLoopReporter
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
import { Reporter, ReporterConfig, ReportFormat, ReporterOutput, AggregatedResults, ControlLoopAction, ThresholdViolation } from '../types';
|
|
12
|
+
/**
|
|
13
|
+
* Control loop configuration
|
|
14
|
+
*/
|
|
15
|
+
export interface ControlLoopConfig extends Partial<ReporterConfig> {
|
|
16
|
+
/** Deployment threshold - minimum test pass rate */
|
|
17
|
+
minPassRate?: number;
|
|
18
|
+
/** Coverage threshold */
|
|
19
|
+
minCoverage?: number;
|
|
20
|
+
/** Quality score threshold */
|
|
21
|
+
minQualityScore?: number;
|
|
22
|
+
/** Security score threshold */
|
|
23
|
+
minSecurityScore?: number;
|
|
24
|
+
/** Maximum allowed critical vulnerabilities */
|
|
25
|
+
maxCriticalVulnerabilities?: number;
|
|
26
|
+
/** Maximum allowed high vulnerabilities */
|
|
27
|
+
maxHighVulnerabilities?: number;
|
|
28
|
+
/** Performance P95 threshold (ms) */
|
|
29
|
+
maxP95ResponseTime?: number;
|
|
30
|
+
/** Error rate threshold (0-1) */
|
|
31
|
+
maxErrorRate?: number;
|
|
32
|
+
/** Flaky test threshold */
|
|
33
|
+
maxFlakyTests?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Control Loop Reporter
|
|
37
|
+
*
|
|
38
|
+
* Designed for automated systems to consume test results and make
|
|
39
|
+
* deployment decisions based on quality gates and thresholds.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const reporter = new ControlLoopReporter({
|
|
44
|
+
* minPassRate: 0.95,
|
|
45
|
+
* minCoverage: 80,
|
|
46
|
+
* maxCriticalVulnerabilities: 0
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* const output = reporter.report(aggregatedResults);
|
|
50
|
+
* const feedback = JSON.parse(output.content) as ControlLoopFeedback;
|
|
51
|
+
*
|
|
52
|
+
* if (!feedback.signals.canDeploy) {
|
|
53
|
+
* // Block deployment
|
|
54
|
+
* process.exit(1);
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare class ControlLoopReporter implements Reporter {
|
|
59
|
+
private config;
|
|
60
|
+
private thresholds;
|
|
61
|
+
constructor(config?: ControlLoopConfig);
|
|
62
|
+
/**
|
|
63
|
+
* Generate control loop feedback
|
|
64
|
+
*/
|
|
65
|
+
report(results: AggregatedResults): ReporterOutput;
|
|
66
|
+
/**
|
|
67
|
+
* Build control loop feedback structure
|
|
68
|
+
*/
|
|
69
|
+
private buildFeedback;
|
|
70
|
+
/**
|
|
71
|
+
* Calculate key metrics for decision making
|
|
72
|
+
*/
|
|
73
|
+
private calculateMetrics;
|
|
74
|
+
/**
|
|
75
|
+
* Calculate performance score (0-100)
|
|
76
|
+
*/
|
|
77
|
+
private calculatePerformanceScore;
|
|
78
|
+
/**
|
|
79
|
+
* Detect actionable signals
|
|
80
|
+
*/
|
|
81
|
+
private detectSignals;
|
|
82
|
+
/**
|
|
83
|
+
* Generate recommended actions
|
|
84
|
+
*/
|
|
85
|
+
private generateActions;
|
|
86
|
+
/**
|
|
87
|
+
* Detect threshold violations
|
|
88
|
+
*/
|
|
89
|
+
private detectViolations;
|
|
90
|
+
/**
|
|
91
|
+
* Generate next steps based on signals and violations
|
|
92
|
+
*/
|
|
93
|
+
private generateNextSteps;
|
|
94
|
+
getFormat(): ReportFormat;
|
|
95
|
+
validateConfig(config: ReporterConfig): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Get current thresholds
|
|
98
|
+
*/
|
|
99
|
+
getThresholds(): {
|
|
100
|
+
minPassRate: number;
|
|
101
|
+
minCoverage: number;
|
|
102
|
+
minQualityScore: number;
|
|
103
|
+
minSecurityScore: number;
|
|
104
|
+
maxCriticalVulnerabilities: number;
|
|
105
|
+
maxHighVulnerabilities: number;
|
|
106
|
+
maxP95ResponseTime: number;
|
|
107
|
+
maxErrorRate: number;
|
|
108
|
+
maxFlakyTests: number;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Update thresholds
|
|
112
|
+
*/
|
|
113
|
+
updateThresholds(thresholds: Partial<typeof this.thresholds>): void;
|
|
114
|
+
/**
|
|
115
|
+
* Check if results pass all gates
|
|
116
|
+
*/
|
|
117
|
+
static passesGates(results: AggregatedResults, config?: ControlLoopConfig): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Get deployment decision
|
|
120
|
+
*/
|
|
121
|
+
static getDeploymentDecision(results: AggregatedResults, config?: ControlLoopConfig): {
|
|
122
|
+
canDeploy: boolean;
|
|
123
|
+
reason: string;
|
|
124
|
+
actions: ControlLoopAction[];
|
|
125
|
+
violations: ThresholdViolation[];
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=ControlLoopReporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlLoopReporter.d.ts","sourceRoot":"","sources":["../../../src/reporting/reporters/ControlLoopReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,cAAc,CAAC;IAChE,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,+CAA+C;IAC/C,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpC,2CAA2C;IAC3C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,qCAAqC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,aAA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