musubi-sdd 5.0.0 → 5.6.1
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/README.ja.md +106 -48
- package/README.md +110 -32
- package/bin/musubi-analyze.js +74 -67
- package/bin/musubi-browser.js +27 -26
- package/bin/musubi-change.js +48 -47
- package/bin/musubi-checkpoint.js +10 -7
- package/bin/musubi-convert.js +25 -25
- package/bin/musubi-costs.js +27 -10
- package/bin/musubi-gui.js +52 -46
- package/bin/musubi-init.js +1952 -10
- package/bin/musubi-orchestrate.js +327 -239
- package/bin/musubi-remember.js +69 -56
- package/bin/musubi-resolve.js +53 -45
- package/bin/musubi-trace.js +51 -22
- package/bin/musubi-validate.js +39 -30
- package/bin/musubi-workflow.js +33 -34
- package/bin/musubi.js +39 -2
- package/package.json +1 -1
- package/src/agents/agent-loop.js +94 -95
- package/src/agents/agentic/code-generator.js +119 -109
- package/src/agents/agentic/code-reviewer.js +105 -108
- package/src/agents/agentic/index.js +4 -4
- package/src/agents/browser/action-executor.js +13 -13
- package/src/agents/browser/ai-comparator.js +11 -10
- package/src/agents/browser/context-manager.js +6 -6
- package/src/agents/browser/index.js +5 -5
- package/src/agents/browser/nl-parser.js +31 -46
- package/src/agents/browser/screenshot.js +2 -2
- package/src/agents/browser/test-generator.js +6 -4
- package/src/agents/function-tool.js +71 -65
- package/src/agents/index.js +7 -7
- package/src/agents/schema-generator.js +98 -94
- package/src/analyzers/ast-extractor.js +164 -145
- package/src/analyzers/codegraph-auto-update.js +858 -0
- package/src/analyzers/complexity-analyzer.js +536 -0
- package/src/analyzers/context-optimizer.js +247 -125
- package/src/analyzers/impact-analyzer.js +1 -1
- package/src/analyzers/large-project-analyzer.js +766 -0
- package/src/analyzers/repository-map.js +83 -80
- package/src/analyzers/security-analyzer.js +19 -11
- package/src/analyzers/stuck-detector.js +19 -17
- package/src/converters/index.js +78 -57
- package/src/converters/ir/types.js +12 -12
- package/src/converters/parsers/musubi-parser.js +134 -126
- package/src/converters/parsers/openapi-parser.js +70 -53
- package/src/converters/parsers/speckit-parser.js +239 -175
- package/src/converters/writers/musubi-writer.js +123 -118
- package/src/converters/writers/speckit-writer.js +124 -113
- package/src/generators/rust-migration-generator.js +512 -0
- package/src/gui/public/index.html +1365 -1211
- package/src/gui/server.js +41 -40
- package/src/gui/services/file-watcher.js +23 -8
- package/src/gui/services/project-scanner.js +26 -20
- package/src/gui/services/replanning-service.js +27 -23
- package/src/gui/services/traceability-service.js +8 -8
- package/src/gui/services/workflow-service.js +14 -7
- package/src/index.js +151 -0
- package/src/integrations/cicd.js +90 -104
- package/src/integrations/codegraph-mcp.js +643 -0
- package/src/integrations/documentation.js +142 -103
- package/src/integrations/examples.js +95 -80
- package/src/integrations/github-client.js +17 -17
- package/src/integrations/index.js +5 -5
- package/src/integrations/mcp/index.js +21 -21
- package/src/integrations/mcp/mcp-context-provider.js +76 -78
- package/src/integrations/mcp/mcp-discovery.js +74 -72
- package/src/integrations/mcp/mcp-tool-registry.js +99 -94
- package/src/integrations/mcp-connector.js +70 -66
- package/src/integrations/platforms.js +50 -49
- package/src/integrations/tool-discovery.js +37 -31
- package/src/llm-providers/anthropic-provider.js +11 -11
- package/src/llm-providers/base-provider.js +16 -18
- package/src/llm-providers/copilot-provider.js +22 -19
- package/src/llm-providers/index.js +26 -25
- package/src/llm-providers/ollama-provider.js +11 -11
- package/src/llm-providers/openai-provider.js +12 -12
- package/src/managers/agent-memory.js +36 -24
- package/src/managers/checkpoint-manager.js +4 -8
- package/src/managers/delta-spec.js +19 -19
- package/src/managers/index.js +13 -4
- package/src/managers/memory-condenser.js +35 -45
- package/src/managers/repo-skill-manager.js +57 -31
- package/src/managers/skill-loader.js +25 -22
- package/src/managers/skill-tools.js +36 -72
- package/src/managers/workflow.js +30 -22
- package/src/monitoring/cost-tracker.js +53 -44
- package/src/monitoring/incident-manager.js +123 -103
- package/src/monitoring/index.js +144 -134
- package/src/monitoring/observability.js +82 -59
- package/src/monitoring/quality-dashboard.js +51 -39
- package/src/monitoring/release-manager.js +70 -50
- package/src/orchestration/agent-skill-binding.js +39 -47
- package/src/orchestration/error-handler.js +65 -107
- package/src/orchestration/guardrails/base-guardrail.js +26 -24
- package/src/orchestration/guardrails/guardrail-rules.js +50 -64
- package/src/orchestration/guardrails/index.js +5 -5
- package/src/orchestration/guardrails/input-guardrail.js +58 -45
- package/src/orchestration/guardrails/output-guardrail.js +104 -81
- package/src/orchestration/guardrails/safety-check.js +79 -79
- package/src/orchestration/index.js +38 -55
- package/src/orchestration/mcp-tool-adapters.js +96 -99
- package/src/orchestration/orchestration-engine.js +21 -21
- package/src/orchestration/pattern-registry.js +60 -45
- package/src/orchestration/patterns/auto.js +34 -47
- package/src/orchestration/patterns/group-chat.js +59 -65
- package/src/orchestration/patterns/handoff.js +67 -65
- package/src/orchestration/patterns/human-in-loop.js +51 -72
- package/src/orchestration/patterns/nested.js +25 -40
- package/src/orchestration/patterns/sequential.js +35 -34
- package/src/orchestration/patterns/swarm.js +63 -56
- package/src/orchestration/patterns/triage.js +150 -109
- package/src/orchestration/reasoning/index.js +9 -9
- package/src/orchestration/reasoning/planning-engine.js +143 -140
- package/src/orchestration/reasoning/reasoning-engine.js +206 -144
- package/src/orchestration/reasoning/self-correction.js +121 -128
- package/src/orchestration/replanning/adaptive-goal-modifier.js +107 -112
- package/src/orchestration/replanning/alternative-generator.js +37 -42
- package/src/orchestration/replanning/config.js +63 -59
- package/src/orchestration/replanning/goal-progress-tracker.js +98 -100
- package/src/orchestration/replanning/index.js +24 -20
- package/src/orchestration/replanning/plan-evaluator.js +49 -50
- package/src/orchestration/replanning/plan-monitor.js +32 -28
- package/src/orchestration/replanning/proactive-path-optimizer.js +175 -178
- package/src/orchestration/replanning/replan-history.js +33 -26
- package/src/orchestration/replanning/replanning-engine.js +106 -108
- package/src/orchestration/skill-executor.js +107 -109
- package/src/orchestration/skill-registry.js +85 -89
- package/src/orchestration/workflow-examples.js +228 -231
- package/src/orchestration/workflow-executor.js +65 -68
- package/src/orchestration/workflow-orchestrator.js +72 -73
- package/src/phase4-integration.js +47 -40
- package/src/phase5-integration.js +89 -30
- package/src/reporters/coverage-report.js +82 -30
- package/src/reporters/hierarchical-reporter.js +498 -0
- package/src/reporters/traceability-matrix-report.js +29 -20
- package/src/resolvers/issue-resolver.js +43 -31
- package/src/steering/advanced-validation.js +133 -124
- package/src/steering/auto-updater.js +60 -73
- package/src/steering/index.js +6 -6
- package/src/steering/quality-metrics.js +41 -35
- package/src/steering/steering-auto-update.js +83 -86
- package/src/steering/steering-validator.js +98 -106
- package/src/steering/template-constraints.js +53 -54
- package/src/templates/agents/claude-code/CLAUDE.md +32 -32
- package/src/templates/agents/claude-code/skills/agent-assistant/SKILL.md +13 -5
- package/src/templates/agents/claude-code/skills/ai-ml-engineer/mlops-guide.md +23 -23
- package/src/templates/agents/claude-code/skills/ai-ml-engineer/model-card-template.md +60 -41
- package/src/templates/agents/claude-code/skills/api-designer/api-patterns.md +27 -19
- package/src/templates/agents/claude-code/skills/api-designer/openapi-template.md +11 -7
- package/src/templates/agents/claude-code/skills/bug-hunter/SKILL.md +4 -3
- package/src/templates/agents/claude-code/skills/bug-hunter/root-cause-analysis.md +37 -15
- package/src/templates/agents/claude-code/skills/change-impact-analyzer/dependency-graph-patterns.md +36 -42
- package/src/templates/agents/claude-code/skills/change-impact-analyzer/impact-analysis-template.md +69 -60
- package/src/templates/agents/claude-code/skills/cloud-architect/aws-patterns.md +31 -38
- package/src/templates/agents/claude-code/skills/cloud-architect/azure-patterns.md +28 -23
- package/src/templates/agents/claude-code/skills/code-reviewer/SKILL.md +61 -0
- package/src/templates/agents/claude-code/skills/code-reviewer/best-practices.md +27 -0
- package/src/templates/agents/claude-code/skills/code-reviewer/review-checklist.md +29 -10
- package/src/templates/agents/claude-code/skills/code-reviewer/review-standards.md +29 -24
- package/src/templates/agents/claude-code/skills/constitution-enforcer/SKILL.md +8 -6
- package/src/templates/agents/claude-code/skills/constitution-enforcer/constitutional-articles.md +62 -26
- package/src/templates/agents/claude-code/skills/constitution-enforcer/phase-minus-one-gates.md +35 -16
- package/src/templates/agents/claude-code/skills/database-administrator/backup-recovery.md +27 -17
- package/src/templates/agents/claude-code/skills/database-administrator/tuning-guide.md +25 -20
- package/src/templates/agents/claude-code/skills/database-schema-designer/schema-patterns.md +39 -22
- package/src/templates/agents/claude-code/skills/devops-engineer/ci-cd-templates.md +25 -22
- package/src/templates/agents/claude-code/skills/issue-resolver/SKILL.md +24 -21
- package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +148 -63
- package/src/templates/agents/claude-code/skills/orchestrator/patterns.md +35 -16
- package/src/templates/agents/claude-code/skills/orchestrator/selection-matrix.md +69 -64
- package/src/templates/agents/claude-code/skills/performance-engineer/optimization-playbook.md +47 -47
- package/src/templates/agents/claude-code/skills/performance-optimizer/SKILL.md +69 -0
- package/src/templates/agents/claude-code/skills/performance-optimizer/benchmark-template.md +63 -45
- package/src/templates/agents/claude-code/skills/performance-optimizer/optimization-patterns.md +33 -35
- package/src/templates/agents/claude-code/skills/project-manager/SKILL.md +7 -6
- package/src/templates/agents/claude-code/skills/project-manager/agile-ceremonies.md +47 -28
- package/src/templates/agents/claude-code/skills/project-manager/project-templates.md +94 -78
- package/src/templates/agents/claude-code/skills/quality-assurance/SKILL.md +20 -17
- package/src/templates/agents/claude-code/skills/quality-assurance/qa-plan-template.md +63 -49
- package/src/templates/agents/claude-code/skills/release-coordinator/SKILL.md +5 -5
- package/src/templates/agents/claude-code/skills/release-coordinator/feature-flag-guide.md +30 -26
- package/src/templates/agents/claude-code/skills/release-coordinator/release-plan-template.md +67 -35
- package/src/templates/agents/claude-code/skills/requirements-analyst/ears-format.md +54 -42
- package/src/templates/agents/claude-code/skills/requirements-analyst/validation-rules.md +36 -33
- package/src/templates/agents/claude-code/skills/security-auditor/SKILL.md +77 -19
- package/src/templates/agents/claude-code/skills/security-auditor/audit-checklists.md +24 -24
- package/src/templates/agents/claude-code/skills/security-auditor/owasp-top-10.md +61 -20
- package/src/templates/agents/claude-code/skills/security-auditor/vulnerability-patterns.md +43 -11
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/incident-response-template.md +55 -25
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/observability-patterns.md +78 -68
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/slo-sli-guide.md +73 -53
- package/src/templates/agents/claude-code/skills/software-developer/solid-principles.md +83 -37
- package/src/templates/agents/claude-code/skills/software-developer/test-first-workflow.md +38 -31
- package/src/templates/agents/claude-code/skills/steering/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/steering/auto-update-rules.md +31 -0
- package/src/templates/agents/claude-code/skills/system-architect/adr-template.md +25 -7
- package/src/templates/agents/claude-code/skills/system-architect/c4-model-guide.md +74 -61
- package/src/templates/agents/claude-code/skills/technical-writer/doc-templates/documentation-templates.md +70 -52
- package/src/templates/agents/claude-code/skills/test-engineer/SKILL.md +2 -0
- package/src/templates/agents/claude-code/skills/test-engineer/ears-test-mapping.md +75 -71
- package/src/templates/agents/claude-code/skills/test-engineer/test-types.md +85 -63
- package/src/templates/agents/claude-code/skills/traceability-auditor/coverage-matrix-template.md +39 -36
- package/src/templates/agents/claude-code/skills/traceability-auditor/gap-detection-rules.md +22 -17
- package/src/templates/agents/claude-code/skills/ui-ux-designer/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/ui-ux-designer/accessibility-guidelines.md +49 -75
- package/src/templates/agents/claude-code/skills/ui-ux-designer/design-system-components.md +71 -59
- package/src/templates/agents/codex/AGENTS.md +74 -42
- package/src/templates/agents/cursor/AGENTS.md +74 -42
- package/src/templates/agents/gemini-cli/GEMINI.md +74 -42
- package/src/templates/agents/github-copilot/AGENTS.md +83 -51
- package/src/templates/agents/qwen-code/QWEN.md +74 -42
- package/src/templates/agents/windsurf/AGENTS.md +74 -42
- package/src/templates/architectures/README.md +41 -0
- package/src/templates/architectures/clean-architecture/README.md +113 -0
- package/src/templates/architectures/event-driven/README.md +162 -0
- package/src/templates/architectures/hexagonal/README.md +130 -0
- package/src/templates/index.js +6 -1
- package/src/templates/locale-manager.js +16 -16
- package/src/templates/shared/delta-spec-template.md +20 -13
- package/src/templates/shared/github-actions/musubi-issue-resolver.yml +5 -5
- package/src/templates/shared/github-actions/musubi-security-check.yml +3 -3
- package/src/templates/shared/github-actions/musubi-validate.yml +4 -4
- package/src/templates/shared/steering/structure.md +95 -0
- package/src/templates/skills/browser-agent.md +21 -16
- package/src/templates/skills/web-gui.md +8 -0
- package/src/templates/template-constraints.js +50 -53
- package/src/validators/advanced-validation.js +30 -36
- package/src/validators/constitutional-validator.js +77 -73
- package/src/validators/critic-system.js +49 -59
- package/src/validators/delta-format.js +59 -55
- package/src/validators/traceability-validator.js +7 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Complex Workflow Examples
|
|
3
3
|
* Sprint 3.5: Advanced Workflows
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
5
|
* Real-world workflow templates demonstrating:
|
|
6
6
|
* - Multi-stage feature development
|
|
7
7
|
* - CI/CD integration
|
|
@@ -14,7 +14,7 @@ const { WorkflowDefinition, StepType, RecoveryStrategy } = require('./workflow-e
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Feature Development Workflow
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* Complete SDD-based feature development from requirements to deployment
|
|
19
19
|
*/
|
|
20
20
|
const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
@@ -29,16 +29,16 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
29
29
|
input: {
|
|
30
30
|
feature: { $var: 'feature_name' },
|
|
31
31
|
description: { $var: 'description' },
|
|
32
|
-
stakeholders: { $var: 'stakeholders', default: [] }
|
|
32
|
+
stakeholders: { $var: 'stakeholders', default: [] },
|
|
33
33
|
},
|
|
34
|
-
outputVariable: 'requirements'
|
|
34
|
+
outputVariable: 'requirements',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
id: 'requirements-checkpoint',
|
|
38
38
|
type: StepType.CHECKPOINT,
|
|
39
|
-
name: 'requirements-complete'
|
|
39
|
+
name: 'requirements-complete',
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
// Stage 2: Design
|
|
43
43
|
{
|
|
44
44
|
id: 'create-design',
|
|
@@ -46,22 +46,22 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
46
46
|
skillId: 'sdd-design',
|
|
47
47
|
input: {
|
|
48
48
|
feature: { $var: 'feature_name' },
|
|
49
|
-
requirements: { $var: 'requirements' }
|
|
49
|
+
requirements: { $var: 'requirements' },
|
|
50
50
|
},
|
|
51
|
-
outputVariable: 'design'
|
|
51
|
+
outputVariable: 'design',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: 'design-review',
|
|
55
55
|
type: StepType.HUMAN_REVIEW,
|
|
56
56
|
message: 'Review design for ${feature_name}:\n\n${design}',
|
|
57
|
-
options: ['approve', 'request-changes', 'reject']
|
|
57
|
+
options: ['approve', 'request-changes', 'reject'],
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
id: 'design-checkpoint',
|
|
61
61
|
type: StepType.CHECKPOINT,
|
|
62
|
-
name: 'design-approved'
|
|
62
|
+
name: 'design-approved',
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
// Stage 3: Task Breakdown
|
|
66
66
|
{
|
|
67
67
|
id: 'create-tasks',
|
|
@@ -69,11 +69,11 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
69
69
|
skillId: 'sdd-tasks',
|
|
70
70
|
input: {
|
|
71
71
|
feature: { $var: 'feature_name' },
|
|
72
|
-
design: { $var: 'design' }
|
|
72
|
+
design: { $var: 'design' },
|
|
73
73
|
},
|
|
74
|
-
outputVariable: 'tasks'
|
|
74
|
+
outputVariable: 'tasks',
|
|
75
75
|
},
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
// Stage 4: Implementation (parallel where possible)
|
|
78
78
|
{
|
|
79
79
|
id: 'implement-tasks',
|
|
@@ -88,21 +88,21 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
88
88
|
skillId: 'sdd-implement',
|
|
89
89
|
input: {
|
|
90
90
|
task: { $var: 'current_task' },
|
|
91
|
-
design: { $var: 'design' }
|
|
91
|
+
design: { $var: 'design' },
|
|
92
92
|
},
|
|
93
|
-
outputVariable: 'implementation_${task_index}'
|
|
93
|
+
outputVariable: 'implementation_${task_index}',
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
id: 'run-tests',
|
|
97
97
|
type: StepType.TOOL,
|
|
98
98
|
toolName: 'run_tests',
|
|
99
99
|
arguments: {
|
|
100
|
-
files: { $var: 'implementation_${task_index}.testFiles' }
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
]
|
|
100
|
+
files: { $var: 'implementation_${task_index}.testFiles' },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
// Stage 5: Validation
|
|
107
107
|
{
|
|
108
108
|
id: 'validate-implementation',
|
|
@@ -110,15 +110,15 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
110
110
|
skillId: 'sdd-validate',
|
|
111
111
|
input: {
|
|
112
112
|
feature: { $var: 'feature_name' },
|
|
113
|
-
design: { $var: 'design' }
|
|
113
|
+
design: { $var: 'design' },
|
|
114
114
|
},
|
|
115
115
|
outputVariable: 'validation_result',
|
|
116
116
|
onError: {
|
|
117
117
|
strategy: RecoveryStrategy.ROLLBACK,
|
|
118
|
-
rollbackTo: 'design-approved'
|
|
119
|
-
}
|
|
118
|
+
rollbackTo: 'design-approved',
|
|
119
|
+
},
|
|
120
120
|
},
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
// Stage 6: Documentation
|
|
123
123
|
{
|
|
124
124
|
id: 'generate-docs',
|
|
@@ -129,23 +129,23 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
129
129
|
id: 'api-docs',
|
|
130
130
|
type: StepType.SKILL,
|
|
131
131
|
skillId: 'documentation',
|
|
132
|
-
input: { type: 'api', source: { $var: 'implementation' } }
|
|
132
|
+
input: { type: 'api', source: { $var: 'implementation' } },
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
id: 'user-docs',
|
|
136
136
|
type: StepType.SKILL,
|
|
137
137
|
skillId: 'documentation',
|
|
138
|
-
input: { type: 'user-guide', feature: { $var: 'feature_name' } }
|
|
138
|
+
input: { type: 'user-guide', feature: { $var: 'feature_name' } },
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
id: 'changelog',
|
|
142
142
|
type: StepType.SKILL,
|
|
143
143
|
skillId: 'documentation',
|
|
144
|
-
input: { type: 'changelog', feature: { $var: 'feature_name' } }
|
|
145
|
-
}
|
|
144
|
+
input: { type: 'changelog', feature: { $var: 'feature_name' } },
|
|
145
|
+
},
|
|
146
146
|
],
|
|
147
|
-
outputVariable: 'documentation'
|
|
148
|
-
}
|
|
147
|
+
outputVariable: 'documentation',
|
|
148
|
+
},
|
|
149
149
|
],
|
|
150
150
|
{
|
|
151
151
|
description: 'Complete feature development workflow following SDD methodology',
|
|
@@ -153,29 +153,29 @@ const featureDevelopmentWorkflow = new WorkflowDefinition(
|
|
|
153
153
|
inputs: [
|
|
154
154
|
{ name: 'feature_name', type: 'string', required: true },
|
|
155
155
|
{ name: 'description', type: 'string', required: true },
|
|
156
|
-
{ name: 'stakeholders', type: 'array', required: false }
|
|
156
|
+
{ name: 'stakeholders', type: 'array', required: false },
|
|
157
157
|
],
|
|
158
158
|
outputs: [
|
|
159
159
|
{ name: 'requirements', from: 'requirements' },
|
|
160
160
|
{ name: 'design', from: 'design' },
|
|
161
161
|
{ name: 'tasks', from: 'tasks' },
|
|
162
162
|
{ name: 'validation', from: 'validation_result' },
|
|
163
|
-
{ name: 'documentation', from: 'documentation' }
|
|
163
|
+
{ name: 'documentation', from: 'documentation' },
|
|
164
164
|
],
|
|
165
165
|
errorHandling: {
|
|
166
166
|
strategy: RecoveryStrategy.ROLLBACK,
|
|
167
|
-
rollbackTo: 'requirements-complete'
|
|
167
|
+
rollbackTo: 'requirements-complete',
|
|
168
168
|
},
|
|
169
169
|
retryPolicy: {
|
|
170
170
|
maxRetries: 2,
|
|
171
|
-
backoffMs: 5000
|
|
172
|
-
}
|
|
171
|
+
backoffMs: 5000,
|
|
172
|
+
},
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* CI/CD Pipeline Workflow
|
|
178
|
-
*
|
|
178
|
+
*
|
|
179
179
|
* Automated build, test, and deployment pipeline
|
|
180
180
|
*/
|
|
181
181
|
const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
@@ -191,24 +191,24 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
191
191
|
id: 'lint-check',
|
|
192
192
|
type: StepType.TOOL,
|
|
193
193
|
toolName: 'run_command',
|
|
194
|
-
arguments: { command: 'npm run lint' }
|
|
194
|
+
arguments: { command: 'npm run lint' },
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
id: 'type-check',
|
|
198
198
|
type: StepType.TOOL,
|
|
199
199
|
toolName: 'run_command',
|
|
200
|
-
arguments: { command: 'npm run typecheck' }
|
|
200
|
+
arguments: { command: 'npm run typecheck' },
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
id: 'security-scan',
|
|
204
204
|
type: StepType.TOOL,
|
|
205
205
|
toolName: 'run_command',
|
|
206
206
|
arguments: { command: 'npm audit --production' },
|
|
207
|
-
onError: { strategy: RecoveryStrategy.SKIP }
|
|
208
|
-
}
|
|
209
|
-
]
|
|
207
|
+
onError: { strategy: RecoveryStrategy.SKIP },
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
210
|
},
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
// Build
|
|
213
213
|
{
|
|
214
214
|
id: 'build',
|
|
@@ -218,18 +218,18 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
218
218
|
command: 'npm run build',
|
|
219
219
|
env: {
|
|
220
220
|
NODE_ENV: 'production',
|
|
221
|
-
BUILD_ID: { $var: 'build_id' }
|
|
222
|
-
}
|
|
221
|
+
BUILD_ID: { $var: 'build_id' },
|
|
222
|
+
},
|
|
223
223
|
},
|
|
224
224
|
outputVariable: 'build_result',
|
|
225
|
-
retry: { maxRetries: 2, backoffMs: 10000 }
|
|
225
|
+
retry: { maxRetries: 2, backoffMs: 10000 },
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
id: 'build-checkpoint',
|
|
229
229
|
type: StepType.CHECKPOINT,
|
|
230
|
-
name: 'build-complete'
|
|
230
|
+
name: 'build-complete',
|
|
231
231
|
},
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
// Test stages
|
|
234
234
|
{
|
|
235
235
|
id: 'unit-tests',
|
|
@@ -238,9 +238,9 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
238
238
|
arguments: {
|
|
239
239
|
type: 'unit',
|
|
240
240
|
coverage: true,
|
|
241
|
-
coverageThreshold: 80
|
|
241
|
+
coverageThreshold: 80,
|
|
242
242
|
},
|
|
243
|
-
outputVariable: 'unit_test_result'
|
|
243
|
+
outputVariable: 'unit_test_result',
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
246
|
id: 'integration-tests',
|
|
@@ -248,7 +248,7 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
248
248
|
toolName: 'run_tests',
|
|
249
249
|
arguments: { type: 'integration' },
|
|
250
250
|
outputVariable: 'integration_test_result',
|
|
251
|
-
when: { $var: 'run_integration_tests' }
|
|
251
|
+
when: { $var: 'run_integration_tests' },
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
id: 'e2e-tests',
|
|
@@ -259,37 +259,34 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
259
259
|
id: 'start-test-env',
|
|
260
260
|
type: StepType.TOOL,
|
|
261
261
|
toolName: 'run_command',
|
|
262
|
-
arguments: { command: 'docker-compose up -d test-env' }
|
|
262
|
+
arguments: { command: 'docker-compose up -d test-env' },
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
id: 'run-e2e',
|
|
266
266
|
type: StepType.TOOL,
|
|
267
267
|
toolName: 'run_tests',
|
|
268
|
-
arguments: { type: 'e2e' }
|
|
268
|
+
arguments: { type: 'e2e' },
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
id: 'stop-test-env',
|
|
272
272
|
type: StepType.TOOL,
|
|
273
273
|
toolName: 'run_command',
|
|
274
|
-
arguments: { command: 'docker-compose down test-env' }
|
|
275
|
-
}
|
|
276
|
-
]
|
|
274
|
+
arguments: { command: 'docker-compose down test-env' },
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
id: 'tests-checkpoint',
|
|
280
280
|
type: StepType.CHECKPOINT,
|
|
281
|
-
name: 'tests-passed'
|
|
281
|
+
name: 'tests-passed',
|
|
282
282
|
},
|
|
283
|
-
|
|
283
|
+
|
|
284
284
|
// Deployment decision
|
|
285
285
|
{
|
|
286
286
|
id: 'deployment-decision',
|
|
287
287
|
type: StepType.CONDITION,
|
|
288
288
|
condition: {
|
|
289
|
-
$and: [
|
|
290
|
-
{ $eq: [{ $var: 'branch' }, 'main'] },
|
|
291
|
-
{ $eq: [{ $var: 'auto_deploy' }, true] }
|
|
292
|
-
]
|
|
289
|
+
$and: [{ $eq: [{ $var: 'branch' }, 'main'] }, { $eq: [{ $var: 'auto_deploy' }, true] }],
|
|
293
290
|
},
|
|
294
291
|
thenSteps: [
|
|
295
292
|
{
|
|
@@ -298,9 +295,9 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
298
295
|
toolName: 'deploy',
|
|
299
296
|
arguments: {
|
|
300
297
|
environment: 'staging',
|
|
301
|
-
version: { $var: 'build_id' }
|
|
298
|
+
version: { $var: 'build_id' },
|
|
302
299
|
},
|
|
303
|
-
outputVariable: 'staging_deploy'
|
|
300
|
+
outputVariable: 'staging_deploy',
|
|
304
301
|
},
|
|
305
302
|
{
|
|
306
303
|
id: 'smoke-tests',
|
|
@@ -317,17 +314,17 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
317
314
|
arguments: {
|
|
318
315
|
environment: 'staging',
|
|
319
316
|
version: { $var: 'previous_version' },
|
|
320
|
-
action: 'rollback'
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
|
-
}
|
|
317
|
+
action: 'rollback',
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
},
|
|
325
322
|
},
|
|
326
323
|
{
|
|
327
324
|
id: 'production-approval',
|
|
328
325
|
type: StepType.HUMAN_REVIEW,
|
|
329
326
|
message: 'Staging deployment successful. Approve production deployment?',
|
|
330
|
-
options: ['deploy-to-production', 'hold', 'cancel']
|
|
327
|
+
options: ['deploy-to-production', 'hold', 'cancel'],
|
|
331
328
|
},
|
|
332
329
|
{
|
|
333
330
|
id: 'deploy-production',
|
|
@@ -337,9 +334,9 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
337
334
|
arguments: {
|
|
338
335
|
environment: 'production',
|
|
339
336
|
version: { $var: 'build_id' },
|
|
340
|
-
strategy: 'blue-green'
|
|
341
|
-
}
|
|
342
|
-
}
|
|
337
|
+
strategy: 'blue-green',
|
|
338
|
+
},
|
|
339
|
+
},
|
|
343
340
|
],
|
|
344
341
|
elseSteps: [
|
|
345
342
|
{
|
|
@@ -348,11 +345,11 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
348
345
|
toolName: 'send_notification',
|
|
349
346
|
arguments: {
|
|
350
347
|
channel: 'builds',
|
|
351
|
-
message: 'Build ${build_id} complete. Manual deployment required.'
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
]
|
|
355
|
-
}
|
|
348
|
+
message: 'Build ${build_id} complete. Manual deployment required.',
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
},
|
|
356
353
|
],
|
|
357
354
|
{
|
|
358
355
|
description: 'Automated CI/CD pipeline with staging and production deployment',
|
|
@@ -362,24 +359,24 @@ const cicdPipelineWorkflow = new WorkflowDefinition(
|
|
|
362
359
|
{ name: 'branch', type: 'string', required: true },
|
|
363
360
|
{ name: 'auto_deploy', type: 'boolean', default: false },
|
|
364
361
|
{ name: 'run_integration_tests', type: 'boolean', default: true },
|
|
365
|
-
{ name: 'run_e2e_tests', type: 'boolean', default: false }
|
|
362
|
+
{ name: 'run_e2e_tests', type: 'boolean', default: false },
|
|
366
363
|
],
|
|
367
364
|
outputs: [
|
|
368
365
|
{ name: 'build_result', from: 'build_result' },
|
|
369
366
|
{ name: 'test_coverage', from: 'unit_test_result.coverage' },
|
|
370
|
-
{ name: 'deployment_status', from: 'staging_deploy' }
|
|
367
|
+
{ name: 'deployment_status', from: 'staging_deploy' },
|
|
371
368
|
],
|
|
372
369
|
timeout: 3600000, // 1 hour
|
|
373
370
|
errorHandling: {
|
|
374
371
|
strategy: RecoveryStrategy.ROLLBACK,
|
|
375
|
-
rollbackTo: 'build-complete'
|
|
376
|
-
}
|
|
372
|
+
rollbackTo: 'build-complete',
|
|
373
|
+
},
|
|
377
374
|
}
|
|
378
375
|
);
|
|
379
376
|
|
|
380
377
|
/**
|
|
381
378
|
* Automated Code Review Workflow
|
|
382
|
-
*
|
|
379
|
+
*
|
|
383
380
|
* AI-assisted code review with human oversight
|
|
384
381
|
*/
|
|
385
382
|
const codeReviewWorkflow = new WorkflowDefinition(
|
|
@@ -395,11 +392,11 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
395
392
|
arguments: {
|
|
396
393
|
owner: { $var: 'repo_owner' },
|
|
397
394
|
repo: { $var: 'repo_name' },
|
|
398
|
-
pr_number: { $var: 'pr_number' }
|
|
395
|
+
pr_number: { $var: 'pr_number' },
|
|
399
396
|
},
|
|
400
|
-
outputVariable: 'pr_details'
|
|
397
|
+
outputVariable: 'pr_details',
|
|
401
398
|
},
|
|
402
|
-
|
|
399
|
+
|
|
403
400
|
// Get changed files
|
|
404
401
|
{
|
|
405
402
|
id: 'get-diff',
|
|
@@ -409,11 +406,11 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
409
406
|
arguments: {
|
|
410
407
|
owner: { $var: 'repo_owner' },
|
|
411
408
|
repo: { $var: 'repo_name' },
|
|
412
|
-
pr_number: { $var: 'pr_number' }
|
|
409
|
+
pr_number: { $var: 'pr_number' },
|
|
413
410
|
},
|
|
414
|
-
outputVariable: 'diff'
|
|
411
|
+
outputVariable: 'diff',
|
|
415
412
|
},
|
|
416
|
-
|
|
413
|
+
|
|
417
414
|
// Parallel analysis
|
|
418
415
|
{
|
|
419
416
|
id: 'parallel-analysis',
|
|
@@ -426,36 +423,36 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
426
423
|
skillId: 'code-analysis',
|
|
427
424
|
input: {
|
|
428
425
|
type: 'quality',
|
|
429
|
-
diff: { $var: 'diff' }
|
|
426
|
+
diff: { $var: 'diff' },
|
|
430
427
|
},
|
|
431
|
-
outputVariable: 'quality_report'
|
|
428
|
+
outputVariable: 'quality_report',
|
|
432
429
|
},
|
|
433
430
|
{
|
|
434
431
|
id: 'security-review',
|
|
435
432
|
type: StepType.SKILL,
|
|
436
433
|
skillId: 'security-analysis',
|
|
437
434
|
input: { diff: { $var: 'diff' } },
|
|
438
|
-
outputVariable: 'security_report'
|
|
435
|
+
outputVariable: 'security_report',
|
|
439
436
|
},
|
|
440
437
|
{
|
|
441
438
|
id: 'performance-review',
|
|
442
439
|
type: StepType.SKILL,
|
|
443
440
|
skillId: 'performance-analysis',
|
|
444
441
|
input: { diff: { $var: 'diff' } },
|
|
445
|
-
outputVariable: 'performance_report'
|
|
442
|
+
outputVariable: 'performance_report',
|
|
446
443
|
},
|
|
447
444
|
{
|
|
448
445
|
id: 'test-coverage-check',
|
|
449
446
|
type: StepType.SKILL,
|
|
450
447
|
skillId: 'coverage-analysis',
|
|
451
448
|
input: {
|
|
452
|
-
changed_files: { $var: 'diff.files' }
|
|
449
|
+
changed_files: { $var: 'diff.files' },
|
|
453
450
|
},
|
|
454
|
-
outputVariable: 'coverage_report'
|
|
455
|
-
}
|
|
456
|
-
]
|
|
451
|
+
outputVariable: 'coverage_report',
|
|
452
|
+
},
|
|
453
|
+
],
|
|
457
454
|
},
|
|
458
|
-
|
|
455
|
+
|
|
459
456
|
// Aggregate findings
|
|
460
457
|
{
|
|
461
458
|
id: 'aggregate-findings',
|
|
@@ -465,11 +462,11 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
465
462
|
quality: { $var: 'quality_report' },
|
|
466
463
|
security: { $var: 'security_report' },
|
|
467
464
|
performance: { $var: 'performance_report' },
|
|
468
|
-
coverage: { $var: 'coverage_report' }
|
|
465
|
+
coverage: { $var: 'coverage_report' },
|
|
469
466
|
},
|
|
470
|
-
outputVariable: 'aggregated_review'
|
|
467
|
+
outputVariable: 'aggregated_review',
|
|
471
468
|
},
|
|
472
|
-
|
|
469
|
+
|
|
473
470
|
// Determine review outcome
|
|
474
471
|
{
|
|
475
472
|
id: 'determine-outcome',
|
|
@@ -477,8 +474,8 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
477
474
|
condition: {
|
|
478
475
|
$or: [
|
|
479
476
|
{ $gt: [{ $var: 'aggregated_review.critical_issues' }, 0] },
|
|
480
|
-
{ $gt: [{ $var: 'aggregated_review.security_vulnerabilities' }, 0] }
|
|
481
|
-
]
|
|
477
|
+
{ $gt: [{ $var: 'aggregated_review.security_vulnerabilities' }, 0] },
|
|
478
|
+
],
|
|
482
479
|
},
|
|
483
480
|
thenSteps: [
|
|
484
481
|
{
|
|
@@ -492,9 +489,9 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
492
489
|
pr_number: { $var: 'pr_number' },
|
|
493
490
|
event: 'REQUEST_CHANGES',
|
|
494
491
|
body: { $var: 'aggregated_review.summary' },
|
|
495
|
-
comments: { $var: 'aggregated_review.comments' }
|
|
496
|
-
}
|
|
497
|
-
}
|
|
492
|
+
comments: { $var: 'aggregated_review.comments' },
|
|
493
|
+
},
|
|
494
|
+
},
|
|
498
495
|
],
|
|
499
496
|
elseSteps: [
|
|
500
497
|
{
|
|
@@ -506,8 +503,8 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
506
503
|
id: 'request-human-review',
|
|
507
504
|
type: StepType.HUMAN_REVIEW,
|
|
508
505
|
message: 'Multiple issues found. Please review:\n${aggregated_review.summary}',
|
|
509
|
-
options: ['approve-with-comments', 'request-changes', 'approve']
|
|
510
|
-
}
|
|
506
|
+
options: ['approve-with-comments', 'request-changes', 'approve'],
|
|
507
|
+
},
|
|
511
508
|
],
|
|
512
509
|
elseSteps: [
|
|
513
510
|
{
|
|
@@ -520,14 +517,14 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
520
517
|
repo: { $var: 'repo_name' },
|
|
521
518
|
pr_number: { $var: 'pr_number' },
|
|
522
519
|
event: 'APPROVE',
|
|
523
|
-
body: 'LGTM! Automated review passed.\n\n${aggregated_review.summary}'
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
]
|
|
527
|
-
}
|
|
528
|
-
]
|
|
520
|
+
body: 'LGTM! Automated review passed.\n\n${aggregated_review.summary}',
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
],
|
|
524
|
+
},
|
|
525
|
+
],
|
|
529
526
|
},
|
|
530
|
-
|
|
527
|
+
|
|
531
528
|
// Post review comments
|
|
532
529
|
{
|
|
533
530
|
id: 'post-comments',
|
|
@@ -546,12 +543,12 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
546
543
|
pr_number: { $var: 'pr_number' },
|
|
547
544
|
path: { $var: 'comment.file' },
|
|
548
545
|
line: { $var: 'comment.line' },
|
|
549
|
-
body: { $var: 'comment.body' }
|
|
550
|
-
}
|
|
551
|
-
}
|
|
546
|
+
body: { $var: 'comment.body' },
|
|
547
|
+
},
|
|
548
|
+
},
|
|
552
549
|
],
|
|
553
|
-
maxIterations: 50
|
|
554
|
-
}
|
|
550
|
+
maxIterations: 50,
|
|
551
|
+
},
|
|
555
552
|
],
|
|
556
553
|
{
|
|
557
554
|
description: 'AI-powered code review with quality, security, and performance analysis',
|
|
@@ -559,22 +556,22 @@ const codeReviewWorkflow = new WorkflowDefinition(
|
|
|
559
556
|
inputs: [
|
|
560
557
|
{ name: 'repo_owner', type: 'string', required: true },
|
|
561
558
|
{ name: 'repo_name', type: 'string', required: true },
|
|
562
|
-
{ name: 'pr_number', type: 'number', required: true }
|
|
559
|
+
{ name: 'pr_number', type: 'number', required: true },
|
|
563
560
|
],
|
|
564
561
|
outputs: [
|
|
565
562
|
{ name: 'review_summary', from: 'aggregated_review' },
|
|
566
|
-
{ name: 'critical_issues', from: 'aggregated_review.critical_issues' }
|
|
563
|
+
{ name: 'critical_issues', from: 'aggregated_review.critical_issues' },
|
|
567
564
|
],
|
|
568
565
|
retryPolicy: {
|
|
569
566
|
maxRetries: 2,
|
|
570
|
-
backoffMs: 3000
|
|
571
|
-
}
|
|
567
|
+
backoffMs: 3000,
|
|
568
|
+
},
|
|
572
569
|
}
|
|
573
570
|
);
|
|
574
571
|
|
|
575
572
|
/**
|
|
576
573
|
* Incident Response Workflow
|
|
577
|
-
*
|
|
574
|
+
*
|
|
578
575
|
* Automated incident detection, triage, and resolution
|
|
579
576
|
*/
|
|
580
577
|
const incidentResponseWorkflow = new WorkflowDefinition(
|
|
@@ -588,11 +585,11 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
588
585
|
skillId: 'incident-classifier',
|
|
589
586
|
input: {
|
|
590
587
|
alert: { $var: 'alert_data' },
|
|
591
|
-
service: { $var: 'affected_service' }
|
|
588
|
+
service: { $var: 'affected_service' },
|
|
592
589
|
},
|
|
593
|
-
outputVariable: 'classification'
|
|
590
|
+
outputVariable: 'classification',
|
|
594
591
|
},
|
|
595
|
-
|
|
592
|
+
|
|
596
593
|
// Severity-based routing
|
|
597
594
|
{
|
|
598
595
|
id: 'severity-routing',
|
|
@@ -600,8 +597,8 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
600
597
|
condition: {
|
|
601
598
|
$or: [
|
|
602
599
|
{ $eq: [{ $var: 'classification.severity' }, 'critical'] },
|
|
603
|
-
{ $eq: [{ $var: 'classification.severity' }, 'high'] }
|
|
604
|
-
]
|
|
600
|
+
{ $eq: [{ $var: 'classification.severity' }, 'high'] },
|
|
601
|
+
],
|
|
605
602
|
},
|
|
606
603
|
thenSteps: [
|
|
607
604
|
// Critical/High: Immediate response
|
|
@@ -616,8 +613,8 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
616
613
|
arguments: {
|
|
617
614
|
service: { $var: 'affected_service' },
|
|
618
615
|
title: { $var: 'classification.title' },
|
|
619
|
-
urgency: 'high'
|
|
620
|
-
}
|
|
616
|
+
urgency: 'high',
|
|
617
|
+
},
|
|
621
618
|
},
|
|
622
619
|
{
|
|
623
620
|
id: 'create-incident-channel',
|
|
@@ -625,11 +622,11 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
625
622
|
toolName: 'slack_create_channel',
|
|
626
623
|
arguments: {
|
|
627
624
|
name: 'incident-${incident_id}',
|
|
628
|
-
topic: { $var: 'classification.title' }
|
|
625
|
+
topic: { $var: 'classification.title' },
|
|
629
626
|
},
|
|
630
|
-
outputVariable: 'incident_channel'
|
|
631
|
-
}
|
|
632
|
-
]
|
|
627
|
+
outputVariable: 'incident_channel',
|
|
628
|
+
},
|
|
629
|
+
],
|
|
633
630
|
},
|
|
634
631
|
{
|
|
635
632
|
id: 'gather-diagnostics',
|
|
@@ -642,9 +639,9 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
642
639
|
arguments: {
|
|
643
640
|
service: { $var: 'affected_service' },
|
|
644
641
|
timeRange: '15m',
|
|
645
|
-
level: 'error'
|
|
642
|
+
level: 'error',
|
|
646
643
|
},
|
|
647
|
-
outputVariable: 'error_logs'
|
|
644
|
+
outputVariable: 'error_logs',
|
|
648
645
|
},
|
|
649
646
|
{
|
|
650
647
|
id: 'fetch-metrics',
|
|
@@ -652,20 +649,20 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
652
649
|
toolName: 'fetch_metrics',
|
|
653
650
|
arguments: {
|
|
654
651
|
service: { $var: 'affected_service' },
|
|
655
|
-
timeRange: '1h'
|
|
652
|
+
timeRange: '1h',
|
|
656
653
|
},
|
|
657
|
-
outputVariable: 'metrics'
|
|
654
|
+
outputVariable: 'metrics',
|
|
658
655
|
},
|
|
659
656
|
{
|
|
660
657
|
id: 'check-dependencies',
|
|
661
658
|
type: StepType.TOOL,
|
|
662
659
|
toolName: 'check_service_health',
|
|
663
660
|
arguments: {
|
|
664
|
-
services: { $var: 'classification.dependencies' }
|
|
661
|
+
services: { $var: 'classification.dependencies' },
|
|
665
662
|
},
|
|
666
|
-
outputVariable: 'dependency_health'
|
|
667
|
-
}
|
|
668
|
-
]
|
|
663
|
+
outputVariable: 'dependency_health',
|
|
664
|
+
},
|
|
665
|
+
],
|
|
669
666
|
},
|
|
670
667
|
{
|
|
671
668
|
id: 'ai-diagnosis',
|
|
@@ -675,9 +672,9 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
675
672
|
logs: { $var: 'error_logs' },
|
|
676
673
|
metrics: { $var: 'metrics' },
|
|
677
674
|
dependencies: { $var: 'dependency_health' },
|
|
678
|
-
classification: { $var: 'classification' }
|
|
675
|
+
classification: { $var: 'classification' },
|
|
679
676
|
},
|
|
680
|
-
outputVariable: 'diagnosis'
|
|
677
|
+
outputVariable: 'diagnosis',
|
|
681
678
|
},
|
|
682
679
|
{
|
|
683
680
|
id: 'post-diagnosis',
|
|
@@ -685,9 +682,9 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
685
682
|
toolName: 'slack_post_message',
|
|
686
683
|
arguments: {
|
|
687
684
|
channel: { $var: 'incident_channel.id' },
|
|
688
|
-
blocks: { $var: 'diagnosis.slack_blocks' }
|
|
689
|
-
}
|
|
690
|
-
}
|
|
685
|
+
blocks: { $var: 'diagnosis.slack_blocks' },
|
|
686
|
+
},
|
|
687
|
+
},
|
|
691
688
|
],
|
|
692
689
|
elseSteps: [
|
|
693
690
|
// Medium/Low: Create ticket
|
|
@@ -699,9 +696,9 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
699
696
|
project: 'OPS',
|
|
700
697
|
type: 'Bug',
|
|
701
698
|
summary: { $var: 'classification.title' },
|
|
702
|
-
priority: { $var: 'classification.jira_priority' }
|
|
699
|
+
priority: { $var: 'classification.jira_priority' },
|
|
703
700
|
},
|
|
704
|
-
outputVariable: 'ticket'
|
|
701
|
+
outputVariable: 'ticket',
|
|
705
702
|
},
|
|
706
703
|
{
|
|
707
704
|
id: 'notify-team',
|
|
@@ -709,12 +706,12 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
709
706
|
toolName: 'slack_post_message',
|
|
710
707
|
arguments: {
|
|
711
708
|
channel: '#ops-alerts',
|
|
712
|
-
text: 'New incident: ${classification.title}\nTicket: ${ticket.key}'
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
]
|
|
709
|
+
text: 'New incident: ${classification.title}\nTicket: ${ticket.key}',
|
|
710
|
+
},
|
|
711
|
+
},
|
|
712
|
+
],
|
|
716
713
|
},
|
|
717
|
-
|
|
714
|
+
|
|
718
715
|
// Resolution attempt
|
|
719
716
|
{
|
|
720
717
|
id: 'attempt-auto-resolution',
|
|
@@ -722,8 +719,8 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
722
719
|
condition: {
|
|
723
720
|
$and: [
|
|
724
721
|
{ $exists: 'diagnosis.auto_remediation' },
|
|
725
|
-
{ $eq: [{ $var: 'classification.auto_remediation_allowed' }, true] }
|
|
726
|
-
]
|
|
722
|
+
{ $eq: [{ $var: 'classification.auto_remediation_allowed' }, true] },
|
|
723
|
+
],
|
|
727
724
|
},
|
|
728
725
|
thenSteps: [
|
|
729
726
|
{
|
|
@@ -739,23 +736,23 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
739
736
|
arguments: { $var: 'step.arguments' },
|
|
740
737
|
onError: {
|
|
741
738
|
strategy: RecoveryStrategy.MANUAL,
|
|
742
|
-
message: 'Remediation step failed: ${step.name}'
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
]
|
|
739
|
+
message: 'Remediation step failed: ${step.name}',
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
],
|
|
746
743
|
},
|
|
747
744
|
{
|
|
748
745
|
id: 'verify-resolution',
|
|
749
746
|
type: StepType.TOOL,
|
|
750
747
|
toolName: 'check_service_health',
|
|
751
748
|
arguments: {
|
|
752
|
-
services: [{ $var: 'affected_service' }]
|
|
749
|
+
services: [{ $var: 'affected_service' }],
|
|
753
750
|
},
|
|
754
|
-
outputVariable: 'post_remediation_health'
|
|
755
|
-
}
|
|
756
|
-
]
|
|
751
|
+
outputVariable: 'post_remediation_health',
|
|
752
|
+
},
|
|
753
|
+
],
|
|
757
754
|
},
|
|
758
|
-
|
|
755
|
+
|
|
759
756
|
// Post-incident
|
|
760
757
|
{
|
|
761
758
|
id: 'finalize-incident',
|
|
@@ -767,8 +764,8 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
767
764
|
toolName: 'statuspage_update',
|
|
768
765
|
arguments: {
|
|
769
766
|
incident_id: { $var: 'incident_id' },
|
|
770
|
-
status: 'resolved'
|
|
771
|
-
}
|
|
767
|
+
status: 'resolved',
|
|
768
|
+
},
|
|
772
769
|
},
|
|
773
770
|
{
|
|
774
771
|
id: 'schedule-postmortem',
|
|
@@ -778,11 +775,11 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
778
775
|
arguments: {
|
|
779
776
|
title: 'Postmortem: ${classification.title}',
|
|
780
777
|
duration: 60,
|
|
781
|
-
attendees: { $var: 'classification.stakeholders' }
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
]
|
|
785
|
-
}
|
|
778
|
+
attendees: { $var: 'classification.stakeholders' },
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
],
|
|
782
|
+
},
|
|
786
783
|
],
|
|
787
784
|
{
|
|
788
785
|
description: 'Automated incident response with AI-powered diagnosis and remediation',
|
|
@@ -790,22 +787,22 @@ const incidentResponseWorkflow = new WorkflowDefinition(
|
|
|
790
787
|
inputs: [
|
|
791
788
|
{ name: 'incident_id', type: 'string', required: true },
|
|
792
789
|
{ name: 'alert_data', type: 'object', required: true },
|
|
793
|
-
{ name: 'affected_service', type: 'string', required: true }
|
|
790
|
+
{ name: 'affected_service', type: 'string', required: true },
|
|
794
791
|
],
|
|
795
792
|
outputs: [
|
|
796
793
|
{ name: 'classification', from: 'classification' },
|
|
797
794
|
{ name: 'diagnosis', from: 'diagnosis' },
|
|
798
|
-
{ name: 'resolution_status', from: 'post_remediation_health' }
|
|
795
|
+
{ name: 'resolution_status', from: 'post_remediation_health' },
|
|
799
796
|
],
|
|
800
797
|
errorHandling: {
|
|
801
|
-
strategy: RecoveryStrategy.MANUAL
|
|
802
|
-
}
|
|
798
|
+
strategy: RecoveryStrategy.MANUAL,
|
|
799
|
+
},
|
|
803
800
|
}
|
|
804
801
|
);
|
|
805
802
|
|
|
806
803
|
/**
|
|
807
804
|
* Data Pipeline Workflow
|
|
808
|
-
*
|
|
805
|
+
*
|
|
809
806
|
* ETL/ELT pipeline with quality checks and monitoring
|
|
810
807
|
*/
|
|
811
808
|
const dataPipelineWorkflow = new WorkflowDefinition(
|
|
@@ -823,10 +820,10 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
823
820
|
toolName: 'data_extract',
|
|
824
821
|
arguments: {
|
|
825
822
|
source: { $var: 'source_a_config' },
|
|
826
|
-
query: { $var: 'source_a_query' }
|
|
823
|
+
query: { $var: 'source_a_query' },
|
|
827
824
|
},
|
|
828
825
|
outputVariable: 'data_a',
|
|
829
|
-
retry: { maxRetries: 3, backoffMs: 5000 }
|
|
826
|
+
retry: { maxRetries: 3, backoffMs: 5000 },
|
|
830
827
|
},
|
|
831
828
|
{
|
|
832
829
|
id: 'extract-source-b',
|
|
@@ -834,19 +831,19 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
834
831
|
toolName: 'data_extract',
|
|
835
832
|
arguments: {
|
|
836
833
|
source: { $var: 'source_b_config' },
|
|
837
|
-
query: { $var: 'source_b_query' }
|
|
834
|
+
query: { $var: 'source_b_query' },
|
|
838
835
|
},
|
|
839
836
|
outputVariable: 'data_b',
|
|
840
|
-
retry: { maxRetries: 3, backoffMs: 5000 }
|
|
841
|
-
}
|
|
842
|
-
]
|
|
837
|
+
retry: { maxRetries: 3, backoffMs: 5000 },
|
|
838
|
+
},
|
|
839
|
+
],
|
|
843
840
|
},
|
|
844
841
|
{
|
|
845
842
|
id: 'extraction-checkpoint',
|
|
846
843
|
type: StepType.CHECKPOINT,
|
|
847
|
-
name: 'extraction-complete'
|
|
844
|
+
name: 'extraction-complete',
|
|
848
845
|
},
|
|
849
|
-
|
|
846
|
+
|
|
850
847
|
// Data quality checks
|
|
851
848
|
{
|
|
852
849
|
id: 'quality-checks',
|
|
@@ -859,9 +856,9 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
859
856
|
input: {
|
|
860
857
|
check: 'completeness',
|
|
861
858
|
data: [{ $var: 'data_a' }, { $var: 'data_b' }],
|
|
862
|
-
thresholds: { $var: 'quality_thresholds' }
|
|
859
|
+
thresholds: { $var: 'quality_thresholds' },
|
|
863
860
|
},
|
|
864
|
-
outputVariable: 'completeness_result'
|
|
861
|
+
outputVariable: 'completeness_result',
|
|
865
862
|
},
|
|
866
863
|
{
|
|
867
864
|
id: 'check-consistency',
|
|
@@ -869,9 +866,9 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
869
866
|
skillId: 'data-quality',
|
|
870
867
|
input: {
|
|
871
868
|
check: 'consistency',
|
|
872
|
-
data: [{ $var: 'data_a' }, { $var: 'data_b' }]
|
|
869
|
+
data: [{ $var: 'data_a' }, { $var: 'data_b' }],
|
|
873
870
|
},
|
|
874
|
-
outputVariable: 'consistency_result'
|
|
871
|
+
outputVariable: 'consistency_result',
|
|
875
872
|
},
|
|
876
873
|
{
|
|
877
874
|
id: 'check-freshness',
|
|
@@ -880,13 +877,13 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
880
877
|
input: {
|
|
881
878
|
check: 'freshness',
|
|
882
879
|
data: [{ $var: 'data_a' }, { $var: 'data_b' }],
|
|
883
|
-
maxAge: { $var: 'max_data_age' }
|
|
880
|
+
maxAge: { $var: 'max_data_age' },
|
|
884
881
|
},
|
|
885
|
-
outputVariable: 'freshness_result'
|
|
886
|
-
}
|
|
887
|
-
]
|
|
882
|
+
outputVariable: 'freshness_result',
|
|
883
|
+
},
|
|
884
|
+
],
|
|
888
885
|
},
|
|
889
|
-
|
|
886
|
+
|
|
890
887
|
// Quality gate
|
|
891
888
|
{
|
|
892
889
|
id: 'quality-gate',
|
|
@@ -895,8 +892,8 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
895
892
|
$and: [
|
|
896
893
|
{ $var: 'completeness_result.passed' },
|
|
897
894
|
{ $var: 'consistency_result.passed' },
|
|
898
|
-
{ $var: 'freshness_result.passed' }
|
|
899
|
-
]
|
|
895
|
+
{ $var: 'freshness_result.passed' },
|
|
896
|
+
],
|
|
900
897
|
},
|
|
901
898
|
thenSteps: [
|
|
902
899
|
// Transform
|
|
@@ -907,18 +904,18 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
907
904
|
input: {
|
|
908
905
|
sources: {
|
|
909
906
|
a: { $var: 'data_a' },
|
|
910
|
-
b: { $var: 'data_b' }
|
|
907
|
+
b: { $var: 'data_b' },
|
|
911
908
|
},
|
|
912
|
-
transformations: { $var: 'transform_config' }
|
|
909
|
+
transformations: { $var: 'transform_config' },
|
|
913
910
|
},
|
|
914
|
-
outputVariable: 'transformed_data'
|
|
911
|
+
outputVariable: 'transformed_data',
|
|
915
912
|
},
|
|
916
913
|
{
|
|
917
914
|
id: 'transform-checkpoint',
|
|
918
915
|
type: StepType.CHECKPOINT,
|
|
919
|
-
name: 'transform-complete'
|
|
916
|
+
name: 'transform-complete',
|
|
920
917
|
},
|
|
921
|
-
|
|
918
|
+
|
|
922
919
|
// Load
|
|
923
920
|
{
|
|
924
921
|
id: 'load-data',
|
|
@@ -927,15 +924,15 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
927
924
|
arguments: {
|
|
928
925
|
destination: { $var: 'destination_config' },
|
|
929
926
|
data: { $var: 'transformed_data' },
|
|
930
|
-
mode: { $var: 'load_mode' }
|
|
927
|
+
mode: { $var: 'load_mode' },
|
|
931
928
|
},
|
|
932
929
|
outputVariable: 'load_result',
|
|
933
930
|
onError: {
|
|
934
931
|
strategy: RecoveryStrategy.ROLLBACK,
|
|
935
|
-
rollbackTo: 'transform-complete'
|
|
936
|
-
}
|
|
932
|
+
rollbackTo: 'transform-complete',
|
|
933
|
+
},
|
|
937
934
|
},
|
|
938
|
-
|
|
935
|
+
|
|
939
936
|
// Post-load validation
|
|
940
937
|
{
|
|
941
938
|
id: 'validate-load',
|
|
@@ -943,10 +940,10 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
943
940
|
toolName: 'data_validate',
|
|
944
941
|
arguments: {
|
|
945
942
|
destination: { $var: 'destination_config' },
|
|
946
|
-
expectedRows: { $var: 'transformed_data.rowCount' }
|
|
943
|
+
expectedRows: { $var: 'transformed_data.rowCount' },
|
|
947
944
|
},
|
|
948
|
-
outputVariable: 'validation_result'
|
|
949
|
-
}
|
|
945
|
+
outputVariable: 'validation_result',
|
|
946
|
+
},
|
|
950
947
|
],
|
|
951
948
|
elseSteps: [
|
|
952
949
|
{
|
|
@@ -960,19 +957,19 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
960
957
|
details: {
|
|
961
958
|
completeness: { $var: 'completeness_result' },
|
|
962
959
|
consistency: { $var: 'consistency_result' },
|
|
963
|
-
freshness: { $var: 'freshness_result' }
|
|
964
|
-
}
|
|
965
|
-
}
|
|
960
|
+
freshness: { $var: 'freshness_result' },
|
|
961
|
+
},
|
|
962
|
+
},
|
|
966
963
|
},
|
|
967
964
|
{
|
|
968
965
|
id: 'quality-human-review',
|
|
969
966
|
type: StepType.HUMAN_REVIEW,
|
|
970
967
|
message: 'Data quality check failed. Review and decide:',
|
|
971
|
-
options: ['proceed-anyway', 'retry-extraction', 'abort']
|
|
972
|
-
}
|
|
973
|
-
]
|
|
968
|
+
options: ['proceed-anyway', 'retry-extraction', 'abort'],
|
|
969
|
+
},
|
|
970
|
+
],
|
|
974
971
|
},
|
|
975
|
-
|
|
972
|
+
|
|
976
973
|
// Metrics and reporting
|
|
977
974
|
{
|
|
978
975
|
id: 'record-metrics',
|
|
@@ -985,11 +982,11 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
985
982
|
duration: { $var: '__duration' },
|
|
986
983
|
qualityScores: {
|
|
987
984
|
completeness: { $var: 'completeness_result.score' },
|
|
988
|
-
consistency: { $var: 'consistency_result.score' }
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
}
|
|
985
|
+
consistency: { $var: 'consistency_result.score' },
|
|
986
|
+
},
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
},
|
|
993
990
|
],
|
|
994
991
|
{
|
|
995
992
|
description: 'ETL/ELT data pipeline with quality gates and monitoring',
|
|
@@ -1004,18 +1001,18 @@ const dataPipelineWorkflow = new WorkflowDefinition(
|
|
|
1004
1001
|
{ name: 'transform_config', type: 'object', required: true },
|
|
1005
1002
|
{ name: 'quality_thresholds', type: 'object', required: false },
|
|
1006
1003
|
{ name: 'max_data_age', type: 'string', default: '24h' },
|
|
1007
|
-
{ name: 'load_mode', type: 'string', default: 'append' }
|
|
1004
|
+
{ name: 'load_mode', type: 'string', default: 'append' },
|
|
1008
1005
|
],
|
|
1009
1006
|
outputs: [
|
|
1010
1007
|
{ name: 'load_result', from: 'load_result' },
|
|
1011
1008
|
{ name: 'validation', from: 'validation_result' },
|
|
1012
|
-
{ name: 'quality_report', from: 'quality_gate_results' }
|
|
1009
|
+
{ name: 'quality_report', from: 'quality_gate_results' },
|
|
1013
1010
|
],
|
|
1014
1011
|
timeout: 7200000, // 2 hours
|
|
1015
1012
|
errorHandling: {
|
|
1016
1013
|
strategy: RecoveryStrategy.ROLLBACK,
|
|
1017
|
-
rollbackTo: 'extraction-complete'
|
|
1018
|
-
}
|
|
1014
|
+
rollbackTo: 'extraction-complete',
|
|
1015
|
+
},
|
|
1019
1016
|
}
|
|
1020
1017
|
);
|
|
1021
1018
|
|
|
@@ -1028,7 +1025,7 @@ function createWorkflowFromTemplate(templateName, customizations = {}) {
|
|
|
1028
1025
|
'cicd-pipeline': cicdPipelineWorkflow,
|
|
1029
1026
|
'code-review': codeReviewWorkflow,
|
|
1030
1027
|
'incident-response': incidentResponseWorkflow,
|
|
1031
|
-
'data-pipeline': dataPipelineWorkflow
|
|
1028
|
+
'data-pipeline': dataPipelineWorkflow,
|
|
1032
1029
|
};
|
|
1033
1030
|
|
|
1034
1031
|
const template = templates[templateName];
|
|
@@ -1048,7 +1045,7 @@ function createWorkflowFromTemplate(templateName, customizations = {}) {
|
|
|
1048
1045
|
outputs: customizations.outputs || template.outputs,
|
|
1049
1046
|
errorHandling: customizations.errorHandling || template.errorHandling,
|
|
1050
1047
|
timeout: customizations.timeout || template.timeout,
|
|
1051
|
-
retryPolicy: customizations.retryPolicy || template.retryPolicy
|
|
1048
|
+
retryPolicy: customizations.retryPolicy || template.retryPolicy,
|
|
1052
1049
|
}
|
|
1053
1050
|
);
|
|
1054
1051
|
|
|
@@ -1062,11 +1059,11 @@ module.exports = {
|
|
|
1062
1059
|
codeReviewWorkflow,
|
|
1063
1060
|
incidentResponseWorkflow,
|
|
1064
1061
|
dataPipelineWorkflow,
|
|
1065
|
-
|
|
1062
|
+
|
|
1066
1063
|
// Factory
|
|
1067
1064
|
createWorkflowFromTemplate,
|
|
1068
|
-
|
|
1065
|
+
|
|
1069
1066
|
// Re-export types
|
|
1070
1067
|
StepType,
|
|
1071
|
-
RecoveryStrategy
|
|
1068
|
+
RecoveryStrategy,
|
|
1072
1069
|
};
|