stringray-ai 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/architectural-integrity.d.ts +21 -0
- package/dist/plugin/architectural-integrity.d.ts.map +1 -0
- package/dist/plugin/architectural-integrity.js +81 -0
- package/dist/plugin/architectural-integrity.js.map +1 -0
- package/dist/plugin/boot-orchestrator.d.ts +100 -0
- package/dist/plugin/boot-orchestrator.d.ts.map +1 -0
- package/dist/plugin/boot-orchestrator.js +606 -0
- package/dist/plugin/boot-orchestrator.js.map +1 -0
- package/dist/plugin/codex-injector.d.ts +72 -0
- package/dist/plugin/codex-injector.d.ts.map +1 -0
- package/dist/plugin/codex-injector.js +387 -0
- package/dist/plugin/codex-injector.js.map +1 -0
- package/dist/plugin/delegation/index.d.ts +16 -0
- package/dist/plugin/delegation/index.d.ts.map +1 -0
- package/dist/plugin/delegation/index.js +13 -0
- package/dist/plugin/delegation/index.js.map +1 -0
- package/dist/plugin/delegation/session-coordinator.d.ts +121 -0
- package/dist/plugin/delegation/session-coordinator.d.ts.map +1 -0
- package/dist/plugin/delegation/session-coordinator.js +346 -0
- package/dist/plugin/delegation/session-coordinator.js.map +1 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +3 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/monitoring/memory-monitor.d.ts +113 -0
- package/dist/plugin/monitoring/memory-monitor.d.ts.map +1 -0
- package/dist/plugin/monitoring/memory-monitor.js +283 -0
- package/dist/plugin/monitoring/memory-monitor.js.map +1 -0
- package/dist/plugin/postprocessor/PostProcessor.d.ts +90 -0
- package/dist/plugin/postprocessor/PostProcessor.d.ts.map +1 -0
- package/dist/plugin/postprocessor/PostProcessor.js +631 -0
- package/dist/plugin/postprocessor/PostProcessor.js.map +1 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.d.ts +40 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.js +244 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.js.map +1 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.d.ts +50 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.js +246 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.js.map +1 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.d.ts +27 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.d.ts.map +1 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.js +158 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.js.map +1 -0
- package/dist/plugin/postprocessor/config.d.ts +7 -0
- package/dist/plugin/postprocessor/config.d.ts.map +1 -0
- package/dist/plugin/postprocessor/config.js +66 -0
- package/dist/plugin/postprocessor/config.js.map +1 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.d.ts +73 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.js +249 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.js.map +1 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.d.ts +19 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.js +120 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.js.map +1 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.d.ts +92 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.d.ts.map +1 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.js +319 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.js.map +1 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.d.ts +61 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.d.ts.map +1 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.js +148 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.d.ts +13 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.js +20 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.d.ts +17 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.js +285 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.d.ts +13 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.js +21 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.js.map +1 -0
- package/dist/plugin/postprocessor/types.d.ts +198 -0
- package/dist/plugin/postprocessor/types.d.ts.map +1 -0
- package/dist/plugin/postprocessor/types.js +5 -0
- package/dist/plugin/postprocessor/types.js.map +1 -0
- package/dist/plugin/security/security-auditor.d.ts +57 -0
- package/dist/plugin/security/security-auditor.d.ts.map +1 -0
- package/dist/plugin/security/security-auditor.js +583 -0
- package/dist/plugin/security/security-auditor.js.map +1 -0
- package/dist/plugin/security/security-hardener.d.ts +63 -0
- package/dist/plugin/security/security-hardener.d.ts.map +1 -0
- package/dist/plugin/security/security-hardener.js +181 -0
- package/dist/plugin/security/security-hardener.js.map +1 -0
- package/dist/plugin/security/security-headers.d.ts +52 -0
- package/dist/plugin/security/security-headers.d.ts.map +1 -0
- package/dist/plugin/security/security-headers.js +118 -0
- package/dist/plugin/security/security-headers.js.map +1 -0
- package/dist/plugin/session/session-cleanup-manager.d.ts +118 -0
- package/dist/plugin/session/session-cleanup-manager.d.ts.map +1 -0
- package/dist/plugin/session/session-cleanup-manager.js +324 -0
- package/dist/plugin/session/session-cleanup-manager.js.map +1 -0
- package/dist/plugin/session/session-monitor.d.ts +99 -0
- package/dist/plugin/session/session-monitor.d.ts.map +1 -0
- package/dist/plugin/session/session-monitor.js +363 -0
- package/dist/plugin/session/session-monitor.js.map +1 -0
- package/dist/plugin/session/session-state-manager.d.ts +142 -0
- package/dist/plugin/session/session-state-manager.d.ts.map +1 -0
- package/dist/plugin/session/session-state-manager.js +504 -0
- package/dist/plugin/session/session-state-manager.js.map +1 -0
- package/dist/plugin/strray-activation.d.ts +18 -0
- package/dist/plugin/strray-activation.d.ts.map +1 -0
- package/dist/plugin/strray-activation.js +114 -0
- package/dist/plugin/strray-activation.js.map +1 -0
- package/dist/plugin/validation/report-content-validator.d.ts +43 -0
- package/dist/plugin/validation/report-content-validator.d.ts.map +1 -0
- package/dist/plugin/validation/report-content-validator.js +219 -0
- package/dist/plugin/validation/report-content-validator.js.map +1 -0
- package/package.json +1 -1
- package/scripts/test-complex-orchestration.mjs +1 -1
- package/scripts/test-simple-prompt.mjs +1 -1
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StringRay Framework v1.0.0 - Boot Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Implements orchestrator-first boot sequence with automatic enforcement activation.
|
|
5
|
+
* Coordinates the initialization of all framework components in the correct order.
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
* @since 2026-01-07
|
|
9
|
+
*/
|
|
10
|
+
import { StringRayContextLoader } from "./context-loader.js";
|
|
11
|
+
import { StringRayStateManager } from "./state/state-manager.js";
|
|
12
|
+
import { ProcessorManager } from "./processors/processor-manager.js";
|
|
13
|
+
import { pathResolver } from "./utils/path-resolver.js";
|
|
14
|
+
// Path configuration - can be overridden by environment or use path resolver
|
|
15
|
+
const AGENTS_BASE_PATH = process.env.STRRAY_AGENTS_PATH || "../agents";
|
|
16
|
+
import { createAgentDelegator, createSessionCoordinator, } from "./delegation/index.js";
|
|
17
|
+
import { createSessionCleanupManager } from "./session/session-cleanup-manager.js";
|
|
18
|
+
import { createSessionMonitor } from "./session/session-monitor.js";
|
|
19
|
+
import { createSessionStateManager } from "./session/session-state-manager.js";
|
|
20
|
+
import { securityHardener } from "./security/security-hardener.js";
|
|
21
|
+
import { securityHeadersMiddleware } from "./security/security-headers.js";
|
|
22
|
+
import { frameworkLogger } from "./framework-logger.js";
|
|
23
|
+
import { memoryMonitor } from "./monitoring/memory-monitor.js";
|
|
24
|
+
/**
|
|
25
|
+
* Set up graceful interruption handling to prevent JSON parsing errors
|
|
26
|
+
* when processes are interrupted mid-operation
|
|
27
|
+
*/
|
|
28
|
+
function setupGracefulShutdown() {
|
|
29
|
+
let isShuttingDown = false;
|
|
30
|
+
process.on("SIGINT", async () => {
|
|
31
|
+
if (isShuttingDown) {
|
|
32
|
+
console.log("🔄 Force exit requested...");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
isShuttingDown = true;
|
|
36
|
+
console.log("⏹️ Received interrupt signal, shutting down gracefully...");
|
|
37
|
+
try {
|
|
38
|
+
// Stop memory monitoring
|
|
39
|
+
memoryMonitor.stop();
|
|
40
|
+
// Give ongoing operations a moment to complete
|
|
41
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
42
|
+
console.log("✅ Graceful shutdown completed");
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error("❌ Error during graceful shutdown:", error);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
process.on("SIGTERM", async () => {
|
|
51
|
+
console.log("⏹️ Received termination signal, shutting down gracefully...");
|
|
52
|
+
try {
|
|
53
|
+
memoryMonitor.stop();
|
|
54
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
55
|
+
process.exit(0);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
// Handle uncaught exceptions that might cause JSON parsing errors
|
|
62
|
+
process.on("uncaughtException", (error) => {
|
|
63
|
+
console.error("❌ Uncaught Exception:", error);
|
|
64
|
+
memoryMonitor.stop();
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|
|
67
|
+
process.on("unhandledRejection", (reason, promise) => {
|
|
68
|
+
console.error("❌ Unhandled Rejection at:", promise, "reason:", reason);
|
|
69
|
+
memoryMonitor.stop();
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export class BootOrchestrator {
|
|
74
|
+
contextLoader;
|
|
75
|
+
stateManager;
|
|
76
|
+
processorManager;
|
|
77
|
+
config;
|
|
78
|
+
constructor(config = {}, stateManager) {
|
|
79
|
+
// Set up graceful shutdown handling first
|
|
80
|
+
setupGracefulShutdown();
|
|
81
|
+
// Initialize components first for state management
|
|
82
|
+
this.contextLoader = StringRayContextLoader.getInstance();
|
|
83
|
+
this.stateManager = stateManager || new StringRayStateManager();
|
|
84
|
+
this.processorManager = new ProcessorManager(this.stateManager);
|
|
85
|
+
// Initialize memory monitoring with alerts
|
|
86
|
+
this.setupMemoryMonitoring();
|
|
87
|
+
this.config = {
|
|
88
|
+
enableEnforcement: true,
|
|
89
|
+
codexValidation: true,
|
|
90
|
+
sessionManagement: true,
|
|
91
|
+
processorActivation: true,
|
|
92
|
+
agentLoading: true,
|
|
93
|
+
...config,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Initialize delegation system components
|
|
98
|
+
*/
|
|
99
|
+
async initializeDelegationSystem() {
|
|
100
|
+
try {
|
|
101
|
+
const agentDelegator = createAgentDelegator(this.stateManager);
|
|
102
|
+
this.stateManager.set("delegation:agent_delegator", agentDelegator);
|
|
103
|
+
const sessionCoordinator = createSessionCoordinator(this.stateManager);
|
|
104
|
+
this.stateManager.set("delegation:session_coordinator", sessionCoordinator);
|
|
105
|
+
const defaultSession = sessionCoordinator.initializeSession("default");
|
|
106
|
+
this.stateManager.set("delegation:default_session", defaultSession);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error("❌ Failed to initialize delegation system:", error);
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Load orchestrator as the first component
|
|
116
|
+
*/
|
|
117
|
+
async loadOrchestrator() {
|
|
118
|
+
try {
|
|
119
|
+
// Import orchestrator dynamically to ensure it's loaded first
|
|
120
|
+
const orchestratorModule = await import("./orchestrator.js");
|
|
121
|
+
const orchestratorInstance = orchestratorModule.strRayOrchestrator;
|
|
122
|
+
if (!orchestratorInstance) {
|
|
123
|
+
console.error("❌ Orchestrator instance not found in module");
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
// Store in state manager for later access
|
|
127
|
+
this.stateManager.set("orchestrator", orchestratorInstance);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error("❌ Failed to load orchestrator:", error);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Initialize session management system
|
|
137
|
+
*/
|
|
138
|
+
async initializeSessionManagement() {
|
|
139
|
+
try {
|
|
140
|
+
// Initialize session state
|
|
141
|
+
this.stateManager.set("session:active", true);
|
|
142
|
+
this.stateManager.set("session:boot_time", Date.now());
|
|
143
|
+
this.stateManager.set("session:agents", []);
|
|
144
|
+
const sessionCoordinator = this.stateManager.get("delegation:session_coordinator");
|
|
145
|
+
if (sessionCoordinator) {
|
|
146
|
+
// Initialize session monitor first
|
|
147
|
+
const sessionMonitor = createSessionMonitor(this.stateManager, sessionCoordinator, undefined);
|
|
148
|
+
this.stateManager.set("session:monitor", sessionMonitor);
|
|
149
|
+
// Initialize session cleanup manager with session monitor reference
|
|
150
|
+
const cleanupManager = createSessionCleanupManager(this.stateManager, {}, sessionMonitor);
|
|
151
|
+
this.stateManager.set("session:cleanup_manager", cleanupManager);
|
|
152
|
+
// Update session monitor with cleanup manager reference
|
|
153
|
+
sessionMonitor.cleanupManager = cleanupManager;
|
|
154
|
+
const stateManagerInstance = createSessionStateManager(this.stateManager, sessionCoordinator);
|
|
155
|
+
this.stateManager.set("session:state_manager", stateManagerInstance);
|
|
156
|
+
const defaultSession = this.stateManager.get("delegation:default_session");
|
|
157
|
+
if (defaultSession?.sessionId) {
|
|
158
|
+
cleanupManager.registerSession(defaultSession.sessionId);
|
|
159
|
+
sessionMonitor.registerSession(defaultSession.sessionId);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error("❌ Failed to initialize session management:", error);
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Activate pre/post processors
|
|
171
|
+
*/
|
|
172
|
+
async activateProcessors() {
|
|
173
|
+
try {
|
|
174
|
+
frameworkLogger.log("boot-orchestrator", "activateProcessors started", "info");
|
|
175
|
+
this.processorManager.registerProcessor({
|
|
176
|
+
name: "preValidate",
|
|
177
|
+
type: "pre",
|
|
178
|
+
priority: 10,
|
|
179
|
+
enabled: true,
|
|
180
|
+
});
|
|
181
|
+
frameworkLogger.log("boot-orchestrator", "registered preValidate processor", "success");
|
|
182
|
+
this.processorManager.registerProcessor({
|
|
183
|
+
name: "codexCompliance",
|
|
184
|
+
type: "pre",
|
|
185
|
+
priority: 20,
|
|
186
|
+
enabled: true,
|
|
187
|
+
});
|
|
188
|
+
frameworkLogger.log("boot-orchestrator", "registered codexCompliance processor", "success");
|
|
189
|
+
this.processorManager.registerProcessor({
|
|
190
|
+
name: "errorBoundary",
|
|
191
|
+
type: "pre",
|
|
192
|
+
priority: 30,
|
|
193
|
+
enabled: true,
|
|
194
|
+
});
|
|
195
|
+
frameworkLogger.log("boot-orchestrator", "registered errorBoundary processor", "success");
|
|
196
|
+
this.processorManager.registerProcessor({
|
|
197
|
+
name: "stateValidation",
|
|
198
|
+
type: "post",
|
|
199
|
+
priority: 130,
|
|
200
|
+
enabled: true,
|
|
201
|
+
});
|
|
202
|
+
frameworkLogger.log("boot-orchestrator", "registered stateValidation processor", "success");
|
|
203
|
+
// Register the refactoring logging processor with its hook
|
|
204
|
+
const { refactoringLoggingProcessor } = await import("./processors/refactoring-logging-processor.js");
|
|
205
|
+
this.processorManager.registerProcessorWithHook(refactoringLoggingProcessor);
|
|
206
|
+
frameworkLogger.log("boot-orchestrator", "registered refactoringLogging processor with hook", "success");
|
|
207
|
+
const initSuccess = await this.processorManager.initializeProcessors();
|
|
208
|
+
if (!initSuccess) {
|
|
209
|
+
frameworkLogger.log("boot-orchestrator", "processor initialization failed", "error");
|
|
210
|
+
throw new Error("Processor initialization failed");
|
|
211
|
+
}
|
|
212
|
+
frameworkLogger.log("boot-orchestrator", "processors initialized successfully", "success");
|
|
213
|
+
this.stateManager.set("processor:manager", this.processorManager);
|
|
214
|
+
this.stateManager.set("processor:active", true);
|
|
215
|
+
frameworkLogger.log("boot-orchestrator", "processors activated and stored in state", "success");
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
frameworkLogger.log("boot-orchestrator", "activateProcessors failed", "error", error);
|
|
220
|
+
console.error("❌ Failed to activate processors:", error);
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Load remaining agents after orchestrator
|
|
226
|
+
*/
|
|
227
|
+
async loadRemainingAgents() {
|
|
228
|
+
const agents = [
|
|
229
|
+
"enforcer",
|
|
230
|
+
"architect",
|
|
231
|
+
"bug-triage-specialist",
|
|
232
|
+
"code-reviewer",
|
|
233
|
+
"security-auditor",
|
|
234
|
+
"refactorer",
|
|
235
|
+
"test-architect",
|
|
236
|
+
];
|
|
237
|
+
const loadedAgents = [];
|
|
238
|
+
for (const agentName of agents) {
|
|
239
|
+
try {
|
|
240
|
+
// Dynamic import of agent modules using path resolver
|
|
241
|
+
const agentPath = pathResolver.resolveAgentPath(agentName);
|
|
242
|
+
console.log(`🔗 Loading agent ${agentName} from: ${agentPath}`);
|
|
243
|
+
const agentModule = await import(agentPath);
|
|
244
|
+
const agentClass = agentModule[`StringRay${agentName.charAt(0).toUpperCase() + agentName.slice(1)}Agent`];
|
|
245
|
+
if (agentClass) {
|
|
246
|
+
const agentInstance = new agentClass();
|
|
247
|
+
this.stateManager.set(`agent:${agentName}`, agentInstance);
|
|
248
|
+
loadedAgents.push(agentName);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
console.warn(`⚠️ Agent class not found in module: ${agentName}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
console.warn(`⚠️ Failed to load agent ${agentName}:`, error instanceof Error ? error.message : String(error));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// Update session state with loaded agents
|
|
259
|
+
this.stateManager.set("session:agents", loadedAgents);
|
|
260
|
+
return loadedAgents;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Enable automatic enforcement activation
|
|
264
|
+
*/
|
|
265
|
+
async enableEnforcement() {
|
|
266
|
+
try {
|
|
267
|
+
// Load codex terms for enforcement
|
|
268
|
+
const loadResult = await this.contextLoader.loadCodexContext(process.cwd());
|
|
269
|
+
if (!loadResult.success || !loadResult.context) {
|
|
270
|
+
throw new Error("No codex terms loaded for enforcement");
|
|
271
|
+
}
|
|
272
|
+
const codexTerms = Array.from(loadResult.context.terms.values());
|
|
273
|
+
// Enable enforcement mechanisms
|
|
274
|
+
this.stateManager.set("enforcement:active", true);
|
|
275
|
+
this.stateManager.set("enforcement:codex_terms", codexTerms);
|
|
276
|
+
this.stateManager.set("enforcement:enabled_at", Date.now());
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
console.error("❌ Failed to enable enforcement:", error);
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Activate codex compliance checking during boot
|
|
286
|
+
*/
|
|
287
|
+
async activateCodexCompliance() {
|
|
288
|
+
try {
|
|
289
|
+
// Initialize codex injector if not already done
|
|
290
|
+
let codexInjector = this.stateManager.get("processor:codex_injector");
|
|
291
|
+
if (!codexInjector) {
|
|
292
|
+
// Import and initialize codex injector
|
|
293
|
+
// Try import with .js extension first (for Node.js/test environment)
|
|
294
|
+
let CodexInjector;
|
|
295
|
+
try {
|
|
296
|
+
({ CodexInjector } = await import("./codex-injector.js"));
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
// Fallback to import without .js extension (for oh-my-opencode plugin environment)
|
|
300
|
+
({ CodexInjector } = await import("./codex-injector"));
|
|
301
|
+
}
|
|
302
|
+
codexInjector = new CodexInjector();
|
|
303
|
+
this.stateManager.set("processor:codex_injector", codexInjector);
|
|
304
|
+
}
|
|
305
|
+
// Enable compliance validation
|
|
306
|
+
this.stateManager.set("compliance:active", true);
|
|
307
|
+
this.stateManager.set("compliance:validator", codexInjector);
|
|
308
|
+
this.stateManager.set("compliance:activated_at", Date.now());
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
console.error("❌ Failed to activate codex compliance:", error);
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async initializeSecurityComponents() {
|
|
317
|
+
try {
|
|
318
|
+
this.stateManager.set("security:hardener", securityHardener);
|
|
319
|
+
this.stateManager.set("security:headers_middleware", securityHeadersMiddleware);
|
|
320
|
+
this.stateManager.set("security:initialized", true);
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
console.error("❌ Failed to initialize security components:", error);
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
async finalizeSecurityIntegration() {
|
|
328
|
+
try {
|
|
329
|
+
const auditResult = await this.runInitialSecurityAudit();
|
|
330
|
+
this.stateManager.set("security:initial_audit", auditResult);
|
|
331
|
+
const hardener = this.stateManager.get("security:hardener");
|
|
332
|
+
if (hardener?.config?.enableSecureHeaders) {
|
|
333
|
+
this.stateManager.set("security:headers_active", true);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
console.error("❌ Failed to finalize security integration:", error);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
async runInitialSecurityAudit() {
|
|
341
|
+
try {
|
|
342
|
+
const securityAuditorPath = pathResolver.resolveModulePath("security/security-auditor");
|
|
343
|
+
const { SecurityAuditor } = await import(securityAuditorPath);
|
|
344
|
+
const auditor = new SecurityAuditor();
|
|
345
|
+
const result = await auditor.auditProject(process.cwd());
|
|
346
|
+
if (result.score < 80) {
|
|
347
|
+
console.warn(`⚠️ Initial security score: ${result.score}/100 (target: 80+)`);
|
|
348
|
+
}
|
|
349
|
+
return result;
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
console.error("❌ Failed to run initial security audit:", error);
|
|
353
|
+
return { score: 0, issues: [] };
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Validate processor health during boot
|
|
358
|
+
*/
|
|
359
|
+
async validateProcessorHealth() {
|
|
360
|
+
try {
|
|
361
|
+
const healthStatus = this.processorManager.getProcessorHealth();
|
|
362
|
+
const failedProcessors = healthStatus.filter((h) => h.status === "failed");
|
|
363
|
+
if (failedProcessors.length > 0) {
|
|
364
|
+
console.error(`❌ ${failedProcessors.length} processors failed health check:`, failedProcessors.map((p) => p.name));
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
const degradedProcessors = healthStatus.filter((h) => h.status === "degraded");
|
|
368
|
+
if (degradedProcessors.length > 0) {
|
|
369
|
+
console.warn(`⚠️ ${degradedProcessors.length} processors are degraded:`, degradedProcessors.map((p) => p.name));
|
|
370
|
+
}
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
console.error("❌ Processor health validation failed:", error);
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Get current boot status information
|
|
380
|
+
*/
|
|
381
|
+
getBootStatus() {
|
|
382
|
+
const agentsLoaded = this.stateManager.get("session:agents") || [];
|
|
383
|
+
const errors = [];
|
|
384
|
+
// Check for any stored errors
|
|
385
|
+
const storedErrors = this.stateManager.get("boot:errors");
|
|
386
|
+
if (Array.isArray(storedErrors)) {
|
|
387
|
+
errors.push(...storedErrors);
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
success: this.stateManager.get("boot:success") || false,
|
|
391
|
+
orchestratorLoaded: !!this.stateManager.get("orchestrator"),
|
|
392
|
+
sessionManagementActive: this.stateManager.get("session:active") || false,
|
|
393
|
+
processorsActivated: this.stateManager.get("processor:active") || false,
|
|
394
|
+
enforcementEnabled: this.stateManager.get("enforcement:active") || false,
|
|
395
|
+
codexComplianceActive: this.stateManager.get("compliance:active") || false,
|
|
396
|
+
agentsLoaded: Array.isArray(agentsLoaded) ? agentsLoaded : [],
|
|
397
|
+
errors,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Set up comprehensive memory monitoring and alerting
|
|
402
|
+
*/
|
|
403
|
+
setupMemoryMonitoring() {
|
|
404
|
+
// Start memory monitor
|
|
405
|
+
memoryMonitor.start();
|
|
406
|
+
// Set up alert handlers
|
|
407
|
+
memoryMonitor.on("alert", (alert) => {
|
|
408
|
+
const level = alert.severity === "critical"
|
|
409
|
+
? "error"
|
|
410
|
+
: alert.severity === "high"
|
|
411
|
+
? "warn"
|
|
412
|
+
: "info";
|
|
413
|
+
frameworkLogger.log("boot-orchestrator", `🚨 MEMORY ALERT: ${alert.message}`, "error");
|
|
414
|
+
// Store alert in state for dashboard access
|
|
415
|
+
const alerts = this.stateManager.get("memory:alerts") || [];
|
|
416
|
+
alerts.push({
|
|
417
|
+
...alert,
|
|
418
|
+
timestamp: Date.now(),
|
|
419
|
+
});
|
|
420
|
+
// Keep only last 100 alerts
|
|
421
|
+
if (alerts.length > 100) {
|
|
422
|
+
alerts.shift();
|
|
423
|
+
}
|
|
424
|
+
this.stateManager.set("memory:alerts", alerts);
|
|
425
|
+
// Log recommendations
|
|
426
|
+
alert.details.recommendations.forEach((rec) => {
|
|
427
|
+
frameworkLogger.log("boot-orchestrator", `💡 ${rec}`, "info");
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
// Log initial memory status
|
|
431
|
+
const initialStats = memoryMonitor.getCurrentStats();
|
|
432
|
+
frameworkLogger.log("boot-orchestrator", `🧠 Initial memory: ${initialStats.heapUsed.toFixed(1)}MB heap, ${initialStats.heapTotal.toFixed(1)}MB total`, "info");
|
|
433
|
+
// Store initial memory baseline
|
|
434
|
+
this.stateManager.set("memory:baseline", initialStats);
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Perform comprehensive memory health check
|
|
438
|
+
*/
|
|
439
|
+
getMemoryHealth() {
|
|
440
|
+
const summary = memoryMonitor.getSummary();
|
|
441
|
+
const issues = [];
|
|
442
|
+
// Check for memory issues
|
|
443
|
+
if (summary.current.heapUsed > 400) {
|
|
444
|
+
issues.push(`Critical heap usage: ${summary.current.heapUsed.toFixed(1)}MB`);
|
|
445
|
+
}
|
|
446
|
+
else if (summary.current.heapUsed > 200) {
|
|
447
|
+
issues.push(`High heap usage: ${summary.current.heapUsed.toFixed(1)}MB`);
|
|
448
|
+
}
|
|
449
|
+
if (summary.trend === "increasing") {
|
|
450
|
+
issues.push("Memory usage trending upward - potential leak detected");
|
|
451
|
+
}
|
|
452
|
+
if (summary.peak.heapUsed > 500) {
|
|
453
|
+
issues.push(`Peak usage exceeded safe limits: ${summary.peak.heapUsed.toFixed(1)}MB`);
|
|
454
|
+
}
|
|
455
|
+
return {
|
|
456
|
+
healthy: issues.length === 0,
|
|
457
|
+
issues,
|
|
458
|
+
metrics: summary,
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Execute the boot sequence (internal framework initialization)
|
|
463
|
+
*/
|
|
464
|
+
async executeBootSequence() {
|
|
465
|
+
frameworkLogger.log("boot-orchestrator", "executeBootSequence started", "info");
|
|
466
|
+
const result = {
|
|
467
|
+
success: false,
|
|
468
|
+
orchestratorLoaded: false,
|
|
469
|
+
sessionManagementActive: false,
|
|
470
|
+
processorsActivated: false,
|
|
471
|
+
agentsLoaded: [],
|
|
472
|
+
enforcementEnabled: false,
|
|
473
|
+
codexComplianceActive: false,
|
|
474
|
+
errors: [],
|
|
475
|
+
};
|
|
476
|
+
try {
|
|
477
|
+
frameworkLogger.log("boot-orchestrator", "loading StringRay configuration", "info");
|
|
478
|
+
// Phase 0: Load StringRay configuration from Python ConfigManager
|
|
479
|
+
await this.loadStringRayConfiguration();
|
|
480
|
+
frameworkLogger.log("boot-orchestrator", "StringRay configuration loaded", "success");
|
|
481
|
+
// Phase 1: Initialize core systems
|
|
482
|
+
frameworkLogger.log("boot-orchestrator", "initializing core systems", "info");
|
|
483
|
+
result.orchestratorLoaded = await this.loadOrchestrator();
|
|
484
|
+
if (!result.orchestratorLoaded) {
|
|
485
|
+
frameworkLogger.log("boot-orchestrator", "orchestrator loading failed", "error");
|
|
486
|
+
result.errors.push("Failed to load orchestrator");
|
|
487
|
+
return result;
|
|
488
|
+
}
|
|
489
|
+
frameworkLogger.log("boot-orchestrator", "orchestrator loaded successfully", "success");
|
|
490
|
+
const delegationInitialized = await this.initializeDelegationSystem();
|
|
491
|
+
if (!delegationInitialized) {
|
|
492
|
+
frameworkLogger.log("boot-orchestrator", "delegation system initialization failed", "error");
|
|
493
|
+
result.errors.push("Failed to initialize delegation system");
|
|
494
|
+
return result;
|
|
495
|
+
}
|
|
496
|
+
frameworkLogger.log("boot-orchestrator", "delegation system initialized", "success");
|
|
497
|
+
// Phase 2: Session management
|
|
498
|
+
if (this.config.sessionManagement) {
|
|
499
|
+
result.sessionManagementActive =
|
|
500
|
+
await this.initializeSessionManagement();
|
|
501
|
+
if (!result.sessionManagementActive) {
|
|
502
|
+
result.errors.push("Failed to initialize session management");
|
|
503
|
+
return result;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Phase 3: Processors
|
|
507
|
+
if (this.config.processorActivation) {
|
|
508
|
+
frameworkLogger.log("boot-orchestrator", "activating processors", "info");
|
|
509
|
+
result.processorsActivated = await this.activateProcessors();
|
|
510
|
+
if (!result.processorsActivated) {
|
|
511
|
+
frameworkLogger.log("boot-orchestrator", "processor activation failed", "error");
|
|
512
|
+
result.errors.push("Failed to activate processors");
|
|
513
|
+
return result;
|
|
514
|
+
}
|
|
515
|
+
frameworkLogger.log("boot-orchestrator", "processors activated successfully", "success");
|
|
516
|
+
// Validate processor health
|
|
517
|
+
const healthValid = await this.validateProcessorHealth();
|
|
518
|
+
if (!healthValid) {
|
|
519
|
+
frameworkLogger.log("boot-orchestrator", "processor health validation failed", "error");
|
|
520
|
+
result.errors.push("Processor health validation failed");
|
|
521
|
+
return result;
|
|
522
|
+
}
|
|
523
|
+
frameworkLogger.log("boot-orchestrator", "processor health validated", "success");
|
|
524
|
+
}
|
|
525
|
+
// Phase 4: Load agents
|
|
526
|
+
if (this.config.agentLoading) {
|
|
527
|
+
result.agentsLoaded = await this.loadRemainingAgents();
|
|
528
|
+
}
|
|
529
|
+
// Phase 5: Security & compliance
|
|
530
|
+
if (this.config.enableEnforcement) {
|
|
531
|
+
result.enforcementEnabled = await this.enableEnforcement();
|
|
532
|
+
if (!result.enforcementEnabled) {
|
|
533
|
+
result.errors.push("Failed to enable enforcement");
|
|
534
|
+
return result;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (this.config.codexValidation) {
|
|
538
|
+
result.codexComplianceActive = await this.activateCodexCompliance();
|
|
539
|
+
if (!result.codexComplianceActive) {
|
|
540
|
+
result.errors.push("Failed to activate codex compliance");
|
|
541
|
+
return result;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
// Finalize security integration
|
|
545
|
+
await this.finalizeSecurityIntegration();
|
|
546
|
+
result.success = true;
|
|
547
|
+
}
|
|
548
|
+
catch (error) {
|
|
549
|
+
result.errors.push(`Boot sequence error: ${error}`);
|
|
550
|
+
}
|
|
551
|
+
// Store boot result in state manager for getBootStatus
|
|
552
|
+
this.stateManager.set("boot:success", result.success);
|
|
553
|
+
this.stateManager.set("boot:errors", result.errors);
|
|
554
|
+
return result;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Load StringRay configuration from Python ConfigManager
|
|
558
|
+
*/
|
|
559
|
+
async loadStringRayConfiguration() {
|
|
560
|
+
try {
|
|
561
|
+
// Load StringRay configuration directly (no Python dependency)
|
|
562
|
+
const stringRayConfig = {
|
|
563
|
+
version: "1.0.0",
|
|
564
|
+
codex_enabled: true,
|
|
565
|
+
codex_version: "v1.2.20",
|
|
566
|
+
codex_terms: [
|
|
567
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
568
|
+
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
|
569
|
+
41, 42, 43
|
|
570
|
+
],
|
|
571
|
+
monitoring_metrics: [
|
|
572
|
+
"bundle-size", "test-coverage", "code-duplication", "build-time", "error-rate"
|
|
573
|
+
],
|
|
574
|
+
monitoring_alerts: [
|
|
575
|
+
"threshold-violations", "security-issues", "performance-degradation", "test-failures"
|
|
576
|
+
],
|
|
577
|
+
agent_capabilities: {
|
|
578
|
+
enforcer: ["compliance-monitoring", "threshold-enforcement", "automation-orchestration"],
|
|
579
|
+
architect: ["design-review", "architecture-validation", "dependency-analysis"],
|
|
580
|
+
orchestrator: ["task-coordination", "multi-agent-orchestration", "workflow-management"],
|
|
581
|
+
"bug-triage-specialist": ["error-analysis", "root-cause-identification", "fix-suggestions"],
|
|
582
|
+
"code-reviewer": ["code-quality-assessment", "best-practice-validation", "security-review"],
|
|
583
|
+
"security-auditor": ["vulnerability-detection", "threat-analysis", "security-validation"],
|
|
584
|
+
refactorer: ["code-modernization", "debt-reduction", "consolidation"],
|
|
585
|
+
"test-architect": ["test-strategy-design", "coverage-optimization", "behavioral-testing"]
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
// Store configuration in state manager for use by other components
|
|
589
|
+
this.stateManager.set("strray:config", stringRayConfig);
|
|
590
|
+
this.stateManager.set("strray:version", stringRayConfig.version);
|
|
591
|
+
this.stateManager.set("strray:codex_enabled", stringRayConfig.codex_enabled);
|
|
592
|
+
this.stateManager.set("strray:codex_terms", stringRayConfig.codex_terms);
|
|
593
|
+
this.stateManager.set("strray:monitoring_metrics", stringRayConfig.monitoring_metrics);
|
|
594
|
+
this.stateManager.set("strray:monitoring_alerts", stringRayConfig.monitoring_alerts);
|
|
595
|
+
this.stateManager.set("strray:agent_capabilities", stringRayConfig.agent_capabilities);
|
|
596
|
+
console.log("✅ StringRay configuration loaded successfully");
|
|
597
|
+
}
|
|
598
|
+
catch (error) {
|
|
599
|
+
console.warn("⚠️ Failed to load StringRay configuration:", error);
|
|
600
|
+
// Continue with defaults if loading fails
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
// Export singleton instance
|
|
605
|
+
export const bootOrchestrator = new BootOrchestrator();
|
|
606
|
+
//# sourceMappingURL=boot-orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot-orchestrator.js","sourceRoot":"","sources":["../../src/boot-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAA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