@girardmedia/bootspring 2.0.22 → 2.0.23
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/bin/bootspring.js +5 -0
- package/cli/org.js +474 -0
- package/cli/preseed.js +9 -301
- package/cli/seed.js +23 -1074
- package/core/api-client.js +77 -0
- package/core/entitlements.js +36 -0
- package/core/organizations.js +223 -0
- package/core/policies.js +51 -6
- package/core/policy-matrix.js +303 -0
- package/core/project-context.js +1 -0
- package/intelligence/orchestrator/config/index.js +4 -1
- package/intelligence/orchestrator/config/pack-lifecycle.js +262 -0
- package/intelligence/orchestrator.js +17 -512
- package/mcp/contracts/mcp-contract.v1.json +1 -1
- package/package.json +1 -1
|
@@ -17,24 +17,24 @@ const fs = require('fs');
|
|
|
17
17
|
const path = require('path');
|
|
18
18
|
const telemetry = require('../core/telemetry');
|
|
19
19
|
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
// Import from extracted modules
|
|
21
|
+
const {
|
|
22
|
+
PHASE_AGENTS,
|
|
23
|
+
TECHNICAL_TRIGGERS,
|
|
24
|
+
WORKFLOWS,
|
|
25
|
+
REMEDIATION_PATHS,
|
|
26
|
+
FAILURE_SIGNATURES,
|
|
27
|
+
SEVERITY_WEIGHTS,
|
|
28
|
+
PARALLEL_FAILURE_STRATEGIES
|
|
29
|
+
} = require('./orchestrator/config');
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
31
|
+
const {
|
|
32
|
+
getPaths,
|
|
33
|
+
createDefaultState,
|
|
34
|
+
loadState,
|
|
35
|
+
saveState,
|
|
36
|
+
emitWorkflowTelemetry
|
|
37
|
+
} = require('./orchestrator/core');
|
|
38
38
|
|
|
39
39
|
// Colors
|
|
40
40
|
const c = {
|
|
@@ -49,308 +49,8 @@ const c = {
|
|
|
49
49
|
magenta: '\x1b[35m'
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* Agent lifecycle phase mapping
|
|
54
|
-
* Maps project phases to recommended agents
|
|
55
|
-
*/
|
|
56
|
-
const PHASE_AGENTS = {
|
|
57
|
-
1: {
|
|
58
|
-
name: 'Foundation',
|
|
59
|
-
description: 'Initial setup, planning, and architecture decisions',
|
|
60
|
-
primary: ['architecture-expert', 'database-expert'],
|
|
61
|
-
supporting: ['security-expert', 'devops-expert']
|
|
62
|
-
},
|
|
63
|
-
2: {
|
|
64
|
-
name: 'Requirements',
|
|
65
|
-
description: 'Data modeling, research, and specification',
|
|
66
|
-
primary: ['database-expert', 'api-expert'],
|
|
67
|
-
supporting: ['testing-expert']
|
|
68
|
-
},
|
|
69
|
-
3: {
|
|
70
|
-
name: 'Design',
|
|
71
|
-
description: 'UI/UX, database schema, API contracts',
|
|
72
|
-
primary: ['frontend-expert', 'ui-ux-expert', 'database-expert', 'api-expert'],
|
|
73
|
-
supporting: ['security-expert']
|
|
74
|
-
},
|
|
75
|
-
4: {
|
|
76
|
-
name: 'Implementation',
|
|
77
|
-
description: 'Core feature development',
|
|
78
|
-
primary: ['backend-expert', 'frontend-expert', 'database-expert'],
|
|
79
|
-
supporting: ['performance-expert', 'code-review-expert']
|
|
80
|
-
},
|
|
81
|
-
5: {
|
|
82
|
-
name: 'Testing',
|
|
83
|
-
description: 'Quality assurance and security review',
|
|
84
|
-
primary: ['testing-expert', 'security-expert', 'code-review-expert'],
|
|
85
|
-
supporting: ['performance-expert']
|
|
86
|
-
},
|
|
87
|
-
6: {
|
|
88
|
-
name: 'Deployment',
|
|
89
|
-
description: 'CI/CD, infrastructure, and monitoring',
|
|
90
|
-
primary: ['devops-expert', 'vercel-expert'],
|
|
91
|
-
supporting: ['security-expert', 'performance-expert']
|
|
92
|
-
},
|
|
93
|
-
7: {
|
|
94
|
-
name: 'Launch',
|
|
95
|
-
description: 'Go-live and post-launch optimization',
|
|
96
|
-
primary: ['devops-expert', 'performance-expert'],
|
|
97
|
-
supporting: ['security-expert']
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
52
|
|
|
101
|
-
/**
|
|
102
|
-
* Technical context triggers
|
|
103
|
-
* Maps keywords to recommended agents
|
|
104
|
-
*/
|
|
105
|
-
const TECHNICAL_TRIGGERS = {
|
|
106
|
-
'api': {
|
|
107
|
-
agents: ['api-expert', 'backend-expert', 'security-expert'],
|
|
108
|
-
indicators: ['api', 'endpoint', 'REST', 'GraphQL', 'route', 'handler'],
|
|
109
|
-
skills: ['api/route-handler', 'api/server-action']
|
|
110
|
-
},
|
|
111
|
-
'database': {
|
|
112
|
-
agents: ['database-expert', 'backend-expert'],
|
|
113
|
-
indicators: ['database', 'schema', 'prisma', 'migration', 'query', 'model', 'sql'],
|
|
114
|
-
skills: ['database/prisma']
|
|
115
|
-
},
|
|
116
|
-
'frontend': {
|
|
117
|
-
agents: ['frontend-expert', 'ui-ux-expert'],
|
|
118
|
-
indicators: ['component', 'react', 'tailwind', 'ui', 'ux', 'page', 'layout', 'css'],
|
|
119
|
-
skills: []
|
|
120
|
-
},
|
|
121
|
-
'authentication': {
|
|
122
|
-
agents: ['security-expert', 'backend-expert'],
|
|
123
|
-
indicators: ['auth', 'login', 'signup', 'session', 'clerk', 'jwt', 'oauth', 'password'],
|
|
124
|
-
skills: ['auth/clerk', 'auth/nextauth']
|
|
125
|
-
},
|
|
126
|
-
'security': {
|
|
127
|
-
agents: ['security-expert'],
|
|
128
|
-
indicators: ['security', 'vulnerability', 'OWASP', 'xss', 'csrf', 'injection', 'sanitize'],
|
|
129
|
-
skills: []
|
|
130
|
-
},
|
|
131
|
-
'performance': {
|
|
132
|
-
agents: ['performance-expert', 'database-expert'],
|
|
133
|
-
indicators: ['performance', 'speed', 'optimization', 'cache', 'slow', 'memory', 'bundle'],
|
|
134
|
-
skills: []
|
|
135
|
-
},
|
|
136
|
-
'deployment': {
|
|
137
|
-
agents: ['devops-expert', 'vercel-expert'],
|
|
138
|
-
indicators: ['deploy', 'CI/CD', 'docker', 'kubernetes', 'production', 'vercel', 'hosting'],
|
|
139
|
-
skills: []
|
|
140
|
-
},
|
|
141
|
-
'testing': {
|
|
142
|
-
agents: ['testing-expert', 'code-review-expert'],
|
|
143
|
-
indicators: ['test', 'jest', 'vitest', 'playwright', 'coverage', 'spec', 'mock'],
|
|
144
|
-
skills: ['testing/vitest']
|
|
145
|
-
},
|
|
146
|
-
'payments': {
|
|
147
|
-
agents: ['backend-expert', 'security-expert'],
|
|
148
|
-
indicators: ['stripe', 'payment', 'subscription', 'checkout', 'billing', 'invoice'],
|
|
149
|
-
skills: ['payments/stripe']
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
53
|
|
|
153
|
-
/**
|
|
154
|
-
* Predefined workflows for common scenarios
|
|
155
|
-
*/
|
|
156
|
-
const WORKFLOWS = {
|
|
157
|
-
'feature-development': {
|
|
158
|
-
name: 'Feature Development',
|
|
159
|
-
description: 'End-to-end feature implementation workflow',
|
|
160
|
-
tier: 'free',
|
|
161
|
-
pack: null,
|
|
162
|
-
outcomes: ['Feature shipped with tests and review complete'],
|
|
163
|
-
completionSignals: ['PR merged', 'Tests passing in CI', 'Security/perf review completed'],
|
|
164
|
-
phases: [
|
|
165
|
-
{ name: 'Design', agents: ['ui-ux-expert', 'frontend-expert', 'api-expert'], duration: '1-2 days' },
|
|
166
|
-
{ name: 'Implementation', agents: ['backend-expert', 'frontend-expert', 'database-expert'], duration: '2-5 days' },
|
|
167
|
-
{ name: 'Testing', agents: ['testing-expert', 'code-review-expert'], duration: '1-2 days' },
|
|
168
|
-
{ name: 'Review', agents: ['security-expert', 'performance-expert'], duration: '1 day' }
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
'security-audit': {
|
|
172
|
-
name: 'Security Audit',
|
|
173
|
-
description: 'Comprehensive security review',
|
|
174
|
-
tier: 'free',
|
|
175
|
-
pack: null,
|
|
176
|
-
outcomes: ['Critical/high vulnerabilities remediated'],
|
|
177
|
-
completionSignals: ['Security findings closed', 'Post-fix verification complete'],
|
|
178
|
-
phases: [
|
|
179
|
-
{ name: 'Code Review', agents: ['code-review-expert', 'security-expert'], duration: '2-3 days' },
|
|
180
|
-
{ name: 'Vulnerability Scan', agents: ['security-expert'], duration: '1 day' },
|
|
181
|
-
{ name: 'Remediation', agents: ['security-expert', 'backend-expert'], duration: '2-5 days' }
|
|
182
|
-
]
|
|
183
|
-
},
|
|
184
|
-
'performance-optimization': {
|
|
185
|
-
name: 'Performance Optimization',
|
|
186
|
-
description: 'Full performance review and optimization',
|
|
187
|
-
tier: 'free',
|
|
188
|
-
pack: null,
|
|
189
|
-
outcomes: ['Performance regressions reduced and hotspots addressed'],
|
|
190
|
-
completionSignals: ['Baseline captured', 'Improvement report documented'],
|
|
191
|
-
phases: [
|
|
192
|
-
{ name: 'Analysis', agents: ['performance-expert'], duration: '1-2 days' },
|
|
193
|
-
{ name: 'Database', agents: ['database-expert', 'performance-expert'], duration: '2-3 days' },
|
|
194
|
-
{ name: 'Frontend', agents: ['frontend-expert', 'performance-expert'], duration: '2-3 days' },
|
|
195
|
-
{ name: 'Infrastructure', agents: ['devops-expert'], duration: '1-2 days' }
|
|
196
|
-
]
|
|
197
|
-
},
|
|
198
|
-
'api-development': {
|
|
199
|
-
name: 'API Development',
|
|
200
|
-
description: 'Design and implement new API endpoints',
|
|
201
|
-
tier: 'free',
|
|
202
|
-
pack: null,
|
|
203
|
-
outcomes: ['API endpoints delivered with security and test coverage'],
|
|
204
|
-
completionSignals: ['Contract approved', 'API tests passing', 'Auth/rate limits verified'],
|
|
205
|
-
phases: [
|
|
206
|
-
{ name: 'Design', agents: ['api-expert', 'database-expert'], duration: '1 day' },
|
|
207
|
-
{ name: 'Implementation', agents: ['backend-expert', 'api-expert'], duration: '2-3 days' },
|
|
208
|
-
{ name: 'Security', agents: ['security-expert'], duration: '1 day' },
|
|
209
|
-
{ name: 'Testing', agents: ['testing-expert'], duration: '1 day' }
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
|
-
'database-migration': {
|
|
213
|
-
name: 'Database Migration',
|
|
214
|
-
description: 'Schema changes and data migration',
|
|
215
|
-
tier: 'free',
|
|
216
|
-
pack: null,
|
|
217
|
-
outcomes: ['Migration completed safely with rollback readiness'],
|
|
218
|
-
completionSignals: ['Migration rehearsed', 'Rollback tested', 'Data integrity checks passing'],
|
|
219
|
-
phases: [
|
|
220
|
-
{ name: 'Schema Design', agents: ['database-expert'], duration: '1 day' },
|
|
221
|
-
{ name: 'Migration Plan', agents: ['database-expert', 'devops-expert'], duration: '1 day' },
|
|
222
|
-
{ name: 'Implementation', agents: ['database-expert', 'backend-expert'], duration: '2-3 days' },
|
|
223
|
-
{ name: 'Verification', agents: ['testing-expert'], duration: '1 day' }
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
'launch-preparation': {
|
|
227
|
-
name: 'Launch Preparation',
|
|
228
|
-
description: 'Pre-launch checklist and deployment',
|
|
229
|
-
tier: 'free',
|
|
230
|
-
pack: null,
|
|
231
|
-
outcomes: ['Launch readiness validated across quality, security, and ops'],
|
|
232
|
-
completionSignals: ['Release checklist complete', 'Monitoring configured', 'Rollback plan confirmed'],
|
|
233
|
-
phases: [
|
|
234
|
-
{ name: 'Testing', agents: ['testing-expert', 'performance-expert'], duration: '2-3 days' },
|
|
235
|
-
{ name: 'Security', agents: ['security-expert'], duration: '1-2 days' },
|
|
236
|
-
{ name: 'Deployment', agents: ['devops-expert', 'vercel-expert'], duration: '1 day' },
|
|
237
|
-
{ name: 'Monitoring', agents: ['devops-expert', 'performance-expert'], duration: '1 day' }
|
|
238
|
-
]
|
|
239
|
-
},
|
|
240
|
-
'launch-pack': {
|
|
241
|
-
name: 'Launch Pack',
|
|
242
|
-
description: 'Premium guided launch workflow from freeze to production validation',
|
|
243
|
-
tier: 'pro',
|
|
244
|
-
pack: 'launch',
|
|
245
|
-
outcomes: ['Production launch completed with no P0 regressions in first 48h'],
|
|
246
|
-
completionSignals: ['Change freeze checklist complete', 'Launch playbook executed', 'Post-launch metrics healthy'],
|
|
247
|
-
phases: [
|
|
248
|
-
{ name: 'Readiness Gate', agents: ['testing-expert', 'security-expert', 'performance-expert'], duration: '1-2 days' },
|
|
249
|
-
{ name: 'Cutover Plan', agents: ['devops-expert', 'architecture-expert'], duration: '1 day' },
|
|
250
|
-
{ name: 'Go-Live', agents: ['devops-expert', 'vercel-expert'], duration: 'same day' },
|
|
251
|
-
{ name: 'Stabilization', agents: ['performance-expert', 'backend-expert'], duration: '2 days' }
|
|
252
|
-
]
|
|
253
|
-
},
|
|
254
|
-
'reliability-pack': {
|
|
255
|
-
name: 'Reliability Pack',
|
|
256
|
-
description: 'Premium reliability hardening workflow for incidents and regressions',
|
|
257
|
-
tier: 'pro',
|
|
258
|
-
pack: 'reliability',
|
|
259
|
-
outcomes: ['Error budget burn reduced and top incident classes mitigated'],
|
|
260
|
-
completionSignals: ['SLOs defined', 'Top 3 failure modes mitigated', 'Runbooks verified in drill'],
|
|
261
|
-
phases: [
|
|
262
|
-
{ name: 'Reliability Baseline', agents: ['performance-expert', 'devops-expert'], duration: '1 day' },
|
|
263
|
-
{ name: 'Failure Mode Audit', agents: ['security-expert', 'backend-expert'], duration: '1-2 days' },
|
|
264
|
-
{ name: 'Resilience Implementation', agents: ['backend-expert', 'database-expert'], duration: '2-4 days' },
|
|
265
|
-
{ name: 'Game Day Validation', agents: ['testing-expert', 'devops-expert'], duration: '1 day' }
|
|
266
|
-
]
|
|
267
|
-
},
|
|
268
|
-
'growth-pack': {
|
|
269
|
-
name: 'Growth Pack',
|
|
270
|
-
description: 'Premium experimentation workflow for activation and conversion improvements',
|
|
271
|
-
tier: 'pro',
|
|
272
|
-
pack: 'growth',
|
|
273
|
-
outcomes: ['Primary growth KPI improved with statistically valid experiment result'],
|
|
274
|
-
completionSignals: ['North-star metric selected', 'Experiment shipped', 'Readout documented with decision'],
|
|
275
|
-
phases: [
|
|
276
|
-
{ name: 'Metric Design', agents: ['architecture-expert', 'frontend-expert'], duration: '1 day' },
|
|
277
|
-
{ name: 'Instrumentation', agents: ['backend-expert', 'api-expert'], duration: '1-2 days' },
|
|
278
|
-
{ name: 'Experiment Build', agents: ['frontend-expert', 'backend-expert'], duration: '2-3 days' },
|
|
279
|
-
{ name: 'Analysis & Decision', agents: ['code-review-expert', 'architecture-expert'], duration: '1 day' }
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
'full-stack-parallel': {
|
|
283
|
-
name: 'Full Stack Parallel Development',
|
|
284
|
-
description: 'Concurrent frontend and backend development with parallel testing',
|
|
285
|
-
tier: 'free',
|
|
286
|
-
pack: null,
|
|
287
|
-
outcomes: ['Full stack feature delivered with parallel development streams'],
|
|
288
|
-
completionSignals: ['API contract finalized', 'Frontend and backend complete', 'Integration tests passing'],
|
|
289
|
-
phases: [
|
|
290
|
-
{ name: 'Design & Contract', agents: ['api-expert', 'ui-ux-expert', 'architecture-expert'], duration: '1-2 days' },
|
|
291
|
-
{ name: 'Backend Development', agents: ['backend-expert', 'database-expert'], duration: '2-4 days', parallel: true },
|
|
292
|
-
{ name: 'Frontend Development', agents: ['frontend-expert', 'ui-ux-expert'], duration: '2-4 days', parallel: true },
|
|
293
|
-
{ name: 'Integration & Testing', agents: ['testing-expert', 'security-expert'], duration: '1-2 days' },
|
|
294
|
-
{ name: 'Review & Deploy', agents: ['code-review-expert', 'devops-expert'], duration: '1 day' }
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
|
-
'comprehensive-audit': {
|
|
298
|
-
name: 'Comprehensive Audit',
|
|
299
|
-
description: 'Parallel security, performance, and code quality audits',
|
|
300
|
-
tier: 'free',
|
|
301
|
-
pack: null,
|
|
302
|
-
outcomes: ['Complete audit report with prioritized findings'],
|
|
303
|
-
completionSignals: ['All audits complete', 'Findings documented', 'Remediation plan created'],
|
|
304
|
-
phases: [
|
|
305
|
-
{ name: 'Preparation', agents: ['architecture-expert'], duration: '0.5 days' },
|
|
306
|
-
{ name: 'Security Audit', agents: ['security-expert'], duration: '1-2 days', parallel: true },
|
|
307
|
-
{ name: 'Performance Audit', agents: ['performance-expert'], duration: '1-2 days', parallel: true },
|
|
308
|
-
{ name: 'Code Quality Audit', agents: ['code-review-expert'], duration: '1-2 days', parallel: true },
|
|
309
|
-
{ name: 'Report & Plan', agents: ['architecture-expert', 'code-review-expert'], duration: '1 day' }
|
|
310
|
-
]
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Load orchestrator state from project
|
|
316
|
-
*/
|
|
317
|
-
function loadState() {
|
|
318
|
-
const paths = getPaths();
|
|
319
|
-
|
|
320
|
-
if (fs.existsSync(paths.statePath)) {
|
|
321
|
-
try {
|
|
322
|
-
return JSON.parse(fs.readFileSync(paths.statePath, 'utf8'));
|
|
323
|
-
} catch {
|
|
324
|
-
return createDefaultState();
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return createDefaultState();
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Create default orchestrator state
|
|
332
|
-
*/
|
|
333
|
-
function createDefaultState() {
|
|
334
|
-
return {
|
|
335
|
-
lastAnalysis: null,
|
|
336
|
-
currentPhase: 1,
|
|
337
|
-
activeWorkflow: null,
|
|
338
|
-
workflowStep: 0,
|
|
339
|
-
workflowSignals: {},
|
|
340
|
-
recentAgents: [],
|
|
341
|
-
suggestions: [],
|
|
342
|
-
history: []
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
function emitWorkflowTelemetry(event, payload = {}) {
|
|
347
|
-
const paths = getPaths();
|
|
348
|
-
try {
|
|
349
|
-
telemetry.emitEvent(event, payload, { projectRoot: paths.projectRoot });
|
|
350
|
-
} catch {
|
|
351
|
-
// Telemetry should not block workflow execution.
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
54
|
|
|
355
55
|
function getWorkflowSignalProgress(workflowName, state = null) {
|
|
356
56
|
const workflow = WORKFLOWS[workflowName];
|
|
@@ -388,22 +88,6 @@ function resolveSignal(workflow, signalRef, stateSignals = []) {
|
|
|
388
88
|
return signals.find(signal => signal.toLowerCase().includes(lower)) || null;
|
|
389
89
|
}
|
|
390
90
|
|
|
391
|
-
/**
|
|
392
|
-
* Save orchestrator state
|
|
393
|
-
*/
|
|
394
|
-
function saveState(state) {
|
|
395
|
-
const paths = getPaths();
|
|
396
|
-
|
|
397
|
-
// Ensure .bootspring directory exists
|
|
398
|
-
const stateDir = path.dirname(paths.statePath);
|
|
399
|
-
if (!fs.existsSync(stateDir)) {
|
|
400
|
-
fs.mkdirSync(stateDir, { recursive: true });
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
state.lastUpdated = new Date().toISOString();
|
|
404
|
-
fs.writeFileSync(paths.statePath, JSON.stringify(state, null, 2));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
91
|
/**
|
|
408
92
|
* Get current phase from ROADMAP.md
|
|
409
93
|
*/
|
|
@@ -1098,174 +782,7 @@ if (require.main === module) {
|
|
|
1098
782
|
}
|
|
1099
783
|
}
|
|
1100
784
|
|
|
1101
|
-
// Export for use as module
|
|
1102
|
-
/**
|
|
1103
|
-
* Remediation workflows for common failure scenarios
|
|
1104
|
-
* Enhanced with severity levels, auto-trigger options, fallback phases, and preventive actions
|
|
1105
|
-
*/
|
|
1106
|
-
const REMEDIATION_PATHS = {
|
|
1107
|
-
'testing-failure': {
|
|
1108
|
-
description: 'Tests failed during workflow',
|
|
1109
|
-
severity: 'high',
|
|
1110
|
-
autoTrigger: true,
|
|
1111
|
-
maxRetries: 3,
|
|
1112
|
-
steps: [
|
|
1113
|
-
{ action: 'analyze_failures', agent: 'testing-expert', description: 'Analyze test failures', timeout: 300 },
|
|
1114
|
-
{ action: 'fix_issues', agent: 'code-review-expert', description: 'Review and fix failing code', timeout: 600 },
|
|
1115
|
-
{ action: 'rerun_tests', agent: 'testing-expert', description: 'Re-run tests', timeout: 300 }
|
|
1116
|
-
],
|
|
1117
|
-
preventiveActions: [
|
|
1118
|
-
'Run tests locally before committing',
|
|
1119
|
-
'Check for flaky tests in CI history',
|
|
1120
|
-
'Verify test environment configuration'
|
|
1121
|
-
],
|
|
1122
|
-
fallbackPhase: { name: 'Manual Review', agents: ['code-review-expert'], duration: '1-2 days' }
|
|
1123
|
-
},
|
|
1124
|
-
'security-failure': {
|
|
1125
|
-
description: 'Security issues found during workflow',
|
|
1126
|
-
severity: 'critical',
|
|
1127
|
-
autoTrigger: true,
|
|
1128
|
-
maxRetries: 2,
|
|
1129
|
-
steps: [
|
|
1130
|
-
{ action: 'security_audit', agent: 'security-expert', description: 'Full security audit', timeout: 600 },
|
|
1131
|
-
{ action: 'remediate', agent: 'security-expert', description: 'Fix security vulnerabilities', timeout: 900 },
|
|
1132
|
-
{ action: 'verify', agent: 'security-expert', description: 'Verify fixes', timeout: 300 }
|
|
1133
|
-
],
|
|
1134
|
-
preventiveActions: [
|
|
1135
|
-
'Run security scans in pre-commit hooks',
|
|
1136
|
-
'Keep dependencies updated',
|
|
1137
|
-
'Review auth/authz changes carefully'
|
|
1138
|
-
],
|
|
1139
|
-
fallbackPhase: { name: 'Security Escalation', agents: ['security-expert', 'architecture-expert'], duration: '2-3 days' }
|
|
1140
|
-
},
|
|
1141
|
-
'performance-failure': {
|
|
1142
|
-
description: 'Performance issues detected',
|
|
1143
|
-
severity: 'medium',
|
|
1144
|
-
autoTrigger: false,
|
|
1145
|
-
maxRetries: 2,
|
|
1146
|
-
steps: [
|
|
1147
|
-
{ action: 'profile', agent: 'performance-expert', description: 'Profile application', timeout: 600 },
|
|
1148
|
-
{ action: 'optimize', agent: 'performance-expert', description: 'Implement optimizations', timeout: 900 },
|
|
1149
|
-
{ action: 'benchmark', agent: 'performance-expert', description: 'Benchmark improvements', timeout: 300 }
|
|
1150
|
-
],
|
|
1151
|
-
preventiveActions: [
|
|
1152
|
-
'Set performance budgets',
|
|
1153
|
-
'Monitor bundle sizes',
|
|
1154
|
-
'Profile database queries'
|
|
1155
|
-
],
|
|
1156
|
-
fallbackPhase: { name: 'Performance Review', agents: ['performance-expert', 'database-expert'], duration: '2-3 days' }
|
|
1157
|
-
},
|
|
1158
|
-
'deployment-failure': {
|
|
1159
|
-
description: 'Deployment failed',
|
|
1160
|
-
severity: 'high',
|
|
1161
|
-
autoTrigger: true,
|
|
1162
|
-
maxRetries: 2,
|
|
1163
|
-
steps: [
|
|
1164
|
-
{ action: 'diagnose', agent: 'devops-expert', description: 'Diagnose deployment failure', timeout: 300 },
|
|
1165
|
-
{ action: 'fix_config', agent: 'devops-expert', description: 'Fix configuration issues', timeout: 600 },
|
|
1166
|
-
{ action: 'retry_deploy', agent: 'devops-expert', description: 'Retry deployment', timeout: 300 }
|
|
1167
|
-
],
|
|
1168
|
-
preventiveActions: [
|
|
1169
|
-
'Deploy to staging first',
|
|
1170
|
-
'Verify environment variables',
|
|
1171
|
-
'Check resource limits and quotas'
|
|
1172
|
-
],
|
|
1173
|
-
fallbackPhase: { name: 'Deployment Rollback', agents: ['devops-expert'], duration: '0.5 days' }
|
|
1174
|
-
},
|
|
1175
|
-
'database-failure': {
|
|
1176
|
-
description: 'Database issues detected',
|
|
1177
|
-
severity: 'high',
|
|
1178
|
-
autoTrigger: true,
|
|
1179
|
-
maxRetries: 1,
|
|
1180
|
-
steps: [
|
|
1181
|
-
{ action: 'analyze_schema', agent: 'database-expert', description: 'Analyze database issues', timeout: 300 },
|
|
1182
|
-
{ action: 'fix_migration', agent: 'database-expert', description: 'Fix migration issues', timeout: 600 },
|
|
1183
|
-
{ action: 'verify_data', agent: 'database-expert', description: 'Verify data integrity', timeout: 300 }
|
|
1184
|
-
],
|
|
1185
|
-
preventiveActions: [
|
|
1186
|
-
'Test migrations on copy of production data',
|
|
1187
|
-
'Have rollback plan ready',
|
|
1188
|
-
'Check for breaking schema changes'
|
|
1189
|
-
],
|
|
1190
|
-
fallbackPhase: { name: 'Database Recovery', agents: ['database-expert', 'devops-expert'], duration: '1-2 days' }
|
|
1191
|
-
},
|
|
1192
|
-
'build-failure': {
|
|
1193
|
-
description: 'Build process failed',
|
|
1194
|
-
severity: 'high',
|
|
1195
|
-
autoTrigger: true,
|
|
1196
|
-
maxRetries: 3,
|
|
1197
|
-
steps: [
|
|
1198
|
-
{ action: 'analyze_build', agent: 'devops-expert', description: 'Analyze build errors', timeout: 300 },
|
|
1199
|
-
{ action: 'fix_dependencies', agent: 'backend-expert', description: 'Fix dependency issues', timeout: 600 },
|
|
1200
|
-
{ action: 'rebuild', agent: 'devops-expert', description: 'Rebuild application', timeout: 300 }
|
|
1201
|
-
],
|
|
1202
|
-
preventiveActions: [
|
|
1203
|
-
'Lock dependency versions',
|
|
1204
|
-
'Verify build environment matches CI',
|
|
1205
|
-
'Check for circular dependencies'
|
|
1206
|
-
],
|
|
1207
|
-
fallbackPhase: { name: 'Build Investigation', agents: ['devops-expert', 'backend-expert'], duration: '1 day' }
|
|
1208
|
-
},
|
|
1209
|
-
'integration-failure': {
|
|
1210
|
-
description: 'Integration issues with external services',
|
|
1211
|
-
severity: 'medium',
|
|
1212
|
-
autoTrigger: false,
|
|
1213
|
-
maxRetries: 2,
|
|
1214
|
-
steps: [
|
|
1215
|
-
{ action: 'diagnose_integration', agent: 'api-expert', description: 'Diagnose integration issues', timeout: 300 },
|
|
1216
|
-
{ action: 'fix_api', agent: 'api-expert', description: 'Fix API integration', timeout: 600 },
|
|
1217
|
-
{ action: 'verify_integration', agent: 'testing-expert', description: 'Verify integration works', timeout: 300 }
|
|
1218
|
-
],
|
|
1219
|
-
preventiveActions: [
|
|
1220
|
-
'Mock external services in tests',
|
|
1221
|
-
'Check API version compatibility',
|
|
1222
|
-
'Verify credentials and permissions'
|
|
1223
|
-
],
|
|
1224
|
-
fallbackPhase: { name: 'Integration Workaround', agents: ['api-expert', 'backend-expert'], duration: '1-2 days' }
|
|
1225
|
-
},
|
|
1226
|
-
'timeout-failure': {
|
|
1227
|
-
description: 'Operation timed out',
|
|
1228
|
-
severity: 'medium',
|
|
1229
|
-
autoTrigger: false,
|
|
1230
|
-
maxRetries: 2,
|
|
1231
|
-
steps: [
|
|
1232
|
-
{ action: 'profile_operation', agent: 'performance-expert', description: 'Profile slow operation', timeout: 600 },
|
|
1233
|
-
{ action: 'optimize_critical_path', agent: 'performance-expert', description: 'Optimize critical path', timeout: 600 },
|
|
1234
|
-
{ action: 'adjust_timeout', agent: 'devops-expert', description: 'Adjust timeout settings', timeout: 300 }
|
|
1235
|
-
],
|
|
1236
|
-
preventiveActions: [
|
|
1237
|
-
'Set appropriate timeout values',
|
|
1238
|
-
'Add progress indicators',
|
|
1239
|
-
'Consider async processing'
|
|
1240
|
-
],
|
|
1241
|
-
fallbackPhase: { name: 'Async Processing', agents: ['backend-expert', 'performance-expert'], duration: '1-2 days' }
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
785
|
|
|
1245
|
-
/**
|
|
1246
|
-
* Failure pattern signatures for auto-detection
|
|
1247
|
-
* Maps keywords to failure types for intelligent failure classification
|
|
1248
|
-
*/
|
|
1249
|
-
const FAILURE_SIGNATURES = {
|
|
1250
|
-
'testing': ['test', 'spec', 'jest', 'vitest', 'assertion', 'expect', 'failing', 'failed test'],
|
|
1251
|
-
'security': ['vulnerability', 'auth', 'permission', 'unauthorized', 'csrf', 'xss', 'injection', 'security'],
|
|
1252
|
-
'performance': ['slow', 'timeout', 'memory', 'cpu', 'latency', 'bottleneck', 'performance'],
|
|
1253
|
-
'deployment': ['deploy', 'release', 'ci/cd', 'pipeline', 'staging', 'production', 'build failed'],
|
|
1254
|
-
'database': ['migration', 'schema', 'query', 'prisma', 'sql', 'database', 'connection', 'deadlock'],
|
|
1255
|
-
'build': ['build', 'compile', 'bundle', 'webpack', 'typescript', 'syntax error', 'module not found'],
|
|
1256
|
-
'integration': ['api', 'endpoint', 'external', 'service', 'http', 'request failed', '500', '503'],
|
|
1257
|
-
'timeout': ['timeout', 'deadline', 'exceeded', 'timed out', 'ETIMEDOUT']
|
|
1258
|
-
};
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* Severity weights for adaptive response calculation
|
|
1262
|
-
*/
|
|
1263
|
-
const SEVERITY_WEIGHTS = {
|
|
1264
|
-
'critical': 4,
|
|
1265
|
-
'high': 3,
|
|
1266
|
-
'medium': 2,
|
|
1267
|
-
'low': 1
|
|
1268
|
-
};
|
|
1269
786
|
/**
|
|
1270
787
|
* Report a phase failure and get remediation options
|
|
1271
788
|
* @param {string} failureType - Type of failure (testing, security, performance, deployment, database)
|
|
@@ -2273,18 +1790,6 @@ function getLinkedPrds() {
|
|
|
2273
1790
|
* - Failure recovery and retry support
|
|
2274
1791
|
*/
|
|
2275
1792
|
|
|
2276
|
-
/**
|
|
2277
|
-
* Failure strategy options for parallel execution
|
|
2278
|
-
* - 'fail-fast': Stop all phases on first failure (default)
|
|
2279
|
-
* - 'continue': Continue other phases, collect failures at end
|
|
2280
|
-
* - 'retry': Allow retry of failed phases while others continue
|
|
2281
|
-
*/
|
|
2282
|
-
const PARALLEL_FAILURE_STRATEGIES = {
|
|
2283
|
-
'fail-fast': 'Stop all phases when one fails',
|
|
2284
|
-
'continue': 'Continue other phases, handle failures at completion',
|
|
2285
|
-
'retry': 'Allow retry of failed phases'
|
|
2286
|
-
};
|
|
2287
|
-
|
|
2288
1793
|
/**
|
|
2289
1794
|
* Start parallel phase execution
|
|
2290
1795
|
* Identifies consecutive parallel phases and starts them together
|
package/package.json
CHANGED