0xray 3.1.1 → 3.2.0
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/.opencode/codex.codex +1 -1
- package/.opencode/commands/auto-format.md +3 -3
- package/.opencode/commands/auto-summary-capture.md +2 -2
- package/.opencode/commands/enforcer-daily-scan.md +3 -3
- package/.opencode/commands/framework-compliance-audit.md +4 -4
- package/.opencode/commands/interactive-validator.md +2 -2
- package/.opencode/commands/job-summary-logger.md +2 -2
- package/.opencode/commands/mode-switch.md +1 -1
- package/.opencode/commands/model-health-check.md +2 -2
- package/.opencode/commands/performance-analysis.md +2 -2
- package/.opencode/commands/pre-commit-introspection.md +3 -3
- package/.opencode/commands/security-scan.md +3 -3
- package/.opencode/commands/sisyphus-validation.md +3 -3
- package/.opencode/commands/summary-logger.md +2 -2
- package/AGENTS.md +3 -13
- package/README.md +3 -3
- package/dist/AGENTS.md +3 -13
- package/dist/CHANGELOG.md +29 -0
- package/dist/README.md +3 -3
- package/dist/analytics/consent-manager.js +0 -1
- package/dist/analytics/emerging-pattern-detector.js +0 -1
- package/dist/analytics/pattern-learning-engine.js +0 -1
- package/dist/analytics/pattern-performance-tracker.js +0 -1
- package/dist/analytics/predictive-analytics.js +0 -1
- package/dist/analytics/prompt-pattern-analyzer.js +0 -1
- package/dist/analytics/routing-performance-analyzer.js +0 -1
- package/dist/analytics/routing-refiner.js +0 -1
- package/dist/analytics/simple-pattern-analyzer.js +0 -1
- package/dist/cli/commands/archive-logs.js +0 -1
- package/dist/cli/commands/opencode-install.js +13 -0
- package/dist/cli/commands/plugin-commands.js +0 -1
- package/dist/cli/commands/status.js +11 -13
- package/dist/cli/index.js +2 -7
- package/dist/core/activity-logger.js +0 -1
- package/dist/core/adaptive-kernel.js +0 -1
- package/dist/core/boot-orchestrator.js +2 -12
- package/dist/core/bridge.mjs +0 -1
- package/dist/core/codex-formatter.js +0 -1
- package/dist/core/codex-injector.js +0 -1
- package/dist/core/config-loader.js +36 -28
- package/dist/core/context-loader.js +0 -1
- package/dist/core/context-validator.js +0 -1
- package/dist/core/features-config.js +37 -1
- package/dist/core/kernel-patterns.js +0 -1
- package/dist/core/model-router.js +23 -64
- package/dist/core/system-prompt-generator.js +0 -1
- package/dist/delegation/agent-delegator.js +0 -1
- package/dist/delegation/agent-expertise.js +0 -1
- package/dist/delegation/analytics/index.js +0 -1
- package/dist/delegation/analytics/learning-engine.js +0 -1
- package/dist/delegation/analytics/outcome-tracker.js +0 -1
- package/dist/delegation/analytics/routing-analytics.js +0 -1
- package/dist/delegation/ast-code-parser.js +0 -1
- package/dist/delegation/complexity-analyzer.js +0 -1
- package/dist/delegation/dependency-graph-builder.js +0 -1
- package/dist/delegation/index.js +0 -1
- package/dist/delegation/metrics-aggregator.js +0 -1
- package/dist/delegation/session-coordinator.js +0 -1
- package/dist/delegation/strategy-selector.js +0 -1
- package/dist/delegation/voting-coordinator.js +0 -1
- package/dist/delegation/voting-types.js +0 -1
- package/dist/delegation/weighted-voting-aggregator.js +0 -1
- package/dist/enforcement/core/index.js +0 -1
- package/dist/enforcement/core/rule-executor.js +0 -1
- package/dist/enforcement/core/rule-hierarchy.js +0 -1
- package/dist/enforcement/core/rule-registry.js +0 -1
- package/dist/enforcement/core/violation-fixer.js +0 -1
- package/dist/enforcement/index.js +0 -1
- package/dist/enforcement/loaders/agent-triage-loader.js +0 -1
- package/dist/enforcement/loaders/agents-md-validation-loader.js +0 -1
- package/dist/enforcement/loaders/base-loader.js +0 -1
- package/dist/enforcement/loaders/codex-loader.js +0 -1
- package/dist/enforcement/loaders/index.js +0 -1
- package/dist/enforcement/loaders/loader-orchestrator.js +0 -1
- package/dist/enforcement/loaders/processor-loader.js +0 -1
- package/dist/enforcement/types.js +0 -1
- package/dist/enforcement/validators/architecture-validators.js +0 -1
- package/dist/enforcement/validators/base-validator.js +0 -1
- package/dist/enforcement/validators/code-quality-validators.js +0 -1
- package/dist/enforcement/validators/index.js +0 -1
- package/dist/enforcement/validators/security-validators.js +0 -1
- package/dist/enforcement/validators/testing-validators.js +0 -1
- package/dist/enforcement/validators/validator-registry.js +0 -1
- package/dist/governance/codex-policy.service.js +0 -1
- package/dist/inference/inference-agent-invoker.js +67 -0
- package/dist/inference/inference-applier.js +178 -0
- package/dist/inference/inference-cycle.js +51 -827
- package/dist/inference/inference-proposal-generator.js +149 -0
- package/dist/infrastructure/iac-validator.js +465 -0
- package/dist/infrastructure/schemas/cloud-schemas.js +488 -0
- package/dist/integrations/base/ExampleIntegration.js +0 -1
- package/dist/integrations/base/Integration.js +0 -1
- package/dist/integrations/base/index.js +0 -1
- package/dist/integrations/base/registry.js +0 -1
- package/dist/integrations/base/types.js +0 -1
- package/dist/integrations/enforcement-gate.js +3 -3
- package/dist/integrations/governance/governance-client.js +0 -1
- package/dist/integrations/governance/index.js +11 -19
- package/dist/integrations/governance/types.js +0 -1
- package/dist/integrations/hermes-agent/__init__.py +4 -0
- package/dist/integrations/hermes-agent/bridge.mjs +37 -0
- package/dist/integrations/openclaw/api-server.js +0 -1
- package/dist/integrations/openclaw/client.js +0 -1
- package/dist/integrations/openclaw/config.js +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +0 -1
- package/dist/integrations/openclaw/index.js +0 -1
- package/dist/integrations/openclaw/types.js +0 -1
- package/dist/integrations/plugins/index.js +0 -1
- package/dist/integrations/plugins/plugin-integration.js +0 -1
- package/dist/integrations/plugins/plugin-registry.js +0 -1
- package/dist/mcps/agent-resolver.js +0 -1
- package/dist/mcps/architect-tools.server.js +119 -185
- package/dist/mcps/auto-format.server.js +56 -74
- package/dist/mcps/boot-orchestrator.server.js +67 -85
- package/dist/mcps/config/config-loader.js +6 -0
- package/dist/mcps/config/plugin-server-registry.js +0 -1
- package/dist/mcps/enforcer-tools.server.js +207 -273
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.js +52 -81
- package/dist/mcps/framework-help.server.js +71 -89
- package/dist/mcps/governance.server.js +97 -149
- package/dist/mcps/knowledge-skills/api-design.server.js +33 -65
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +33 -65
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +123 -163
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +210 -237
- package/dist/mcps/knowledge-skills/code-review.server.js +108 -142
- package/dist/mcps/knowledge-skills/content-creator.server.js +203 -225
- package/dist/mcps/knowledge-skills/database-design.server.js +116 -150
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +123 -157
- package/dist/mcps/knowledge-skills/git-workflow.server.js +34 -67
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +301 -323
- package/dist/mcps/knowledge-skills/log-monitor.server.js +139 -159
- package/dist/mcps/knowledge-skills/mobile-development.server.js +170 -200
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +122 -158
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +88 -138
- package/dist/mcps/knowledge-skills/project-analysis.server.js +131 -218
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +115 -150
- package/dist/mcps/knowledge-skills/security-audit.server.js +16 -143
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +20 -213
- package/dist/mcps/knowledge-skills/session-management.server.js +13 -90
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +43 -421
- package/dist/mcps/knowledge-skills/strategist.server.js +10 -55
- package/dist/mcps/knowledge-skills/tech-writer.server.js +16 -191
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +18 -191
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +18 -156
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +22 -296
- package/dist/mcps/lint.server.js +50 -91
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/orchestrator/aside-context.js +207 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +5 -1
- package/dist/mcps/orchestrator/handlers/status-handler.js +8 -1
- package/dist/mcps/orchestrator/handlers/task-handler.js +5 -0
- package/dist/mcps/orchestrator/index.js +5 -0
- package/dist/mcps/orchestrator/server.js +63 -8
- package/dist/mcps/performance-analysis.server.js +56 -87
- package/dist/mcps/processor-pipeline.server.js +68 -99
- package/dist/mcps/researcher.server.js +80 -153
- package/dist/mcps/security-scan.server.js +56 -70
- package/dist/mcps/shared/knowledge-skill-base.js +11 -4
- package/dist/mcps/state-manager.server.js +124 -152
- package/dist/monitoring/nudge-watchdog.js +0 -1
- package/dist/nucleus/default-plugins.js +13 -19
- package/dist/nucleus/index.js +0 -1
- package/dist/orchestrator/agent-spawn-governor.js +0 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +2 -10
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +0 -1
- package/dist/orchestrator/orchestrator.js +8 -18
- package/dist/orchestrator/self-direction-activation.js +0 -1
- package/dist/orchestrator/universal-registry-bridge.js +0 -1
- package/dist/performance/performance-budget-enforcer.js +0 -1
- package/dist/performance/performance-regression-tester.js +0 -1
- package/dist/plugin/plugin-codex-context.js +87 -0
- package/dist/plugin/plugin-helpers.js +155 -0
- package/dist/plugin/plugin-logger.js +46 -0
- package/dist/plugin/plugin-modules.js +144 -0
- package/dist/plugin/plugin-quality-gate.js +88 -0
- package/dist/plugin/plugin-types.js +1 -0
- package/dist/plugin/xray-codex-injection.js +338 -0
- package/dist/postprocessor/PostProcessor.js +3 -9
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +16 -0
- package/dist/postprocessor/integration.js +194 -0
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +472 -0
- package/dist/postprocessor/metamorphosis/index.js +1 -0
- package/dist/postprocessor/redeploy/RetryHandler.js +118 -0
- package/dist/postprocessor/services/RegressionAnalysisService.js +0 -1
- package/dist/postprocessor/triggers/APITrigger.js +0 -1
- package/dist/postprocessor/triggers/WebhookTrigger.js +0 -1
- package/dist/processors/implementations/agents-md-validation-processor.js +0 -1
- package/dist/processors/implementations/async-pattern-processor.js +0 -1
- package/dist/processors/implementations/console-log-guard-processor.js +0 -1
- package/dist/processors/implementations/coverage-analysis-processor.js +0 -1
- package/dist/processors/implementations/inference-improvement-processor.js +2 -9
- package/dist/processors/implementations/log-protection-processor.js +0 -1
- package/dist/processors/implementations/nudge-processor.js +0 -1
- package/dist/processors/implementations/performance-budget-processor.js +0 -1
- package/dist/processors/implementations/postprocessor-chain-validator.js +0 -1
- package/dist/processors/implementations/publish-preflight-processor.js +4 -12
- package/dist/processors/implementations/session-summary-processor.js +8 -16
- package/dist/processors/implementations/spawn-governance-processor.js +0 -1
- package/dist/processors/implementations/storytelling-trigger-processor.js +3 -28
- package/dist/processors/implementations/test-auto-creation-processor.js +0 -1
- package/dist/processors/implementations/typescript-compilation-processor.js +0 -1
- package/dist/processors/implementations/version-compliance-processor.js +0 -1
- package/dist/processors/processor-interfaces.js +0 -1
- package/dist/processors/processor-types.js +0 -1
- package/dist/scripts/integration.js +0 -1
- package/dist/security/comprehensive-security-audit.js +0 -1
- package/dist/security/security-agent-coordinator.js +0 -1
- package/dist/security/security-auditor.js +0 -1
- package/dist/security/security-hardener.js +0 -1
- package/dist/security/security-hardening-system.js +0 -1
- package/dist/security/security-headers.js +0 -1
- package/dist/security/security-orchestration-layer.js +0 -1
- package/dist/services/inference-tuner.js +0 -1
- package/dist/session/session-cleanup-manager.js +0 -1
- package/dist/session/session-monitor.js +0 -1
- package/dist/session/session-state-manager.js +0 -1
- package/dist/skills/xray-orchestrator/index.js +0 -1
- package/dist/utils/codex-parser.js +0 -1
- package/dist/utils/language-detector.js +0 -1
- package/dist/utils/shutdown-handler.js +0 -1
- package/dist/validation/agent-config-validator.js +280 -0
- package/dist/validation/orchestration-flow-validator.js +606 -0
- package/package.json +1 -1
- package/scripts/node/release.mjs +2 -2
- package/scripts/node/setup.cjs +28 -0
- package/scripts/node/universal-version-manager.js +1 -1
- package/src/mcps/agent-resolver.ts +0 -1
- package/src/mcps/architect-tools.server.ts +129 -211
- package/src/mcps/auto-format.server.ts +74 -103
- package/src/mcps/boot-orchestrator.server.ts +71 -96
- package/src/mcps/config/__tests__/config-loader.test.ts +6 -6
- package/src/mcps/config/config-loader.ts +7 -0
- package/src/mcps/config/plugin-server-registry.ts +0 -1
- package/src/mcps/enforcer-tools.server.ts +217 -294
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +53 -95
- package/src/mcps/framework-help.server.ts +74 -96
- package/src/mcps/governance.server.ts +97 -162
- package/src/mcps/knowledge-skills/api-design.server.ts +33 -72
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +33 -72
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +148 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +222 -254
- package/src/mcps/knowledge-skills/code-review.server.ts +115 -157
- package/src/mcps/knowledge-skills/content-creator.server.ts +219 -246
- package/src/mcps/knowledge-skills/database-design.server.ts +119 -160
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +126 -167
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +322 -360
- package/src/mcps/knowledge-skills/log-monitor.server.ts +68 -95
- package/src/mcps/knowledge-skills/mobile-development.server.ts +16 -56
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +13 -59
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +13 -74
- package/src/mcps/knowledge-skills/project-analysis.server.ts +13 -120
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +13 -60
- package/src/mcps/knowledge-skills/security-audit.server.ts +19 -157
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +23 -227
- package/src/mcps/knowledge-skills/session-management.server.ts +17 -106
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +45 -446
- package/src/mcps/knowledge-skills/strategist.server.ts +13 -63
- package/src/mcps/knowledge-skills/tech-writer.server.ts +19 -204
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +21 -204
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +21 -165
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +25 -342
- package/src/mcps/lint.server.ts +52 -105
- package/src/mcps/model-health-check.server.ts +34 -70
- package/src/mcps/orchestrator/aside-context.ts +245 -0
- package/src/mcps/orchestrator/handlers/complexity-handler.ts +9 -3
- package/src/mcps/orchestrator/handlers/status-handler.ts +11 -1
- package/src/mcps/orchestrator/handlers/task-handler.ts +8 -1
- package/src/mcps/orchestrator/index.ts +29 -0
- package/src/mcps/orchestrator/server.ts +79 -24
- package/src/mcps/orchestrator/types.ts +37 -0
- package/src/mcps/performance-analysis.server.ts +59 -102
- package/src/mcps/processor-pipeline.server.ts +70 -108
- package/src/mcps/researcher.server.ts +87 -175
- package/src/mcps/security-scan.server.ts +57 -76
- package/src/mcps/shared/knowledge-skill-base.ts +12 -4
- package/src/mcps/state-manager.server.ts +129 -169
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/auto-format.md +3 -3
- package/src/opencode/commands/auto-summary-capture.md +2 -2
- package/src/opencode/commands/enforcer-daily-scan.md +3 -3
- package/src/opencode/commands/framework-compliance-audit.md +4 -4
- package/src/opencode/commands/interactive-validator.md +2 -2
- package/src/opencode/commands/job-summary-logger.md +2 -2
- package/src/opencode/commands/mode-switch.md +1 -1
- package/src/opencode/commands/model-health-check.md +2 -2
- package/src/opencode/commands/performance-analysis.md +2 -2
- package/src/opencode/commands/pre-commit-introspection.md +3 -3
- package/src/opencode/commands/security-scan.md +3 -3
- package/src/opencode/commands/sisyphus-validation.md +3 -3
- package/src/opencode/commands/summary-logger.md +2 -2
- package/src/skills/xray-orchestrator/index.ts +0 -1
- package/dist/nucleus/orchestrator.js +0 -479
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* COMPREHENSIVE ORCHESTRATION FLOW VALIDATION SUITE
|
|
3
|
+
* Validates the complete end-to-end orchestration pipeline
|
|
4
|
+
*/
|
|
5
|
+
import { XrayOrchestrator } from "../orchestrator/orchestrator.js";
|
|
6
|
+
import { enhancedMultiAgentOrchestrator } from "../orchestrator/enhanced-multi-agent-orchestrator.js";
|
|
7
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
8
|
+
import { frameworkLogger } from "../core/framework-logger.js";
|
|
9
|
+
import { xrayConfigLoader } from "../core/config-loader.js";
|
|
10
|
+
import { createAgentDelegator } from "../delegation/agent-delegator.js";
|
|
11
|
+
class OrchestrationFlowValidator {
|
|
12
|
+
orchestrator;
|
|
13
|
+
stateManager;
|
|
14
|
+
agentDelegator;
|
|
15
|
+
testResults = new Map();
|
|
16
|
+
constructor() {
|
|
17
|
+
this.stateManager = new XrayStateManager();
|
|
18
|
+
this.agentDelegator = createAgentDelegator(this.stateManager, xrayConfigLoader);
|
|
19
|
+
this.orchestrator = new XrayOrchestrator({
|
|
20
|
+
maxConcurrentTasks: 5,
|
|
21
|
+
conflictResolutionStrategy: "expert_priority",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* SIMULATION 1: Basic Orchestration Flow
|
|
26
|
+
* Tests the fundamental orchestration pipeline
|
|
27
|
+
*/
|
|
28
|
+
async testBasicOrchestrationFlow() {
|
|
29
|
+
const startTime = Date.now();
|
|
30
|
+
const testName = "Basic Orchestration Flow";
|
|
31
|
+
const validationSteps = [];
|
|
32
|
+
try {
|
|
33
|
+
// Step 1: Initialize orchestrator
|
|
34
|
+
validationSteps.push({
|
|
35
|
+
step: "Orchestrator Initialization",
|
|
36
|
+
success: true,
|
|
37
|
+
timestamp: Date.now(),
|
|
38
|
+
details: "XrayOrchestrator created successfully",
|
|
39
|
+
});
|
|
40
|
+
// Step 2: Define simple task
|
|
41
|
+
const tasks = [
|
|
42
|
+
{
|
|
43
|
+
id: "testing-lead",
|
|
44
|
+
description: "Design a simple API endpoint",
|
|
45
|
+
subagentType: "architect",
|
|
46
|
+
priority: "medium",
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
validationSteps.push({
|
|
50
|
+
step: "Task Definition",
|
|
51
|
+
success: true,
|
|
52
|
+
timestamp: Date.now(),
|
|
53
|
+
details: `Defined ${tasks.length} task(s)`,
|
|
54
|
+
});
|
|
55
|
+
// Step 3: Execute orchestration
|
|
56
|
+
const results = await this.orchestrator.executeComplexTask("Test basic orchestration", tasks);
|
|
57
|
+
validationSteps.push({
|
|
58
|
+
step: "Task Execution",
|
|
59
|
+
success: results.length === 1,
|
|
60
|
+
timestamp: Date.now(),
|
|
61
|
+
details: `Executed ${results.length} task(s)`,
|
|
62
|
+
});
|
|
63
|
+
// Step 4: Validate results
|
|
64
|
+
const success = results.every((r) => r.success);
|
|
65
|
+
validationSteps.push({
|
|
66
|
+
step: "Result Validation",
|
|
67
|
+
success,
|
|
68
|
+
timestamp: Date.now(),
|
|
69
|
+
details: `${results.filter((r) => r.success).length}/${results.length} tasks succeeded`,
|
|
70
|
+
});
|
|
71
|
+
// Step 5: Check monitoring
|
|
72
|
+
const monitoringData = enhancedMultiAgentOrchestrator.getMonitoringInterface();
|
|
73
|
+
const hasMonitoring = Object.keys(monitoringData).length > 0;
|
|
74
|
+
validationSteps.push({
|
|
75
|
+
step: "Monitoring Validation",
|
|
76
|
+
success: hasMonitoring,
|
|
77
|
+
timestamp: Date.now(),
|
|
78
|
+
details: `${Object.keys(monitoringData).length} agents monitored`,
|
|
79
|
+
});
|
|
80
|
+
const duration = Date.now() - startTime;
|
|
81
|
+
const stats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
82
|
+
return {
|
|
83
|
+
testName,
|
|
84
|
+
success: success && hasMonitoring,
|
|
85
|
+
duration,
|
|
86
|
+
metrics: {
|
|
87
|
+
agentsSpawned: stats.totalSpawned,
|
|
88
|
+
agentsCompleted: stats.completedAgents,
|
|
89
|
+
agentsFailed: stats.failedAgents,
|
|
90
|
+
dependenciesResolved: 0,
|
|
91
|
+
monitoringUpdates: Object.keys(monitoringData).length,
|
|
92
|
+
},
|
|
93
|
+
validationSteps,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return {
|
|
98
|
+
testName,
|
|
99
|
+
success: false,
|
|
100
|
+
duration: Date.now() - startTime,
|
|
101
|
+
error: error instanceof Error ? error.message : String(error),
|
|
102
|
+
metrics: {
|
|
103
|
+
agentsSpawned: 0,
|
|
104
|
+
agentsCompleted: 0,
|
|
105
|
+
agentsFailed: 0,
|
|
106
|
+
dependenciesResolved: 0,
|
|
107
|
+
monitoringUpdates: 0,
|
|
108
|
+
},
|
|
109
|
+
validationSteps,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* SIMULATION 2: Dependency Management Flow
|
|
115
|
+
* Tests complex task dependencies and sequencing
|
|
116
|
+
*/
|
|
117
|
+
async testDependencyManagementFlow() {
|
|
118
|
+
const startTime = Date.now();
|
|
119
|
+
const testName = "Dependency Management Flow";
|
|
120
|
+
const validationSteps = [];
|
|
121
|
+
try {
|
|
122
|
+
// Define tasks with dependencies
|
|
123
|
+
const tasks = [
|
|
124
|
+
{
|
|
125
|
+
id: "design-phase",
|
|
126
|
+
description: "Design system architecture",
|
|
127
|
+
subagentType: "architect",
|
|
128
|
+
priority: "high",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "validate-design",
|
|
132
|
+
description: "Validate design against requirements",
|
|
133
|
+
subagentType: "enforcer",
|
|
134
|
+
priority: "high",
|
|
135
|
+
dependencies: ["design-phase"],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "implement-design",
|
|
139
|
+
description: "Implement the validated design",
|
|
140
|
+
subagentType: "testing-lead",
|
|
141
|
+
priority: "medium",
|
|
142
|
+
dependencies: ["design-phase", "validate-design"],
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
validationSteps.push({
|
|
146
|
+
step: "Dependency Task Setup",
|
|
147
|
+
success: true,
|
|
148
|
+
timestamp: Date.now(),
|
|
149
|
+
details: `Created ${tasks.length} tasks with ${tasks.filter((t) => t.dependencies).length} dependencies`,
|
|
150
|
+
});
|
|
151
|
+
// Execute complex orchestration
|
|
152
|
+
const results = await this.orchestrator.executeComplexTask("Test dependency management", tasks);
|
|
153
|
+
validationSteps.push({
|
|
154
|
+
step: "Complex Execution",
|
|
155
|
+
success: results.length === 3,
|
|
156
|
+
timestamp: Date.now(),
|
|
157
|
+
details: `Completed ${results.length} interdependent tasks`,
|
|
158
|
+
});
|
|
159
|
+
// Validate dependency order was respected
|
|
160
|
+
const executionOrder = results.map((r) => r.result?.id).filter(Boolean);
|
|
161
|
+
const correctOrder = [
|
|
162
|
+
"design-phase",
|
|
163
|
+
"validate-design",
|
|
164
|
+
"implement-design",
|
|
165
|
+
];
|
|
166
|
+
const orderCorrect = JSON.stringify(executionOrder) === JSON.stringify(correctOrder);
|
|
167
|
+
validationSteps.push({
|
|
168
|
+
step: "Dependency Order Validation",
|
|
169
|
+
success: orderCorrect,
|
|
170
|
+
timestamp: Date.now(),
|
|
171
|
+
details: `Execution order: ${executionOrder.join(" → ")}`,
|
|
172
|
+
});
|
|
173
|
+
// Check for parallel execution where possible
|
|
174
|
+
const monitoringData = enhancedMultiAgentOrchestrator.getMonitoringInterface();
|
|
175
|
+
const parallelExecution = Object.keys(monitoringData).length >= 2; // At least 25 agents ran
|
|
176
|
+
validationSteps.push({
|
|
177
|
+
step: "Parallel Execution Validation",
|
|
178
|
+
success: parallelExecution,
|
|
179
|
+
timestamp: Date.now(),
|
|
180
|
+
details: `${Object.keys(monitoringData).length} agents executed`,
|
|
181
|
+
});
|
|
182
|
+
const duration = Date.now() - startTime;
|
|
183
|
+
const stats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
184
|
+
return {
|
|
185
|
+
testName,
|
|
186
|
+
success: results.every((r) => r.success) && orderCorrect,
|
|
187
|
+
duration,
|
|
188
|
+
metrics: {
|
|
189
|
+
agentsSpawned: stats.totalSpawned,
|
|
190
|
+
agentsCompleted: stats.completedAgents,
|
|
191
|
+
agentsFailed: stats.failedAgents,
|
|
192
|
+
dependenciesResolved: tasks.filter((t) => t.dependencies).length,
|
|
193
|
+
monitoringUpdates: Object.keys(monitoringData).length,
|
|
194
|
+
},
|
|
195
|
+
validationSteps,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
return {
|
|
200
|
+
testName,
|
|
201
|
+
success: false,
|
|
202
|
+
duration: Date.now() - startTime,
|
|
203
|
+
error: error instanceof Error ? error.message : String(error),
|
|
204
|
+
metrics: {
|
|
205
|
+
agentsSpawned: 0,
|
|
206
|
+
agentsCompleted: 0,
|
|
207
|
+
agentsFailed: 0,
|
|
208
|
+
dependenciesResolved: 0,
|
|
209
|
+
monitoringUpdates: 0,
|
|
210
|
+
},
|
|
211
|
+
validationSteps,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* SIMULATION 3: Error Handling & Recovery Flow
|
|
217
|
+
* Tests system resilience and fallback mechanisms
|
|
218
|
+
*/
|
|
219
|
+
async testErrorHandlingFlow() {
|
|
220
|
+
const startTime = Date.now();
|
|
221
|
+
const testName = "Error Handling & Recovery Flow";
|
|
222
|
+
const validationSteps = [];
|
|
223
|
+
try {
|
|
224
|
+
// Create tasks that will trigger fallback scenarios
|
|
225
|
+
const tasks = [
|
|
226
|
+
{
|
|
227
|
+
id: "reliable-task",
|
|
228
|
+
description: "Execute reliable task",
|
|
229
|
+
subagentType: "architect",
|
|
230
|
+
priority: "medium",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "unreliable-task",
|
|
234
|
+
description: "Execute task that may fail",
|
|
235
|
+
subagentType: "invalid-agent-type", // This should trigger fallback
|
|
236
|
+
priority: "low",
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
validationSteps.push({
|
|
240
|
+
step: "Error Scenario Setup",
|
|
241
|
+
success: true,
|
|
242
|
+
timestamp: Date.now(),
|
|
243
|
+
details: "Created tasks with intentional failure scenarios",
|
|
244
|
+
});
|
|
245
|
+
// Execute with error handling
|
|
246
|
+
const results = await this.orchestrator.executeComplexTask("Test error handling and recovery", tasks);
|
|
247
|
+
validationSteps.push({
|
|
248
|
+
step: "Error Execution",
|
|
249
|
+
success: results.length === 2,
|
|
250
|
+
timestamp: Date.now(),
|
|
251
|
+
details: `Processed ${results.length} tasks with error handling`,
|
|
252
|
+
});
|
|
253
|
+
// Validate that system continued despite errors
|
|
254
|
+
const successfulTasks = results.filter((r) => r.success).length;
|
|
255
|
+
const failedTasks = results.filter((r) => !r.success).length;
|
|
256
|
+
const gracefulFailure = failedTasks > 0 && successfulTasks > 0;
|
|
257
|
+
validationSteps.push({
|
|
258
|
+
step: "Graceful Failure Validation",
|
|
259
|
+
success: gracefulFailure,
|
|
260
|
+
timestamp: Date.now(),
|
|
261
|
+
details: `${successfulTasks} succeeded, ${failedTasks} failed gracefully`,
|
|
262
|
+
});
|
|
263
|
+
// Check monitoring shows both success and failure states
|
|
264
|
+
const monitoringData = enhancedMultiAgentOrchestrator.getMonitoringInterface();
|
|
265
|
+
const hasCompletedAgents = Object.values(monitoringData).some((agent) => agent.status === "completed");
|
|
266
|
+
const hasFailedAgents = Object.values(monitoringData).some((agent) => agent.status === "failed");
|
|
267
|
+
validationSteps.push({
|
|
268
|
+
step: "Monitoring State Validation",
|
|
269
|
+
success: hasCompletedAgents && hasFailedAgents,
|
|
270
|
+
timestamp: Date.now(),
|
|
271
|
+
details: `Monitoring shows ${hasCompletedAgents ? "completed" : "no completed"} and ${hasFailedAgents ? "failed" : "no failed"} agents`,
|
|
272
|
+
});
|
|
273
|
+
const duration = Date.now() - startTime;
|
|
274
|
+
const stats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
275
|
+
return {
|
|
276
|
+
testName,
|
|
277
|
+
success: gracefulFailure && hasCompletedAgents,
|
|
278
|
+
duration,
|
|
279
|
+
metrics: {
|
|
280
|
+
agentsSpawned: stats.totalSpawned,
|
|
281
|
+
agentsCompleted: stats.completedAgents,
|
|
282
|
+
agentsFailed: stats.failedAgents,
|
|
283
|
+
dependenciesResolved: 0,
|
|
284
|
+
monitoringUpdates: Object.keys(monitoringData).length,
|
|
285
|
+
},
|
|
286
|
+
validationSteps,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
return {
|
|
291
|
+
testName,
|
|
292
|
+
success: false,
|
|
293
|
+
duration: Date.now() - startTime,
|
|
294
|
+
error: error instanceof Error ? error.message : String(error),
|
|
295
|
+
metrics: {
|
|
296
|
+
agentsSpawned: 0,
|
|
297
|
+
agentsCompleted: 0,
|
|
298
|
+
agentsFailed: 0,
|
|
299
|
+
dependenciesResolved: 0,
|
|
300
|
+
monitoringUpdates: 0,
|
|
301
|
+
},
|
|
302
|
+
validationSteps,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* SIMULATION 4: Performance & Scalability Flow
|
|
308
|
+
* Tests system performance under load
|
|
309
|
+
*/
|
|
310
|
+
async testPerformanceFlow() {
|
|
311
|
+
const startTime = Date.now();
|
|
312
|
+
const testName = "Performance & Scalability Flow";
|
|
313
|
+
const validationSteps = [];
|
|
314
|
+
try {
|
|
315
|
+
// Create multiple concurrent tasks
|
|
316
|
+
const taskCount = 5;
|
|
317
|
+
const tasks = Array.from({ length: taskCount }, (_, i) => ({
|
|
318
|
+
id: `perf-task-${i}`,
|
|
319
|
+
description: `Performance test task ${i}`,
|
|
320
|
+
subagentType: [
|
|
321
|
+
"architect",
|
|
322
|
+
"researcher",
|
|
323
|
+
"enforcer",
|
|
324
|
+
"testing-lead",
|
|
325
|
+
"security-auditor",
|
|
326
|
+
][i % 5],
|
|
327
|
+
priority: "medium",
|
|
328
|
+
}));
|
|
329
|
+
validationSteps.push({
|
|
330
|
+
step: "Performance Task Setup",
|
|
331
|
+
success: true,
|
|
332
|
+
timestamp: Date.now(),
|
|
333
|
+
details: `Created ${taskCount} concurrent tasks`,
|
|
334
|
+
});
|
|
335
|
+
// Execute concurrent tasks
|
|
336
|
+
const results = await this.orchestrator.executeComplexTask("Test performance and scalability", tasks);
|
|
337
|
+
validationSteps.push({
|
|
338
|
+
step: "Concurrent Execution",
|
|
339
|
+
success: results.length === taskCount,
|
|
340
|
+
timestamp: Date.now(),
|
|
341
|
+
details: `Executed ${results.length} concurrent tasks`,
|
|
342
|
+
});
|
|
343
|
+
// Validate performance metrics
|
|
344
|
+
const totalDuration = Date.now() - startTime;
|
|
345
|
+
const avgTaskDuration = totalDuration / taskCount;
|
|
346
|
+
const reasonablePerformance = avgTaskDuration < 10000; // Less than 10 seconds per task
|
|
347
|
+
validationSteps.push({
|
|
348
|
+
step: "Performance Validation",
|
|
349
|
+
success: reasonablePerformance,
|
|
350
|
+
timestamp: Date.now(),
|
|
351
|
+
details: `Average task duration: ${avgTaskDuration.toFixed(2)}ms`,
|
|
352
|
+
});
|
|
353
|
+
// Check resource management
|
|
354
|
+
const stats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
355
|
+
const resourceEfficiency = stats.completedAgents >= taskCount * 0.8; // At least 80% success rate
|
|
356
|
+
validationSteps.push({
|
|
357
|
+
step: "Resource Management Validation",
|
|
358
|
+
success: resourceEfficiency,
|
|
359
|
+
timestamp: Date.now(),
|
|
360
|
+
details: `${stats.completedAgents}/${taskCount} tasks completed successfully`,
|
|
361
|
+
});
|
|
362
|
+
const duration = Date.now() - startTime;
|
|
363
|
+
return {
|
|
364
|
+
testName,
|
|
365
|
+
success: reasonablePerformance && resourceEfficiency,
|
|
366
|
+
duration,
|
|
367
|
+
metrics: {
|
|
368
|
+
agentsSpawned: stats.totalSpawned,
|
|
369
|
+
agentsCompleted: stats.completedAgents,
|
|
370
|
+
agentsFailed: stats.failedAgents,
|
|
371
|
+
dependenciesResolved: 0,
|
|
372
|
+
monitoringUpdates: taskCount,
|
|
373
|
+
},
|
|
374
|
+
validationSteps,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
catch (error) {
|
|
378
|
+
return {
|
|
379
|
+
testName,
|
|
380
|
+
success: false,
|
|
381
|
+
duration: Date.now() - startTime,
|
|
382
|
+
error: error instanceof Error ? error.message : String(error),
|
|
383
|
+
metrics: {
|
|
384
|
+
agentsSpawned: 0,
|
|
385
|
+
agentsCompleted: 0,
|
|
386
|
+
agentsFailed: 0,
|
|
387
|
+
dependenciesResolved: 0,
|
|
388
|
+
monitoringUpdates: 0,
|
|
389
|
+
},
|
|
390
|
+
validationSteps,
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* SIMULATION 5: Monitoring & Cleanup Flow
|
|
396
|
+
* Tests the complete monitoring and cleanup lifecycle
|
|
397
|
+
*/
|
|
398
|
+
async testMonitoringCleanupFlow() {
|
|
399
|
+
const startTime = Date.now();
|
|
400
|
+
const testName = "Monitoring & Cleanup Flow";
|
|
401
|
+
const validationSteps = [];
|
|
402
|
+
try {
|
|
403
|
+
// Execute tasks to generate monitoring data
|
|
404
|
+
const tasks = [
|
|
405
|
+
{
|
|
406
|
+
id: "monitor-test-1",
|
|
407
|
+
description: "Test monitoring capabilities",
|
|
408
|
+
subagentType: "architect",
|
|
409
|
+
priority: "medium",
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
id: "monitor-test-2",
|
|
413
|
+
description: "Test cleanup mechanisms",
|
|
414
|
+
subagentType: "researcher",
|
|
415
|
+
priority: "medium",
|
|
416
|
+
},
|
|
417
|
+
];
|
|
418
|
+
const results = await this.orchestrator.executeComplexTask("Test monitoring and cleanup", tasks);
|
|
419
|
+
validationSteps.push({
|
|
420
|
+
step: "Monitoring Data Generation",
|
|
421
|
+
success: results.length === 2,
|
|
422
|
+
timestamp: Date.now(),
|
|
423
|
+
details: "Generated monitoring data through task execution",
|
|
424
|
+
});
|
|
425
|
+
// Validate monitoring interface
|
|
426
|
+
const monitoringData = enhancedMultiAgentOrchestrator.getMonitoringInterface();
|
|
427
|
+
const hasClickableAgents = Object.values(monitoringData).every((agent) => agent.clickable);
|
|
428
|
+
const hasProgressTracking = Object.values(monitoringData).every((agent) => typeof agent.progress === "number");
|
|
429
|
+
validationSteps.push({
|
|
430
|
+
step: "Monitoring Interface Validation",
|
|
431
|
+
success: hasClickableAgents && hasProgressTracking,
|
|
432
|
+
timestamp: Date.now(),
|
|
433
|
+
details: `Clickable: ${hasClickableAgents}, Progress: ${hasProgressTracking}`,
|
|
434
|
+
});
|
|
435
|
+
// Test agent cancellation
|
|
436
|
+
const agentIds = Object.keys(monitoringData);
|
|
437
|
+
if (agentIds.length > 0) {
|
|
438
|
+
const agentIdToCancel = agentIds[0];
|
|
439
|
+
if (agentIdToCancel) {
|
|
440
|
+
const cancelResult = await enhancedMultiAgentOrchestrator.cancelAgent(agentIdToCancel);
|
|
441
|
+
validationSteps.push({
|
|
442
|
+
step: "Agent Cancellation Test",
|
|
443
|
+
success: cancelResult,
|
|
444
|
+
timestamp: Date.now(),
|
|
445
|
+
details: `Cancelled agent ${agentIdToCancel}: ${cancelResult}`,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
// Wait for cleanup to occur
|
|
450
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
451
|
+
// Validate cleanup occurred
|
|
452
|
+
const postCleanupStats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
453
|
+
const cleanupOccurred = postCleanupStats.activeAgents < 2; // Should have cleaned up cancelled agent
|
|
454
|
+
validationSteps.push({
|
|
455
|
+
step: "Cleanup Validation",
|
|
456
|
+
success: cleanupOccurred,
|
|
457
|
+
timestamp: Date.now(),
|
|
458
|
+
details: `Active agents after cleanup: ${postCleanupStats.activeAgents}`,
|
|
459
|
+
});
|
|
460
|
+
const duration = Date.now() - startTime;
|
|
461
|
+
const stats = enhancedMultiAgentOrchestrator.getStatistics();
|
|
462
|
+
return {
|
|
463
|
+
testName,
|
|
464
|
+
success: hasClickableAgents && hasProgressTracking && cleanupOccurred,
|
|
465
|
+
duration,
|
|
466
|
+
metrics: {
|
|
467
|
+
agentsSpawned: stats.totalSpawned,
|
|
468
|
+
agentsCompleted: stats.completedAgents,
|
|
469
|
+
agentsFailed: stats.failedAgents,
|
|
470
|
+
dependenciesResolved: 0,
|
|
471
|
+
monitoringUpdates: Object.keys(monitoringData).length,
|
|
472
|
+
},
|
|
473
|
+
validationSteps,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
catch (error) {
|
|
477
|
+
return {
|
|
478
|
+
testName,
|
|
479
|
+
success: false,
|
|
480
|
+
duration: Date.now() - startTime,
|
|
481
|
+
error: error instanceof Error ? error.message : String(error),
|
|
482
|
+
metrics: {
|
|
483
|
+
agentsSpawned: 0,
|
|
484
|
+
agentsCompleted: 0,
|
|
485
|
+
agentsFailed: 0,
|
|
486
|
+
dependenciesResolved: 0,
|
|
487
|
+
monitoringUpdates: 0,
|
|
488
|
+
},
|
|
489
|
+
validationSteps,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Run all orchestration flow validations
|
|
495
|
+
*/
|
|
496
|
+
async runCompleteValidationSuite() {
|
|
497
|
+
await frameworkLogger.log("orchestration-flow-validator", "-starting-comprehensive-orchestration-flow-validat", "info", {
|
|
498
|
+
message: "🚀 STARTING COMPREHENSIVE ORCHESTRATION FLOW VALIDATION SUITE\n",
|
|
499
|
+
});
|
|
500
|
+
await frameworkLogger.log("orchestration-flow-validator", "-repeat-70-", "info", { message: "=".repeat(70) });
|
|
501
|
+
const tests = [
|
|
502
|
+
this.testBasicOrchestrationFlow(),
|
|
503
|
+
this.testDependencyManagementFlow(),
|
|
504
|
+
this.testErrorHandlingFlow(),
|
|
505
|
+
this.testPerformanceFlow(),
|
|
506
|
+
this.testMonitoringCleanupFlow(),
|
|
507
|
+
];
|
|
508
|
+
const results = await Promise.all(tests);
|
|
509
|
+
// Store results
|
|
510
|
+
results.forEach((result) => {
|
|
511
|
+
this.testResults.set(result.testName, result);
|
|
512
|
+
});
|
|
513
|
+
// Generate comprehensive report
|
|
514
|
+
return this.generateValidationReport(results);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Generate comprehensive validation report
|
|
518
|
+
*/
|
|
519
|
+
generateValidationReport(results) {
|
|
520
|
+
const totalTests = results.length;
|
|
521
|
+
const passedTests = results.filter((r) => r.success).length;
|
|
522
|
+
const failedTests = totalTests - passedTests;
|
|
523
|
+
const successRate = (passedTests / totalTests) * 100;
|
|
524
|
+
const totalDuration = results.reduce((sum, r) => sum + r.duration, 0);
|
|
525
|
+
const avgDuration = totalDuration / totalTests;
|
|
526
|
+
const totalAgentsSpawned = results.reduce((sum, r) => sum + r.metrics.agentsSpawned, 0);
|
|
527
|
+
const totalAgentsCompleted = results.reduce((sum, r) => sum + r.metrics.agentsCompleted, 0);
|
|
528
|
+
const totalDependenciesResolved = results.reduce((sum, r) => sum + r.metrics.dependenciesResolved, 0);
|
|
529
|
+
// Validation report output - kept as console.log for user-readable reports
|
|
530
|
+
results.forEach((result, index) => {
|
|
531
|
+
const status = result.success ? "✅ PASS" : "❌ FAIL";
|
|
532
|
+
const duration = result.duration;
|
|
533
|
+
const agents = result.metrics.agentsSpawned;
|
|
534
|
+
// Test result details - kept as console.log for readability
|
|
535
|
+
void frameworkLogger.log("orchestration-flow-validator", "-index-1-result-testname-status-duration-ms-agents", "info", {
|
|
536
|
+
message: `${index + 1}. ${result.testName} - ${status} (${duration}ms, ${agents} agents)`,
|
|
537
|
+
});
|
|
538
|
+
// Show key metrics
|
|
539
|
+
void frameworkLogger.log("orchestration-flow-validator", "-metrics-result-metrics-agentscompleted-result-met", "info", {
|
|
540
|
+
message: ` Metrics: ${result.metrics.agentsCompleted}/${result.metrics.agentsSpawned} completed, ${result.metrics.dependenciesResolved} deps resolved`,
|
|
541
|
+
});
|
|
542
|
+
// Show validation steps
|
|
543
|
+
result.validationSteps.forEach((step) => {
|
|
544
|
+
const stepStatus = step.success ? "✓" : "✗";
|
|
545
|
+
void frameworkLogger.log("orchestration-flow-validator", "-stepstatus-step-step-", "info", { message: ` ${stepStatus} ${step.step}` });
|
|
546
|
+
});
|
|
547
|
+
void frameworkLogger.log("orchestration-flow-validator", "-", "info", {
|
|
548
|
+
message: "",
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
// Cleanup
|
|
552
|
+
enhancedMultiAgentOrchestrator.shutdown();
|
|
553
|
+
return {
|
|
554
|
+
summary: {
|
|
555
|
+
totalTests,
|
|
556
|
+
passedTests,
|
|
557
|
+
failedTests,
|
|
558
|
+
successRate,
|
|
559
|
+
totalDuration,
|
|
560
|
+
avgDuration,
|
|
561
|
+
},
|
|
562
|
+
metrics: {
|
|
563
|
+
totalAgentsSpawned,
|
|
564
|
+
totalAgentsCompleted,
|
|
565
|
+
totalDependenciesResolved,
|
|
566
|
+
totalMonitoringUpdates: results.reduce((sum, r) => sum + r.metrics.monitoringUpdates, 0),
|
|
567
|
+
},
|
|
568
|
+
testResults: results,
|
|
569
|
+
recommendations: this.generateRecommendations(results),
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Generate recommendations based on test results
|
|
574
|
+
*/
|
|
575
|
+
generateRecommendations(results) {
|
|
576
|
+
const recommendations = [];
|
|
577
|
+
const failedTests = results.filter((r) => !r.success);
|
|
578
|
+
if (failedTests.length > 0) {
|
|
579
|
+
recommendations.push(`Address ${failedTests.length} failing test(s): ${failedTests.map((t) => t.testName).join(", ")}`);
|
|
580
|
+
}
|
|
581
|
+
const slowTests = results.filter((r) => r.duration > 10000);
|
|
582
|
+
if (slowTests.length > 0) {
|
|
583
|
+
recommendations.push(`Optimize performance for ${slowTests.length} slow test(s) averaging >10s execution time`);
|
|
584
|
+
}
|
|
585
|
+
const lowCompletionRate = results.some((r) => r.metrics.agentsCompleted / r.metrics.agentsSpawned < 0.8);
|
|
586
|
+
if (lowCompletionRate) {
|
|
587
|
+
recommendations.push("Improve agent completion rates - some tests show <80% success rate");
|
|
588
|
+
}
|
|
589
|
+
if (recommendations.length === 0) {
|
|
590
|
+
recommendations.push("All tests passed successfully - orchestration pipeline is fully validated");
|
|
591
|
+
}
|
|
592
|
+
return recommendations;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
// Export for external use
|
|
596
|
+
export { OrchestrationFlowValidator };
|
|
597
|
+
// Run validation suite if executed directly
|
|
598
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
599
|
+
const validator = new OrchestrationFlowValidator();
|
|
600
|
+
validator
|
|
601
|
+
.runCompleteValidationSuite()
|
|
602
|
+
.then((results) => {
|
|
603
|
+
// Validation completion - kept as console.log for user feedback
|
|
604
|
+
})
|
|
605
|
+
.catch(() => { });
|
|
606
|
+
}
|
package/package.json
CHANGED
package/scripts/node/release.mjs
CHANGED
|
@@ -98,7 +98,7 @@ async function main() {
|
|
|
98
98
|
// This removes the brittle "must be exactly one ahead" problem.
|
|
99
99
|
let publishedVersion;
|
|
100
100
|
try {
|
|
101
|
-
publishedVersion = execSync('npm view
|
|
101
|
+
publishedVersion = execSync('npm view 0xray version', { encoding: 'utf-8' }).trim();
|
|
102
102
|
console.log(`📌 Latest published on npm: ${publishedVersion}`);
|
|
103
103
|
} catch {
|
|
104
104
|
publishedVersion = '0.0.0';
|
|
@@ -154,7 +154,7 @@ async function main() {
|
|
|
154
154
|
|
|
155
155
|
// Step 5: Push
|
|
156
156
|
console.log('\n📦 Step 5: Pushing to origin...');
|
|
157
|
-
runCommand('git push origin
|
|
157
|
+
runCommand('git push origin main', 'Failed to push to origin');
|
|
158
158
|
runCommand(`git push origin v${newVersion}`, 'Failed to push tag');
|
|
159
159
|
|
|
160
160
|
// Step 6: Publish to npm
|
package/scripts/node/setup.cjs
CHANGED
|
@@ -13,6 +13,9 @@ if (__dirname.includes("node_modules/xray")) {
|
|
|
13
13
|
targetDir = process.env.PWD || process.cwd();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
const resolvedPackage = path.resolve(packageRoot);
|
|
17
|
+
const resolvedTarget = path.resolve(targetDir);
|
|
18
|
+
|
|
16
19
|
console.log("🔧 xray Setup: Full configuration...\n");
|
|
17
20
|
|
|
18
21
|
const hasHermes = fs.existsSync(path.join(targetDir, ".hermes")) &&
|
|
@@ -211,4 +214,29 @@ if (fs.existsSync(hermesSkillSource)) {
|
|
|
211
214
|
} catch (e) { console.warn(`⚠️ Hermes skill: ${e.message}`); }
|
|
212
215
|
}
|
|
213
216
|
|
|
217
|
+
// 8. Deploy .xray/ config files (codex.json, features.json, config.json) for consumer installs
|
|
218
|
+
const xraySourceDir = path.join(packageRoot, ".xray");
|
|
219
|
+
const xrayTargetDir = path.join(targetDir, ".xray");
|
|
220
|
+
const CONFIG_FILES = ["codex.json", "features.json", "config.json"];
|
|
221
|
+
|
|
222
|
+
if (fs.existsSync(xraySourceDir) && resolvedPackage !== resolvedTarget) {
|
|
223
|
+
try {
|
|
224
|
+
if (!fs.existsSync(xrayTargetDir)) fs.mkdirSync(xrayTargetDir, { recursive: true });
|
|
225
|
+
let copied = 0;
|
|
226
|
+
for (const file of CONFIG_FILES) {
|
|
227
|
+
const src = path.join(xraySourceDir, file);
|
|
228
|
+
const dst = path.join(xrayTargetDir, file);
|
|
229
|
+
if (!fs.existsSync(src)) continue;
|
|
230
|
+
const shouldCopy = !fs.existsSync(dst) ||
|
|
231
|
+
fs.statSync(src).mtime > fs.statSync(dst).mtime;
|
|
232
|
+
if (shouldCopy) {
|
|
233
|
+
fs.copyFileSync(src, dst);
|
|
234
|
+
copied++;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (copied > 0) console.log(`✅ .xray/: ${copied} config files deployed`);
|
|
238
|
+
else console.log("ℹ️ .xray/: up to date");
|
|
239
|
+
} catch (e) { console.warn(`⚠️ .xray/ deploy: ${e.message}`); }
|
|
240
|
+
}
|
|
241
|
+
|
|
214
242
|
console.log("\n✅ xray setup complete.\n");
|
|
@@ -138,7 +138,7 @@ const OFFICIAL_VERSIONS = {
|
|
|
138
138
|
framework: {
|
|
139
139
|
version: "3.1.1",
|
|
140
140
|
displayName: "xray: Self-Healing AI Governance OS",
|
|
141
|
-
lastUpdated: "2026-06-
|
|
141
|
+
lastUpdated: "2026-06-17",
|
|
142
142
|
// Counts (auto-calculated, but can be overridden)
|
|
143
143
|
...CALCULATED_COUNTS,
|
|
144
144
|
},
|