musubix 3.4.7 → 3.5.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.
Files changed (95) hide show
  1. package/README.md +50 -315
  2. package/bin/musubix.js +1 -9
  3. package/dist/index.d.ts +25 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +74 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +52 -58
  8. package/.github/AGENTS.md +0 -949
  9. package/.github/prompts/sdd-change-apply.prompt.md +0 -283
  10. package/.github/prompts/sdd-change-archive.prompt.md +0 -241
  11. package/.github/prompts/sdd-change-init.prompt.md +0 -269
  12. package/.github/prompts/sdd-design.prompt.md +0 -250
  13. package/.github/prompts/sdd-implement.prompt.md +0 -387
  14. package/.github/prompts/sdd-requirements.prompt.md +0 -193
  15. package/.github/prompts/sdd-review.prompt.md +0 -155
  16. package/.github/prompts/sdd-security.prompt.md +0 -228
  17. package/.github/prompts/sdd-steering.prompt.md +0 -269
  18. package/.github/prompts/sdd-tasks.prompt.md +0 -255
  19. package/.github/prompts/sdd-test.prompt.md +0 -230
  20. package/.github/prompts/sdd-validate.prompt.md +0 -304
  21. package/.github/skills/musubix-adr-generation/SKILL.md +0 -209
  22. package/.github/skills/musubix-best-practices/SKILL.md +0 -315
  23. package/.github/skills/musubix-c4-design/SKILL.md +0 -162
  24. package/.github/skills/musubix-code-generation/SKILL.md +0 -237
  25. package/.github/skills/musubix-domain-inference/SKILL.md +0 -196
  26. package/.github/skills/musubix-ears-validation/SKILL.md +0 -161
  27. package/.github/skills/musubix-sdd-workflow/SKILL.md +0 -217
  28. package/.github/skills/musubix-technical-writing/SKILL.md +0 -444
  29. package/.github/skills/musubix-test-generation/SKILL.md +0 -212
  30. package/.github/skills/musubix-traceability/SKILL.md +0 -141
  31. package/AGENTS.md +0 -1134
  32. package/LICENSE +0 -21
  33. package/README.ja.md +0 -313
  34. package/bin/musubix-mcp.js +0 -15
  35. package/docs/API-REFERENCE.md +0 -1425
  36. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +0 -132
  37. package/docs/INSTALL-GUIDE.ja.md +0 -459
  38. package/docs/INSTALL-GUIDE.md +0 -459
  39. package/docs/MIGRATION-v3.0.md +0 -324
  40. package/docs/MUSUBI-enhancement_roadmap_20260105.md +0 -651
  41. package/docs/MUSUBIX-v3.0-User-Guide.md +0 -1357
  42. package/docs/MUSUBIXv2.2.0-Manual-outline.md +0 -136
  43. package/docs/MUSUBIXv2.2.0-Manual.md +0 -3123
  44. package/docs/MUSUBIXv2.3.5-Refactering.md +0 -1310
  45. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
  46. package/docs/MUSUBIv2.2.0-USERGUIDE.md +0 -2079
  47. package/docs/ROADMAP-v1.5.md +0 -116
  48. package/docs/SwarmCoding.md +0 -1284
  49. package/docs/Test-prompt.md +0 -105
  50. package/docs/USER-GUIDE-v1.8.0.md +0 -2371
  51. package/docs/USER-GUIDE.ja.md +0 -2147
  52. package/docs/USER-GUIDE.md +0 -3022
  53. package/docs/YATA-GLOBAL-GUIDE.ja.md +0 -750
  54. package/docs/YATA-GLOBAL-GUIDE.md +0 -595
  55. package/docs/YATA-LOCAL-GUIDE.ja.md +0 -989
  56. package/docs/YATA-LOCAL-GUIDE.md +0 -730
  57. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
  58. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
  59. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
  60. package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +0 -217
  61. package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +0 -308
  62. package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +0 -475
  63. package/docs/enterprise-knowledge-management.md +0 -1737
  64. package/docs/evolution-from-musubi-to-musubix.md +0 -2170
  65. package/docs/getting-started-with-sdd.md +0 -1602
  66. package/docs/moodle-refactering-codegraph-musubix.md +0 -391
  67. package/docs/moodle-refactering-codegraph.md +0 -278
  68. package/docs/overview/MUSUBIX-CodeGraph.md +0 -322
  69. package/docs/overview/MUSUBIX-Core.md +0 -671
  70. package/docs/overview/MUSUBIX-Decisions.md +0 -494
  71. package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
  72. package/docs/overview/MUSUBIX-Knowledge.md +0 -1231
  73. package/docs/overview/MUSUBIX-Learning.md +0 -837
  74. package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
  75. package/docs/overview/MUSUBIX-Overview.md +0 -264
  76. package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
  77. package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
  78. package/docs/overview/MUSUBIX-Policy.md +0 -477
  79. package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
  80. package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
  81. package/docs/overview/MUSUBIX-Security-v2.1.md +0 -668
  82. package/docs/overview/MUSUBIX-Security.md +0 -891
  83. package/docs/overview/MUSUBIX-YATA.md +0 -666
  84. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +0 -513
  85. package/docs/overview/Neuro-SymbolicAI.md +0 -159
  86. package/docs/packages/knowledge.md +0 -594
  87. package/docs/qiita-linux-kernel-knowledge-graph.md +0 -596
  88. package/scripts/generate-quality-gate-report.ts +0 -106
  89. package/scripts/postinstall.js +0 -94
  90. package/steering/.musubi-version +0 -1
  91. package/steering/product.ja.md +0 -572
  92. package/steering/project.yml +0 -66
  93. package/steering/rules/constitution.md +0 -491
  94. package/steering/structure.ja.md +0 -503
  95. package/steering/tech.ja.md +0 -208
@@ -1,651 +0,0 @@
1
- # MUSUBIX改善提案とMCP開発ロードマップ
2
-
3
- ## エグゼクティブサマリー
4
-
5
- 調査により、Neuro-Symbolic AIのソフトウェア開発ツールへの実用化において**6つの主要な統合パターン**が識別された。MUSUBIXは現在「**Symbolic→Neural Context Augmentation(記号的コンテキスト補強型)**」を主に採用しているが、より深い統合を実現するために以下の3つの戦略的方向性を提案する:
6
-
7
- 1. **形式検証ループ型の導入**(AlphaProof/LeanDojo型)
8
- 2. **生成→フィルター型の強化**(Snyk DeepCode AI型)
9
- 3. **微分可能記号推論の実験的導入**(IBM LNN型)
10
-
11
- これらを実現するための**5つの新規MCPサーバー**と**3つのコア改善**を提案する。
12
-
13
- ---
14
-
15
- ## 第1部:現状分析と改善の必要性
16
-
17
- ### MUSUBIXの現在の技術的位置づけ
18
-
19
- | 評価項目 | 現状レベル | 先行事例との比較 |
20
- |---------|-----------|----------------|
21
- | 記号的推論 | ★★★★☆ | 9条憲法、EARS形式(IBM LNNの論理統合には及ばない) |
22
- | GraphRAG | ★★★★☆ | YATA知識グラフ(GraphGen4Codeの20億トリプルには及ばない) |
23
- | 形式検証統合 | ★★☆☆☆ | 静的解析のみ(LeanDojo型の形式証明ループなし) |
24
- | LLM生成検証 | ★★★☆☆ | Constitution検証(Snyk型のセマンティック検証なし) |
25
- | 継続学習 | ★★★★☆ | Project Memory(DreamCoder型のライブラリ学習なし) |
26
-
27
- ### 改善により得られる価値
28
-
29
- 1. **品質保証の数学的厳密化**: 生成コードの形式検証による「証明付きコード」
30
- 2. **ハルシネーション削減**: 記号的フィルタリングによる誤り検出率向上
31
- 3. **学習効率向上**: 抽象パターンの自動抽出による知識累積
32
- 4. **差別化強化**: AGI Codingツールとしての独自ポジション確立
33
-
34
- ---
35
-
36
- ## 第2部:推奨MCP開発ロードマップ
37
-
38
- ### MCP 1: Formal Verification MCP Server(形式検証MCP)
39
-
40
- **目的**: LLM生成コードに対する形式検証ループの実現
41
-
42
- **技術スタック**:
43
- - **SMTソルバー**: Z3(Microsoft)またはCVC5
44
- - **型検証**: TypeScript strict mode + Zod runtime validation
45
- - **契約検証**: Design by Contract (DbC) パターン
46
-
47
- **提供ツール**:
48
-
49
- ```typescript
50
- // MCP Tools
51
- {
52
- "verify_precondition": {
53
- "description": "関数の事前条件を検証",
54
- "input": { "code": "string", "preconditions": "EARS形式[]" },
55
- "output": { "valid": "boolean", "counterexample?": "string" }
56
- },
57
- "verify_postcondition": {
58
- "description": "関数の事後条件を検証",
59
- "input": { "code": "string", "postconditions": "EARS形式[]" },
60
- "output": { "valid": "boolean", "proof?": "string" }
61
- },
62
- "verify_invariant": {
63
- "description": "ループ不変条件・クラス不変条件を検証",
64
- "input": { "code": "string", "invariants": "EARS形式[]" },
65
- "output": { "valid": "boolean", "violations": "Location[]" }
66
- },
67
- "generate_verification_conditions": {
68
- "description": "コードから検証条件を自動生成",
69
- "input": { "code": "string", "spec": "EARS形式[]" },
70
- "output": { "vcs": "VerificationCondition[]" }
71
- }
72
- }
73
- ```
74
-
75
- **アーキテクチャ**:
76
-
77
- ```
78
- ┌─────────────────────────────────────────────────────────────┐
79
- │ Formal Verification MCP │
80
- ├─────────────────────────────────────────────────────────────┤
81
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
82
- │ │ EARS Parser │───▶│ VC Gen │───▶│ Z3 Solver │ │
83
- │ │ (要件→論理式)│ │ (検証条件生成)│ │ (充足判定) │ │
84
- │ └─────────────┘ └─────────────┘ └──────┬──────┘ │
85
- │ │ │ │
86
- │ ▼ ▼ │
87
- │ ┌─────────────────────────────────────────────────────┐ │
88
- │ │ Feedback Generator │ │
89
- │ │ • 反例からの修正提案 │ │
90
- │ │ • 証明成功時のドキュメント生成 │ │
91
- │ │ • MUSUBIX Constitution との整合性検証 │ │
92
- │ └─────────────────────────────────────────────────────┘ │
93
- └─────────────────────────────────────────────────────────────┘
94
- ```
95
-
96
- **期待効果**:
97
- - LLM生成コードの形式的正しさ保証
98
- - EARS要件からの自動検証条件生成
99
- - 反例に基づく具体的な修正指示
100
-
101
- **実装優先度**: ★★★★★(最高)
102
-
103
- ---
104
-
105
- ### MCP 2: Semantic Code Filter MCP Server(セマンティックフィルターMCP)
106
-
107
- **目的**: Snyk DeepCode AI型の「生成→記号検証→フィルター」パイプラインの実現
108
-
109
- **技術スタック**:
110
- - **静的解析**: ESLint/TypeScript Compiler API
111
- - **セキュリティ**: Semgrep + カスタムルール
112
- - **データフロー分析**: Tree-sitter + カスタムDFG
113
-
114
- **提供ツール**:
115
-
116
- ```typescript
117
- {
118
- "filter_generated_code": {
119
- "description": "LLM生成コードを記号ルールでフィルタリング",
120
- "input": {
121
- "candidates": "GeneratedCode[]",
122
- "requirements": "EARS形式[]",
123
- "constitution_articles": "Article[]"
124
- },
125
- "output": {
126
- "accepted": "GeneratedCode[]",
127
- "rejected": "{ code: GeneratedCode, reason: string }[]",
128
- "confidence_scores": "number[]"
129
- }
130
- },
131
- "detect_hallucination": {
132
- "description": "LLM生成の幻覚(存在しないAPI等)を検出",
133
- "input": { "code": "string", "project_context": "ProjectMemory" },
134
- "output": {
135
- "hallucinations": "{ type: string, location: Location, suggestion: string }[]"
136
- }
137
- },
138
- "verify_against_ears": {
139
- "description": "コードがEARS要件を満たすか検証",
140
- "input": { "code": "string", "ears_requirement": "EARS形式" },
141
- "output": {
142
- "satisfied": "boolean",
143
- "coverage": "number",
144
- "gaps": "string[]"
145
- }
146
- },
147
- "rank_by_quality": {
148
- "description": "複数候補を品質メトリクスでランキング",
149
- "input": { "candidates": "GeneratedCode[]", "weights": "QualityWeights" },
150
- "output": { "ranked": "{ code: GeneratedCode, score: number, breakdown: Metrics }[]" }
151
- }
152
- }
153
- ```
154
-
155
- **フィルタリングルール例**:
156
-
157
- ```yaml
158
- # constitution_rules.yaml
159
- rules:
160
- - id: CONST-001-library-first
161
- description: "Library-First Principle違反検出"
162
- pattern: |
163
- // 標準ライブラリで実現可能な自前実装を検出
164
- function $FUNC(...) { ... }
165
- condition: "exists_standard_library_alternative($FUNC)"
166
- severity: warning
167
-
168
- - id: CONST-002-test-first
169
- description: "Test-First Imperative違反検出"
170
- pattern: |
171
- // テストなしの実装を検出
172
- export function $FUNC(...) { ... }
173
- condition: "!exists_test_for($FUNC)"
174
- severity: error
175
-
176
- - id: CONST-003-ears-traceability
177
- description: "EARS要件へのトレーサビリティ欠如検出"
178
- pattern: |
179
- // @requirement タグのない公開関数
180
- export function $FUNC(...) { ... }
181
- condition: "!has_requirement_tag($FUNC)"
182
- severity: warning
183
- ```
184
-
185
- **期待効果**:
186
- - LLM生成結果の自動品質フィルタリング
187
- - Constitution違反の早期検出
188
- - 複数候補からの最適解選択
189
-
190
- **実装優先度**: ★★★★★(最高)
191
-
192
- ---
193
-
194
- ### MCP 3: Pattern Library Learning MCP Server(パターンライブラリ学習MCP)
195
-
196
- **目的**: DreamCoder型のWake-Sleep学習による抽象パターン自動抽出
197
-
198
- **技術スタック**:
199
- - **パターン抽出**: E-graph(egg-rs)またはTree-sitter
200
- - **類似度計算**: Code2Vec埋め込み
201
- - **クラスタリング**: HDBSCAN
202
-
203
- **提供ツール**:
204
-
205
- ```typescript
206
- {
207
- "extract_patterns": {
208
- "description": "コードベースから再利用可能なパターンを抽出",
209
- "input": { "codebase_path": "string", "min_occurrences": "number" },
210
- "output": {
211
- "patterns": "{
212
- id: string,
213
- abstraction: string,
214
- instances: Location[],
215
- frequency: number
216
- }[]"
217
- }
218
- },
219
- "suggest_abstraction": {
220
- "description": "類似コードから抽象化を提案",
221
- "input": { "code_snippets": "string[]" },
222
- "output": {
223
- "abstraction": "string",
224
- "parameters": "Parameter[]",
225
- "confidence": "number"
226
- }
227
- },
228
- "compress_library": {
229
- "description": "パターンライブラリを圧縮・最適化",
230
- "input": { "library": "PatternLibrary" },
231
- "output": {
232
- "optimized": "PatternLibrary",
233
- "removed_redundant": "Pattern[]",
234
- "merged": "{ from: Pattern[], to: Pattern }[]"
235
- }
236
- },
237
- "wake_sleep_cycle": {
238
- "description": "Wake-Sleep学習サイクルを実行",
239
- "input": {
240
- "task_examples": "{ input: any, output: any }[]",
241
- "current_library": "PatternLibrary"
242
- },
243
- "output": {
244
- "updated_library": "PatternLibrary",
245
- "new_patterns": "Pattern[]",
246
- "improved_solutions": "Solution[]"
247
- }
248
- }
249
- }
250
- ```
251
-
252
- **Wake-Sleepサイクル**:
253
-
254
- ```
255
- Wake Phase(覚醒フェーズ):
256
- ┌─────────────────────────────────────────────────────────┐
257
- │ 入力: タスク例 + 現在のパターンライブラリ │
258
- │ 処理: パターンを組み合わせてタスクを解決 │
259
- │ 出力: 解決策 + 使用パターンの統計 │
260
- └─────────────────────────────────────────────────────────┘
261
-
262
-
263
- Sleep Phase(睡眠フェーズ):
264
- ┌─────────────────────────────────────────────────────────┐
265
- │ 入力: 解決策の集合 │
266
- │ 処理: 共通パターンを抽出・抽象化 │
267
- │ 出力: 新規パターン + 更新されたライブラリ │
268
- └─────────────────────────────────────────────────────────┘
269
-
270
-
271
- 次のWake Phaseへ(反復)
272
- ```
273
-
274
- **期待効果**:
275
- - プロジェクト固有のパターンライブラリ自動構築
276
- - 類似コードの検出と抽象化提案
277
- - 継続的な知識累積と再利用
278
-
279
- **実装優先度**: ★★★★☆(高)
280
-
281
- ---
282
-
283
- ### MCP 4: Ontology Reasoning MCP Server(オントロジー推論MCP)
284
-
285
- **目的**: OWL/RDFベースの形式オントロジーによる深い意味推論
286
-
287
- **技術スタック**:
288
- - **オントロジー言語**: OWL 2 RL(推論可能サブセット)
289
- - **推論エンジン**: Apache JenaまたはRDFLib+OWL-RL
290
- - **クエリ**: SPARQL 1.1
291
-
292
- **提供ツール**:
293
-
294
- ```typescript
295
- {
296
- "define_domain_ontology": {
297
- "description": "ドメイン固有のオントロジーを定義",
298
- "input": {
299
- "concepts": "Concept[]",
300
- "relations": "Relation[]",
301
- "axioms": "Axiom[]"
302
- },
303
- "output": { "ontology_iri": "string", "validation_result": "ValidationResult" }
304
- },
305
- "infer_implications": {
306
- "description": "オントロジーから含意を推論",
307
- "input": { "facts": "Triple[]", "ontology_iri": "string" },
308
- "output": { "inferred": "Triple[]", "explanation": "ProofTree" }
309
- },
310
- "check_consistency": {
311
- "description": "知識ベースの一貫性をチェック",
312
- "input": { "knowledge_base": "Triple[]", "ontology_iri": "string" },
313
- "output": {
314
- "consistent": "boolean",
315
- "conflicts": "{ triples: Triple[], reason: string }[]"
316
- }
317
- },
318
- "map_requirements_to_ontology": {
319
- "description": "EARS要件をオントロジー概念にマッピング",
320
- "input": { "ears_requirements": "EARS形式[]", "ontology_iri": "string" },
321
- "output": {
322
- "mappings": "{ requirement: EARS形式, concepts: Concept[], relations: Relation[] }[]",
323
- "unmapped": "EARS形式[]"
324
- }
325
- },
326
- "query_knowledge": {
327
- "description": "SPARQLで知識をクエリ",
328
- "input": { "sparql": "string", "ontology_iri": "string" },
329
- "output": { "results": "QueryResult[]" }
330
- }
331
- }
332
- ```
333
-
334
- **ソフトウェア開発オントロジー例**:
335
-
336
- ```turtle
337
- @prefix sdd: <http://musubix.dev/ontology/sdd#> .
338
- @prefix ears: <http://musubix.dev/ontology/ears#> .
339
-
340
- # 概念階層
341
- sdd:Requirement a owl:Class .
342
- sdd:FunctionalRequirement rdfs:subClassOf sdd:Requirement .
343
- sdd:NonFunctionalRequirement rdfs:subClassOf sdd:Requirement .
344
-
345
- # EARS形式クラス
346
- ears:UbiquitousRequirement rdfs:subClassOf sdd:FunctionalRequirement .
347
- ears:EventDrivenRequirement rdfs:subClassOf sdd:FunctionalRequirement .
348
- ears:StateDrivenRequirement rdfs:subClassOf sdd:FunctionalRequirement .
349
-
350
- # 関係
351
- sdd:implements a owl:ObjectProperty ;
352
- rdfs:domain sdd:Component ;
353
- rdfs:range sdd:Requirement .
354
-
355
- sdd:dependsOn a owl:ObjectProperty, owl:TransitiveProperty ;
356
- rdfs:domain sdd:Component ;
357
- rdfs:range sdd:Component .
358
-
359
- # 公理(推論ルール)
360
- [ a owl:Restriction ;
361
- owl:onProperty sdd:implements ;
362
- owl:someValuesFrom sdd:SecurityRequirement
363
- ] rdfs:subClassOf sdd:SecureComponent .
364
- ```
365
-
366
- **期待効果**:
367
- - 要件間の暗黙的関係の自動発見
368
- - 知識ベースの一貫性保証
369
- - セマンティックな要件検索・分析
370
-
371
- **実装優先度**: ★★★☆☆(中)
372
-
373
- ---
374
-
375
- ### MCP 5: Confidence-Based Routing MCP Server(信頼度ルーティングMCP)
376
-
377
- **目的**: ニューラル出力の信頼度に基づく記号推論へのフォールバック制御
378
-
379
- **技術スタック**:
380
- - **信頼度推定**: Logit分析、Temperature Scaling
381
- - **ルーティング**: 閾値ベース + 強化学習(将来)
382
-
383
- **提供ツール**:
384
-
385
- ```typescript
386
- {
387
- "estimate_confidence": {
388
- "description": "LLM出力の信頼度を推定",
389
- "input": {
390
- "llm_output": "string",
391
- "logits?": "number[]",
392
- "context": "ProjectContext"
393
- },
394
- "output": {
395
- "overall_confidence": "number",
396
- "breakdown": {
397
- "syntactic": "number",
398
- "semantic": "number",
399
- "factual": "number",
400
- "consistency": "number"
401
- },
402
- "risk_factors": "string[]"
403
- }
404
- },
405
- "route_to_symbolic": {
406
- "description": "信頼度に基づいて記号推論にルーティング",
407
- "input": {
408
- "task": "Task",
409
- "neural_result": "NeuralOutput",
410
- "confidence_threshold": "number"
411
- },
412
- "output": {
413
- "routing_decision": "'accept' | 'symbolic_verify' | 'symbolic_regenerate'",
414
- "reason": "string",
415
- "symbolic_task?": "SymbolicTask"
416
- }
417
- },
418
- "blend_results": {
419
- "description": "ニューラルと記号結果をブレンド",
420
- "input": {
421
- "neural_result": "NeuralOutput",
422
- "symbolic_result": "SymbolicOutput",
423
- "blend_strategy": "'neural_priority' | 'symbolic_priority' | 'confidence_weighted'"
424
- },
425
- "output": {
426
- "blended": "BlendedOutput",
427
- "source_attribution": "{ neural: number, symbolic: number }"
428
- }
429
- }
430
- }
431
- ```
432
-
433
- **ルーティングロジック**:
434
-
435
- ```
436
- ┌─────────────────┐
437
- │ LLM Output │
438
- └────────┬────────┘
439
-
440
- ┌────────▼────────┐
441
- │ Confidence Est. │
442
- └────────┬────────┘
443
-
444
- ┌──────────────┼──────────────┐
445
- │ │ │
446
- confidence confidence confidence
447
- > 0.9 0.7 - 0.9 < 0.7
448
- │ │ │
449
- ▼ ▼ ▼
450
- ┌─────────┐ ┌───────────┐ ┌─────────────┐
451
- │ Accept │ │ Verify │ │ Regenerate │
452
- │ (採用) │ │ (記号検証)│ │ (記号再生成)│
453
- └─────────┘ └───────────┘ └─────────────┘
454
- ```
455
-
456
- **期待効果**:
457
- - LLMの過信によるエラー削減
458
- - リソース効率的な記号推論の活用
459
- - 適応的な品質制御
460
-
461
- **実装優先度**: ★★★★☆(高)
462
-
463
- ---
464
-
465
- ## 第3部:コア改善提案
466
-
467
- ### 改善1: EARS→形式仕様変換エンジン
468
-
469
- **現状**: EARSはセミフォーマルな自然言語テンプレート
470
-
471
- **改善**: EARSから形式論理式への自動変換
472
-
473
- ```typescript
474
- // 変換例
475
- const ears = "When user clicks login button, the system shall authenticate user within 3 seconds";
476
-
477
- const formalSpec = {
478
- trigger: { event: "user.click", target: "login_button" },
479
- postcondition: {
480
- action: "system.authenticate",
481
- constraint: { type: "temporal", operator: "<=", value: 3, unit: "seconds" }
482
- },
483
- ltl: "G(click(login_button) → F≤3s(authenticated))" // LTL式
484
- };
485
- ```
486
-
487
- ### 改善2: 双方向トレーサビリティの形式化
488
-
489
- **現状**: トレーサビリティはMarkdownリンク
490
-
491
- **改善**: グラフデータベースによる形式的トレーサビリティ
492
-
493
- ```typescript
494
- // Neo4j/Memgraphスキーマ例
495
- CREATE CONSTRAINT requirement_id ON (r:Requirement) ASSERT r.id IS UNIQUE;
496
- CREATE CONSTRAINT design_id ON (d:Design) ASSERT d.id IS UNIQUE;
497
- CREATE CONSTRAINT code_id ON (c:Code) ASSERT c.path IS UNIQUE;
498
- CREATE CONSTRAINT test_id ON (t:Test) ASSERT t.id IS UNIQUE;
499
-
500
- // 関係
501
- (r:Requirement)-[:DESIGNED_BY]->(d:Design)
502
- (d:Design)-[:IMPLEMENTED_BY]->(c:Code)
503
- (c:Code)-[:TESTED_BY]->(t:Test)
504
- (t:Test)-[:VERIFIES]->(r:Requirement)
505
-
506
- // クエリ例: 未検証要件の検出
507
- MATCH (r:Requirement)
508
- WHERE NOT (r)<-[:VERIFIES]-(:Test)
509
- RETURN r.id, r.description
510
- ```
511
-
512
- ### 改善3: Constitution強制エンジンの拡張
513
-
514
- **現状**: 9条憲法はドキュメントとして存在
515
-
516
- **改善**: 実行可能な形式ルールへの変換
517
-
518
- ```typescript
519
- // constitution_rules.ts
520
- export const constitutionRules: Rule[] = [
521
- {
522
- article: 1,
523
- name: "Specification First",
524
- predicate: (change: CodeChange) => {
525
- // 要件仕様が存在するかチェック
526
- return existsRequirement(change.targetFunction);
527
- },
528
- enforcement: "block", // block | warn | log
529
- message: "Code change blocked: No requirement specification found"
530
- },
531
- {
532
- article: 4,
533
- name: "Traceability Mandate",
534
- predicate: (change: CodeChange) => {
535
- // 100%トレーサビリティチェック
536
- const coverage = calculateTraceabilityCoverage(change);
537
- return coverage >= 1.0;
538
- },
539
- enforcement: "block",
540
- message: "Incomplete traceability: All code must link to requirements"
541
- },
542
- {
543
- article: 7,
544
- name: "Test-First Imperative",
545
- predicate: (change: CodeChange) => {
546
- // テストカバレッジ80%チェック
547
- const coverage = calculateTestCoverage(change);
548
- return coverage >= 0.8;
549
- },
550
- enforcement: "warn",
551
- message: "Test coverage below 80%"
552
- }
553
- ];
554
- ```
555
-
556
- ---
557
-
558
- ## 第4部:実装ロードマップ
559
-
560
- ### Phase 1: 基盤強化(1-2か月)
561
-
562
- | タスク | 優先度 | 工数見積 |
563
- |-------|-------|---------|
564
- | Semantic Code Filter MCP | ★★★★★ | 2週間 |
565
- | Confidence-Based Routing MCP | ★★★★☆ | 1週間 |
566
- | Constitution強制エンジン拡張 | ★★★★☆ | 1週間 |
567
- | EARS→形式仕様変換 | ★★★☆☆ | 2週間 |
568
-
569
- ### Phase 2: 形式検証統合(2-3か月)
570
-
571
- | タスク | 優先度 | 工数見積 |
572
- |-------|-------|---------|
573
- | Formal Verification MCP | ★★★★★ | 4週間 |
574
- | Z3統合 | ★★★★☆ | 2週間 |
575
- | 双方向トレーサビリティDB | ★★★☆☆ | 2週間 |
576
- | 検証レポート生成 | ★★★☆☆ | 1週間 |
577
-
578
- ### Phase 3: 学習・推論拡張(3-4か月)
579
-
580
- | タスク | 優先度 | 工数見積 |
581
- |-------|-------|---------|
582
- | Pattern Library Learning MCP | ★★★★☆ | 4週間 |
583
- | Ontology Reasoning MCP | ★★★☆☆ | 4週間 |
584
- | Wake-Sleep学習エンジン | ★★★☆☆ | 3週間 |
585
- | SDDオントロジー構築 | ★★☆☆☆ | 2週間 |
586
-
587
- ---
588
-
589
- ## 第5部:期待される成果と評価指標
590
-
591
- ### 定量的目標
592
-
593
- | 指標 | 現状(推定) | 目標 | 測定方法 |
594
- |-----|-------------|------|---------|
595
- | LLM生成コードの形式的正当性 | 未測定 | 95%+ | 検証条件充足率 |
596
- | ハルシネーション検出率 | 60-70% | 95%+ | 既知パターンでのベンチマーク |
597
- | 要件→コードトレーサビリティ | 80% | 100% | 自動リンク検出 |
598
- | パターン再利用率 | 未測定 | 40%+ | 抽出パターン使用頻度 |
599
- | Constitution違反検出率 | 手動 | 100%自動 | CI/CDゲート |
600
-
601
- ### 定性的目標
602
-
603
- 1. **「証明付きコード」の実現**: 形式検証により品質を数学的に保証
604
- 2. **AGI Codingツールとしての差別化**: Neuro-Symbolic統合の深化
605
- 3. **エンタープライズ適用可能性**: 規制産業(金融、医療、航空)での採用
606
- 4. **研究コミュニティへの貢献**: オープンソースMCPエコシステムの発展
607
-
608
- ---
609
-
610
- ## 第6部:まとめと推奨アクション
611
-
612
- ### 即時実行すべきアクション(今週)
613
-
614
- 1. **Semantic Code Filter MCPのプロトタイプ開発開始**
615
- - ESLint + カスタムルールでConstitution検証
616
- - LLM出力フィルタリングパイプライン構築
617
-
618
- 2. **Confidence-Based Routingの設計**
619
- - 閾値パラメーターの決定
620
- - フォールバック先の記号ツール特定
621
-
622
- ### 短期アクション(1か月以内)
623
-
624
- 3. **Z3統合の技術検証**
625
- - TypeScriptバインディング(z3-solver)の評価
626
- - EARS→SMT-LIB変換のプロトタイプ
627
-
628
- 4. **既存MCPサーバーの拡張**
629
- - musubix-mcp-serverへの検証ツール追加
630
- - YATAクライアントとの連携強化
631
-
632
- ### 中期アクション(3か月以内)
633
-
634
- 5. **Pattern Library Learning MCPの開発**
635
- - E-graph/Tree-sitterベースのパターン抽出
636
- - Wake-Sleepサイクルの実装
637
-
638
- 6. **Ontology Reasoning MCPの開発**
639
- - SDDオントロジーの設計
640
- - Apache Jena統合
641
-
642
- ---
643
-
644
- **本提案は、調査で識別された6つのNeuro-Symbolic統合パターンのうち、MUSUBIXが現在採用している「記号的コンテキスト補強型」を基盤として、「形式証明ループ型」「生成→フィルター型」「交互学習型」を段階的に追加することで、AGI Codingツールとしての独自ポジションを確立することを目指している。**
645
-
646
- ---
647
-
648
- **Document ID**: MUSUBIX-Enhancement-Roadmap
649
- **Version**: 1.0.0
650
- **Date**: 2026-01-06
651
- **Author**: Claude Analysis