snow-flow 3.0.9 → 3.0.13
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/claude-flow.bat +0 -0
- package/claude-flow.ps1 +0 -0
- package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
- package/dist/mcp/intelligent-reporting-mcp.js +379 -0
- package/dist/mcp/servicenow-automation-mcp.js +0 -0
- package/dist/mcp/servicenow-deployment-mcp.js +0 -0
- package/dist/mcp/servicenow-integration-mcp.js +0 -0
- package/dist/mcp/servicenow-mcp-server.js +0 -0
- package/dist/mcp/servicenow-operations-mcp.js +0 -0
- package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
- package/dist/mcp/servicenow-progressive-indexer.js +0 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
- package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
- package/dist/mcp/servicenow-update-set-mcp.js +0 -0
- package/dist/mcp/start-all-mcp-servers.js +0 -0
- package/dist/mcp/start-servicenow-mcp.js +0 -0
- package/dist/services/widget-deployment-service.d.ts +2 -1
- package/dist/services/widget-deployment-service.js +17 -16
- package/dist/utils/anti-mock-data-validator.d.ts +66 -0
- package/dist/utils/anti-mock-data-validator.js +316 -0
- package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
- package/dist/utils/servicenow-eventual-consistency.js +220 -0
- package/memory/agents/README.md +1 -1
- package/memory/claude-flow-data.json +1 -1
- package/memory/sessions/README.md +1 -1
- package/package.json +4 -3
- package/.mcp.json +0 -22
- package/claude-flow.config.json +0 -20
- package/dist/agents/app-creator.agent.d.ts +0 -55
- package/dist/agents/app-creator.agent.js +0 -1292
- package/dist/agents/base/base-snow-agent.d.ts +0 -75
- package/dist/agents/base/base-snow-agent.js +0 -169
- package/dist/agents/base-snow-agent.d.ts +0 -63
- package/dist/agents/base-snow-agent.js +0 -296
- package/dist/agents/coordinator.d.ts +0 -200
- package/dist/agents/coordinator.js +0 -777
- package/dist/agents/flow-builder-agent.d.ts +0 -18
- package/dist/agents/flow-builder-agent.js +0 -197
- package/dist/agents/queen-403-handler.d.ts +0 -47
- package/dist/agents/queen-403-handler.js +0 -175
- package/dist/agents/queen-agent-example.d.ts +0 -23
- package/dist/agents/queen-agent-example.js +0 -240
- package/dist/agents/queen-agent.test.d.ts +0 -6
- package/dist/agents/script-generator.agent.d.ts +0 -32
- package/dist/agents/script-generator.agent.js +0 -772
- package/dist/agents/script-writer-agent.d.ts +0 -22
- package/dist/agents/script-writer-agent.js +0 -695
- package/dist/agents/security-agent.d.ts +0 -23
- package/dist/agents/security-agent.js +0 -619
- package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
- package/dist/agents/specialists/automation-specialist.agent.js +0 -204
- package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
- package/dist/agents/specialists/data-specialist.agent.js +0 -484
- package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
- package/dist/agents/specialists/integration-specialist.agent.js +0 -725
- package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
- package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
- package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
- package/dist/agents/specialists/security-specialist.agent.js +0 -309
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
- package/dist/agents/teams/base-team.d.ts +0 -72
- package/dist/agents/teams/base-team.js +0 -253
- package/dist/agents/teams/team-types.d.ts +0 -265
- package/dist/agents/teams/team-types.js +0 -3
- package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
- package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
- package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
- package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
- package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
- package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
- package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
- package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
- package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
- package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
- package/dist/agents/test-agent.d.ts +0 -26
- package/dist/agents/test-agent.js +0 -734
- package/dist/agents/test-agents.d.ts +0 -7
- package/dist/agents/test-agents.js +0 -64
- package/dist/agents/ui-builder.agent.d.ts +0 -50
- package/dist/agents/ui-builder.agent.js +0 -1539
- package/dist/agents/widget-builder.agent.d.ts +0 -32
- package/dist/agents/widget-builder.agent.js +0 -439
- package/dist/agents/widget-creator-agent.d.ts +0 -18
- package/dist/agents/widget-creator-agent.js +0 -498
- package/dist/agents/workflow-designer.agent.d.ts +0 -31
- package/dist/agents/workflow-designer.agent.js +0 -583
- package/dist/api/error-handling.d.ts +0 -325
- package/dist/api/error-handling.js +0 -1488
- package/dist/api/flow-designer-api.d.ts +0 -167
- package/dist/api/flow-designer-api.js +0 -554
- package/dist/api/natural-language-mapper.d.ts +0 -124
- package/dist/api/natural-language-mapper.js +0 -501
- package/dist/api/performance-optimizer.d.ts +0 -240
- package/dist/api/performance-optimizer.js +0 -706
- package/dist/api/transaction-manager.d.ts +0 -189
- package/dist/api/transaction-manager.js +0 -576
- package/dist/assembly/team-assembler.d.ts +0 -140
- package/dist/assembly/team-assembler.js +0 -502
- package/dist/benchmark-performance.d.ts +0 -41
- package/dist/benchmark-performance.js +0 -230
- package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
- package/dist/cli/snow-flow-cli-integration.js +0 -396
- package/dist/coordination/coordination-engine.d.ts +0 -41
- package/dist/coordination/coordination-engine.js +0 -324
- package/dist/coordination/coordination.test.d.ts +0 -6
- package/dist/coordination/example.d.ts +0 -31
- package/dist/coordination/example.js +0 -394
- package/dist/coordination/execution-patterns.d.ts +0 -43
- package/dist/coordination/execution-patterns.js +0 -507
- package/dist/coordination/factory.d.ts +0 -94
- package/dist/coordination/factory.js +0 -433
- package/dist/coordination/index.d.ts +0 -71
- package/dist/coordination/index.js +0 -135
- package/dist/coordination/progress-monitor.d.ts +0 -71
- package/dist/coordination/progress-monitor.js +0 -505
- package/dist/coordination/quality-gates.d.ts +0 -124
- package/dist/coordination/quality-gates.js +0 -577
- package/dist/coordination/shared-memory.d.ts +0 -39
- package/dist/coordination/shared-memory.js +0 -289
- package/dist/coordination/task-dependencies.d.ts +0 -50
- package/dist/coordination/task-dependencies.js +0 -407
- package/dist/coordination/team-coordinator.d.ts +0 -59
- package/dist/coordination/team-coordinator.js +0 -550
- package/dist/coordination/types.d.ts +0 -152
- package/dist/coordination/types.js +0 -3
- package/dist/mcp/mcp-wrapper.d.ts +0 -8
- package/dist/mcp/mcp-wrapper.js +0 -77
- package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
- package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
- package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
- package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
- package/dist/mcp/singleton-check.js +0 -31
- package/dist/mcp/test-simple-mcp.d.ts +0 -6
- package/dist/mcp/test-simple-mcp.js +0 -63
- package/dist/memory/hierarchical-memory-system.d.ts +0 -90
- package/dist/memory/hierarchical-memory-system.js +0 -400
- package/dist/memory/index.d.ts +0 -9
- package/dist/memory/index.js +0 -20
- package/dist/memory/mcp-integration-example.d.ts +0 -6
- package/dist/memory/mcp-integration-example.js +0 -281
- package/dist/memory/memory-client.d.ts +0 -199
- package/dist/memory/memory-client.js +0 -364
- package/dist/memory/memory-manager.d.ts +0 -29
- package/dist/memory/memory-manager.js +0 -280
- package/dist/memory/memory-operations.d.ts +0 -179
- package/dist/memory/memory-operations.js +0 -691
- package/dist/memory/memory-system.d.ts +0 -153
- package/dist/memory/memory-system.js +0 -651
- package/dist/memory/memory-test.d.ts +0 -6
- package/dist/memory/memory-test.js +0 -161
- package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
- package/dist/memory/snow-flow-memory-patterns.js +0 -200
- package/dist/memory/snow-memory.d.ts +0 -54
- package/dist/memory/snow-memory.js +0 -301
- package/dist/memory/swarm-memory.d.ts +0 -135
- package/dist/memory/swarm-memory.js +0 -378
- package/dist/optimization/flow-performance-optimizer.js +0 -723
- package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
- package/dist/orchestration/discovery/service-discovery.js +0 -808
- package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
- package/dist/orchestration/distributed-orchestrator.js +0 -712
- package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
- package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
- package/dist/orchestration/flow-update-orchestrator.js +0 -648
- package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
- package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
- package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
- package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
- package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
- package/dist/orchestration/state/distributed-state-manager.js +0 -716
- package/dist/orchestrator/flow-composer.d.ts +0 -105
- package/dist/orchestrator/flow-composer.js +0 -404
- package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
- package/dist/orchestrator/flow-pattern-templates.js +0 -908
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
- package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
- package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
- package/dist/orchestrator/flow-validation-engine.js +0 -913
- package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
- package/dist/orchestrator/snow-orchestrator.js +0 -235
- package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
- package/dist/orchestrator/subflow-creation-handler.js +0 -791
- package/dist/patterns/adaptive-patterns.d.ts +0 -140
- package/dist/patterns/adaptive-patterns.js +0 -549
- package/dist/queen/advanced-integration-test.d.ts +0 -48
- package/dist/queen/advanced-integration-test.js +0 -473
- package/dist/queen/integration-example.d.ts +0 -82
- package/dist/queen/integration-example.js +0 -219
- package/dist/queen/integration-test.d.ts +0 -72
- package/dist/queen/integration-test.js +0 -563
- package/dist/queen/mock-mcp-client.d.ts +0 -71
- package/dist/queen/mock-mcp-client.js +0 -317
- package/dist/queen/run-integration-tests.d.ts +0 -9
- package/dist/queen/run-integration-tests.js +0 -27
- package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
- package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
- package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
- package/dist/sparc/coordinators/team-coordinator.js +0 -402
- package/dist/sparc/modes/team-modes.d.ts +0 -33
- package/dist/sparc/modes/team-modes.js +0 -399
- package/dist/sparc/teams/application-team.d.ts +0 -73
- package/dist/sparc/teams/application-team.js +0 -463
- package/dist/sparc/teams/flow-team.d.ts +0 -67
- package/dist/sparc/teams/flow-team.js +0 -373
- package/dist/sparc/teams/widget-team.d.ts +0 -61
- package/dist/sparc/teams/widget-team.js +0 -280
- package/dist/specialists/app-specialists.d.ts +0 -93
- package/dist/specialists/app-specialists.js +0 -1639
- package/dist/specialists/base-specialist.d.ts +0 -19
- package/dist/specialists/base-specialist.js +0 -54
- package/dist/specialists/flow-specialists.d.ts +0 -113
- package/dist/specialists/flow-specialists.js +0 -1787
- package/dist/specialists/individual-specialists.d.ts +0 -67
- package/dist/specialists/individual-specialists.js +0 -632
- package/dist/specialists/widget-specialists.d.ts +0 -70
- package/dist/specialists/widget-specialists.js +0 -1264
- package/dist/src/utils/agent-detector.js +0 -655
- package/dist/teams/adaptive-team.d.ts +0 -81
- package/dist/teams/adaptive-team.js +0 -1153
- package/dist/teams/application-team.d.ts +0 -30
- package/dist/teams/application-team.js +0 -547
- package/dist/teams/base-team.d.ts +0 -55
- package/dist/teams/base-team.js +0 -243
- package/dist/teams/flow-team.d.ts +0 -28
- package/dist/teams/flow-team.js +0 -525
- package/dist/teams/widget-team.d.ts +0 -26
- package/dist/teams/widget-team.js +0 -459
- package/dist/templates/flow-template-system.js +0 -625
- package/dist/test-fetch-incidents.d.ts +0 -2
- package/dist/test-fetch-incidents.js +0 -84
- package/dist/test-incident-access.d.ts +0 -2
- package/dist/test-incident-access.js +0 -72
- package/dist/test-iphone-flow.js +0 -189
- package/dist/test-limit-problem.d.ts +0 -2
- package/dist/test-limit-problem.js +0 -60
- package/dist/test-ml-batch-fix.d.ts +0 -2
- package/dist/test-ml-batch-fix.js +0 -104
- package/dist/test-ml-batch.d.ts +0 -2
- package/dist/test-ml-batch.js +0 -87
- package/dist/test-ml-query.d.ts +0 -2
- package/dist/test-ml-query.js +0 -100
- package/dist/test-ml-training-fix.d.ts +0 -12
- package/dist/test-ml-training-fix.js +0 -113
- package/dist/test-ml-training.d.ts +0 -2
- package/dist/test-ml-training.js +0 -32
- package/dist/test-operations-query.d.ts +0 -2
- package/dist/test-operations-query.js +0 -84
- package/dist/test-performance-query.d.ts +0 -2
- package/dist/test-performance-query.js +0 -52
- package/dist/test-singleton-protection.d.ts +0 -8
- package/dist/test-singleton-protection.js +0 -110
- package/dist/test-smart-limits.d.ts +0 -13
- package/dist/test-smart-limits.js +0 -100
- package/dist/test-snow-query-incidents.d.ts +0 -2
- package/dist/test-snow-query-incidents.js +0 -66
- package/dist/test-universal-query.d.ts +0 -2
- package/dist/test-universal-query.js +0 -106
- package/dist/testing/flow-testing-automation.js +0 -641
- package/dist/utils/complete-flow-xml-generator.js +0 -1285
- package/dist/utils/file-storage-fallback.d.ts +0 -62
- package/dist/utils/file-storage-fallback.js +0 -289
- package/dist/utils/flow-api-discovery.d.ts +0 -151
- package/dist/utils/flow-api-discovery.js +0 -439
- package/dist/utils/flow-examples.js +0 -720
- package/dist/utils/flow-structure-builder.js +0 -677
- package/dist/utils/flow-xml-generator.d.ts +0 -41
- package/dist/utils/flow-xml-generator.js +0 -258
- package/dist/utils/improved-flow-xml-generator.js +0 -820
- package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
- package/dist/utils/mcp-process-manager.backup.js +0 -220
- package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
- package/dist/utils/mcp-singleton-enforcer.js +0 -201
- package/dist/utils/mcp-timeout-fix.d.ts +0 -53
- package/dist/utils/mcp-timeout-fix.js +0 -221
- package/dist/utils/migrate-claude-flow.d.ts +0 -22
- package/dist/utils/migrate-claude-flow.js +0 -120
- package/dist/utils/scope-utils.d.ts +0 -72
- package/dist/utils/scope-utils.js +0 -386
- package/dist/utils/snow-oauth-old.d.ts +0 -65
- package/dist/utils/snow-oauth-old.js +0 -345
- package/dist/utils/xml-first-flow-generator.js +0 -513
- package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
- package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
- package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
- package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
- package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
- package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
- package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
- package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
- package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
- package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
- package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
- package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
- package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
- package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
- package/reports/swarm-auto-centralized-1752649029776.json +0 -13
- package/src/memory/README.md +0 -240
|
@@ -1,577 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BusinessLogicGate = exports.ServiceNowGate = exports.PerformanceGate = exports.SecurityGate = exports.CodeQualityGate = exports.QualityGateManager = void 0;
|
|
4
|
-
const eventemitter3_1 = require("eventemitter3");
|
|
5
|
-
const logger_1 = require("../utils/logger");
|
|
6
|
-
class QualityGateManager extends eventemitter3_1.EventEmitter {
|
|
7
|
-
constructor(config = {}) {
|
|
8
|
-
super();
|
|
9
|
-
this.gates = new Map();
|
|
10
|
-
this.gateResults = new Map();
|
|
11
|
-
this.config = {
|
|
12
|
-
enableBlocking: true,
|
|
13
|
-
enableScoring: true,
|
|
14
|
-
minPassingScore: 0.7,
|
|
15
|
-
enableMetrics: true,
|
|
16
|
-
timeoutMs: 30000,
|
|
17
|
-
...config
|
|
18
|
-
};
|
|
19
|
-
logger_1.logger.info('🛡️ Quality Gate Manager initialized', { config: this.config });
|
|
20
|
-
}
|
|
21
|
-
addGate(taskId, gate) {
|
|
22
|
-
if (!this.gates.has(taskId)) {
|
|
23
|
-
this.gates.set(taskId, []);
|
|
24
|
-
}
|
|
25
|
-
this.gates.get(taskId).push(gate);
|
|
26
|
-
logger_1.logger.debug('🚪 Added quality gate', {
|
|
27
|
-
taskId,
|
|
28
|
-
gateName: gate.name,
|
|
29
|
-
blocking: gate.blocking
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async validateTask(taskId, result) {
|
|
33
|
-
const startTime = Date.now();
|
|
34
|
-
try {
|
|
35
|
-
logger_1.logger.info('🔍 Starting quality gate validation', { taskId });
|
|
36
|
-
const gates = this.gates.get(taskId) || [];
|
|
37
|
-
if (gates.length === 0) {
|
|
38
|
-
logger_1.logger.debug('⚠️ No quality gates configured for task', { taskId });
|
|
39
|
-
return this.createPassingResult(taskId, startTime);
|
|
40
|
-
}
|
|
41
|
-
const validationResults = [];
|
|
42
|
-
let overallPassed = true;
|
|
43
|
-
let blockingFailure = false;
|
|
44
|
-
// Execute all quality gates
|
|
45
|
-
for (const gate of gates) {
|
|
46
|
-
try {
|
|
47
|
-
logger_1.logger.debug('🔍 Executing quality gate', {
|
|
48
|
-
taskId,
|
|
49
|
-
gateName: gate.name
|
|
50
|
-
});
|
|
51
|
-
const validation = await this.executeGateWithTimeout(gate, result);
|
|
52
|
-
validationResults.push(validation);
|
|
53
|
-
if (!validation.passed) {
|
|
54
|
-
if (gate.blocking) {
|
|
55
|
-
blockingFailure = true;
|
|
56
|
-
overallPassed = false;
|
|
57
|
-
logger_1.logger.warn('🚫 Blocking quality gate failed', {
|
|
58
|
-
taskId,
|
|
59
|
-
gateName: gate.name,
|
|
60
|
-
error: validation.error
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
logger_1.logger.warn('⚠️ Non-blocking quality gate failed', {
|
|
65
|
-
taskId,
|
|
66
|
-
gateName: gate.name,
|
|
67
|
-
error: validation.error
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
logger_1.logger.error('❌ Quality gate execution failed', {
|
|
74
|
-
taskId,
|
|
75
|
-
gateName: gate.name,
|
|
76
|
-
error: error.message
|
|
77
|
-
});
|
|
78
|
-
const failedValidation = {
|
|
79
|
-
passed: false,
|
|
80
|
-
error: `Gate execution failed: ${error.message}`,
|
|
81
|
-
suggestions: ['Check gate configuration', 'Verify input data format']
|
|
82
|
-
};
|
|
83
|
-
validationResults.push(failedValidation);
|
|
84
|
-
if (gate.blocking) {
|
|
85
|
-
blockingFailure = true;
|
|
86
|
-
overallPassed = false;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const result_obj = {
|
|
91
|
-
gateName: `quality_gates_${taskId}`,
|
|
92
|
-
passed: overallPassed,
|
|
93
|
-
blocking: blockingFailure,
|
|
94
|
-
validations: validationResults,
|
|
95
|
-
overallScore: this.calculateOverallScore(validationResults),
|
|
96
|
-
executionTime: Date.now() - startTime
|
|
97
|
-
};
|
|
98
|
-
// Store results for analytics
|
|
99
|
-
if (!this.gateResults.has(taskId)) {
|
|
100
|
-
this.gateResults.set(taskId, []);
|
|
101
|
-
}
|
|
102
|
-
this.gateResults.get(taskId).push(result_obj);
|
|
103
|
-
// Emit events
|
|
104
|
-
if (overallPassed) {
|
|
105
|
-
this.emit('gate:passed', { taskId, result: result_obj });
|
|
106
|
-
logger_1.logger.info('✅ Quality gates passed', {
|
|
107
|
-
taskId,
|
|
108
|
-
gatesCount: gates.length,
|
|
109
|
-
score: result_obj.overallScore
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this.emit('gate:failed', { taskId, result: result_obj });
|
|
114
|
-
logger_1.logger.error('❌ Quality gates failed', {
|
|
115
|
-
taskId,
|
|
116
|
-
blocking: blockingFailure,
|
|
117
|
-
failedGates: validationResults.filter(v => !v.passed).length
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return result_obj;
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
logger_1.logger.error('💥 Quality gate validation crashed', { taskId, error: error.message });
|
|
124
|
-
return {
|
|
125
|
-
gateName: `quality_gates_${taskId}`,
|
|
126
|
-
passed: false,
|
|
127
|
-
blocking: true,
|
|
128
|
-
validations: [{
|
|
129
|
-
passed: false,
|
|
130
|
-
error: `Validation system error: ${error.message}`
|
|
131
|
-
}],
|
|
132
|
-
executionTime: Date.now() - startTime
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async executeGateWithTimeout(gate, result) {
|
|
137
|
-
return new Promise(async (resolve, reject) => {
|
|
138
|
-
const timeout = setTimeout(() => {
|
|
139
|
-
reject(new Error(`Quality gate '${gate.name}' timed out after ${this.config.timeoutMs}ms`));
|
|
140
|
-
}, this.config.timeoutMs);
|
|
141
|
-
try {
|
|
142
|
-
const validation = await gate.validate(result);
|
|
143
|
-
clearTimeout(timeout);
|
|
144
|
-
resolve(validation);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
clearTimeout(timeout);
|
|
148
|
-
reject(error);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
calculateOverallScore(validations) {
|
|
153
|
-
if (!this.config.enableScoring || validations.length === 0) {
|
|
154
|
-
return 1.0;
|
|
155
|
-
}
|
|
156
|
-
const scores = validations
|
|
157
|
-
.filter(v => typeof v.score === 'number')
|
|
158
|
-
.map(v => v.score);
|
|
159
|
-
if (scores.length === 0) {
|
|
160
|
-
// Fall back to pass/fail scoring
|
|
161
|
-
const passed = validations.filter(v => v.passed).length;
|
|
162
|
-
return passed / validations.length;
|
|
163
|
-
}
|
|
164
|
-
return scores.reduce((sum, score) => sum + score, 0) / scores.length;
|
|
165
|
-
}
|
|
166
|
-
createPassingResult(taskId, startTime) {
|
|
167
|
-
return {
|
|
168
|
-
gateName: `quality_gates_${taskId}`,
|
|
169
|
-
passed: true,
|
|
170
|
-
blocking: false,
|
|
171
|
-
validations: [],
|
|
172
|
-
overallScore: 1.0,
|
|
173
|
-
executionTime: Date.now() - startTime
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
// Analytics and reporting
|
|
177
|
-
async getGateStatistics(taskId) {
|
|
178
|
-
const allResults = taskId
|
|
179
|
-
? this.gateResults.get(taskId) || []
|
|
180
|
-
: Array.from(this.gateResults.values()).flat();
|
|
181
|
-
if (allResults.length === 0) {
|
|
182
|
-
return {
|
|
183
|
-
totalExecutions: 0,
|
|
184
|
-
passRate: 0,
|
|
185
|
-
averageScore: 0,
|
|
186
|
-
averageExecutionTime: 0,
|
|
187
|
-
mostCommonFailures: []
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
const passed = allResults.filter(r => r.passed).length;
|
|
191
|
-
const scores = allResults
|
|
192
|
-
.filter(r => typeof r.overallScore === 'number')
|
|
193
|
-
.map(r => r.overallScore);
|
|
194
|
-
const failures = allResults
|
|
195
|
-
.filter(r => !r.passed)
|
|
196
|
-
.flatMap(r => r.validations)
|
|
197
|
-
.filter(v => !v.passed && v.error)
|
|
198
|
-
.map(v => v.error)
|
|
199
|
-
.reduce((counts, error) => {
|
|
200
|
-
counts[error] = (counts[error] || 0) + 1;
|
|
201
|
-
return counts;
|
|
202
|
-
}, {});
|
|
203
|
-
const mostCommonFailures = Object.entries(failures)
|
|
204
|
-
.sort(([, a], [, b]) => b - a)
|
|
205
|
-
.slice(0, 5)
|
|
206
|
-
.map(([error, count]) => ({ error, count }));
|
|
207
|
-
return {
|
|
208
|
-
totalExecutions: allResults.length,
|
|
209
|
-
passRate: passed / allResults.length,
|
|
210
|
-
averageScore: scores.length > 0 ? scores.reduce((sum, s) => sum + s, 0) / scores.length : 0,
|
|
211
|
-
averageExecutionTime: allResults.reduce((sum, r) => sum + r.executionTime, 0) / allResults.length,
|
|
212
|
-
mostCommonFailures
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
// Predefined Quality Gates
|
|
216
|
-
createCodeQualityGate(options = {}) {
|
|
217
|
-
return new CodeQualityGate(options);
|
|
218
|
-
}
|
|
219
|
-
createSecurityGate(options = {}) {
|
|
220
|
-
return new SecurityGate(options);
|
|
221
|
-
}
|
|
222
|
-
createPerformanceGate(options = {}) {
|
|
223
|
-
return new PerformanceGate(options);
|
|
224
|
-
}
|
|
225
|
-
createServiceNowGate(options = {}) {
|
|
226
|
-
return new ServiceNowGate(options);
|
|
227
|
-
}
|
|
228
|
-
createBusinessLogicGate(options = {}) {
|
|
229
|
-
return new BusinessLogicGate(options);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
exports.QualityGateManager = QualityGateManager;
|
|
233
|
-
// Predefined Quality Gate Implementations
|
|
234
|
-
class CodeQualityGate {
|
|
235
|
-
constructor(options = {}) {
|
|
236
|
-
this.name = 'Code Quality';
|
|
237
|
-
this.blocking = options.blocking ?? true;
|
|
238
|
-
this.options = {
|
|
239
|
-
maxComplexity: 10,
|
|
240
|
-
minCoverage: 80,
|
|
241
|
-
maxLines: 1000,
|
|
242
|
-
requireDocumentation: true,
|
|
243
|
-
checkNaming: true,
|
|
244
|
-
blocking: true,
|
|
245
|
-
...options
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
async validate(result) {
|
|
249
|
-
const issues = [];
|
|
250
|
-
const warnings = [];
|
|
251
|
-
let score = 1.0;
|
|
252
|
-
// Check code complexity
|
|
253
|
-
if (result.code && result.complexity > this.options.maxComplexity) {
|
|
254
|
-
issues.push(`Code complexity ${result.complexity} exceeds maximum ${this.options.maxComplexity}`);
|
|
255
|
-
score -= 0.3;
|
|
256
|
-
}
|
|
257
|
-
// Check test coverage
|
|
258
|
-
if (result.coverage && result.coverage < this.options.minCoverage) {
|
|
259
|
-
issues.push(`Test coverage ${result.coverage}% below minimum ${this.options.minCoverage}%`);
|
|
260
|
-
score -= 0.2;
|
|
261
|
-
}
|
|
262
|
-
// Check code length
|
|
263
|
-
if (result.code && result.code.split('\n').length > this.options.maxLines) {
|
|
264
|
-
warnings.push(`Code is very long (${result.code.split('\n').length} lines)`);
|
|
265
|
-
score -= 0.1;
|
|
266
|
-
}
|
|
267
|
-
// Check documentation
|
|
268
|
-
if (this.options.requireDocumentation && result.code && !this.hasDocumentation(result.code)) {
|
|
269
|
-
warnings.push('Missing documentation');
|
|
270
|
-
score -= 0.1;
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
passed: issues.length === 0,
|
|
274
|
-
score: Math.max(score, 0),
|
|
275
|
-
error: issues.length > 0 ? issues.join('; ') : undefined,
|
|
276
|
-
warnings,
|
|
277
|
-
suggestions: this.generateCodeSuggestions(issues, warnings)
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
hasDocumentation(code) {
|
|
281
|
-
return /\/\*\*|\*\/|\/\//.test(code);
|
|
282
|
-
}
|
|
283
|
-
generateCodeSuggestions(issues, warnings) {
|
|
284
|
-
const suggestions = [];
|
|
285
|
-
if (issues.some(i => i.includes('complexity'))) {
|
|
286
|
-
suggestions.push('Consider breaking down complex functions into smaller ones');
|
|
287
|
-
suggestions.push('Use early returns to reduce nesting');
|
|
288
|
-
}
|
|
289
|
-
if (issues.some(i => i.includes('coverage'))) {
|
|
290
|
-
suggestions.push('Add more unit tests');
|
|
291
|
-
suggestions.push('Test edge cases and error conditions');
|
|
292
|
-
}
|
|
293
|
-
if (warnings.some(w => w.includes('documentation'))) {
|
|
294
|
-
suggestions.push('Add JSDoc comments to public functions');
|
|
295
|
-
suggestions.push('Document complex business logic');
|
|
296
|
-
}
|
|
297
|
-
return suggestions;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
exports.CodeQualityGate = CodeQualityGate;
|
|
301
|
-
class SecurityGate {
|
|
302
|
-
constructor(options = {}) {
|
|
303
|
-
this.name = 'Security Review';
|
|
304
|
-
this.blocking = true;
|
|
305
|
-
this.options = {
|
|
306
|
-
checkInjection: true,
|
|
307
|
-
checkXSS: true,
|
|
308
|
-
checkAuth: true,
|
|
309
|
-
checkSecrets: true,
|
|
310
|
-
checkPermissions: true,
|
|
311
|
-
...options
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
async validate(result) {
|
|
315
|
-
const vulnerabilities = [];
|
|
316
|
-
let score = 1.0;
|
|
317
|
-
if (result.code) {
|
|
318
|
-
// Check for SQL injection vulnerabilities
|
|
319
|
-
if (this.options.checkInjection && this.hasSQLInjectionRisk(result.code)) {
|
|
320
|
-
vulnerabilities.push('Potential SQL injection vulnerability detected');
|
|
321
|
-
score -= 0.4;
|
|
322
|
-
}
|
|
323
|
-
// Check for XSS vulnerabilities
|
|
324
|
-
if (this.options.checkXSS && this.hasXSSRisk(result.code)) {
|
|
325
|
-
vulnerabilities.push('Potential XSS vulnerability detected');
|
|
326
|
-
score -= 0.3;
|
|
327
|
-
}
|
|
328
|
-
// Check for hardcoded secrets
|
|
329
|
-
if (this.options.checkSecrets && this.hasHardcodedSecrets(result.code)) {
|
|
330
|
-
vulnerabilities.push('Hardcoded secrets or credentials detected');
|
|
331
|
-
score -= 0.5;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
// Check ServiceNow specific security
|
|
335
|
-
if (result.servicenow) {
|
|
336
|
-
if (this.options.checkAuth && !this.hasProperAuthentication(result.servicenow)) {
|
|
337
|
-
vulnerabilities.push('Missing or weak authentication controls');
|
|
338
|
-
score -= 0.3;
|
|
339
|
-
}
|
|
340
|
-
if (this.options.checkPermissions && !this.hasProperPermissions(result.servicenow)) {
|
|
341
|
-
vulnerabilities.push('Insufficient access controls');
|
|
342
|
-
score -= 0.2;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
return {
|
|
346
|
-
passed: vulnerabilities.length === 0,
|
|
347
|
-
score: Math.max(score, 0),
|
|
348
|
-
error: vulnerabilities.length > 0 ? vulnerabilities.join('; ') : undefined,
|
|
349
|
-
suggestions: this.generateSecuritySuggestions(vulnerabilities)
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
hasSQLInjectionRisk(code) {
|
|
353
|
-
const patterns = [
|
|
354
|
-
/query\s*\+\s*['"`]/i,
|
|
355
|
-
/\$\{.*\}/,
|
|
356
|
-
/\.addQuery\(/i
|
|
357
|
-
];
|
|
358
|
-
return patterns.some(pattern => pattern.test(code));
|
|
359
|
-
}
|
|
360
|
-
hasXSSRisk(code) {
|
|
361
|
-
const patterns = [
|
|
362
|
-
/innerHTML\s*=/i,
|
|
363
|
-
/document\.write\(/i,
|
|
364
|
-
/eval\(/i
|
|
365
|
-
];
|
|
366
|
-
return patterns.some(pattern => pattern.test(code));
|
|
367
|
-
}
|
|
368
|
-
hasHardcodedSecrets(code) {
|
|
369
|
-
const patterns = [
|
|
370
|
-
/password\s*=\s*['"][^'"]+['"]/i,
|
|
371
|
-
/api[_-]?key\s*=\s*['"][^'"]+['"]/i,
|
|
372
|
-
/secret\s*=\s*['"][^'"]+['"]/i,
|
|
373
|
-
/token\s*=\s*['"][^'"]+['"]/i
|
|
374
|
-
];
|
|
375
|
-
return patterns.some(pattern => pattern.test(code));
|
|
376
|
-
}
|
|
377
|
-
hasProperAuthentication(servicenow) {
|
|
378
|
-
return servicenow.authMethod && servicenow.authMethod !== 'none';
|
|
379
|
-
}
|
|
380
|
-
hasProperPermissions(servicenow) {
|
|
381
|
-
return servicenow.accessControls && servicenow.accessControls.length > 0;
|
|
382
|
-
}
|
|
383
|
-
generateSecuritySuggestions(vulnerabilities) {
|
|
384
|
-
const suggestions = [];
|
|
385
|
-
if (vulnerabilities.some(v => v.includes('injection'))) {
|
|
386
|
-
suggestions.push('Use parameterized queries or prepared statements');
|
|
387
|
-
suggestions.push('Validate and sanitize all user inputs');
|
|
388
|
-
}
|
|
389
|
-
if (vulnerabilities.some(v => v.includes('XSS'))) {
|
|
390
|
-
suggestions.push('Use proper output encoding');
|
|
391
|
-
suggestions.push('Implement Content Security Policy (CSP)');
|
|
392
|
-
}
|
|
393
|
-
if (vulnerabilities.some(v => v.includes('secrets'))) {
|
|
394
|
-
suggestions.push('Use environment variables for secrets');
|
|
395
|
-
suggestions.push('Implement secure credential management');
|
|
396
|
-
}
|
|
397
|
-
return suggestions;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
exports.SecurityGate = SecurityGate;
|
|
401
|
-
class PerformanceGate {
|
|
402
|
-
constructor(options = {}) {
|
|
403
|
-
this.name = 'Performance Validation';
|
|
404
|
-
this.blocking = false;
|
|
405
|
-
this.options = {
|
|
406
|
-
maxResponseTime: 5000,
|
|
407
|
-
maxMemoryUsage: 100,
|
|
408
|
-
minThroughput: 100,
|
|
409
|
-
blocking: false,
|
|
410
|
-
...options
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
async validate(result) {
|
|
414
|
-
const issues = [];
|
|
415
|
-
let score = 1.0;
|
|
416
|
-
if (result.performance) {
|
|
417
|
-
const perf = result.performance;
|
|
418
|
-
if (perf.responseTime > this.options.maxResponseTime) {
|
|
419
|
-
issues.push(`Response time ${perf.responseTime}ms exceeds maximum ${this.options.maxResponseTime}ms`);
|
|
420
|
-
score -= 0.3;
|
|
421
|
-
}
|
|
422
|
-
if (perf.memoryUsage > this.options.maxMemoryUsage) {
|
|
423
|
-
issues.push(`Memory usage ${perf.memoryUsage}MB exceeds maximum ${this.options.maxMemoryUsage}MB`);
|
|
424
|
-
score -= 0.2;
|
|
425
|
-
}
|
|
426
|
-
if (perf.throughput < this.options.minThroughput) {
|
|
427
|
-
issues.push(`Throughput ${perf.throughput} below minimum ${this.options.minThroughput}`);
|
|
428
|
-
score -= 0.2;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
return {
|
|
432
|
-
passed: issues.length === 0,
|
|
433
|
-
score: Math.max(score, 0),
|
|
434
|
-
error: issues.length > 0 ? issues.join('; ') : undefined,
|
|
435
|
-
suggestions: this.generatePerformanceSuggestions(issues)
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
generatePerformanceSuggestions(issues) {
|
|
439
|
-
const suggestions = [];
|
|
440
|
-
if (issues.some(i => i.includes('response time'))) {
|
|
441
|
-
suggestions.push('Optimize database queries');
|
|
442
|
-
suggestions.push('Implement caching strategies');
|
|
443
|
-
suggestions.push('Consider pagination for large datasets');
|
|
444
|
-
}
|
|
445
|
-
if (issues.some(i => i.includes('memory'))) {
|
|
446
|
-
suggestions.push('Review object lifecycle management');
|
|
447
|
-
suggestions.push('Implement lazy loading');
|
|
448
|
-
}
|
|
449
|
-
return suggestions;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
exports.PerformanceGate = PerformanceGate;
|
|
453
|
-
class ServiceNowGate {
|
|
454
|
-
constructor(options = {}) {
|
|
455
|
-
this.name = 'ServiceNow Compliance';
|
|
456
|
-
this.blocking = true;
|
|
457
|
-
this.options = {
|
|
458
|
-
checkScope: true,
|
|
459
|
-
checkUpdateSet: true,
|
|
460
|
-
checkNaming: true,
|
|
461
|
-
checkDependencies: true,
|
|
462
|
-
blocking: true,
|
|
463
|
-
...options
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
async validate(result) {
|
|
467
|
-
const issues = [];
|
|
468
|
-
let score = 1.0;
|
|
469
|
-
// Check ServiceNow specific requirements
|
|
470
|
-
if (this.options.checkScope && !this.hasValidScope(result)) {
|
|
471
|
-
issues.push('Invalid or missing ServiceNow scope configuration');
|
|
472
|
-
score -= 0.3;
|
|
473
|
-
}
|
|
474
|
-
if (this.options.checkUpdateSet && !this.hasValidUpdateSet(result)) {
|
|
475
|
-
issues.push('Missing or invalid update set tracking');
|
|
476
|
-
score -= 0.4;
|
|
477
|
-
}
|
|
478
|
-
if (this.options.checkNaming && !this.hasValidNaming(result)) {
|
|
479
|
-
issues.push('ServiceNow naming conventions not followed');
|
|
480
|
-
score -= 0.2;
|
|
481
|
-
}
|
|
482
|
-
if (this.options.checkDependencies && !this.hasValidDependencies(result)) {
|
|
483
|
-
issues.push('Missing or invalid ServiceNow dependencies');
|
|
484
|
-
score -= 0.2;
|
|
485
|
-
}
|
|
486
|
-
return {
|
|
487
|
-
passed: issues.length === 0,
|
|
488
|
-
score: Math.max(score, 0),
|
|
489
|
-
error: issues.length > 0 ? issues.join('; ') : undefined,
|
|
490
|
-
suggestions: this.generateServiceNowSuggestions(issues)
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
hasValidScope(result) {
|
|
494
|
-
return result.servicenow?.scope && result.servicenow.scope.length > 0;
|
|
495
|
-
}
|
|
496
|
-
hasValidUpdateSet(result) {
|
|
497
|
-
return result.servicenow?.updateSet || result.updateSetId;
|
|
498
|
-
}
|
|
499
|
-
hasValidNaming(result) {
|
|
500
|
-
// Check if names follow ServiceNow conventions
|
|
501
|
-
if (result.name) {
|
|
502
|
-
return /^[a-z][a-z0-9_]*$/.test(result.name);
|
|
503
|
-
}
|
|
504
|
-
return true;
|
|
505
|
-
}
|
|
506
|
-
hasValidDependencies(result) {
|
|
507
|
-
// Check for required ServiceNow dependencies
|
|
508
|
-
return true; // Simplified - would check actual dependencies
|
|
509
|
-
}
|
|
510
|
-
generateServiceNowSuggestions(issues) {
|
|
511
|
-
const suggestions = [];
|
|
512
|
-
if (issues.some(i => i.includes('scope'))) {
|
|
513
|
-
suggestions.push('Configure proper ServiceNow application scope');
|
|
514
|
-
}
|
|
515
|
-
if (issues.some(i => i.includes('update set'))) {
|
|
516
|
-
suggestions.push('Ensure all changes are tracked in update sets');
|
|
517
|
-
}
|
|
518
|
-
if (issues.some(i => i.includes('naming'))) {
|
|
519
|
-
suggestions.push('Follow ServiceNow naming conventions (lowercase, underscores)');
|
|
520
|
-
}
|
|
521
|
-
return suggestions;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
exports.ServiceNowGate = ServiceNowGate;
|
|
525
|
-
class BusinessLogicGate {
|
|
526
|
-
constructor(options = {}) {
|
|
527
|
-
this.name = 'Business Logic Validation';
|
|
528
|
-
this.blocking = true;
|
|
529
|
-
this.options = {
|
|
530
|
-
checkRequirements: true,
|
|
531
|
-
checkOutputs: true,
|
|
532
|
-
checkErrorHandling: true,
|
|
533
|
-
blocking: true,
|
|
534
|
-
...options
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
async validate(result) {
|
|
538
|
-
const issues = [];
|
|
539
|
-
let score = 1.0;
|
|
540
|
-
// Check business requirements compliance
|
|
541
|
-
if (this.options.checkRequirements && !this.meetsBusinessRequirements(result)) {
|
|
542
|
-
issues.push('Does not meet specified business requirements');
|
|
543
|
-
score -= 0.4;
|
|
544
|
-
}
|
|
545
|
-
// Check expected outputs
|
|
546
|
-
if (this.options.checkOutputs && !this.hasExpectedOutputs(result)) {
|
|
547
|
-
issues.push('Missing expected outputs or data structures');
|
|
548
|
-
score -= 0.3;
|
|
549
|
-
}
|
|
550
|
-
// Check error handling
|
|
551
|
-
if (this.options.checkErrorHandling && !this.hasProperErrorHandling(result)) {
|
|
552
|
-
issues.push('Insufficient error handling implementation');
|
|
553
|
-
score -= 0.2;
|
|
554
|
-
}
|
|
555
|
-
return {
|
|
556
|
-
passed: issues.length === 0,
|
|
557
|
-
score: Math.max(score, 0),
|
|
558
|
-
error: issues.length > 0 ? issues.join('; ') : undefined,
|
|
559
|
-
suggestions: ['Review business requirements', 'Implement comprehensive error handling']
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
meetsBusinessRequirements(result) {
|
|
563
|
-
// Simplified - would check against actual business requirements
|
|
564
|
-
return result.businessLogic && Object.keys(result.businessLogic).length > 0;
|
|
565
|
-
}
|
|
566
|
-
hasExpectedOutputs(result) {
|
|
567
|
-
return result.outputs && Array.isArray(result.outputs) && result.outputs.length > 0;
|
|
568
|
-
}
|
|
569
|
-
hasProperErrorHandling(result) {
|
|
570
|
-
if (result.code) {
|
|
571
|
-
return /try\s*\{|catch\s*\(|throw\s+|error/i.test(result.code);
|
|
572
|
-
}
|
|
573
|
-
return true;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
exports.BusinessLogicGate = BusinessLogicGate;
|
|
577
|
-
//# sourceMappingURL=quality-gates.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { MemoryValue } from './types';
|
|
3
|
-
import { SnowAgent } from '../types/snow-flow.types';
|
|
4
|
-
export declare class SharedMemoryManager extends EventEmitter {
|
|
5
|
-
private memory;
|
|
6
|
-
private subscribers;
|
|
7
|
-
private versionCounters;
|
|
8
|
-
private accessLogs;
|
|
9
|
-
private readonly ttl;
|
|
10
|
-
private cleanupInterval;
|
|
11
|
-
constructor(ttl?: number);
|
|
12
|
-
store(key: string, value: any, notifySubscribers?: boolean): Promise<void>;
|
|
13
|
-
get(key: string): Promise<any>;
|
|
14
|
-
subscribe(key: string, agent: SnowAgent, callback: (key: string, value: any, version: number) => Promise<void>): Promise<void>;
|
|
15
|
-
unsubscribe(key: string, agent: SnowAgent): Promise<void>;
|
|
16
|
-
getHistory(key: string, limit?: number): Promise<MemoryValue[]>;
|
|
17
|
-
getKeys(pattern?: string): Promise<string[]>;
|
|
18
|
-
delete(key: string): Promise<boolean>;
|
|
19
|
-
clear(): Promise<void>;
|
|
20
|
-
getStats(): Promise<MemoryStats>;
|
|
21
|
-
compareAndSwap(key: string, expectedValue: any, newValue: any): Promise<boolean>;
|
|
22
|
-
atomicUpdate(key: string, updateFunction: (currentValue: any) => any): Promise<any>;
|
|
23
|
-
private getNextVersion;
|
|
24
|
-
private notifySubscribers;
|
|
25
|
-
private logAccess;
|
|
26
|
-
private calculateSize;
|
|
27
|
-
private isExpired;
|
|
28
|
-
private cleanupExpiredEntries;
|
|
29
|
-
destroy(): void;
|
|
30
|
-
}
|
|
31
|
-
interface MemoryStats {
|
|
32
|
-
totalEntries: number;
|
|
33
|
-
totalSize: number;
|
|
34
|
-
subscriberCount: number;
|
|
35
|
-
oldestEntryAge: number;
|
|
36
|
-
averageEntrySize: number;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=shared-memory.d.ts.map
|