musubi-sdd 5.1.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 +158 -146
- package/src/analyzers/codegraph-auto-update.js +858 -0
- package/src/analyzers/complexity-analyzer.js +536 -0
- package/src/analyzers/context-optimizer.js +241 -126
- package/src/analyzers/impact-analyzer.js +1 -1
- package/src/analyzers/large-project-analyzer.js +766 -0
- package/src/analyzers/repository-map.js +77 -81
- 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 +48 -46
- package/src/monitoring/incident-manager.js +116 -106
- package/src/monitoring/index.js +144 -134
- package/src/monitoring/observability.js +75 -62
- package/src/monitoring/quality-dashboard.js +45 -41
- package/src/monitoring/release-manager.js +63 -53
- 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,18 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phase 5 Integration Module
|
|
3
3
|
* Advanced Features統合エンジン
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
5
|
* @module phase5-integration
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const EventEmitter = require('events');
|
|
9
9
|
|
|
10
10
|
// Phase 5 modules
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const {
|
|
12
|
+
SteeringAutoUpdate,
|
|
13
|
+
createSteeringAutoUpdate,
|
|
14
|
+
TRIGGER,
|
|
15
|
+
STEERING_TYPE,
|
|
16
|
+
} = require('./steering/steering-auto-update');
|
|
17
|
+
const {
|
|
18
|
+
SteeringValidator,
|
|
19
|
+
createSteeringValidator,
|
|
20
|
+
SEVERITY,
|
|
21
|
+
RULE_TYPE,
|
|
22
|
+
} = require('./steering/steering-validator');
|
|
23
|
+
const {
|
|
24
|
+
TemplateConstraints,
|
|
25
|
+
ThinkingChecklist,
|
|
26
|
+
createTemplateConstraints,
|
|
27
|
+
createThinkingChecklist,
|
|
28
|
+
CONSTRAINT_TYPE,
|
|
29
|
+
UNCERTAINTY,
|
|
30
|
+
MARKER_TYPE,
|
|
31
|
+
} = require('./templates/template-constraints');
|
|
32
|
+
const {
|
|
33
|
+
QualityDashboard,
|
|
34
|
+
createQualityDashboard,
|
|
35
|
+
METRIC_CATEGORY,
|
|
36
|
+
HEALTH_STATUS,
|
|
37
|
+
CONSTITUTIONAL_ARTICLES,
|
|
38
|
+
} = require('./monitoring/quality-dashboard');
|
|
39
|
+
const {
|
|
40
|
+
AdvancedValidation,
|
|
41
|
+
createAdvancedValidation,
|
|
42
|
+
VALIDATION_TYPE,
|
|
43
|
+
ARTIFACT_TYPE,
|
|
44
|
+
GAP_SEVERITY,
|
|
45
|
+
} = require('./validators/advanced-validation');
|
|
46
|
+
const {
|
|
47
|
+
CodeGraphAutoUpdate,
|
|
48
|
+
createCodeGraphAutoUpdate,
|
|
49
|
+
TRIGGER: CODEGRAPH_TRIGGER,
|
|
50
|
+
TARGET: CODEGRAPH_TARGET,
|
|
51
|
+
} = require('./analyzers/codegraph-auto-update');
|
|
16
52
|
|
|
17
53
|
/**
|
|
18
54
|
* Phase 5 integration status
|
|
@@ -22,7 +58,7 @@ const INTEGRATION_STATUS = {
|
|
|
22
58
|
READY: 'ready',
|
|
23
59
|
RUNNING: 'running',
|
|
24
60
|
STOPPED: 'stopped',
|
|
25
|
-
ERROR: 'error'
|
|
61
|
+
ERROR: 'error',
|
|
26
62
|
};
|
|
27
63
|
|
|
28
64
|
/**
|
|
@@ -37,6 +73,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
37
73
|
* @param {Object} options.templates - Template constraints options
|
|
38
74
|
* @param {Object} options.dashboard - Quality dashboard options
|
|
39
75
|
* @param {Object} options.validation - Advanced validation options
|
|
76
|
+
* @param {Object} options.codegraph - CodeGraph auto-update options
|
|
40
77
|
*/
|
|
41
78
|
constructor(options = {}) {
|
|
42
79
|
super();
|
|
@@ -50,6 +87,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
50
87
|
this.templateConstraints = createTemplateConstraints(options.templates || {});
|
|
51
88
|
this.qualityDashboard = createQualityDashboard(options.dashboard || {});
|
|
52
89
|
this.advancedValidation = createAdvancedValidation(options.validation || {});
|
|
90
|
+
this.codeGraphAutoUpdate = createCodeGraphAutoUpdate(options.codegraph || {});
|
|
53
91
|
|
|
54
92
|
// Thinking checklist
|
|
55
93
|
this.thinkingChecklist = createThinkingChecklist();
|
|
@@ -66,12 +104,12 @@ class Phase5Integration extends EventEmitter {
|
|
|
66
104
|
*/
|
|
67
105
|
setupEventHandlers() {
|
|
68
106
|
// When steering is updated, validate it
|
|
69
|
-
this.steeringAutoUpdate.on('update-applied',
|
|
107
|
+
this.steeringAutoUpdate.on('update-applied', update => {
|
|
70
108
|
this.emit('steering-updated', update);
|
|
71
109
|
});
|
|
72
110
|
|
|
73
111
|
// When quality is collected, check thresholds
|
|
74
|
-
this.qualityDashboard.on('collected',
|
|
112
|
+
this.qualityDashboard.on('collected', snapshot => {
|
|
75
113
|
const health = this.qualityDashboard.getHealthSummary();
|
|
76
114
|
if (health.status === HEALTH_STATUS.CRITICAL || health.status === HEALTH_STATUS.FAILING) {
|
|
77
115
|
this.emit('health-alert', { status: health.status, snapshot });
|
|
@@ -79,18 +117,28 @@ class Phase5Integration extends EventEmitter {
|
|
|
79
117
|
});
|
|
80
118
|
|
|
81
119
|
// When validation finds issues, emit alerts
|
|
82
|
-
this.advancedValidation.on('validated',
|
|
120
|
+
this.advancedValidation.on('validated', result => {
|
|
83
121
|
if (!result.valid) {
|
|
84
122
|
this.emit('validation-alert', result);
|
|
85
123
|
}
|
|
86
124
|
});
|
|
87
125
|
|
|
88
126
|
// When gaps are detected, emit alerts
|
|
89
|
-
this.advancedValidation.on('gaps-detected',
|
|
127
|
+
this.advancedValidation.on('gaps-detected', result => {
|
|
90
128
|
if (result.criticalGaps > 0) {
|
|
91
129
|
this.emit('gap-alert', result);
|
|
92
130
|
}
|
|
93
131
|
});
|
|
132
|
+
|
|
133
|
+
// When codegraph is updated, emit events
|
|
134
|
+
this.codeGraphAutoUpdate.on('update-complete', result => {
|
|
135
|
+
this.emit('codegraph-updated', result);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// When codegraph has errors, emit alerts
|
|
139
|
+
this.codeGraphAutoUpdate.on('update-error', error => {
|
|
140
|
+
this.emit('codegraph-error', error);
|
|
141
|
+
});
|
|
94
142
|
}
|
|
95
143
|
|
|
96
144
|
/**
|
|
@@ -105,7 +153,8 @@ class Phase5Integration extends EventEmitter {
|
|
|
105
153
|
templateConstraints: this.templateConstraints,
|
|
106
154
|
qualityDashboard: this.qualityDashboard,
|
|
107
155
|
advancedValidation: this.advancedValidation,
|
|
108
|
-
thinkingChecklist: this.thinkingChecklist
|
|
156
|
+
thinkingChecklist: this.thinkingChecklist,
|
|
157
|
+
codeGraphAutoUpdate: this.codeGraphAutoUpdate,
|
|
109
158
|
};
|
|
110
159
|
return components[name] || null;
|
|
111
160
|
}
|
|
@@ -139,7 +188,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
139
188
|
metrics,
|
|
140
189
|
validation,
|
|
141
190
|
overallScore,
|
|
142
|
-
recommendations: this.generateRecommendations(health, validation)
|
|
191
|
+
recommendations: this.generateRecommendations(health, validation),
|
|
143
192
|
};
|
|
144
193
|
|
|
145
194
|
this.status = INTEGRATION_STATUS.READY;
|
|
@@ -158,8 +207,9 @@ class Phase5Integration extends EventEmitter {
|
|
|
158
207
|
*/
|
|
159
208
|
calculateOverallScore(metrics, validation) {
|
|
160
209
|
const healthScore = metrics.health?.overall ?? 0;
|
|
161
|
-
const validationScore = validation.valid
|
|
162
|
-
|
|
210
|
+
const validationScore = validation.valid
|
|
211
|
+
? 100
|
|
212
|
+
: Math.max(0, 100 - validation.criticalIssues * 20 - validation.totalIssues * 5);
|
|
163
213
|
|
|
164
214
|
return Math.round((healthScore + validationScore) / 2);
|
|
165
215
|
}
|
|
@@ -176,7 +226,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
176
226
|
type: 'coverage',
|
|
177
227
|
priority: 'high',
|
|
178
228
|
message: 'Increase test coverage to improve project health',
|
|
179
|
-
currentScore: health.breakdown.coverage.score
|
|
229
|
+
currentScore: health.breakdown.coverage.score,
|
|
180
230
|
});
|
|
181
231
|
}
|
|
182
232
|
|
|
@@ -185,7 +235,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
185
235
|
type: 'constitutional',
|
|
186
236
|
priority: 'high',
|
|
187
237
|
message: 'Review constitutional compliance for all articles',
|
|
188
|
-
currentScore: health.breakdown.constitutional.score
|
|
238
|
+
currentScore: health.breakdown.constitutional.score,
|
|
189
239
|
});
|
|
190
240
|
}
|
|
191
241
|
|
|
@@ -195,7 +245,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
195
245
|
type: 'gaps',
|
|
196
246
|
priority: validation.gaps.criticalGaps > 0 ? 'critical' : 'medium',
|
|
197
247
|
message: `Address ${validation.gaps.gapCount} specification gaps`,
|
|
198
|
-
details: validation.gaps.gaps.slice(0, 5)
|
|
248
|
+
details: validation.gaps.gaps.slice(0, 5),
|
|
199
249
|
});
|
|
200
250
|
}
|
|
201
251
|
|
|
@@ -204,7 +254,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
204
254
|
type: 'traceability',
|
|
205
255
|
priority: 'medium',
|
|
206
256
|
message: 'Improve traceability coverage between artifacts',
|
|
207
|
-
currentCoverage: validation.traceability.coverage
|
|
257
|
+
currentCoverage: validation.traceability.coverage,
|
|
208
258
|
});
|
|
209
259
|
}
|
|
210
260
|
|
|
@@ -224,13 +274,14 @@ class Phase5Integration extends EventEmitter {
|
|
|
224
274
|
}
|
|
225
275
|
|
|
226
276
|
const overallValid = Object.values(results).every(r => r.valid);
|
|
227
|
-
const avgScore =
|
|
277
|
+
const avgScore =
|
|
278
|
+
Object.values(results).reduce((sum, r) => sum + r.score, 0) / Object.keys(results).length;
|
|
228
279
|
|
|
229
280
|
return {
|
|
230
281
|
valid: overallValid,
|
|
231
282
|
files: results,
|
|
232
283
|
avgScore: Math.round(avgScore),
|
|
233
|
-
timestamp: new Date().toISOString()
|
|
284
|
+
timestamp: new Date().toISOString(),
|
|
234
285
|
};
|
|
235
286
|
}
|
|
236
287
|
|
|
@@ -254,26 +305,26 @@ class Phase5Integration extends EventEmitter {
|
|
|
254
305
|
components: {
|
|
255
306
|
steeringAutoUpdate: {
|
|
256
307
|
rules: this.steeringAutoUpdate.rules?.length ?? 0,
|
|
257
|
-
history: this.steeringAutoUpdate.updateHistory?.length ?? 0
|
|
308
|
+
history: this.steeringAutoUpdate.updateHistory?.length ?? 0,
|
|
258
309
|
},
|
|
259
310
|
steeringValidator: {
|
|
260
311
|
rules: this.steeringValidator.rules?.size ?? 0,
|
|
261
|
-
history: this.steeringValidator.history?.length ?? 0
|
|
312
|
+
history: this.steeringValidator.history?.length ?? 0,
|
|
262
313
|
},
|
|
263
314
|
templateConstraints: {
|
|
264
315
|
templates: Object.keys(this.templateConstraints.templates).length,
|
|
265
|
-
history: this.templateConstraints.validationHistory?.length ?? 0
|
|
316
|
+
history: this.templateConstraints.validationHistory?.length ?? 0,
|
|
266
317
|
},
|
|
267
318
|
qualityDashboard: {
|
|
268
319
|
metrics: this.qualityDashboard.metrics?.size ?? 0,
|
|
269
|
-
history: this.qualityDashboard.history?.length ?? 0
|
|
320
|
+
history: this.qualityDashboard.history?.length ?? 0,
|
|
270
321
|
},
|
|
271
322
|
advancedValidation: {
|
|
272
323
|
artifacts: this.advancedValidation.artifacts?.size ?? 0,
|
|
273
|
-
links: this.advancedValidation.countLinks?.() ?? 0
|
|
274
|
-
}
|
|
324
|
+
links: this.advancedValidation.countLinks?.() ?? 0,
|
|
325
|
+
},
|
|
275
326
|
},
|
|
276
|
-
timestamp: new Date().toISOString()
|
|
327
|
+
timestamp: new Date().toISOString(),
|
|
277
328
|
};
|
|
278
329
|
}
|
|
279
330
|
|
|
@@ -328,7 +379,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
328
379
|
this.qualityDashboard.clear();
|
|
329
380
|
this.advancedValidation.clear();
|
|
330
381
|
this.thinkingChecklist.reset();
|
|
331
|
-
|
|
382
|
+
|
|
332
383
|
this.status = INTEGRATION_STATUS.READY;
|
|
333
384
|
this.emit('reset');
|
|
334
385
|
}
|
|
@@ -338,6 +389,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
338
389
|
*/
|
|
339
390
|
start() {
|
|
340
391
|
this.qualityDashboard.startAutoCollection();
|
|
392
|
+
this.codeGraphAutoUpdate.start();
|
|
341
393
|
this.status = INTEGRATION_STATUS.RUNNING;
|
|
342
394
|
this.emit('started');
|
|
343
395
|
}
|
|
@@ -347,6 +399,7 @@ class Phase5Integration extends EventEmitter {
|
|
|
347
399
|
*/
|
|
348
400
|
stop() {
|
|
349
401
|
this.qualityDashboard.stopAutoCollection();
|
|
402
|
+
this.codeGraphAutoUpdate.stop();
|
|
350
403
|
this.status = INTEGRATION_STATUS.STOPPED;
|
|
351
404
|
this.emit('stopped');
|
|
352
405
|
}
|
|
@@ -398,5 +451,11 @@ module.exports = {
|
|
|
398
451
|
createAdvancedValidation,
|
|
399
452
|
VALIDATION_TYPE,
|
|
400
453
|
ARTIFACT_TYPE,
|
|
401
|
-
GAP_SEVERITY
|
|
454
|
+
GAP_SEVERITY,
|
|
455
|
+
|
|
456
|
+
// Re-export Sprint 5.5: CodeGraph Auto-Update
|
|
457
|
+
CodeGraphAutoUpdate,
|
|
458
|
+
createCodeGraphAutoUpdate,
|
|
459
|
+
CODEGRAPH_TRIGGER,
|
|
460
|
+
CODEGRAPH_TARGET,
|
|
402
461
|
};
|
|
@@ -90,10 +90,18 @@ class CoverageReporter {
|
|
|
90
90
|
lines.push('-'.repeat(30));
|
|
91
91
|
lines.push(`Total Requirements: ${coverage.totalRequirements}`);
|
|
92
92
|
lines.push('');
|
|
93
|
-
lines.push(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
lines.push(
|
|
93
|
+
lines.push(
|
|
94
|
+
`Design Coverage: ${this.formatBar(coverage.designCoverage)} ${coverage.designCoverage}%`
|
|
95
|
+
);
|
|
96
|
+
lines.push(
|
|
97
|
+
`Tasks Coverage: ${this.formatBar(coverage.tasksCoverage)} ${coverage.tasksCoverage}%`
|
|
98
|
+
);
|
|
99
|
+
lines.push(
|
|
100
|
+
`Code Coverage: ${this.formatBar(coverage.codeCoverage)} ${coverage.codeCoverage}%`
|
|
101
|
+
);
|
|
102
|
+
lines.push(
|
|
103
|
+
`Test Coverage: ${this.formatBar(coverage.testsCoverage)} ${coverage.testsCoverage}%`
|
|
104
|
+
);
|
|
97
105
|
lines.push('-'.repeat(30));
|
|
98
106
|
lines.push(`OVERALL: ${this.formatBar(coverage.overall)} ${coverage.overall}%`);
|
|
99
107
|
lines.push('');
|
|
@@ -129,7 +137,7 @@ class CoverageReporter {
|
|
|
129
137
|
*/
|
|
130
138
|
formatMarkdown(data) {
|
|
131
139
|
const lines = [];
|
|
132
|
-
const { coverage, gaps, matrix } = data;
|
|
140
|
+
const { coverage, gaps, matrix: _matrix } = data;
|
|
133
141
|
|
|
134
142
|
lines.push('# Traceability Coverage Report');
|
|
135
143
|
lines.push('');
|
|
@@ -137,7 +145,12 @@ class CoverageReporter {
|
|
|
137
145
|
lines.push('');
|
|
138
146
|
|
|
139
147
|
// Overall status
|
|
140
|
-
const status =
|
|
148
|
+
const status =
|
|
149
|
+
coverage.overall >= 80
|
|
150
|
+
? '✅ Good'
|
|
151
|
+
: coverage.overall >= 60
|
|
152
|
+
? '⚠️ Needs Improvement'
|
|
153
|
+
: '❌ Critical';
|
|
141
154
|
lines.push(`## Overall Status: ${status}`);
|
|
142
155
|
lines.push('');
|
|
143
156
|
|
|
@@ -146,32 +159,55 @@ class CoverageReporter {
|
|
|
146
159
|
lines.push('');
|
|
147
160
|
lines.push('| Category | Covered | Total | Coverage |');
|
|
148
161
|
lines.push('|----------|---------|-------|----------|');
|
|
149
|
-
lines.push(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
lines.push(
|
|
153
|
-
|
|
162
|
+
lines.push(
|
|
163
|
+
`| Design | ${coverage.withDesign} | ${coverage.totalRequirements} | ${this.formatProgressBar(coverage.designCoverage)} ${coverage.designCoverage}% |`
|
|
164
|
+
);
|
|
165
|
+
lines.push(
|
|
166
|
+
`| Tasks | ${coverage.withTasks} | ${coverage.totalRequirements} | ${this.formatProgressBar(coverage.tasksCoverage)} ${coverage.tasksCoverage}% |`
|
|
167
|
+
);
|
|
168
|
+
lines.push(
|
|
169
|
+
`| Code | ${coverage.withCode} | ${coverage.totalRequirements} | ${this.formatProgressBar(coverage.codeCoverage)} ${coverage.codeCoverage}% |`
|
|
170
|
+
);
|
|
171
|
+
lines.push(
|
|
172
|
+
`| Tests | ${coverage.withTests} | ${coverage.totalRequirements} | ${this.formatProgressBar(coverage.testsCoverage)} ${coverage.testsCoverage}% |`
|
|
173
|
+
);
|
|
174
|
+
lines.push(
|
|
175
|
+
`| **Overall** | - | - | ${this.formatProgressBar(coverage.overall)} **${coverage.overall}%** |`
|
|
176
|
+
);
|
|
154
177
|
lines.push('');
|
|
155
178
|
|
|
156
179
|
// Gaps
|
|
157
180
|
if (gaps) {
|
|
158
181
|
lines.push('## Gaps Analysis');
|
|
159
182
|
lines.push('');
|
|
160
|
-
|
|
161
|
-
const totalGaps =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
183
|
+
|
|
184
|
+
const totalGaps =
|
|
185
|
+
gaps.orphanedRequirements.length +
|
|
186
|
+
gaps.orphanedDesign.length +
|
|
187
|
+
gaps.orphanedTasks.length +
|
|
188
|
+
gaps.untestedCode.length +
|
|
189
|
+
gaps.missingTests.length;
|
|
190
|
+
|
|
165
191
|
lines.push(`**Total Gaps Found**: ${totalGaps}`);
|
|
166
192
|
lines.push('');
|
|
167
193
|
|
|
168
194
|
lines.push('| Gap Type | Count | Status |');
|
|
169
195
|
lines.push('|----------|-------|--------|');
|
|
170
|
-
lines.push(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
lines.push(
|
|
174
|
-
|
|
196
|
+
lines.push(
|
|
197
|
+
`| Orphaned Requirements | ${gaps.orphanedRequirements.length} | ${gaps.orphanedRequirements.length === 0 ? '✅' : '⚠️'} |`
|
|
198
|
+
);
|
|
199
|
+
lines.push(
|
|
200
|
+
`| Orphaned Design | ${gaps.orphanedDesign.length} | ${gaps.orphanedDesign.length === 0 ? '✅' : '⚠️'} |`
|
|
201
|
+
);
|
|
202
|
+
lines.push(
|
|
203
|
+
`| Orphaned Tasks | ${gaps.orphanedTasks.length} | ${gaps.orphanedTasks.length === 0 ? '✅' : '⚠️'} |`
|
|
204
|
+
);
|
|
205
|
+
lines.push(
|
|
206
|
+
`| Untested Code | ${gaps.untestedCode.length} | ${gaps.untestedCode.length === 0 ? '✅' : '⚠️'} |`
|
|
207
|
+
);
|
|
208
|
+
lines.push(
|
|
209
|
+
`| Missing Tests | ${gaps.missingTests.length} | ${gaps.missingTests.length === 0 ? '✅' : '❌'} |`
|
|
210
|
+
);
|
|
175
211
|
lines.push('');
|
|
176
212
|
|
|
177
213
|
// Show details for each gap type
|
|
@@ -217,19 +253,27 @@ class CoverageReporter {
|
|
|
217
253
|
// Recommendations
|
|
218
254
|
lines.push('## Recommendations');
|
|
219
255
|
lines.push('');
|
|
220
|
-
|
|
256
|
+
|
|
221
257
|
if (coverage.overall < 100) {
|
|
222
258
|
if (coverage.testsCoverage < 80) {
|
|
223
|
-
lines.push(
|
|
259
|
+
lines.push(
|
|
260
|
+
'1. 🧪 **Increase test coverage**: Add tests for requirements that are missing test links'
|
|
261
|
+
);
|
|
224
262
|
}
|
|
225
263
|
if (coverage.designCoverage < 80) {
|
|
226
|
-
lines.push(
|
|
264
|
+
lines.push(
|
|
265
|
+
'2. 📐 **Complete design documentation**: Link requirements to design documents'
|
|
266
|
+
);
|
|
227
267
|
}
|
|
228
268
|
if (coverage.codeCoverage < 80) {
|
|
229
|
-
lines.push(
|
|
269
|
+
lines.push(
|
|
270
|
+
'3. 💻 **Link code to requirements**: Add requirement references in code comments'
|
|
271
|
+
);
|
|
230
272
|
}
|
|
231
273
|
if (gaps && gaps.orphanedRequirements.length > 0) {
|
|
232
|
-
lines.push(
|
|
274
|
+
lines.push(
|
|
275
|
+
'4. 🔗 **Address orphaned requirements**: Link them to design, tasks, or remove if obsolete'
|
|
276
|
+
);
|
|
233
277
|
}
|
|
234
278
|
} else {
|
|
235
279
|
lines.push('✅ Excellent! Full traceability coverage achieved.');
|
|
@@ -360,7 +404,9 @@ class CoverageReporter {
|
|
|
360
404
|
</table>
|
|
361
405
|
</div>
|
|
362
406
|
|
|
363
|
-
${
|
|
407
|
+
${
|
|
408
|
+
gaps
|
|
409
|
+
? `
|
|
364
410
|
<div class="card">
|
|
365
411
|
<h2>Gaps Analysis</h2>
|
|
366
412
|
<table>
|
|
@@ -396,17 +442,23 @@ class CoverageReporter {
|
|
|
396
442
|
</tr>
|
|
397
443
|
</table>
|
|
398
444
|
</div>
|
|
399
|
-
`
|
|
445
|
+
`
|
|
446
|
+
: ''
|
|
447
|
+
}
|
|
400
448
|
|
|
401
449
|
<div class="card">
|
|
402
450
|
<h2>Recommendations</h2>
|
|
403
451
|
<ul>
|
|
404
|
-
${
|
|
452
|
+
${
|
|
453
|
+
coverage.overall < 100
|
|
454
|
+
? `
|
|
405
455
|
${coverage.testsCoverage < 80 ? '<li>🧪 <strong>Increase test coverage</strong>: Add tests for requirements that are missing test links</li>' : ''}
|
|
406
456
|
${coverage.designCoverage < 80 ? '<li>📐 <strong>Complete design documentation</strong>: Link requirements to design documents</li>' : ''}
|
|
407
457
|
${coverage.codeCoverage < 80 ? '<li>💻 <strong>Link code to requirements</strong>: Add requirement references in code comments</li>' : ''}
|
|
408
458
|
${gaps && gaps.orphanedRequirements.length > 0 ? '<li>🔗 <strong>Address orphaned requirements</strong>: Link them to design, tasks, or remove if obsolete</li>' : ''}
|
|
409
|
-
`
|
|
459
|
+
`
|
|
460
|
+
: '<li>✅ Excellent! Full traceability coverage achieved.</li>'
|
|
461
|
+
}
|
|
410
462
|
</ul>
|
|
411
463
|
</div>
|
|
412
464
|
|