musubix 1.4.4 → 1.6.0
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 +9 -4
- package/README.ja.md +30 -5
- package/README.md +30 -5
- package/docs/API-REFERENCE.md +225 -1
- package/docs/INSTALL-GUIDE.ja.md +2 -2
- package/docs/INSTALL-GUIDE.md +2 -2
- package/docs/ROADMAP-v1.5.md +60 -56
- package/docs/USER-GUIDE.ja.md +238 -5
- package/docs/USER-GUIDE.md +238 -5
- package/docs/evolution-from-musubi-to-musubix.md +106 -4
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
| 項目 | 詳細 |
|
|
10
10
|
|------|------|
|
|
11
|
-
| **バージョン** | 1.
|
|
11
|
+
| **バージョン** | 1.6.0 (開発中) |
|
|
12
12
|
| **言語** | TypeScript |
|
|
13
13
|
| **ランタイム** | Node.js >= 20.0.0 |
|
|
14
14
|
| **パッケージマネージャ** | npm >= 10.0.0 |
|
|
15
15
|
| **ビルドシステム** | モノレポ(npm workspaces) |
|
|
16
16
|
| **テストフレームワーク** | Vitest |
|
|
17
|
-
| **テスト数** |
|
|
17
|
+
| **テスト数** | 1208 (全合格) |
|
|
18
18
|
| **コンポーネント数** | 249 (62ドメイン対応) |
|
|
19
19
|
| **Agent Skills** | 12 (Claude Code対応) |
|
|
20
20
|
|
|
@@ -121,6 +121,11 @@ npx musubix ontology validate -f <file> # 知識グラフ整合性検証
|
|
|
121
121
|
npx musubix ontology check-circular -f <file> # 循環依存チェック
|
|
122
122
|
npx musubix ontology stats -f <file> # 統計表示
|
|
123
123
|
|
|
124
|
+
# Interactive REPL (v1.5.0 NEW!)
|
|
125
|
+
npx musubix repl # 対話的シェルを起動
|
|
126
|
+
npx musubix repl --history <file> # カスタム履歴ファイル
|
|
127
|
+
npx musubix repl --no-color # 色なしモード
|
|
128
|
+
|
|
124
129
|
# ヘルプ
|
|
125
130
|
npx musubix --help
|
|
126
131
|
npx musubix help <command>
|
|
@@ -482,6 +487,6 @@ npx musubix learn best-practices --format markdown
|
|
|
482
487
|
---
|
|
483
488
|
|
|
484
489
|
**Agent**: GitHub Copilot / Claude
|
|
485
|
-
**Last Updated**:
|
|
486
|
-
**Version**: 1.
|
|
490
|
+
**Last Updated**: 2026-01-06
|
|
491
|
+
**Version**: 1.5.0
|
|
487
492
|
**Repository**: https://github.com/nahisaho/MUSUBIX
|
package/README.ja.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
9
|
-
[](https://github.com/nahisaho/MUSUBIX)
|
|
10
10
|
|
|
11
11
|
> MUSUBI × YATA 統合による次世代AIコーディングシステム
|
|
12
12
|
>
|
|
13
|
-
> **v1.
|
|
13
|
+
> **v1.6.0** - REPLテスト実装&CLI統合
|
|
14
14
|
|
|
15
15
|
## 概要
|
|
16
16
|
|
|
@@ -30,6 +30,8 @@ MUSUBIXは、**ニューラル(LLM)** と **シンボリック(知識グ
|
|
|
30
30
|
- 📚 **自己学習システム** - フィードバック収集とパターン抽出による適応的改善
|
|
31
31
|
- 🏗️ **C4コード生成** - C4設計ドキュメントからTypeScriptスケルトン生成
|
|
32
32
|
- ⚙️ **品質ゲート** - フェーズ移行前の自動品質検証
|
|
33
|
+
- 🔮 **高度推論** - OWL 2 RL推論とDatalog評価 *(v1.4.5)*
|
|
34
|
+
- 🖥️ **対話的REPL** - コマンド補完、履歴管理、セッション変数 *(v1.6.0)*
|
|
33
35
|
|
|
34
36
|
## アーキテクチャ
|
|
35
37
|
|
|
@@ -59,7 +61,7 @@ flowchart TB
|
|
|
59
61
|
|
|
60
62
|
| パス | 説明 |
|
|
61
63
|
|------|------|
|
|
62
|
-
| `packages/core/` | コアライブラリ(
|
|
64
|
+
| `packages/core/` | コアライブラリ(249モジュール) |
|
|
63
65
|
| `packages/core/auth/` | 認証・認可 |
|
|
64
66
|
| `packages/core/cli/` | CLIインターフェース |
|
|
65
67
|
| `packages/core/codegen/` | コード生成・解析 |
|
|
@@ -73,7 +75,7 @@ flowchart TB
|
|
|
73
75
|
| `packages/core/types/` | 型定義 |
|
|
74
76
|
| `packages/core/utils/` | ユーティリティ |
|
|
75
77
|
| `packages/core/validators/` | EARS検証 |
|
|
76
|
-
| `packages/mcp-server/` | MCPサーバー(
|
|
78
|
+
| `packages/mcp-server/` | MCPサーバー(19 tools, 3 prompts) |
|
|
77
79
|
| `packages/yata-client/` | YATA クライアント |
|
|
78
80
|
| `packages/pattern-mcp/` | **パターン学習(NEW!)** |
|
|
79
81
|
| `packages/ontology-mcp/` | **オントロジーエンジン(NEW!)** |
|
|
@@ -233,6 +235,29 @@ Wake-Sleepアルゴリズムに基づく継続的学習システム:
|
|
|
233
235
|
- `ontology_query` - オントロジーグラフへのクエリ
|
|
234
236
|
- `ontology_infer` - オントロジーによる推論実行
|
|
235
237
|
|
|
238
|
+
## 高度推論(v1.4.5)
|
|
239
|
+
|
|
240
|
+
OWL 2 RLプロファイル推論とDatalog評価エンジン:
|
|
241
|
+
|
|
242
|
+
### 推論コンポーネント
|
|
243
|
+
- **OWL2RLReasoner** - OWL 2 RLプロファイル準拠推論(20+ビルトインルール)
|
|
244
|
+
- **DatalogEngine** - ストラティファイドDatalog評価(否定サポート)
|
|
245
|
+
- **InferenceExplainer** - 人間可読な推論説明生成
|
|
246
|
+
- **ProgressReporter** - リアルタイム進捗フィードバック(500ms間隔)
|
|
247
|
+
|
|
248
|
+
### OWL 2 RLビルトインルール
|
|
249
|
+
| カテゴリ | ルール | 説明 |
|
|
250
|
+
|----------|-------|------|
|
|
251
|
+
| Class Axioms | cax-sco, cax-eqc | サブクラス、同値クラス推論 |
|
|
252
|
+
| Property | prp-dom, prp-rng | ドメイン、レンジ推論 |
|
|
253
|
+
| Property Characteristics | prp-symp, prp-trp, prp-inv | 対称、推移、逆プロパティ |
|
|
254
|
+
| Equality | eq-ref, eq-sym, eq-trans | sameAs推論 |
|
|
255
|
+
|
|
256
|
+
### 説明フォーマット
|
|
257
|
+
- `text` - プレーンテキスト説明
|
|
258
|
+
- `markdown` - Markdown形式
|
|
259
|
+
- `html` - HTML形式(エスケープ対応)
|
|
260
|
+
|
|
236
261
|
## 憲法(9条)
|
|
237
262
|
|
|
238
263
|
MUSUBIXは以下の9条の憲法に準拠しています:
|
|
@@ -262,5 +287,5 @@ nahisaho
|
|
|
262
287
|
---
|
|
263
288
|
|
|
264
289
|
**文書ID**: README
|
|
265
|
-
**バージョン**: 1.
|
|
290
|
+
**バージョン**: 1.4.5
|
|
266
291
|
**最終更新**: 2026-01-05
|
package/README.md
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://github.com/nahisaho/MUSUBIX)
|
|
11
11
|
|
|
12
12
|
> Next-generation AI Coding System powered by MUSUBI × YATA Integration
|
|
13
13
|
>
|
|
14
|
-
> **v1.
|
|
14
|
+
> **v1.6.0** - REPL Test Implementation & CLI Enhancement
|
|
15
15
|
|
|
16
16
|
**[日本語版 README](README.ja.md)**
|
|
17
17
|
|
|
@@ -33,6 +33,8 @@ MUSUBIX is an innovative AI coding system that integrates **Neural (LLM)** and *
|
|
|
33
33
|
- 📚 **Self-Learning System** - Adaptive improvement through feedback collection and pattern extraction
|
|
34
34
|
- 🏗️ **C4 Code Generation** - Generate TypeScript skeleton from C4 design documents
|
|
35
35
|
- ⚙️ **Quality Gates** - Automated quality validation before phase transitions
|
|
36
|
+
- 🔮 **Advanced Inference** - OWL 2 RL reasoning and Datalog evaluation *(v1.4.5)*
|
|
37
|
+
- 🖥️ **Interactive REPL** - Command completion, history, session variables *(v1.6.0)*
|
|
36
38
|
|
|
37
39
|
## Architecture
|
|
38
40
|
|
|
@@ -62,7 +64,7 @@ flowchart TB
|
|
|
62
64
|
|
|
63
65
|
| Path | Description |
|
|
64
66
|
|------|-------------|
|
|
65
|
-
| `packages/core/` | Core library (
|
|
67
|
+
| `packages/core/` | Core library (249 modules) |
|
|
66
68
|
| `packages/core/auth/` | Authentication & Authorization |
|
|
67
69
|
| `packages/core/cli/` | CLI Interface |
|
|
68
70
|
| `packages/core/codegen/` | Code Generation & Analysis |
|
|
@@ -76,7 +78,7 @@ flowchart TB
|
|
|
76
78
|
| `packages/core/types/` | Type Definitions |
|
|
77
79
|
| `packages/core/utils/` | Utilities |
|
|
78
80
|
| `packages/core/validators/` | EARS Validation |
|
|
79
|
-
| `packages/mcp-server/` | MCP Server (
|
|
81
|
+
| `packages/mcp-server/` | MCP Server (19 tools, 3 prompts) |
|
|
80
82
|
| `packages/yata-client/` | YATA Client |
|
|
81
83
|
| `packages/pattern-mcp/` | **Pattern Learning (NEW!)** |
|
|
82
84
|
| `packages/ontology-mcp/` | **Ontology Engine (NEW!)** |
|
|
@@ -236,6 +238,29 @@ Continuous learning system based on the Wake-Sleep algorithm:
|
|
|
236
238
|
- `ontology_query` - Query ontology graph
|
|
237
239
|
- `ontology_infer` - Execute ontology-based inference
|
|
238
240
|
|
|
241
|
+
## Advanced Inference (v1.4.5)
|
|
242
|
+
|
|
243
|
+
OWL 2 RL profile reasoning and Datalog evaluation engine:
|
|
244
|
+
|
|
245
|
+
### Inference Components
|
|
246
|
+
- **OWL2RLReasoner** - OWL 2 RL profile compliant inference (20+ built-in rules)
|
|
247
|
+
- **DatalogEngine** - Stratified Datalog evaluation with negation support
|
|
248
|
+
- **InferenceExplainer** - Human-readable inference explanation generator
|
|
249
|
+
- **ProgressReporter** - Real-time progress feedback (500ms interval)
|
|
250
|
+
|
|
251
|
+
### OWL 2 RL Built-in Rules
|
|
252
|
+
| Category | Rules | Description |
|
|
253
|
+
|----------|-------|-------------|
|
|
254
|
+
| Class Axioms | cax-sco, cax-eqc | Subclass, Equivalent class inference |
|
|
255
|
+
| Property | prp-dom, prp-rng | Domain, Range inference |
|
|
256
|
+
| Property Characteristics | prp-symp, prp-trp, prp-inv | Symmetric, Transitive, Inverse |
|
|
257
|
+
| Equality | eq-ref, eq-sym, eq-trans | sameAs inference |
|
|
258
|
+
|
|
259
|
+
### Explanation Formats
|
|
260
|
+
- `text` - Plain text explanation
|
|
261
|
+
- `markdown` - Markdown format
|
|
262
|
+
- `html` - HTML format with escaping
|
|
263
|
+
|
|
239
264
|
## Constitutional Articles (9 Articles)
|
|
240
265
|
|
|
241
266
|
MUSUBIX adheres to the following 9 constitutional articles:
|
|
@@ -265,5 +290,5 @@ See [CHANGELOG.md](CHANGELOG.md)
|
|
|
265
290
|
---
|
|
266
291
|
|
|
267
292
|
**Document ID**: README
|
|
268
|
-
**Version**: 1.
|
|
293
|
+
**Version**: 1.4.5
|
|
269
294
|
**Last Updated**: 2026-01-05
|
package/docs/API-REFERENCE.md
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
- [Design](#design)
|
|
13
13
|
- [Codegen](#codegen)
|
|
14
14
|
- [Symbolic](#symbolic)
|
|
15
|
+
- [Inference](#inference) *(v1.4.5)*
|
|
16
|
+
- [REPL](#repl) *(v1.5.0)*
|
|
15
17
|
- [Validation](#validation)
|
|
16
18
|
- [Utils](#utils)
|
|
17
19
|
- [MCP Server](#mcp-server)
|
|
@@ -291,6 +293,99 @@ const violations = checker.check(code, 'typescript');
|
|
|
291
293
|
|
|
292
294
|
---
|
|
293
295
|
|
|
296
|
+
### REPL
|
|
297
|
+
|
|
298
|
+
*(New in v1.5.0, Enhanced in v1.6.0)*
|
|
299
|
+
|
|
300
|
+
Interactive command-line interface components.
|
|
301
|
+
|
|
302
|
+
#### ReplEngine
|
|
303
|
+
|
|
304
|
+
Main REPL controller.
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
import { createReplEngine } from '@nahisaho/musubix-core';
|
|
308
|
+
|
|
309
|
+
const engine = createReplEngine({
|
|
310
|
+
history: { maxSize: 1000 },
|
|
311
|
+
prompt: { showProject: true, showPhase: true },
|
|
312
|
+
completion: { maxSuggestions: 10 },
|
|
313
|
+
output: { defaultFormat: 'auto' }
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
await engine.start();
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Methods:**
|
|
320
|
+
|
|
321
|
+
| Method | Parameters | Returns | Description |
|
|
322
|
+
|--------|------------|---------|-------------|
|
|
323
|
+
| `start()` | - | `Promise<void>` | Starts REPL session |
|
|
324
|
+
| `stop()` | - | `Promise<void>` | Stops REPL session |
|
|
325
|
+
| `execute(command)` | `command: string` | `Promise<CommandResult>` | Executes command |
|
|
326
|
+
| `isRunning()` | - | `boolean` | Returns running state |
|
|
327
|
+
| `on(event, handler)` | `event: string, handler: Function` | `void` | Registers event handler |
|
|
328
|
+
|
|
329
|
+
#### CommandCompleter
|
|
330
|
+
|
|
331
|
+
TAB completion provider.
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
import { createCommandCompleter } from '@nahisaho/musubix-core';
|
|
335
|
+
|
|
336
|
+
const completer = createCommandCompleter({ maxSuggestions: 10 });
|
|
337
|
+
completer.registerCommands(commandDefinitions);
|
|
338
|
+
|
|
339
|
+
const result = completer.complete('req', 3);
|
|
340
|
+
// { completions: ['requirements'], prefix: 'req' }
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### HistoryManager
|
|
344
|
+
|
|
345
|
+
Command history persistence.
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
import { createHistoryManager } from '@nahisaho/musubix-core';
|
|
349
|
+
|
|
350
|
+
const history = createHistoryManager({
|
|
351
|
+
maxSize: 1000,
|
|
352
|
+
filePath: '~/.musubix_history'
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
await history.load();
|
|
356
|
+
history.add('requirements analyze input.md');
|
|
357
|
+
await history.save();
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### SessionState
|
|
361
|
+
|
|
362
|
+
Session variable storage.
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
import { createSessionState } from '@nahisaho/musubix-core';
|
|
366
|
+
|
|
367
|
+
const session = createSessionState();
|
|
368
|
+
session.set('project', 'my-app');
|
|
369
|
+
const value = session.get('project'); // 'my-app'
|
|
370
|
+
const expanded = session.expand('design $project'); // 'design my-app'
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
#### OutputFormatter
|
|
374
|
+
|
|
375
|
+
Output formatting (JSON/YAML/Table).
|
|
376
|
+
|
|
377
|
+
```typescript
|
|
378
|
+
import { createOutputFormatter } from '@nahisaho/musubix-core';
|
|
379
|
+
|
|
380
|
+
const formatter = createOutputFormatter({ defaultFormat: 'auto' });
|
|
381
|
+
console.log(formatter.format(data));
|
|
382
|
+
console.log(formatter.formatTable(arrayOfObjects));
|
|
383
|
+
console.log(formatter.formatJson(object));
|
|
384
|
+
console.log(formatter.formatYaml(object));
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
294
389
|
### Validation
|
|
295
390
|
|
|
296
391
|
#### ConstitutionalValidator
|
|
@@ -457,6 +552,135 @@ const report = validator.generateApprovalReport(result);
|
|
|
457
552
|
|
|
458
553
|
---
|
|
459
554
|
|
|
555
|
+
### Inference (v1.4.5)
|
|
556
|
+
|
|
557
|
+
The inference module provides OWL 2 RL reasoning and Datalog evaluation capabilities.
|
|
558
|
+
|
|
559
|
+
#### OWL2RLReasoner
|
|
560
|
+
|
|
561
|
+
Performs OWL 2 RL profile reasoning with 20+ built-in entailment rules.
|
|
562
|
+
|
|
563
|
+
```typescript
|
|
564
|
+
import { OWL2RLReasoner } from '@nahisaho/musubix-ontology-mcp';
|
|
565
|
+
|
|
566
|
+
const reasoner = new OWL2RLReasoner({
|
|
567
|
+
maxIterations: 100,
|
|
568
|
+
enablePropertyChains: true,
|
|
569
|
+
enableInverseProperties: true
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
const result = await reasoner.reason(store, {
|
|
573
|
+
onProgress: (progress) => console.log(`Iteration ${progress.iteration}`)
|
|
574
|
+
});
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Methods:**
|
|
578
|
+
|
|
579
|
+
| Method | Parameters | Returns | Description |
|
|
580
|
+
|--------|------------|---------|-------------|
|
|
581
|
+
| `reason(store, options)` | `store: N3Store, options?: ReasonerOptions` | `Promise<ReasoningResult>` | Execute reasoning |
|
|
582
|
+
| `getProvenanceLog()` | - | `ProvenanceLog` | Get inference provenance |
|
|
583
|
+
| `getRulesApplied()` | - | `string[]` | Get list of applied rules |
|
|
584
|
+
|
|
585
|
+
**Built-in Rules:**
|
|
586
|
+
|
|
587
|
+
| Rule | Description |
|
|
588
|
+
|------|-------------|
|
|
589
|
+
| `prp-dom` | Property domain inference |
|
|
590
|
+
| `prp-rng` | Property range inference |
|
|
591
|
+
| `prp-inv1/2` | Inverse property inference |
|
|
592
|
+
| `prp-trp` | Transitive property chaining |
|
|
593
|
+
| `prp-symp` | Symmetric property inference |
|
|
594
|
+
| `cax-sco` | SubClassOf propagation |
|
|
595
|
+
| `scm-spo` | SubPropertyOf inference |
|
|
596
|
+
| `eq-rep-s/p/o` | SameAs replacement |
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
#### DatalogEngine
|
|
601
|
+
|
|
602
|
+
Evaluates Datalog rules with stratified negation support.
|
|
603
|
+
|
|
604
|
+
```typescript
|
|
605
|
+
import { DatalogEngine } from '@nahisaho/musubix-ontology-mcp';
|
|
606
|
+
|
|
607
|
+
const engine = new DatalogEngine();
|
|
608
|
+
|
|
609
|
+
const rules = [
|
|
610
|
+
{
|
|
611
|
+
head: { predicate: 'ancestor', args: ['?x', '?y'] },
|
|
612
|
+
body: [{ predicate: 'parent', args: ['?x', '?y'] }]
|
|
613
|
+
}
|
|
614
|
+
];
|
|
615
|
+
|
|
616
|
+
const result = await engine.evaluate(rules, facts);
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
**Methods:**
|
|
620
|
+
|
|
621
|
+
| Method | Parameters | Returns | Description |
|
|
622
|
+
|--------|------------|---------|-------------|
|
|
623
|
+
| `evaluate(rules, facts, options)` | `rules: Rule[], facts: Fact[], options?: EvalOptions` | `Promise<EvaluationResult>` | Evaluate rules |
|
|
624
|
+
| `stratify(rules)` | `rules: Rule[]` | `Rule[][]` | Stratify rules by dependency |
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
#### InferenceExplainer
|
|
629
|
+
|
|
630
|
+
Generates human-readable explanations for inferred facts.
|
|
631
|
+
|
|
632
|
+
```typescript
|
|
633
|
+
import { InferenceExplainer, ExplanationFormat } from '@nahisaho/musubix-ontology-mcp';
|
|
634
|
+
|
|
635
|
+
const explainer = new InferenceExplainer(provenanceLog);
|
|
636
|
+
|
|
637
|
+
const explanation = explainer.explain(
|
|
638
|
+
subject, predicate, object,
|
|
639
|
+
ExplanationFormat.TEXT
|
|
640
|
+
);
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
**Methods:**
|
|
644
|
+
|
|
645
|
+
| Method | Parameters | Returns | Description |
|
|
646
|
+
|--------|------------|---------|-------------|
|
|
647
|
+
| `explain(s, p, o, format)` | `s: string, p: string, o: string, format: ExplanationFormat` | `string` | Generate explanation |
|
|
648
|
+
| `getInferenceChain(s, p, o)` | `s: string, p: string, o: string` | `InferenceStep[]` | Get inference chain |
|
|
649
|
+
|
|
650
|
+
**Explanation Formats:**
|
|
651
|
+
|
|
652
|
+
| Format | Description |
|
|
653
|
+
|--------|-------------|
|
|
654
|
+
| `TEXT` | Plain text explanation |
|
|
655
|
+
| `MARKDOWN` | Markdown formatted |
|
|
656
|
+
| `HTML` | HTML with styling |
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
#### ProgressReporter
|
|
661
|
+
|
|
662
|
+
Reports real-time inference progress.
|
|
663
|
+
|
|
664
|
+
```typescript
|
|
665
|
+
import { createProgressReporter } from '@nahisaho/musubix-ontology-mcp';
|
|
666
|
+
|
|
667
|
+
const reporter = createProgressReporter({
|
|
668
|
+
onProgress: (info) => console.log(`${info.phase}: ${info.newInferences} new`),
|
|
669
|
+
throttleMs: 500
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
await reasoner.reason(store, { progressReporter: reporter });
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
**Configuration:**
|
|
676
|
+
|
|
677
|
+
| Option | Type | Description |
|
|
678
|
+
|--------|------|-------------|
|
|
679
|
+
| `onProgress` | `(info: ProgressInfo) => void` | Progress callback |
|
|
680
|
+
| `throttleMs` | `number` | Throttle interval (default: 500ms) |
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
460
684
|
### Utils
|
|
461
685
|
|
|
462
686
|
#### I18nManager
|
|
@@ -754,6 +978,6 @@ MIT License - see [LICENSE](./LICENSE) for details.
|
|
|
754
978
|
|
|
755
979
|
---
|
|
756
980
|
|
|
757
|
-
**Version:** 1.
|
|
981
|
+
**Version:** 1.4.5
|
|
758
982
|
**Generated:** 2026-01-05
|
|
759
983
|
**MUSUBIX Core Package**
|
package/docs/INSTALL-GUIDE.ja.md
CHANGED
package/docs/INSTALL-GUIDE.md
CHANGED
package/docs/ROADMAP-v1.5.md
CHANGED
|
@@ -1,98 +1,102 @@
|
|
|
1
|
-
# MUSUBIX v1.5.0 Roadmap
|
|
1
|
+
# MUSUBIX v1.5.0 - v1.6.0 Roadmap
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## ✅ v1.5.0 Released: 2026-01-05
|
|
4
|
+
## ✅ v1.6.0 Released: 2026-01-06
|
|
4
5
|
|
|
5
6
|
## 🎯 Major Features
|
|
6
7
|
|
|
7
8
|
### 1. Real-time Pattern Learning (REQ-LEARN-010)
|
|
8
|
-
**Priority: P0**
|
|
9
|
+
**Priority: P0** - ✅ Implemented in v1.5.0
|
|
9
10
|
|
|
10
11
|
現在のバッチ学習からリアルタイム学習への進化。
|
|
11
12
|
|
|
12
|
-
| 機能 | 説明 |
|
|
13
|
-
|
|
14
|
-
| Stream Processing | コード変更のストリーム処理 |
|
|
15
|
-
| Incremental Learning | 差分学習による効率化 |
|
|
16
|
-
| Online Feedback | リアルタイムフィードバック反映 |
|
|
13
|
+
| 機能 | 説明 | 状態 |
|
|
14
|
+
|------|------|------|
|
|
15
|
+
| Stream Processing | コード変更のストリーム処理 | ✅ |
|
|
16
|
+
| Incremental Learning | 差分学習による効率化 | ✅ |
|
|
17
|
+
| Online Feedback | リアルタイムフィードバック反映 | ✅ |
|
|
17
18
|
|
|
18
19
|
### 2. Pattern Sharing (REQ-SHARE-001)
|
|
19
|
-
**Priority: P1**
|
|
20
|
+
**Priority: P1** - ✅ Implemented in v1.5.0
|
|
20
21
|
|
|
21
22
|
チーム間でパターンを共有する機能。
|
|
22
23
|
|
|
23
|
-
| 機能 | 説明 |
|
|
24
|
-
|
|
25
|
-
| Pattern Export/Import | 標準フォーマットでのエクスポート |
|
|
26
|
-
| Pattern Repository | 共有リポジトリ連携 |
|
|
27
|
-
| Conflict Resolution | パターン競合の解決 |
|
|
24
|
+
| 機能 | 説明 | 状態 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| Pattern Export/Import | 標準フォーマットでのエクスポート | ✅ |
|
|
27
|
+
| Pattern Repository | 共有リポジトリ連携 | ✅ |
|
|
28
|
+
| Conflict Resolution | パターン競合の解決 | ✅ |
|
|
28
29
|
|
|
29
30
|
### 3. Advanced Inference (REQ-ONTO-010)
|
|
30
|
-
**Priority: P1**
|
|
31
|
+
**Priority: P1** - ✅ Implemented in v1.4.5
|
|
31
32
|
|
|
32
33
|
オントロジー推論の高度化。
|
|
33
34
|
|
|
34
|
-
| 機能 | 説明 |
|
|
35
|
-
|
|
36
|
-
| OWL 2 RL Support | OWL 2 RLプロファイル対応 |
|
|
37
|
-
| Datalog Integration | Datalogルールエンジン統合 |
|
|
38
|
-
| Explanation Generation | 推論過程の説明生成 |
|
|
35
|
+
| 機能 | 説明 | 状態 |
|
|
36
|
+
|------|------|------|
|
|
37
|
+
| OWL 2 RL Support | OWL 2 RLプロファイル対応 | ✅ |
|
|
38
|
+
| Datalog Integration | Datalogルールエンジン統合 | ✅ |
|
|
39
|
+
| Explanation Generation | 推論過程の説明生成 | ✅ |
|
|
39
40
|
|
|
40
41
|
### 4. Interactive CLI Mode (REQ-CLI-010)
|
|
41
|
-
**Priority: P2**
|
|
42
|
+
**Priority: P2** - ✅ Implemented in v1.5.0, Enhanced in v1.6.0
|
|
42
43
|
|
|
43
44
|
対話的なCLI操作モード。
|
|
44
45
|
|
|
45
|
-
| 機能 | 説明 |
|
|
46
|
-
|
|
47
|
-
| REPL Mode | 対話的シェル |
|
|
48
|
-
| Auto-completion | コマンド補完 |
|
|
49
|
-
| History | コマンド履歴 |
|
|
46
|
+
| 機能 | 説明 | 状態 |
|
|
47
|
+
|------|------|------|
|
|
48
|
+
| REPL Mode | 対話的シェル | ✅ |
|
|
49
|
+
| Auto-completion | コマンド補完 | ✅ |
|
|
50
|
+
| History | コマンド履歴 | ✅ |
|
|
51
|
+
| CLI Integration | REPLからCLI実行 | ✅ v1.6.0 |
|
|
52
|
+
| Session Variables | セッション変数 | ✅ v1.6.0 |
|
|
50
53
|
|
|
51
54
|
### 5. Performance Optimization (REQ-PERF-001)
|
|
52
|
-
**Priority: P2**
|
|
55
|
+
**Priority: P2** - ✅ Implemented in v1.5.1
|
|
53
56
|
|
|
54
57
|
大規模プロジェクトでのパフォーマンス改善。
|
|
55
58
|
|
|
56
|
-
| 機能 | 説明 |
|
|
57
|
-
|
|
58
|
-
| Lazy Loading | 遅延読み込み |
|
|
59
|
-
| Cache Layer | キャッシュ層追加 |
|
|
60
|
-
| Parallel Processing | 並列処理強化 |
|
|
59
|
+
| 機能 | 説明 | 状態 |
|
|
60
|
+
|------|------|------|
|
|
61
|
+
| Lazy Loading | 遅延読み込み | ✅ |
|
|
62
|
+
| Cache Layer | キャッシュ層追加 | ✅ |
|
|
63
|
+
| Parallel Processing | 並列処理強化 | ✅ |
|
|
61
64
|
|
|
62
65
|
---
|
|
63
66
|
|
|
64
|
-
## 📊 Current Status (v1.
|
|
67
|
+
## 📊 Current Status (v1.6.0)
|
|
65
68
|
|
|
66
|
-
| メトリクス |
|
|
67
|
-
|
|
68
|
-
| テスト数 | 815 |
|
|
69
|
-
| パッケージ数 | 8 |
|
|
70
|
-
| MCPツール | 19 |
|
|
71
|
-
|
|
|
69
|
+
| メトリクス | v1.4.1 | v1.6.0 |
|
|
70
|
+
|-----------|--------|--------|
|
|
71
|
+
| テスト数 | 815 | **1208** |
|
|
72
|
+
| パッケージ数 | 8 | 8 |
|
|
73
|
+
| MCPツール | 19 | 19 |
|
|
74
|
+
| REPLテスト | 22 | **105** |
|
|
72
75
|
|
|
73
76
|
---
|
|
74
77
|
|
|
75
|
-
## 📅 Implementation Schedule
|
|
78
|
+
## 📅 Implementation Schedule - ✅ COMPLETED
|
|
76
79
|
|
|
77
|
-
### Phase 1: Foundation (Week 1-2)
|
|
78
|
-
- [
|
|
79
|
-
- [
|
|
80
|
-
- [
|
|
80
|
+
### Phase 1: Foundation (Week 1-2) ✅
|
|
81
|
+
- [x] Real-time Learning基盤設計
|
|
82
|
+
- [x] Pattern Sharing API設計
|
|
83
|
+
- [x] テストカバレッジ向上
|
|
81
84
|
|
|
82
|
-
### Phase 2: Core Features (Week 3-4)
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
85
|
+
### Phase 2: Core Features (Week 3-4) ✅
|
|
86
|
+
- [x] Real-time Pattern Learning実装
|
|
87
|
+
- [x] Pattern Export/Import拡張
|
|
88
|
+
- [x] OWL 2 RL基本サポート
|
|
86
89
|
|
|
87
|
-
### Phase 3: Integration (Week 5-6)
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
90
|
+
### Phase 3: Integration (Week 5-6) ✅
|
|
91
|
+
- [x] Pattern Repository連携
|
|
92
|
+
- [x] Interactive CLI Mode
|
|
93
|
+
- [x] Performance Optimization
|
|
91
94
|
|
|
92
|
-
### Phase 4: Stabilization (Week 7-8)
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
95
|
+
### Phase 4: Stabilization (Week 7-8) ✅
|
|
96
|
+
- [x] E2Eテスト追加
|
|
97
|
+
- [x] REPL完全テスト実装 (v1.6.0)
|
|
98
|
+
- [x] ドキュメント更新
|
|
99
|
+
- [x] リリース準備
|
|
96
100
|
|
|
97
101
|
---
|
|
98
102
|
|
package/docs/USER-GUIDE.ja.md
CHANGED
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
11. [C4コード生成](#c4コード生成)
|
|
18
18
|
12. [シンボリック推論](#シンボリック推論) *(v1.2.0)*
|
|
19
19
|
13. [正誤性検証](#正誤性検証) *(v1.4.1)*
|
|
20
|
-
14. [
|
|
21
|
-
15. [
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
14. [高度な推論](#高度な推論) *(v1.4.5)*
|
|
21
|
+
15. [対話的REPLモード](#対話的replモード) *(v1.5.0)*
|
|
22
|
+
16. [MCPサーバー連携](#mcpサーバー連携)
|
|
23
|
+
17. [YATA知識グラフ](#yata知識グラフ)
|
|
24
|
+
18. [ベストプラクティス](#ベストプラクティス)
|
|
25
|
+
19. [トラブルシューティング](#トラブルシューティング)
|
|
24
26
|
|
|
25
27
|
---
|
|
26
28
|
|
|
@@ -840,6 +842,237 @@ const semanticDuplicates = validator.findSemanticDuplicates(allTriples);
|
|
|
840
842
|
|
|
841
843
|
---
|
|
842
844
|
|
|
845
|
+
## 高度な推論
|
|
846
|
+
|
|
847
|
+
*(v1.4.5 新機能)*
|
|
848
|
+
|
|
849
|
+
### 概要
|
|
850
|
+
|
|
851
|
+
高度な推論は、知識グラフにOWL 2 RL推論とDatalog評価機能を提供します。暗黙的な事実の実体化、ルールベースの推論、人間が理解しやすい説明の生成をサポートします。
|
|
852
|
+
|
|
853
|
+
### 主要コンポーネント
|
|
854
|
+
|
|
855
|
+
| コンポーネント | 説明 |
|
|
856
|
+
|--------------|------|
|
|
857
|
+
| `OWL2RLReasoner` | 20以上のビルトインルールを持つOWL 2 RL推論エンジン |
|
|
858
|
+
| `DatalogEngine` | 階層化評価対応のDatalogエンジン |
|
|
859
|
+
| `InferenceExplainer` | 自然言語での説明生成 |
|
|
860
|
+
| `ProgressReporter` | リアルタイム推論進捗追跡 |
|
|
861
|
+
|
|
862
|
+
### OWL 2 RL 推論
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
import { OWL2RLReasoner } from '@nahisaho/musubix-ontology-mcp';
|
|
866
|
+
|
|
867
|
+
const reasoner = new OWL2RLReasoner({
|
|
868
|
+
maxIterations: 100,
|
|
869
|
+
enablePropertyChains: true,
|
|
870
|
+
enableInverseProperties: true
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
// ストアに対して推論を実行
|
|
874
|
+
const result = await reasoner.reason(store, {
|
|
875
|
+
onProgress: (progress) => {
|
|
876
|
+
console.log(`反復 ${progress.iteration}: ${progress.newTriples} 新規トリプル`);
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
|
|
880
|
+
console.log(`${result.inferredCount} 個の新しい事実を推論`);
|
|
881
|
+
console.log(`適用ルール: ${result.rulesApplied.join(', ')}`);
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
### OWL 2 RL ルール
|
|
885
|
+
|
|
886
|
+
| ルールID | 名称 | 説明 |
|
|
887
|
+
|---------|------|------|
|
|
888
|
+
| `prp-dom` | Property Domain | プロパティのドメインから型を推論 |
|
|
889
|
+
| `prp-rng` | Property Range | プロパティのレンジから型を推論 |
|
|
890
|
+
| `prp-inv1/2` | Inverse Properties | 逆関係を推論 |
|
|
891
|
+
| `prp-trp` | Transitive Properties | 推移的プロパティを連鎖 |
|
|
892
|
+
| `prp-symp` | Symmetric Properties | 対称関係を推論 |
|
|
893
|
+
| `cax-sco` | SubClassOf | クラスメンバーシップを伝播 |
|
|
894
|
+
| `scm-spo` | SubPropertyOf | プロパティの包摂関係 |
|
|
895
|
+
| `eq-rep-s/p/o` | SameAs Replacement | 同一個体の置換 |
|
|
896
|
+
|
|
897
|
+
### Datalog 評価
|
|
898
|
+
|
|
899
|
+
```typescript
|
|
900
|
+
import { DatalogEngine } from '@nahisaho/musubix-ontology-mcp';
|
|
901
|
+
|
|
902
|
+
const engine = new DatalogEngine();
|
|
903
|
+
|
|
904
|
+
// ルールを定義
|
|
905
|
+
const rules = [
|
|
906
|
+
{
|
|
907
|
+
head: { predicate: 'ancestor', args: ['?x', '?y'] },
|
|
908
|
+
body: [
|
|
909
|
+
{ predicate: 'parent', args: ['?x', '?y'] }
|
|
910
|
+
]
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
head: { predicate: 'ancestor', args: ['?x', '?z'] },
|
|
914
|
+
body: [
|
|
915
|
+
{ predicate: 'parent', args: ['?x', '?y'] },
|
|
916
|
+
{ predicate: 'ancestor', args: ['?y', '?z'] }
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
];
|
|
920
|
+
|
|
921
|
+
// ルールを評価
|
|
922
|
+
const result = await engine.evaluate(rules, facts, {
|
|
923
|
+
onProgress: (progress) => {
|
|
924
|
+
console.log(`階層 ${progress.stratum}: ${progress.rule} を評価中`);
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
console.log(`${result.derivedFacts.length} 個の新しい事実を導出`);
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
### 推論説明
|
|
932
|
+
|
|
933
|
+
```typescript
|
|
934
|
+
import { InferenceExplainer, ExplanationFormat } from '@nahisaho/musubix-ontology-mcp';
|
|
935
|
+
|
|
936
|
+
const explainer = new InferenceExplainer(reasoner.getProvenanceLog());
|
|
937
|
+
|
|
938
|
+
// 特定のトリプルの説明を取得
|
|
939
|
+
const explanation = explainer.explain(
|
|
940
|
+
'http://example.org/Animal',
|
|
941
|
+
'rdf:type',
|
|
942
|
+
'owl:Class',
|
|
943
|
+
ExplanationFormat.TEXT
|
|
944
|
+
);
|
|
945
|
+
|
|
946
|
+
console.log(explanation);
|
|
947
|
+
// 出力: "Animal は owl:Class として宣言されているため Class です(ルール cax-sco)"
|
|
948
|
+
|
|
949
|
+
// HTML形式の説明を生成
|
|
950
|
+
const htmlExplanation = explainer.explain(
|
|
951
|
+
subject, predicate, object,
|
|
952
|
+
ExplanationFormat.HTML
|
|
953
|
+
);
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
### 進捗レポート
|
|
957
|
+
|
|
958
|
+
```typescript
|
|
959
|
+
import { createProgressReporter } from '@nahisaho/musubix-ontology-mcp';
|
|
960
|
+
|
|
961
|
+
const reporter = createProgressReporter({
|
|
962
|
+
onProgress: (info) => {
|
|
963
|
+
console.log(`フェーズ: ${info.phase}`);
|
|
964
|
+
console.log(`反復: ${info.iteration}/${info.maxIterations}`);
|
|
965
|
+
console.log(`トリプル数: ${info.totalTriples}`);
|
|
966
|
+
console.log(`新規推論: ${info.newInferences}`);
|
|
967
|
+
},
|
|
968
|
+
throttleMs: 500 // 500ms間隔でレポート
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
await reasoner.reason(store, { progressReporter: reporter });
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
---
|
|
975
|
+
|
|
976
|
+
## 対話的REPLモード
|
|
977
|
+
|
|
978
|
+
*(v1.5.0 新規、v1.6.0 強化)*
|
|
979
|
+
|
|
980
|
+
MUSUBIXは、リアルタイムでコマンドを実行・探索できる対話的REPLシェルを提供します。
|
|
981
|
+
|
|
982
|
+
### REPLの起動
|
|
983
|
+
|
|
984
|
+
```bash
|
|
985
|
+
# 対話的REPLを起動
|
|
986
|
+
musubix repl
|
|
987
|
+
|
|
988
|
+
# カスタム履歴ファイルを指定
|
|
989
|
+
musubix repl --history ~/.musubix-repl-history
|
|
990
|
+
|
|
991
|
+
# カラー表示なし
|
|
992
|
+
musubix repl --no-color
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
### REPL機能
|
|
996
|
+
|
|
997
|
+
| 機能 | 説明 |
|
|
998
|
+
|------|------|
|
|
999
|
+
| コマンド補完 | TABキーでコマンド・オプションを補完 |
|
|
1000
|
+
| 履歴ナビゲーション | 上下矢印、履歴検索 |
|
|
1001
|
+
| セッション変数 | `$name=value` で設定、`$name` で参照 |
|
|
1002
|
+
| 出力フォーマット | JSON、YAML、テーブル自動整形 |
|
|
1003
|
+
| CLI統合 | CLIコマンドをそのまま実行可能 |
|
|
1004
|
+
|
|
1005
|
+
### 基本的な使い方
|
|
1006
|
+
|
|
1007
|
+
```bash
|
|
1008
|
+
musubix> help # すべてのコマンドを表示
|
|
1009
|
+
musubix> help requirements # コマンド詳細を表示
|
|
1010
|
+
musubix> requirements analyze input.md # CLIコマンドを実行
|
|
1011
|
+
musubix> $project=my-app # セッション変数を設定
|
|
1012
|
+
musubix> design generate $project # 変数をコマンドで使用
|
|
1013
|
+
musubix> history # コマンド履歴を表示
|
|
1014
|
+
musubix> exit # REPLを終了
|
|
1015
|
+
```
|
|
1016
|
+
|
|
1017
|
+
### セッション変数
|
|
1018
|
+
|
|
1019
|
+
```bash
|
|
1020
|
+
# 変数の設定
|
|
1021
|
+
musubix> $req=REQ-001
|
|
1022
|
+
musubix> $file=./docs/requirements.md
|
|
1023
|
+
|
|
1024
|
+
# コマンドで使用
|
|
1025
|
+
musubix> requirements validate $file
|
|
1026
|
+
musubix> trace impact $req
|
|
1027
|
+
|
|
1028
|
+
# 特殊変数: $_ は前回の実行結果を保持
|
|
1029
|
+
musubix> requirements analyze input.md
|
|
1030
|
+
musubix> $_ # 前回の結果にアクセス
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
### 出力フォーマット
|
|
1034
|
+
|
|
1035
|
+
```bash
|
|
1036
|
+
# 自動検出(デフォルト)
|
|
1037
|
+
musubix> learn status
|
|
1038
|
+
|
|
1039
|
+
# JSON出力を強制
|
|
1040
|
+
musubix> set format json
|
|
1041
|
+
musubix> learn patterns
|
|
1042
|
+
|
|
1043
|
+
# YAML出力を強制
|
|
1044
|
+
musubix> set format yaml
|
|
1045
|
+
|
|
1046
|
+
# テーブル出力を強制
|
|
1047
|
+
musubix> set format table
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
### 履歴管理
|
|
1051
|
+
|
|
1052
|
+
```bash
|
|
1053
|
+
# 最近のコマンドを表示
|
|
1054
|
+
musubix> history
|
|
1055
|
+
|
|
1056
|
+
# 履歴を検索(Ctrl+Rスタイル)
|
|
1057
|
+
musubix> history search requirements
|
|
1058
|
+
|
|
1059
|
+
# 履歴をクリア
|
|
1060
|
+
musubix> history clear
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
### REPLコンポーネント
|
|
1064
|
+
|
|
1065
|
+
| コンポーネント | 役割 |
|
|
1066
|
+
|---------------|------|
|
|
1067
|
+
| `ReplEngine` | REPLメインコントローラー |
|
|
1068
|
+
| `CommandCompleter` | TAB補完プロバイダー |
|
|
1069
|
+
| `HistoryManager` | コマンド履歴の永続化 |
|
|
1070
|
+
| `SessionState` | 変数ストレージ |
|
|
1071
|
+
| `OutputFormatter` | JSON/YAML/テーブル出力 |
|
|
1072
|
+
| `PromptRenderer` | 動的プロンプト表示 |
|
|
1073
|
+
|
|
1074
|
+
---
|
|
1075
|
+
|
|
843
1076
|
## MCPサーバー連携
|
|
844
1077
|
|
|
845
1078
|
### MCPサーバーの起動
|
|
@@ -1152,6 +1385,6 @@ const client = createYATAClient({
|
|
|
1152
1385
|
|
|
1153
1386
|
---
|
|
1154
1387
|
|
|
1155
|
-
**バージョン**: 1.
|
|
1388
|
+
**バージョン**: 1.4.5
|
|
1156
1389
|
**最終更新**: 2026-01-05
|
|
1157
1390
|
**MUSUBIX Project**
|
package/docs/USER-GUIDE.md
CHANGED
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
7. [C4 Code Generation](#c4-code-generation)
|
|
16
16
|
8. [Symbolic Reasoning](#symbolic-reasoning) *(v1.2.0)*
|
|
17
17
|
9. [Consistency Validation](#consistency-validation) *(v1.4.1)*
|
|
18
|
-
10. [
|
|
19
|
-
11. [
|
|
20
|
-
12. [
|
|
21
|
-
13. [
|
|
18
|
+
10. [Advanced Inference](#advanced-inference) *(v1.4.5)*
|
|
19
|
+
11. [Interactive REPL Mode](#interactive-repl-mode) *(v1.5.0)*
|
|
20
|
+
12. [MCP Server Integration](#mcp-server-integration)
|
|
21
|
+
13. [YATA Integration](#yata-integration)
|
|
22
|
+
14. [Best Practices](#best-practices)
|
|
23
|
+
15. [Troubleshooting](#troubleshooting)
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
@@ -513,6 +515,106 @@ export function createAuthService(): IAuthService {
|
|
|
513
515
|
|
|
514
516
|
---
|
|
515
517
|
|
|
518
|
+
## Interactive REPL Mode
|
|
519
|
+
|
|
520
|
+
*(New in v1.5.0, Enhanced in v1.6.0)*
|
|
521
|
+
|
|
522
|
+
MUSUBIX provides an interactive REPL (Read-Eval-Print-Loop) shell for real-time command execution and exploration.
|
|
523
|
+
|
|
524
|
+
### Starting REPL
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
# Start interactive REPL
|
|
528
|
+
musubix repl
|
|
529
|
+
|
|
530
|
+
# With custom history file
|
|
531
|
+
musubix repl --history ~/.musubix-repl-history
|
|
532
|
+
|
|
533
|
+
# Without colors
|
|
534
|
+
musubix repl --no-color
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### REPL Features
|
|
538
|
+
|
|
539
|
+
| Feature | Description |
|
|
540
|
+
|---------|-------------|
|
|
541
|
+
| Command completion | TAB completion for commands, options |
|
|
542
|
+
| History navigation | UP/DOWN arrows, history search |
|
|
543
|
+
| Session variables | `$name=value` to set, `$name` to reference |
|
|
544
|
+
| Output formatting | JSON, YAML, Table auto-formatting |
|
|
545
|
+
| CLI integration | Execute any CLI command directly |
|
|
546
|
+
|
|
547
|
+
### Basic Usage
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
musubix> help # Show all commands
|
|
551
|
+
musubix> help requirements # Show command details
|
|
552
|
+
musubix> requirements analyze input.md # Execute CLI command
|
|
553
|
+
musubix> $project=my-app # Set session variable
|
|
554
|
+
musubix> design generate $project # Use variable in command
|
|
555
|
+
musubix> history # Show command history
|
|
556
|
+
musubix> exit # Exit REPL
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### Session Variables
|
|
560
|
+
|
|
561
|
+
```bash
|
|
562
|
+
# Set variables
|
|
563
|
+
musubix> $req=REQ-001
|
|
564
|
+
musubix> $file=./docs/requirements.md
|
|
565
|
+
|
|
566
|
+
# Use in commands
|
|
567
|
+
musubix> requirements validate $file
|
|
568
|
+
musubix> trace impact $req
|
|
569
|
+
|
|
570
|
+
# Special variable: $_ holds last result
|
|
571
|
+
musubix> requirements analyze input.md
|
|
572
|
+
musubix> $_ # Access last result
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Output Formats
|
|
576
|
+
|
|
577
|
+
```bash
|
|
578
|
+
# Auto-detect best format (default)
|
|
579
|
+
musubix> learn status
|
|
580
|
+
|
|
581
|
+
# Force JSON output
|
|
582
|
+
musubix> set format json
|
|
583
|
+
musubix> learn patterns
|
|
584
|
+
|
|
585
|
+
# Force YAML output
|
|
586
|
+
musubix> set format yaml
|
|
587
|
+
|
|
588
|
+
# Force table output
|
|
589
|
+
musubix> set format table
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
### History Management
|
|
593
|
+
|
|
594
|
+
```bash
|
|
595
|
+
# Show recent commands
|
|
596
|
+
musubix> history
|
|
597
|
+
|
|
598
|
+
# Search history (Ctrl+R style)
|
|
599
|
+
musubix> history search requirements
|
|
600
|
+
|
|
601
|
+
# Clear history
|
|
602
|
+
musubix> history clear
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### REPL Components
|
|
606
|
+
|
|
607
|
+
| Component | Purpose |
|
|
608
|
+
|-----------|---------|
|
|
609
|
+
| `ReplEngine` | Main REPL controller |
|
|
610
|
+
| `CommandCompleter` | TAB completion provider |
|
|
611
|
+
| `HistoryManager` | Command history persistence |
|
|
612
|
+
| `SessionState` | Variable storage |
|
|
613
|
+
| `OutputFormatter` | JSON/YAML/Table output |
|
|
614
|
+
| `PromptRenderer` | Dynamic prompt display |
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
516
618
|
## MCP Server Integration
|
|
517
619
|
|
|
518
620
|
### CLI Startup
|
|
@@ -800,6 +902,137 @@ const semanticDuplicates = validator.findSemanticDuplicates(allTriples);
|
|
|
800
902
|
|
|
801
903
|
---
|
|
802
904
|
|
|
905
|
+
## Advanced Inference
|
|
906
|
+
|
|
907
|
+
*(v1.4.5 New Feature)*
|
|
908
|
+
|
|
909
|
+
### Overview
|
|
910
|
+
|
|
911
|
+
Advanced Inference provides OWL 2 RL reasoning and Datalog evaluation capabilities for the knowledge graph. It supports materialization of implicit facts, rule-based inference, and human-readable explanations.
|
|
912
|
+
|
|
913
|
+
### Key Components
|
|
914
|
+
|
|
915
|
+
| Component | Description |
|
|
916
|
+
|-----------|-------------|
|
|
917
|
+
| `OWL2RLReasoner` | OWL 2 RL profile reasoning with 20+ built-in rules |
|
|
918
|
+
| `DatalogEngine` | Stratified Datalog evaluation engine |
|
|
919
|
+
| `InferenceExplainer` | Natural language explanation generator |
|
|
920
|
+
| `ProgressReporter` | Real-time inference progress tracking |
|
|
921
|
+
|
|
922
|
+
### OWL 2 RL Reasoning
|
|
923
|
+
|
|
924
|
+
```typescript
|
|
925
|
+
import { OWL2RLReasoner } from '@nahisaho/musubix-ontology-mcp';
|
|
926
|
+
|
|
927
|
+
const reasoner = new OWL2RLReasoner({
|
|
928
|
+
maxIterations: 100,
|
|
929
|
+
enablePropertyChains: true,
|
|
930
|
+
enableInverseProperties: true
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
// Run reasoning on store
|
|
934
|
+
const result = await reasoner.reason(store, {
|
|
935
|
+
onProgress: (progress) => {
|
|
936
|
+
console.log(`Iteration ${progress.iteration}: ${progress.newTriples} new triples`);
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
console.log(`Inferred ${result.inferredCount} new facts`);
|
|
941
|
+
console.log(`Rules applied: ${result.rulesApplied.join(', ')}`);
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
### OWL 2 RL Rules
|
|
945
|
+
|
|
946
|
+
| Rule ID | Name | Description |
|
|
947
|
+
|---------|------|-------------|
|
|
948
|
+
| `prp-dom` | Property Domain | Infer type from property domain |
|
|
949
|
+
| `prp-rng` | Property Range | Infer type from property range |
|
|
950
|
+
| `prp-inv1/2` | Inverse Properties | Infer inverse relationships |
|
|
951
|
+
| `prp-trp` | Transitive Properties | Chain transitive properties |
|
|
952
|
+
| `prp-symp` | Symmetric Properties | Infer symmetric relationships |
|
|
953
|
+
| `cax-sco` | SubClassOf | Propagate class membership |
|
|
954
|
+
| `scm-spo` | SubPropertyOf | Property subsumption |
|
|
955
|
+
| `eq-rep-s/p/o` | SameAs Replacement | Substitute equal individuals |
|
|
956
|
+
|
|
957
|
+
### Datalog Evaluation
|
|
958
|
+
|
|
959
|
+
```typescript
|
|
960
|
+
import { DatalogEngine } from '@nahisaho/musubix-ontology-mcp';
|
|
961
|
+
|
|
962
|
+
const engine = new DatalogEngine();
|
|
963
|
+
|
|
964
|
+
// Define rules
|
|
965
|
+
const rules = [
|
|
966
|
+
{
|
|
967
|
+
head: { predicate: 'ancestor', args: ['?x', '?y'] },
|
|
968
|
+
body: [
|
|
969
|
+
{ predicate: 'parent', args: ['?x', '?y'] }
|
|
970
|
+
]
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
head: { predicate: 'ancestor', args: ['?x', '?z'] },
|
|
974
|
+
body: [
|
|
975
|
+
{ predicate: 'parent', args: ['?x', '?y'] },
|
|
976
|
+
{ predicate: 'ancestor', args: ['?y', '?z'] }
|
|
977
|
+
]
|
|
978
|
+
}
|
|
979
|
+
];
|
|
980
|
+
|
|
981
|
+
// Evaluate rules
|
|
982
|
+
const result = await engine.evaluate(rules, facts, {
|
|
983
|
+
onProgress: (progress) => {
|
|
984
|
+
console.log(`Stratum ${progress.stratum}: evaluating ${progress.rule}`);
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
console.log(`Derived ${result.derivedFacts.length} new facts`);
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
### Inference Explanation
|
|
992
|
+
|
|
993
|
+
```typescript
|
|
994
|
+
import { InferenceExplainer, ExplanationFormat } from '@nahisaho/musubix-ontology-mcp';
|
|
995
|
+
|
|
996
|
+
const explainer = new InferenceExplainer(reasoner.getProvenanceLog());
|
|
997
|
+
|
|
998
|
+
// Get explanation for a specific triple
|
|
999
|
+
const explanation = explainer.explain(
|
|
1000
|
+
'http://example.org/Animal',
|
|
1001
|
+
'rdf:type',
|
|
1002
|
+
'owl:Class',
|
|
1003
|
+
ExplanationFormat.TEXT
|
|
1004
|
+
);
|
|
1005
|
+
|
|
1006
|
+
console.log(explanation);
|
|
1007
|
+
// Output: "Animal is a Class because it is declared as owl:Class via rule cax-sco"
|
|
1008
|
+
|
|
1009
|
+
// Generate HTML explanation
|
|
1010
|
+
const htmlExplanation = explainer.explain(
|
|
1011
|
+
subject, predicate, object,
|
|
1012
|
+
ExplanationFormat.HTML
|
|
1013
|
+
);
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
### Progress Reporting
|
|
1017
|
+
|
|
1018
|
+
```typescript
|
|
1019
|
+
import { createProgressReporter } from '@nahisaho/musubix-ontology-mcp';
|
|
1020
|
+
|
|
1021
|
+
const reporter = createProgressReporter({
|
|
1022
|
+
onProgress: (info) => {
|
|
1023
|
+
console.log(`Phase: ${info.phase}`);
|
|
1024
|
+
console.log(`Iteration: ${info.iteration}/${info.maxIterations}`);
|
|
1025
|
+
console.log(`Triples: ${info.totalTriples}`);
|
|
1026
|
+
console.log(`New inferences: ${info.newInferences}`);
|
|
1027
|
+
},
|
|
1028
|
+
throttleMs: 500 // Report every 500ms
|
|
1029
|
+
});
|
|
1030
|
+
|
|
1031
|
+
await reasoner.reason(store, { progressReporter: reporter });
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
---
|
|
1035
|
+
|
|
803
1036
|
## YATA Integration
|
|
804
1037
|
|
|
805
1038
|
### What is YATA?
|
|
@@ -992,6 +1225,6 @@ const client = createYATAClient({
|
|
|
992
1225
|
|
|
993
1226
|
---
|
|
994
1227
|
|
|
995
|
-
**Version**: 1.
|
|
1228
|
+
**Version**: 1.4.5
|
|
996
1229
|
**Last Updated**: 2026-01-05
|
|
997
1230
|
**MUSUBIX Project**
|
|
@@ -7,7 +7,7 @@ tags:
|
|
|
7
7
|
- LLM
|
|
8
8
|
- ニューロシンボリック
|
|
9
9
|
private: false
|
|
10
|
-
updated_at: '2026-01-
|
|
10
|
+
updated_at: '2026-01-06'
|
|
11
11
|
id: null
|
|
12
12
|
organization_url_name: null
|
|
13
13
|
slide: false
|
|
@@ -21,7 +21,7 @@ AIコーディング支援ツールは急速に進化しています。本記事
|
|
|
21
21
|
|
|
22
22
|
# TL;DR
|
|
23
23
|
|
|
24
|
-
> **最新バージョン**: v1.
|
|
24
|
+
> **最新バージョン**: v1.6.0 | **62ドメイン対応** | **249コンポーネント** | **1208テスト** | **17ベストプラクティス**
|
|
25
25
|
|
|
26
26
|
| 項目 | MUSUBI | MUSUBIX |
|
|
27
27
|
|------|--------|---------|
|
|
@@ -34,6 +34,7 @@ AIコーディング支援ツールは急速に進化しています。本記事
|
|
|
34
34
|
| **自己学習** | なし | フィードバックベースの適応学習 |
|
|
35
35
|
| **知識共有** | なし | **プロジェクト間ポータビリティ**(v1.4.0) |
|
|
36
36
|
| **正誤性検証** | なし | **OWL制約チェック**(v1.4.1) |
|
|
37
|
+
| **対話的CLI** | なし | **Interactive REPL**(v1.6.0) |
|
|
37
38
|
|
|
38
39
|
# 1. MUSUBIとは?
|
|
39
40
|
|
|
@@ -1253,6 +1254,99 @@ if (!consistency.consistent) {
|
|
|
1253
1254
|
└──────────────┘
|
|
1254
1255
|
```
|
|
1255
1256
|
|
|
1257
|
+
## 4.10 高度推論(v1.4.5)
|
|
1258
|
+
|
|
1259
|
+
v1.4.5では、**OWL 2 RLプロファイル推論エンジン**と**Datalog評価エンジン**を追加しました。これにより、知識グラフ上での自動推論と、人間可読な説明生成が可能になりました。
|
|
1260
|
+
|
|
1261
|
+
### なぜ高度推論が必要か?
|
|
1262
|
+
|
|
1263
|
+
従来の課題:
|
|
1264
|
+
- 明示的に登録された事実しか利用できない
|
|
1265
|
+
- 暗黙的な関係性を導出できない
|
|
1266
|
+
- 推論結果の根拠が不明確
|
|
1267
|
+
|
|
1268
|
+
v1.4.5での解決:
|
|
1269
|
+
- **OWL2RLReasoner**: 20以上のビルトインルールによる自動推論
|
|
1270
|
+
- **DatalogEngine**: ストラティファイド評価による柔軟なルール適用
|
|
1271
|
+
- **InferenceExplainer**: 推論チェーンの自然言語説明
|
|
1272
|
+
|
|
1273
|
+
### OWL 2 RL推論
|
|
1274
|
+
|
|
1275
|
+
OWL 2 RLプロファイルは、OWL 2のサブセットであり、ルールベースの推論に適しています。
|
|
1276
|
+
|
|
1277
|
+
| カテゴリ | ルール | 説明 |
|
|
1278
|
+
|----------|-------|------|
|
|
1279
|
+
| Class Axioms | `cax-sco`, `cax-eqc` | サブクラス、同値クラス推論 |
|
|
1280
|
+
| Property | `prp-dom`, `prp-rng` | ドメイン、レンジ推論 |
|
|
1281
|
+
| Property Characteristics | `prp-symp`, `prp-trp`, `prp-inv` | 対称、推移、逆プロパティ |
|
|
1282
|
+
| Equality | `eq-ref`, `eq-sym`, `eq-trans` | sameAs推論 |
|
|
1283
|
+
|
|
1284
|
+
### 使用例
|
|
1285
|
+
|
|
1286
|
+
```typescript
|
|
1287
|
+
import { OWL2RLReasoner, DatalogEngine, InferenceExplainer } from '@nahisaho/musubix-ontology-mcp';
|
|
1288
|
+
|
|
1289
|
+
// OWL 2 RL推論
|
|
1290
|
+
const reasoner = new OWL2RLReasoner({
|
|
1291
|
+
maxIterations: 100,
|
|
1292
|
+
enablePropertyChains: true
|
|
1293
|
+
});
|
|
1294
|
+
|
|
1295
|
+
const result = await reasoner.reason(store, {
|
|
1296
|
+
onProgress: (p) => console.log(`反復 ${p.iteration}: ${p.newTriples} 新規`)
|
|
1297
|
+
});
|
|
1298
|
+
|
|
1299
|
+
console.log(`${result.inferredCount} 個の事実を推論`);
|
|
1300
|
+
|
|
1301
|
+
// Datalog評価
|
|
1302
|
+
const engine = new DatalogEngine();
|
|
1303
|
+
const rules = [
|
|
1304
|
+
{
|
|
1305
|
+
head: { predicate: 'ancestor', args: ['?x', '?y'] },
|
|
1306
|
+
body: [{ predicate: 'parent', args: ['?x', '?y'] }]
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
head: { predicate: 'ancestor', args: ['?x', '?z'] },
|
|
1310
|
+
body: [
|
|
1311
|
+
{ predicate: 'parent', args: ['?x', '?y'] },
|
|
1312
|
+
{ predicate: 'ancestor', args: ['?y', '?z'] }
|
|
1313
|
+
]
|
|
1314
|
+
}
|
|
1315
|
+
];
|
|
1316
|
+
const derived = await engine.evaluate(rules, facts);
|
|
1317
|
+
|
|
1318
|
+
// 推論説明
|
|
1319
|
+
const explainer = new InferenceExplainer(reasoner.getProvenanceLog());
|
|
1320
|
+
const explanation = explainer.explain(subject, predicate, object, 'text');
|
|
1321
|
+
console.log(explanation);
|
|
1322
|
+
// → "Animal は owl:Class として宣言されているため Class です(ルール cax-sco)"
|
|
1323
|
+
```
|
|
1324
|
+
|
|
1325
|
+
### 推論フロー
|
|
1326
|
+
|
|
1327
|
+
```
|
|
1328
|
+
知識グラフ
|
|
1329
|
+
│
|
|
1330
|
+
▼
|
|
1331
|
+
┌─────────────────┐
|
|
1332
|
+
│ OWL2RLReasoner │ ← 20+ ビルトインルール
|
|
1333
|
+
└────────┬────────┘
|
|
1334
|
+
│
|
|
1335
|
+
▼
|
|
1336
|
+
┌─────────────────┐
|
|
1337
|
+
│ 固定点到達まで │ ← 反復推論
|
|
1338
|
+
│ 新規推論を生成 │
|
|
1339
|
+
└────────┬────────┘
|
|
1340
|
+
│
|
|
1341
|
+
▼
|
|
1342
|
+
┌─────────────────┐
|
|
1343
|
+
│ InferenceExplainer │ ← 説明生成
|
|
1344
|
+
└────────┬────────┘
|
|
1345
|
+
│
|
|
1346
|
+
▼
|
|
1347
|
+
人間可読な推論根拠
|
|
1348
|
+
```
|
|
1349
|
+
|
|
1256
1350
|
# 5. 9つの憲法条項
|
|
1257
1351
|
|
|
1258
1352
|
MUSUBIXは、MUSUBIから継承した **9つの憲法条項(Constitutional Articles)** を遵守します。これらは開発プロセス全体を統治する不変の原則であり、AIコーディングエージェントが従うべきガバナンスフレームワークです。
|
|
@@ -1575,7 +1669,7 @@ claude mcp list
|
|
|
1575
1669
|
}
|
|
1576
1670
|
```
|
|
1577
1671
|
|
|
1578
|
-
### 利用可能なMCPツール(
|
|
1672
|
+
### 利用可能なMCPツール(19ツール)
|
|
1579
1673
|
|
|
1580
1674
|
#### SDD基本ツール(9ツール)
|
|
1581
1675
|
|
|
@@ -1603,6 +1697,14 @@ claude mcp list
|
|
|
1603
1697
|
| `ontology_query` | オントロジーグラフへのクエリ |
|
|
1604
1698
|
| `ontology_infer` | オントロジーによる推論実行 |
|
|
1605
1699
|
|
|
1700
|
+
#### オントロジー検証ツール(3ツール)- v1.4.1 NEW!
|
|
1701
|
+
|
|
1702
|
+
| ツール名 | 説明 |
|
|
1703
|
+
|---------|------|
|
|
1704
|
+
| `consistency_validate` | 知識グラフの整合性検証 |
|
|
1705
|
+
| `validate_triple` | 単一トリプルの事前検証 |
|
|
1706
|
+
| `check_circular` | 循環依存の検出 |
|
|
1707
|
+
|
|
1606
1708
|
### メリット
|
|
1607
1709
|
|
|
1608
1710
|
- ✅ **高度な機能**: 知識グラフ連携、矛盾検出
|
|
@@ -1649,4 +1751,4 @@ flowchart TD
|
|
|
1649
1751
|
**著者**: nahisaho
|
|
1650
1752
|
**公開日**: 2026-01-02
|
|
1651
1753
|
**更新日**: 2026-01-05
|
|
1652
|
-
**バージョン**: v1.
|
|
1754
|
+
**バージョン**: v1.4.5
|