musubix 1.4.1 → 1.4.3

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/AGENTS.md CHANGED
@@ -8,14 +8,14 @@
8
8
 
9
9
  | 項目 | 詳細 |
10
10
  |------|------|
11
- | **バージョン** | 1.4.1 |
11
+ | **バージョン** | 1.4.3 |
12
12
  | **言語** | TypeScript |
13
13
  | **ランタイム** | Node.js >= 20.0.0 |
14
14
  | **パッケージマネージャ** | npm >= 10.0.0 |
15
15
  | **ビルドシステム** | モノレポ(npm workspaces) |
16
16
  | **テストフレームワーク** | Vitest |
17
- | **テスト数** | 775 (全合格) |
18
- | **コンポーネント数** | 243 (62ドメイン対応) |
17
+ | **テスト数** | 853 (全合格) |
18
+ | **コンポーネント数** | 249 (62ドメイン対応) |
19
19
  | **Agent Skills** | 12 (Claude Code対応) |
20
20
 
21
21
  ---
@@ -38,7 +38,7 @@ packages/
38
38
  | パッケージ | npm | 役割 |
39
39
  |-----------|-----|------|
40
40
  | `packages/core/` | `@nahisaho/musubix-core` | コアライブラリ - CLI、EARS検証、コード生成、設計パターン |
41
- | `packages/mcp-server/` | `@nahisaho/musubix-mcp-server` | MCPサーバー - 16ツール、3プロンプト |
41
+ | `packages/mcp-server/` | `@nahisaho/musubix-mcp-server` | MCPサーバー - 19ツール、3プロンプト |
42
42
  | `packages/yata-client/` | `@nahisaho/musubix-yata-client` | YATAクライアント - 知識グラフ連携 |
43
43
  | `packages/pattern-mcp/` | `@nahisaho/musubix-pattern-mcp` | パターン学習 - 抽出・圧縮・ライブラリ |
44
44
  | `packages/ontology-mcp/` | `@nahisaho/musubix-ontology-mcp` | オントロジー - N3Store・推論エンジン |
@@ -116,6 +116,11 @@ npx musubix learn export # 学習データエクスポート
116
116
  npx musubix learn import <file> # 学習データインポート
117
117
  # オプション: --merge-strategy <skip|overwrite|merge>, --dry-run, --patterns-only, --feedback-only
118
118
 
119
+ # オントロジー操作 (v1.4.1 NEW!)
120
+ npx musubix ontology validate -f <file> # 知識グラフ整合性検証
121
+ npx musubix ontology check-circular -f <file> # 循環依存チェック
122
+ npx musubix ontology stats -f <file> # 統計表示
123
+
119
124
  # ヘルプ
120
125
  npx musubix --help
121
126
  npx musubix help <command>
@@ -132,7 +137,7 @@ npx @nahisaho/musubix-mcp-server
132
137
  npx musubix-mcp --transport stdio
133
138
  ```
134
139
 
135
- ### ツール一覧(16ツール)
140
+ ### ツール一覧(19ツール)
136
141
 
137
142
  #### SDD基本ツール(9ツール)
138
143
 
@@ -160,6 +165,14 @@ npx musubix-mcp --transport stdio
160
165
  | `ontology_query` | オントロジーグラフへのクエリ |
161
166
  | `ontology_infer` | オントロジーによる推論実行 |
162
167
 
168
+ #### オントロジー検証ツール(3ツール)- v1.4.1 NEW!
169
+
170
+ | ツール名 | 説明 |
171
+ |---------|------|
172
+ | `consistency_validate` | 知識グラフの整合性検証 |
173
+ | `validate_triple` | 単一トリプルの事前検証 |
174
+ | `check_circular` | 循環依存の検出 |
175
+
163
176
  ### プロンプト一覧(3プロンプト)
164
177
 
165
178
  | プロンプト名 | 説明 |
@@ -0,0 +1,112 @@
1
+ # MUSUBIX v1.5.0 Roadmap
2
+
3
+ ## Release Target: 2026-Q1
4
+
5
+ ## 🎯 Major Features
6
+
7
+ ### 1. Real-time Pattern Learning (REQ-LEARN-010)
8
+ **Priority: P0**
9
+
10
+ 現在のバッチ学習からリアルタイム学習への進化。
11
+
12
+ | 機能 | 説明 |
13
+ |------|------|
14
+ | Stream Processing | コード変更のストリーム処理 |
15
+ | Incremental Learning | 差分学習による効率化 |
16
+ | Online Feedback | リアルタイムフィードバック反映 |
17
+
18
+ ### 2. Pattern Sharing (REQ-SHARE-001)
19
+ **Priority: P1**
20
+
21
+ チーム間でパターンを共有する機能。
22
+
23
+ | 機能 | 説明 |
24
+ |------|------|
25
+ | Pattern Export/Import | 標準フォーマットでのエクスポート |
26
+ | Pattern Repository | 共有リポジトリ連携 |
27
+ | Conflict Resolution | パターン競合の解決 |
28
+
29
+ ### 3. Advanced Inference (REQ-ONTO-010)
30
+ **Priority: P1**
31
+
32
+ オントロジー推論の高度化。
33
+
34
+ | 機能 | 説明 |
35
+ |------|------|
36
+ | OWL 2 RL Support | OWL 2 RLプロファイル対応 |
37
+ | Datalog Integration | Datalogルールエンジン統合 |
38
+ | Explanation Generation | 推論過程の説明生成 |
39
+
40
+ ### 4. Interactive CLI Mode (REQ-CLI-010)
41
+ **Priority: P2**
42
+
43
+ 対話的なCLI操作モード。
44
+
45
+ | 機能 | 説明 |
46
+ |------|------|
47
+ | REPL Mode | 対話的シェル |
48
+ | Auto-completion | コマンド補完 |
49
+ | History | コマンド履歴 |
50
+
51
+ ### 5. Performance Optimization (REQ-PERF-001)
52
+ **Priority: P2**
53
+
54
+ 大規模プロジェクトでのパフォーマンス改善。
55
+
56
+ | 機能 | 説明 |
57
+ |------|------|
58
+ | Lazy Loading | 遅延読み込み |
59
+ | Cache Layer | キャッシュ層追加 |
60
+ | Parallel Processing | 並列処理強化 |
61
+
62
+ ---
63
+
64
+ ## 📊 Current Status (v1.4.1)
65
+
66
+ | メトリクス | 値 |
67
+ |-----------|-----|
68
+ | テスト数 | 815 |
69
+ | パッケージ数 | 8 |
70
+ | MCPツール | 19 |
71
+ | カバレッジ (lines) | 25% |
72
+
73
+ ---
74
+
75
+ ## 📅 Implementation Schedule
76
+
77
+ ### Phase 1: Foundation (Week 1-2)
78
+ - [ ] Real-time Learning基盤設計
79
+ - [ ] Pattern Sharing API設計
80
+ - [ ] テストカバレッジ向上 (25% → 40%)
81
+
82
+ ### Phase 2: Core Features (Week 3-4)
83
+ - [ ] Real-time Pattern Learning実装
84
+ - [ ] Pattern Export/Import拡張
85
+ - [ ] OWL 2 RL基本サポート
86
+
87
+ ### Phase 3: Integration (Week 5-6)
88
+ - [ ] Pattern Repository連携
89
+ - [ ] Interactive CLI Mode
90
+ - [ ] Performance Optimization
91
+
92
+ ### Phase 4: Stabilization (Week 7-8)
93
+ - [ ] E2Eテスト追加
94
+ - [ ] ドキュメント更新
95
+ - [ ] リリース準備
96
+
97
+ ---
98
+
99
+ ## 🔗 Dependencies
100
+
101
+ - Node.js >= 20.0.0
102
+ - TypeScript 5.x
103
+ - N3.js (RDF handling)
104
+ - tree-sitter (AST parsing)
105
+
106
+ ---
107
+
108
+ ## 📝 Notes
109
+
110
+ - v1.4.xはバグ修正のみ
111
+ - 破壊的変更なし (後方互換性維持)
112
+ - 新機能はオプトイン形式
@@ -0,0 +1,75 @@
1
+ # ADR-0001: Real-time Pattern Learning Architecture for v1.5.0
2
+
3
+ - **Date**: 2026-01-05
4
+ - **Status**: accepted
5
+ - **Deciders**: Architecture Team
6
+ - **Categories**: Learning, Performance
7
+
8
+ ## Context
9
+
10
+ MUSUBIX v1.4.xではバッチ学習方式を採用しているが、ユーザーのコード変更をリアルタイムで学習する要求がある。
11
+
12
+ ### 要件
13
+ - REQ-LEARN-011: ファイル変更時500ms以内に分析
14
+ - REQ-LEARN-013: フィードバック収集レイテンシ100ms以内
15
+ - REQ-LEARN-014: ストリーム処理1000 events/sec以上
16
+
17
+ ### 検討した選択肢
18
+ 1. **Polling方式**: 定期的にファイル変更をチェック
19
+ 2. **fs.watch + EventEmitter**: Node.js標準のファイル監視
20
+ 3. **chokidar + RxJS**: サードパーティライブラリによるリアクティブストリーム
21
+
22
+ ## Decision
23
+
24
+ **選択肢 2: fs.watch + EventEmitter** を採用する。
25
+
26
+ ### 理由
27
+ - 外部依存なしで実現可能
28
+ - Node.js標準APIで十分な性能
29
+ - メモリフットプリントが小さい
30
+
31
+ ### アーキテクチャ
32
+
33
+ ```
34
+ FileWatcher (fs.watch)
35
+
36
+
37
+ StreamProcessor (EventEmitter)
38
+
39
+ ├─▼ FeedbackQueue (Non-blocking)
40
+
41
+ └─▼ PatternExtractor (AST)
42
+
43
+
44
+ IncrementalUpdater (Delta)
45
+ ```
46
+
47
+ ### パフォーマンス目標
48
+ | メトリクス | 目標 | 測定方法 |
49
+ |------------|------|----------|
50
+ | 分析レイテンシ | < 500ms | StreamProcessor.getLatency() |
51
+ | フィードバック収集 | < 100ms | FeedbackQueue timing |
52
+ | スループット | ≥ 1000/sec | EventStream.getThroughput() |
53
+
54
+ ## Consequences
55
+
56
+ ### Positive
57
+ - リアルタイム学習によるユーザー体験向上
58
+ - 外部依存なしで軽量
59
+ - 段階的な実装が可能
60
+
61
+ ### Negative
62
+ - fs.watchのクロスプラットフォーム差異への対応が必要
63
+ - 大規模プロジェクトでのスケーラビリティ検証が必要
64
+
65
+ ### Risks
66
+ - macOS/Linux/Windowsでのfs.watchの挙動差異
67
+ - 軽減策: chokidarへのフォールバック機構を用意
68
+
69
+ ## Related Requirements
70
+
71
+ - REQ-LEARN-010: Real-time pattern learning
72
+ - REQ-LEARN-011: 500ms analysis latency
73
+ - REQ-LEARN-012: Incremental update
74
+ - REQ-LEARN-013: Non-blocking feedback
75
+ - REQ-LEARN-014: Stream processing
@@ -0,0 +1,79 @@
1
+ # ADR-0002: Pattern Sharing Protocol for cross-team collaboration
2
+
3
+ - **Date**: 2026-01-05
4
+ - **Status**: accepted
5
+ - **Deciders**: Architecture Team
6
+ - **Categories**: Sharing, Security
7
+
8
+ ## Context
9
+
10
+ チーム間で学習済みパターンを共有する要求がある。プライバシーとセキュリティを考慮したプロトコルが必要。
11
+
12
+ ### 要件
13
+ - REQ-SHARE-001: JSON形式でエクスポート
14
+ - REQ-SHARE-003: インポート時のオントロジー検証
15
+ - REQ-SHARE-004: 機密データの除去
16
+ - REQ-SHARE-005: 競合解決戦略
17
+
18
+ ### 検討した選択肢
19
+ 1. **Git-based sharing**: Gitリポジトリでパターンを共有
20
+ 2. **REST API**: 中央サーバー経由の共有
21
+ 3. **File-based export/import**: JSONファイルの直接交換
22
+
23
+ ## Decision
24
+
25
+ **選択肢 3: File-based export/import** を採用する。
26
+
27
+ ### 理由
28
+ - インフラ不要で即座に利用可能
29
+ - オフライン環境でも利用可能
30
+ - 将来的にGit連携への拡張が容易
31
+
32
+ ### ファイルフォーマット
33
+
34
+ ```json
35
+ {
36
+ "version": "1.0",
37
+ "exportedAt": "2026-01-05T12:00:00Z",
38
+ "patterns": [
39
+ {
40
+ "id": "PAT-001",
41
+ "name": "Repository Pattern",
42
+ "category": "design",
43
+ "confidence": 0.95,
44
+ "template": "...",
45
+ "metadata": {
46
+ "author": "[REDACTED]",
47
+ "domain": "data-access"
48
+ }
49
+ }
50
+ ],
51
+ "checksum": "sha256:..."
52
+ }
53
+ ```
54
+
55
+ ### セキュリティ対策
56
+ | 対策 | 実装 |
57
+ |------|------|
58
+ | 機密データ除去 | DataSanitizerによる自動マスキング |
59
+ | 改ざん検出 | SHA-256チェックサム |
60
+ | スキーマ検証 | JSON Schemaによるバリデーション |
61
+
62
+ ## Consequences
63
+
64
+ ### Positive
65
+ - シンプルで即座に利用可能
66
+ - プライバシー保護が容易
67
+ - バージョン管理が明確
68
+
69
+ ### Negative
70
+ - 自動同期機能なし(将来拡張)
71
+ - 大規模チームでの管理が煩雑になる可能性
72
+
73
+ ## Related Requirements
74
+
75
+ - REQ-SHARE-001: JSON export format
76
+ - REQ-SHARE-002: External import
77
+ - REQ-SHARE-003: Ontology validation
78
+ - REQ-SHARE-004: Privacy protection
79
+ - REQ-SHARE-005: Conflict resolution
@@ -0,0 +1,90 @@
1
+ # ADR-0003: OWL 2 RL Implementation Strategy for advanced inference
2
+
3
+ - **Date**: 2026-01-05
4
+ - **Status**: accepted
5
+ - **Deciders**: Architecture Team
6
+ - **Categories**: Ontology, Inference
7
+
8
+ ## Context
9
+
10
+ MUSUBIX v1.4.xではN3.jsによる基本的なRDF処理を実装済み。OWL 2 RLプロファイルの推論機能を追加する必要がある。
11
+
12
+ ### 要件
13
+ - REQ-ONTO-010: OWL 2 RLプロファイル対応
14
+ - REQ-ONTO-011: 200ms以内の推論(10,000トリプルまで)
15
+ - REQ-ONTO-014: Datalogルール統合(最大100ルール)
16
+
17
+ ### 検討した選択肢
18
+ 1. **完全なOWL 2推論器(HermiT等)**: Javaベース、高機能だが重い
19
+ 2. **N3.js + カスタムルール**: 既存実装を拡張
20
+ 3. **RDFox / Stardog**: 商用推論エンジン
21
+
22
+ ## Decision
23
+
24
+ **選択肢 2: N3.js + カスタムOWL 2 RLルール** を採用する。
25
+
26
+ ### 理由
27
+ - 既存のN3Store実装を活用可能
28
+ - 軽量でNode.js環境に最適
29
+ - 必要なルールセットのみ実装(段階的拡張)
30
+
31
+ ### 実装するOWL 2 RLルール(Phase 1)
32
+
33
+ | ルールID | 説明 | 優先度 |
34
+ |----------|------|--------|
35
+ | prp-dom | rdfs:domain推論 | P0 |
36
+ | prp-rng | rdfs:range推論 | P0 |
37
+ | prp-spo1 | rdfs:subPropertyOf推論 | P0 |
38
+ | cax-sco | rdfs:subClassOf推論 | P0 |
39
+ | prp-trp | owl:TransitiveProperty | P1 |
40
+ | prp-symp | owl:SymmetricProperty | P1 |
41
+ | prp-inv1/2 | owl:inverseOf | P1 |
42
+
43
+ ### アーキテクチャ
44
+
45
+ ```
46
+ QueryEngine
47
+
48
+
49
+ RuleEngine (OWL 2 RL)
50
+
51
+ ├── BuiltInRules (prp-*, cax-*)
52
+
53
+ └── DatalogIntegrator (最大100ルール)
54
+
55
+
56
+ InferenceExecutor (200ms SLA)
57
+
58
+
59
+ ExplanationGenerator
60
+ ```
61
+
62
+ ### パフォーマンス目標
63
+ | グラフサイズ | 目標レイテンシ |
64
+ |-------------|---------------|
65
+ | 1,000 triples | < 50ms |
66
+ | 5,000 triples | < 100ms |
67
+ | 10,000 triples | < 200ms |
68
+
69
+ ## Consequences
70
+
71
+ ### Positive
72
+ - 既存実装との統合が容易
73
+ - 軽量で高速
74
+ - 段階的な機能追加が可能
75
+
76
+ ### Negative
77
+ - OWL 2 RL全機能のサポートには時間がかかる
78
+ - 複雑な推論には限界あり
79
+
80
+ ### Risks
81
+ - 10,000トリプル超での性能劣化
82
+ - 軽減策: インデックス最適化、マテリアライズドビュー
83
+
84
+ ## Related Requirements
85
+
86
+ - REQ-ONTO-010: OWL 2 RL support
87
+ - REQ-ONTO-011: 200ms inference latency
88
+ - REQ-ONTO-012: Progress feedback
89
+ - REQ-ONTO-013: Explanation generation
90
+ - REQ-ONTO-014: Datalog integration
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "musubix",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Neuro-Symbolic AI Coding System - MUSUBI × YATA Integration",
5
5
  "type": "module",
6
6
  "workspaces": [
7
7
  "packages/*"
8
8
  ],
9
9
  "bin": {
10
- "musubix": "./bin/musubix.js",
11
- "musubix-mcp": "./bin/musubix-mcp.js"
10
+ "musubix": "bin/musubix.js",
11
+ "musubix-mcp": "bin/musubix-mcp.js"
12
12
  },
13
13
  "files": [
14
14
  "bin/",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",
40
- "url": "https://github.com/nahisaho/MUSUBIX.git"
40
+ "url": "git+https://github.com/nahisaho/MUSUBIX.git"
41
41
  },
42
42
  "keywords": [
43
43
  "ai",
@@ -56,6 +56,7 @@
56
56
  "@types/node": "^20.10.0",
57
57
  "@typescript-eslint/eslint-plugin": "^6.13.0",
58
58
  "@typescript-eslint/parser": "^6.13.0",
59
+ "@vitest/coverage-v8": "^4.0.16",
59
60
  "eslint": "^8.55.0",
60
61
  "typescript": "^5.3.0",
61
62
  "vitest": "^4.0.16"
@@ -65,10 +66,10 @@
65
66
  "@nahisaho/musubi": "^1.3.0",
66
67
  "@nahisaho/musubix-core": "^1.3.0",
67
68
  "@nahisaho/musubix-mcp-server": "^1.3.0",
68
- "@nahisaho/musubix-yata-client": "^1.3.0",
69
- "@nahisaho/musubix-pattern-mcp": "^1.0.0",
70
69
  "@nahisaho/musubix-ontology-mcp": "^1.0.0",
70
+ "@nahisaho/musubix-pattern-mcp": "^1.0.0",
71
+ "@nahisaho/musubix-sdd-ontology": "^1.0.0",
71
72
  "@nahisaho/musubix-wake-sleep": "^1.0.0",
72
- "@nahisaho/musubix-sdd-ontology": "^1.0.0"
73
+ "@nahisaho/musubix-yata-client": "^1.3.0"
73
74
  }
74
75
  }