musubix 2.4.1 → 3.0.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.
Files changed (80) hide show
  1. package/README.md +44 -310
  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 +51 -72
  8. package/.github/AGENTS.md +0 -242
  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 -229
  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 -210
  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 -772
  32. package/LICENSE +0 -21
  33. package/README.ja.md +0 -302
  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/MUSUBI-enhancement_roadmap_20260105.md +0 -651
  40. package/docs/MUSUBIXv2.2.0-Manual-outline.md +0 -136
  41. package/docs/MUSUBIXv2.2.0-Manual.md +0 -3123
  42. package/docs/MUSUBIXv2.3.5-Refactering.md +0 -1310
  43. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
  44. package/docs/MUSUBIv2.2.0-USERGUIDE.md +0 -2079
  45. package/docs/ROADMAP-v1.5.md +0 -116
  46. package/docs/SwarmCoding.md +0 -1284
  47. package/docs/Test-prompt.md +0 -105
  48. package/docs/USER-GUIDE-v1.8.0.md +0 -2371
  49. package/docs/USER-GUIDE.ja.md +0 -2147
  50. package/docs/USER-GUIDE.md +0 -2847
  51. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
  52. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
  53. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
  54. package/docs/evolution-from-musubi-to-musubix.md +0 -2170
  55. package/docs/getting-started-with-sdd.md +0 -1602
  56. package/docs/moodle-refactering-codegraph-musubix.md +0 -391
  57. package/docs/moodle-refactering-codegraph.md +0 -278
  58. package/docs/overview/MUSUBIX-CodeGraph.md +0 -322
  59. package/docs/overview/MUSUBIX-Core.md +0 -671
  60. package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
  61. package/docs/overview/MUSUBIX-Learning.md +0 -837
  62. package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
  63. package/docs/overview/MUSUBIX-Overview.md +0 -264
  64. package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
  65. package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
  66. package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
  67. package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
  68. package/docs/overview/MUSUBIX-Security-v2.1.md +0 -668
  69. package/docs/overview/MUSUBIX-Security.md +0 -891
  70. package/docs/overview/MUSUBIX-YATA.md +0 -666
  71. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +0 -513
  72. package/docs/overview/Neuro-SymbolicAI.md +0 -159
  73. package/scripts/generate-quality-gate-report.ts +0 -106
  74. package/scripts/postinstall.js +0 -94
  75. package/steering/.musubi-version +0 -1
  76. package/steering/product.ja.md +0 -572
  77. package/steering/project.yml +0 -66
  78. package/steering/rules/constitution.md +0 -412
  79. package/steering/structure.ja.md +0 -503
  80. package/steering/tech.ja.md +0 -208
@@ -1,2847 +0,0 @@
1
- # MUSUBIX User Guide
2
-
3
- > Neuro-Symbolic AI Coding with Ultimate Specification Driven Development
4
-
5
- ---
6
-
7
- ## Table of Contents
8
-
9
- 1. [Introduction](#introduction)
10
- 2. [Installation](#installation)
11
- 3. [CLI Usage](#cli-usage)
12
- 4. [Quick Start](#quick-start)
13
- 5. [SDD Workflow](#sdd-workflow)
14
- 6. [Self-Learning System](#self-learning-system)
15
- 7. [C4 Code Generation](#c4-code-generation)
16
- 8. [Symbolic Reasoning](#symbolic-reasoning) *(v1.2.0)*
17
- 9. [Consistency Validation](#consistency-validation) *(v1.4.1)*
18
- 10. [Advanced Inference](#advanced-inference) *(v1.4.5)*
19
- 11. [Interactive REPL Mode](#interactive-repl-mode) *(v1.5.0)*
20
- 12. [YATA Local](#yata-local) *(v1.6.3)*
21
- 13. [YATA Global](#yata-global) *(v1.6.3)*
22
- 14. [KGPR - Knowledge Graph Pull Request](#kgpr---knowledge-graph-pull-request) *(v1.6.4)*
23
- 15. [YATA Platform Enhancements](#yata-platform-enhancements) *(v1.7.0)*
24
- 16. [Formal Verification](#formal-verification) *(v1.7.5)*
25
- 17. [Security Analysis](#security-analysis) *(v1.8.0)*
26
- 18. [DFG/CFG Extraction](#dfgcfg-extraction) *(v2.0.0)*
27
- 19. [Lean 4 Integration](#lean-4-integration) *(v2.0.0)*
28
- 20. [YATA Scale](#yata-scale) *(v2.0.0)*
29
- 21. [Library Learning](#library-learning) *(v2.0.0)*
30
- 22. [Neural Search](#neural-search) *(v2.0.0)*
31
- 23. [Program Synthesis](#program-synthesis) *(v2.0.0)*
32
- 24. [Advanced Learning Enhancement](#advanced-learning-enhancement) *(v2.2.0 NEW!)*
33
- 25. [MCP Server Integration](#mcp-server-integration)
34
- 26. [YATA Integration](#yata-integration)
35
- 27. [Best Practices](#best-practices)
36
- 28. [Troubleshooting](#troubleshooting)
37
-
38
- ---
39
-
40
- ## Introduction
41
-
42
- ### What is MUSUBIX?
43
-
44
- **MUSUBIX** is an Ultimate Specification Driven Development (SDD) platform based on Neuro-Symbolic AI. By integrating MUSUBI (SDD Engine) with YATA (Knowledge Graph), it provides an AI-assisted development environment that maintains requirements, design, and implementation consistency.
45
-
46
- ### 9 Constitutional Articles
47
-
48
- MUSUBIX development follows 9 Articles:
49
-
50
- | Article | Description |
51
- |---------|-------------|
52
- | Article 1 | EARS-format requirements |
53
- | Article 2 | C4 architecture design |
54
- | Article 3 | ADR-based technical decisions |
55
- | Article 4 | Test-first development (TDD) |
56
- | Article 5 | Full requirement traceability |
57
- | Article 6 | CI/CD automation |
58
- | Article 7 | Knowledge graph management |
59
- | Article 8 | AI-assisted code review |
60
- | Article 9 | Continuous quality improvement |
61
-
62
- ---
63
-
64
- ## Installation
65
-
66
- ### System Requirements
67
-
68
- - Node.js: >= 20.0.0
69
- - npm: >= 10.0.0
70
- - TypeScript: >= 5.3
71
-
72
- ### Method 1: Global Installation (Recommended)
73
-
74
- ```bash
75
- # Global installation
76
- npm install -g musubix
77
-
78
- # Verify installation
79
- musubix --version
80
- ```
81
-
82
- ### Method 2: Using npx
83
-
84
- ```bash
85
- # Initialize project without installation
86
- npx musubix init my-project
87
-
88
- # Project templates
89
- npx musubix init my-app --template typescript
90
- npx musubix init my-api --template node
91
- npx musubix init my-web --template react
92
- ```
93
-
94
- ### Method 3: Project Dependency
95
-
96
- ```bash
97
- # Add to existing project
98
- npm install musubix
99
-
100
- # Use with npx
101
- npx musubix --help
102
- ```
103
-
104
- ### Method 4: From Source
105
-
106
- ```bash
107
- # Clone repository
108
- git clone https://github.com/nahisaho/MUSUBIX.git
109
- cd MUSUBIX
110
-
111
- # Install dependencies
112
- npm install
113
-
114
- # Build
115
- npm run build
116
-
117
- # Global link
118
- npm link
119
- ```
120
-
121
- ### YATA Installation (Optional)
122
-
123
- If you want to use knowledge graph features, install YATA separately:
124
-
125
- ```bash
126
- # Install uv (if not installed)
127
- curl -LsSf https://astral.sh/uv/install.sh | sh
128
-
129
- # Clone YATA
130
- git clone https://github.com/nahisaho/YATA.git
131
- cd YATA
132
-
133
- # Create Python environment
134
- uv venv
135
- source .venv/bin/activate # Linux/macOS
136
- # or .venv\Scripts\activate # Windows
137
-
138
- # Install dependencies
139
- uv pip install -e ".[dev]"
140
- ```
141
-
142
- ---
143
-
144
- ## CLI Usage
145
-
146
- ### musubix Command
147
-
148
- Main command for project management:
149
-
150
- ```bash
151
- # Initialize project
152
- musubix init <project-name>
153
-
154
- # Available templates
155
- musubix init my-project --template typescript
156
- musubix init my-project --template node
157
- musubix init my-project --template react
158
-
159
- # Help
160
- musubix --help
161
-
162
- # Version
163
- musubix --version
164
- ```
165
-
166
- ### musubix-mcp Command
167
-
168
- Start MCP server for AI platform integration:
169
-
170
- ```bash
171
- # Start with stdio transport (default)
172
- musubix-mcp
173
-
174
- # Start with SSE transport
175
- musubix-mcp --transport sse --port 3000
176
-
177
- # Help
178
- musubix-mcp --help
179
-
180
- # Version
181
- musubix-mcp --version
182
- ```
183
-
184
- ---
185
-
186
- ## Quick Start
187
-
188
- ### Basic TypeScript Usage
189
-
190
- ```typescript
191
- import {
192
- createRequirementsService,
193
- createDesignService,
194
- createValidationService
195
- } from 'musubix';
196
-
197
- // Create services
198
- const requirements = createRequirementsService();
199
- const design = createDesignService();
200
- const validation = createValidationService();
201
-
202
- // Add requirement (EARS format)
203
- const req = requirements.addRequirement({
204
- id: 'REQ-001',
205
- text: 'When a user logs in, the system shall authenticate the user',
206
- priority: 'high',
207
- acceptanceCriteria: [
208
- 'JWT token shall be returned on successful login',
209
- 'Error message shall be displayed on failure'
210
- ]
211
- });
212
-
213
- // Create design
214
- const des = design.createComponent({
215
- id: 'DES-001',
216
- name: 'AuthModule',
217
- type: 'component',
218
- requirements: ['REQ-001'],
219
- decisions: ['Use JWT authentication']
220
- });
221
-
222
- // Validate
223
- const result = validation.validate({
224
- requirements: [req],
225
- designs: [des]
226
- });
227
-
228
- console.log(result.compliant); // true or false
229
- ```
230
-
231
- ### SDD Workflow Overview
232
-
233
- ```
234
- ┌─────────────────┐
235
- │ Requirements │ EARS format requirements
236
- └────────┬────────┘
237
-
238
- ┌─────────────────┐
239
- │ Design │ C4 Architecture + ADR
240
- └────────┬────────┘
241
-
242
- ┌─────────────────┐
243
- │ Tasks │ Traceable implementation tasks
244
- └────────┬────────┘
245
-
246
- ┌─────────────────┐
247
- │ Validation │ 9 Articles compliance check
248
- └─────────────────┘
249
- ```
250
-
251
- ---
252
-
253
- ## SDD Workflow
254
-
255
- ### Phase 1: Requirements (EARS Format)
256
-
257
- Use EARS (Easy Approach to Requirements Syntax) format for requirements:
258
-
259
- ```typescript
260
- const requirements = createRequirementsService();
261
-
262
- // Pattern: "When <trigger>, the system shall <response>"
263
- const loginReq = requirements.addRequirement({
264
- id: 'REQ-001',
265
- text: 'When a user enters valid credentials, the system shall issue an authentication token',
266
- priority: 'high',
267
- acceptanceCriteria: [
268
- 'Token shall be valid for 24 hours',
269
- 'Token shall include user information'
270
- ]
271
- });
272
-
273
- // Pattern: "While <state>, the system shall <behavior>"
274
- const sessionReq = requirements.addRequirement({
275
- id: 'REQ-002',
276
- text: 'While a session is active, the system shall maintain user state',
277
- priority: 'medium'
278
- });
279
-
280
- // Get all requirements
281
- const allReqs = requirements.getAllRequirements();
282
- console.log(`Total requirements: ${allReqs.length}`);
283
- ```
284
-
285
- ### Phase 2: Design (C4 + ADR)
286
-
287
- #### C4 Model
288
-
289
- Design at 4 levels:
290
-
291
- ```typescript
292
- const design = createDesignService();
293
-
294
- // Level 1: Context
295
- const system = design.createContainer({
296
- id: 'SYS-001',
297
- name: 'MUSUBIX System',
298
- type: 'system',
299
- description: 'Neuro-Symbolic AI-based SDD platform'
300
- });
301
-
302
- // Level 2: Container
303
- const apiServer = design.createContainer({
304
- id: 'CON-001',
305
- name: 'API Server',
306
- type: 'container',
307
- parent: 'SYS-001',
308
- technology: 'Node.js + Express'
309
- });
310
-
311
- // Level 3: Component
312
- const authModule = design.createComponent({
313
- id: 'COMP-001',
314
- name: 'Authentication Module',
315
- type: 'component',
316
- parent: 'CON-001',
317
- requirements: ['REQ-001']
318
- });
319
- ```
320
-
321
- #### ADR (Architecture Decision Record)
322
-
323
- Document technical decisions:
324
-
325
- ```typescript
326
- const adr = design.createADR({
327
- id: 'ADR-001',
328
- title: 'JWT for Authentication',
329
- context: 'Need to select stateless authentication method',
330
- decision: 'Use JWT',
331
- status: 'accepted',
332
- consequences: [
333
- 'Positive: Stateless, scalable',
334
- 'Negative: Token revocation requires additional implementation'
335
- ],
336
- relatedRequirements: ['REQ-001']
337
- });
338
- ```
339
-
340
- ### Phase 3: Tasks
341
-
342
- Break down requirements and designs into implementation tasks:
343
-
344
- ```typescript
345
- const tasks = createTaskService();
346
-
347
- // Create task linked to requirements
348
- const task = tasks.createTask({
349
- id: 'TASK-001',
350
- title: 'Implement JWT authentication',
351
- description: 'Implement JWT-based authentication module',
352
- requirements: ['REQ-001'],
353
- designs: ['COMP-001'],
354
- estimatedHours: 4,
355
- acceptanceCriteria: [
356
- 'Login API endpoint completed',
357
- 'JWT generation/validation tests passing'
358
- ]
359
- });
360
-
361
- // Track progress
362
- tasks.updateProgress('TASK-001', {
363
- status: 'in-progress',
364
- completedItems: ['Login API endpoint completed']
365
- });
366
- ```
367
-
368
- ### Phase 4: Validation
369
-
370
- Check compliance with 9 Constitutional Articles:
371
-
372
- ```typescript
373
- const validation = createValidationService();
374
-
375
- // Full validation
376
- const result = validation.validateAll({
377
- requirements: requirements.getAllRequirements(),
378
- designs: design.getAllDesigns(),
379
- tasks: tasks.getAllTasks()
380
- });
381
-
382
- // Check results
383
- console.log('Compliant:', result.compliant);
384
- console.log('Score:', result.score);
385
-
386
- // Check details by Article
387
- result.articleResults.forEach(article => {
388
- console.log(`Article ${article.number}: ${article.passed ? '✓' : '✗'}`);
389
- if (!article.passed) {
390
- console.log(' Issues:', article.issues);
391
- }
392
- });
393
- ```
394
-
395
- ---
396
-
397
- ## Self-Learning System
398
-
399
- MUSUBIX includes a self-learning system that improves through feedback collection and pattern extraction.
400
-
401
- ### Learning CLI Commands
402
-
403
- ```bash
404
- # View learning status dashboard
405
- musubix learn status
406
-
407
- # Record feedback on an artifact
408
- musubix learn feedback <artifact-id> --type accept|reject|modify --artifact-type requirement|design|code|test --reason "explanation"
409
-
410
- # List learned patterns
411
- musubix learn patterns
412
-
413
- # Manually register a pattern
414
- musubix learn add-pattern <name> --category code|design|requirement|test --action prefer|avoid --description "pattern description"
415
-
416
- # Remove a pattern
417
- musubix learn remove-pattern <pattern-id>
418
-
419
- # Get context-based recommendations
420
- musubix learn recommend --artifact-type code
421
-
422
- # Apply decay to unused patterns
423
- musubix learn decay
424
-
425
- # Export learning data (v1.4.0 enhanced)
426
- musubix learn export --output learning-data.json
427
- # Options:
428
- # --privacy-filter Remove sensitive data (API keys, passwords)
429
- # --patterns-only Export patterns only (exclude feedback)
430
- # --feedback-only Export feedback only (exclude patterns)
431
- # --min-confidence <n> Minimum confidence threshold (0-1)
432
-
433
- # Import learning data with merge strategy (v1.4.0 enhanced)
434
- musubix learn import learning-data.json
435
- # Options:
436
- # --merge-strategy <skip|overwrite|merge> How to handle duplicates
437
- # --dry-run Preview without applying
438
- # --patterns-only Import patterns only
439
- # --feedback-only Import feedback only
440
- ```
441
-
442
- ### Programmatic Usage
443
-
444
- ```typescript
445
- import { createLearningEngine } from '@nahisaho/musubix-core';
446
-
447
- const learningEngine = createLearningEngine();
448
-
449
- // Record feedback
450
- await learningEngine.recordFeedback({
451
- type: 'accept',
452
- artifactType: 'code',
453
- artifactId: 'AUTH-001',
454
- reason: 'Good implementation of JWT authentication'
455
- });
456
-
457
- // Get recommendations
458
- const recommendations = await learningEngine.getRecommendations({
459
- artifactType: 'code',
460
- context: 'authentication'
461
- });
462
-
463
- // Export learning data
464
- const data = await learningEngine.exportData();
465
- ```
466
-
467
- ### Pattern Extraction
468
-
469
- Patterns are automatically extracted when similar feedback is recorded multiple times (default threshold: 3).
470
-
471
- ```typescript
472
- // Patterns gain confidence with each occurrence
473
- // High-confidence patterns (≥70%) appear in recommendations
474
- const stats = await learningEngine.getStats();
475
- console.log(`Total patterns: ${stats.totalPatterns}`);
476
- console.log(`High confidence patterns: ${stats.highConfidencePatterns}`);
477
- ```
478
-
479
- ---
480
-
481
- ## C4 Code Generation
482
-
483
- Generate TypeScript skeleton code from C4 design documents.
484
-
485
- ### CLI Usage
486
-
487
- ```bash
488
- # Generate code from C4 design
489
- musubix codegen generate design-c4.md --output src/
490
-
491
- # With specific language
492
- musubix codegen generate design-c4.md --output src/ --language typescript
493
- ```
494
-
495
- ### Generated Code Structure
496
-
497
- From a C4 design with components like:
498
-
499
- | ID | Name | Type | Description |
500
- |----|------|------|-------------|
501
- | auth | AuthService | component | Authentication |
502
-
503
- MUSUBIX generates:
504
-
505
- ```typescript
506
- // auth-service.ts
507
- export interface IAuthService {
508
- authenticate(credentials: { username: string; password: string }): Promise<{ token: string }>;
509
- validate(token: string): Promise<boolean>;
510
- }
511
-
512
- export class AuthService implements IAuthService {
513
- async authenticate(credentials: { username: string; password: string }): Promise<{ token: string }> {
514
- // TODO: Implement authenticate
515
- throw new Error('Not implemented');
516
- }
517
-
518
- async validate(token: string): Promise<boolean> {
519
- // TODO: Implement validate
520
- throw new Error('Not implemented');
521
- }
522
- }
523
-
524
- export function createAuthService(): IAuthService {
525
- return new AuthService();
526
- }
527
- ```
528
-
529
- ---
530
-
531
- ## Interactive REPL Mode
532
-
533
- *(New in v1.5.0, Enhanced in v1.6.0)*
534
-
535
- MUSUBIX provides an interactive REPL (Read-Eval-Print-Loop) shell for real-time command execution and exploration.
536
-
537
- ### Starting REPL
538
-
539
- ```bash
540
- # Start interactive REPL
541
- musubix repl
542
-
543
- # With custom history file
544
- musubix repl --history ~/.musubix-repl-history
545
-
546
- # Without colors
547
- musubix repl --no-color
548
- ```
549
-
550
- ### REPL Features
551
-
552
- | Feature | Description |
553
- |---------|-------------|
554
- | Command completion | TAB completion for commands, options |
555
- | History navigation | UP/DOWN arrows, history search |
556
- | Session variables | `$name=value` to set, `$name` to reference |
557
- | Output formatting | JSON, YAML, Table auto-formatting |
558
- | CLI integration | Execute any CLI command directly |
559
-
560
- ### Basic Usage
561
-
562
- ```bash
563
- musubix> help # Show all commands
564
- musubix> help requirements # Show command details
565
- musubix> requirements analyze input.md # Execute CLI command
566
- musubix> $project=my-app # Set session variable
567
- musubix> design generate $project # Use variable in command
568
- musubix> history # Show command history
569
- musubix> exit # Exit REPL
570
- ```
571
-
572
- ### Session Variables
573
-
574
- ```bash
575
- # Set variables
576
- musubix> $req=REQ-001
577
- musubix> $file=./docs/requirements.md
578
-
579
- # Use in commands
580
- musubix> requirements validate $file
581
- musubix> trace impact $req
582
-
583
- # Special variable: $_ holds last result
584
- musubix> requirements analyze input.md
585
- musubix> $_ # Access last result
586
- ```
587
-
588
- ### Output Formats
589
-
590
- ```bash
591
- # Auto-detect best format (default)
592
- musubix> learn status
593
-
594
- # Force JSON output
595
- musubix> set format json
596
- musubix> learn patterns
597
-
598
- # Force YAML output
599
- musubix> set format yaml
600
-
601
- # Force table output
602
- musubix> set format table
603
- ```
604
-
605
- ### History Management
606
-
607
- ```bash
608
- # Show recent commands
609
- musubix> history
610
-
611
- # Search history (Ctrl+R style)
612
- musubix> history search requirements
613
-
614
- # Clear history
615
- musubix> history clear
616
- ```
617
-
618
- ### REPL Components
619
-
620
- | Component | Purpose |
621
- |-----------|---------|
622
- | `ReplEngine` | Main REPL controller |
623
- | `CommandCompleter` | TAB completion provider |
624
- | `HistoryManager` | Command history persistence |
625
- | `SessionState` | Variable storage |
626
- | `OutputFormatter` | JSON/YAML/Table output |
627
- | `PromptRenderer` | Dynamic prompt display |
628
-
629
- ---
630
-
631
- ## YATA Local
632
-
633
- *(New in v1.6.3)*
634
-
635
- YATA Local provides a high-performance, SQLite-based local knowledge graph with built-in inference capabilities. Designed for single-user, offline scenarios where data sovereignty and speed are critical.
636
-
637
- ### Features
638
-
639
- | Feature | Description |
640
- |---------|-------------|
641
- | **SQLite Storage** | WAL mode for concurrent reads, single-writer |
642
- | **Full-Text Search** | FTS5-based triple search |
643
- | **Graph Traversal** | BFS/DFS with depth control |
644
- | **Inference Engine** | 4 OWL-lite rules (transitivity, symmetry, inverse, domain/range) |
645
- | **Constraints** | 4 validation rules (cardinality, disjoint, unique, required) |
646
- | **ACID Transactions** | Full transaction support |
647
-
648
- ### Installation
649
-
650
- ```bash
651
- npm install @nahisaho/yata-local
652
- ```
653
-
654
- ### Quick Start
655
-
656
- ```typescript
657
- import { YataLocal } from '@nahisaho/yata-local';
658
-
659
- // Initialize with default config
660
- const yata = new YataLocal('./knowledge.db');
661
- await yata.initialize();
662
-
663
- // Add triples
664
- await yata.addTriple({
665
- subject: 'Person:john',
666
- predicate: 'hasParent',
667
- object: 'Person:mary'
668
- });
669
-
670
- // Query triples
671
- const results = await yata.query({
672
- subject: 'Person:john',
673
- predicate: 'hasParent'
674
- });
675
-
676
- // Full-text search
677
- const searchResults = await yata.search('john parent');
678
-
679
- // Graph traversal (BFS)
680
- const ancestors = await yata.traverse('Person:john', 'hasParent', {
681
- direction: 'outgoing',
682
- maxDepth: 5,
683
- algorithm: 'bfs'
684
- });
685
-
686
- // Clean up
687
- await yata.close();
688
- ```
689
-
690
- ### Inference Engine
691
-
692
- YATA Local supports four OWL-lite inference rules:
693
-
694
- | Rule | Description | Example |
695
- |------|-------------|---------|
696
- | **Transitivity** | If A→B and B→C then A→C | hasAncestor is transitive |
697
- | **Symmetry** | If A→B then B→A | friendOf is symmetric |
698
- | **Inverse** | If A→B via P then B→A via P⁻¹ | hasChild ↔ hasParent |
699
- | **Domain/Range** | Type inference from predicate | hasAge implies Person |
700
-
701
- ```typescript
702
- // Run inference
703
- const inferred = await yata.infer();
704
- console.log(`Inferred ${inferred.length} new triples`);
705
- ```
706
-
707
- ### Constraints
708
-
709
- ```typescript
710
- // Define constraints
711
- await yata.addConstraint({
712
- type: 'cardinality',
713
- predicate: 'hasSpouse',
714
- max: 1
715
- });
716
-
717
- // Validate
718
- const violations = await yata.validate();
719
- if (violations.length > 0) {
720
- console.error('Constraint violations:', violations);
721
- }
722
- ```
723
-
724
- ### Configuration Options
725
-
726
- ```typescript
727
- const yata = new YataLocal('./knowledge.db', {
728
- // WAL mode for better concurrency (default: true)
729
- walMode: true,
730
-
731
- // Enable FTS5 search (default: true)
732
- enableSearch: true,
733
-
734
- // Auto-run inference on writes (default: false)
735
- autoInfer: false,
736
-
737
- // Journal mode (default: 'wal')
738
- journalMode: 'wal'
739
- });
740
- ```
741
-
742
- ---
743
-
744
- ## YATA Global
745
-
746
- *(New in v1.6.3)*
747
-
748
- YATA Global is a distributed knowledge graph platform for team collaboration. It provides REST API access to shared knowledge graphs with offline support and intelligent synchronization.
749
-
750
- ### Features
751
-
752
- | Feature | Description |
753
- |---------|-------------|
754
- | **REST API** | Full CRUD operations via HTTP |
755
- | **Offline Cache** | SQLite-based local cache |
756
- | **Sync Engine** | Push/Pull with conflict resolution |
757
- | **Conflict Resolution** | Last-write-wins or custom strategies |
758
- | **Authentication** | API key-based auth |
759
- | **Batch Operations** | Bulk triple operations |
760
-
761
- ### Installation
762
-
763
- ```bash
764
- npm install @nahisaho/yata-global
765
- ```
766
-
767
- ### Quick Start
768
-
769
- ```typescript
770
- import { YataGlobal } from '@nahisaho/yata-global';
771
-
772
- // Initialize client
773
- const yata = new YataGlobal({
774
- endpoint: 'https://yata.example.com/api',
775
- apiKey: 'your-api-key',
776
- graphId: 'project-knowledge'
777
- });
778
-
779
- await yata.initialize();
780
-
781
- // Add triples (batched)
782
- await yata.addTriples([
783
- { subject: 'Task:001', predicate: 'assignedTo', object: 'User:alice' },
784
- { subject: 'Task:001', predicate: 'status', object: 'in-progress' }
785
- ]);
786
-
787
- // Query with filters
788
- const tasks = await yata.query({
789
- predicate: 'assignedTo',
790
- object: 'User:alice'
791
- });
792
-
793
- // Clean up
794
- await yata.close();
795
- ```
796
-
797
- ### Offline Support
798
-
799
- YATA Global supports offline-first operation with automatic synchronization:
800
-
801
- ```typescript
802
- const yata = new YataGlobal({
803
- endpoint: 'https://yata.example.com/api',
804
- apiKey: 'your-api-key',
805
- graphId: 'project-knowledge',
806
-
807
- // Offline configuration
808
- offlineMode: true,
809
- cachePath: './yata-cache.db',
810
- syncInterval: 60000 // Auto-sync every 60 seconds
811
- });
812
-
813
- // Works offline - cached locally
814
- await yata.addTriple({
815
- subject: 'Note:001',
816
- predicate: 'content',
817
- object: 'Important meeting notes'
818
- });
819
-
820
- // Manual sync when online
821
- await yata.sync();
822
- ```
823
-
824
- ### Conflict Resolution
825
-
826
- ```typescript
827
- const yata = new YataGlobal({
828
- // ... other options
829
-
830
- conflictStrategy: 'last-write-wins', // Default
831
- // or: 'server-wins', 'client-wins', 'manual'
832
-
833
- onConflict: async (local, remote) => {
834
- // Custom resolution logic
835
- console.log('Conflict detected:', local, remote);
836
- return remote; // Prefer remote version
837
- }
838
- });
839
- ```
840
-
841
- ### Sync Status
842
-
843
- ```typescript
844
- // Check sync status
845
- const status = await yata.getSyncStatus();
846
- console.log(`Pending changes: ${status.pendingPush}`);
847
- console.log(`Last sync: ${status.lastSyncAt}`);
848
-
849
- // Force full sync
850
- await yata.sync({ force: true });
851
- ```
852
-
853
- ### When to Use YATA Local vs YATA Global
854
-
855
- | Use Case | Recommended |
856
- |----------|-------------|
857
- | Personal knowledge base | YATA Local |
858
- | Single-user application | YATA Local |
859
- | Privacy-sensitive data | YATA Local |
860
- | Team collaboration | YATA Global |
861
- | Cross-device access | YATA Global |
862
- | Shared project knowledge | YATA Global |
863
- | Offline-first with sync | YATA Global |
864
-
865
- ---
866
-
867
- ## KGPR - Knowledge Graph Pull Request
868
-
869
- *(v1.6.4)*
870
-
871
- KGPR (Knowledge Graph Pull Request) enables safe sharing of knowledge graphs from YATA Local to YATA Global using a GitHub PR-like workflow.
872
-
873
- ### Workflow
874
-
875
- ```
876
- ┌─────────────┐ ┌──────────────┐ ┌───────────────┐
877
- │ YATA Local │ ──► │ KGPR (Draft) │ ──► │ YATA Global │
878
- │ (Local KG) │ │ (Extract) │ │ (Review/Merge)│
879
- └─────────────┘ └──────────────┘ └───────────────┘
880
-
881
- Status Flow:
882
- draft → open → reviewing → approved/changes_requested → merged/closed
883
- ```
884
-
885
- ### Privacy Levels
886
-
887
- | Level | Filtered Content |
888
- |-------|------------------|
889
- | `strict` | File paths, URLs, credentials, all metadata |
890
- | `moderate` | File paths, URLs, credentials |
891
- | `none` | No filtering |
892
-
893
- ### CLI Commands
894
-
895
- ```bash
896
- # Create a KGPR
897
- musubix kgpr create -t "Add authentication patterns"
898
-
899
- # Preview diff before creating
900
- musubix kgpr diff --namespace myproject --privacy moderate
901
-
902
- # List KGPRs
903
- musubix kgpr list
904
-
905
- # Submit KGPR for review
906
- musubix kgpr submit <id>
907
-
908
- # Show KGPR details
909
- musubix kgpr show <id>
910
-
911
- # Close without merging
912
- musubix kgpr close <id>
913
- ```
914
-
915
- ### MCP Tools
916
-
917
- | Tool | Description |
918
- |------|-------------|
919
- | `kgpr_create` | Create KGPR from local knowledge graph |
920
- | `kgpr_diff` | Preview diff before creating KGPR |
921
- | `kgpr_list` | List all KGPRs |
922
- | `kgpr_submit` | Submit KGPR for review |
923
- | `kgpr_review` | Review KGPR (approve/changes_requested/commented) |
924
-
925
- ### Example Usage
926
-
927
- ```bash
928
- # 1. Preview what will be shared
929
- musubix kgpr diff --privacy strict
930
-
931
- # 2. Create KGPR with description
932
- musubix kgpr create -t "Share React patterns" -d "Learned patterns from project-x"
933
-
934
- # 3. Review the KGPR
935
- musubix kgpr show KGPR-001
936
-
937
- # 4. Submit for review
938
- musubix kgpr submit KGPR-001
939
- ```
940
-
941
- ---
942
-
943
- ## YATA Platform Enhancements
944
-
945
- *(v1.7.0)*
946
-
947
- Version 1.7.0 introduces significant enhancements to the YATA platform with 5 major features.
948
-
949
- ### Phase 1: Index Optimization
950
-
951
- Optimized query performance for YATA Local with composite indexes.
952
-
953
- ```typescript
954
- import { IndexOptimizer } from '@nahisaho/yata-local';
955
-
956
- const optimizer = new IndexOptimizer(database);
957
-
958
- // Analyze and create optimal indexes
959
- const analysis = await optimizer.analyzeQueryPatterns();
960
- const created = await optimizer.createOptimalIndexes();
961
-
962
- // Check index health
963
- const health = await optimizer.checkIndexHealth();
964
- ```
965
-
966
- **Key Features:**
967
- - Composite index creation for common query patterns
968
- - Index health monitoring with fragmentation detection
969
- - Automatic optimization recommendations
970
-
971
- ### Phase 2: Enhanced Export Pipeline
972
-
973
- Powerful export capabilities with incremental export and multiple formats.
974
-
975
- ```typescript
976
- import { ExportPipeline } from '@nahisaho/yata-local';
977
-
978
- const pipeline = new ExportPipeline(database);
979
-
980
- // Full export
981
- const fullData = await pipeline.exportFull({ namespace: 'myproject' });
982
-
983
- // Incremental export (changes since last export)
984
- const changes = await pipeline.exportIncremental({
985
- since: lastExportTimestamp,
986
- format: 'json'
987
- });
988
-
989
- // Export with transformation
990
- const transformed = await pipeline.exportWithTransform({
991
- format: 'rdf',
992
- includeMetadata: true
993
- });
994
- ```
995
-
996
- **Supported Formats:**
997
- - JSON (default)
998
- - RDF/Turtle
999
- - N-Triples
1000
- - Custom transformers
1001
-
1002
- ### Phase 3: Global Sync Integration
1003
-
1004
- Seamless synchronization between YATA Local and YATA Global.
1005
-
1006
- ```typescript
1007
- import { GlobalSyncClient, SyncEngine } from '@nahisaho/yata-global';
1008
-
1009
- const client = new GlobalSyncClient({
1010
- endpoint: 'https://yata-global.example.com',
1011
- offlineMode: true
1012
- });
1013
-
1014
- // Initialize sync
1015
- await client.initialize();
1016
-
1017
- // Push local changes
1018
- const syncResult = await client.sync({
1019
- namespace: 'myproject',
1020
- direction: 'push'
1021
- });
1022
-
1023
- // Pull updates from global
1024
- await client.sync({
1025
- namespace: 'shared-patterns',
1026
- direction: 'pull'
1027
- });
1028
- ```
1029
-
1030
- **Features:**
1031
- - Offline-first with automatic sync
1032
- - Conflict resolution strategies
1033
- - Selective namespace sync
1034
- - Framework pattern repository
1035
-
1036
- ### Phase 4: Code Generator Enhancement
1037
-
1038
- Advanced code generation from design documents.
1039
-
1040
- ```typescript
1041
- import { CodeGenerator } from '@nahisaho/yata-local';
1042
-
1043
- const generator = new CodeGenerator({
1044
- language: 'typescript',
1045
- outputDir: './src/generated'
1046
- });
1047
-
1048
- // Generate from C4 design
1049
- const result = await generator.generateFromC4(designDocument);
1050
-
1051
- // Generate with custom templates
1052
- await generator.generate({
1053
- template: 'repository-pattern',
1054
- context: { entityName: 'User' }
1055
- });
1056
- ```
1057
-
1058
- **Supported Patterns:**
1059
- - Repository Pattern
1060
- - Service Layer
1061
- - Factory Pattern
1062
- - Domain Events
1063
- - Value Objects
1064
-
1065
- ### Phase 5: YATA UI (Web Visualization)
1066
-
1067
- Web-based visualization and management interface for knowledge graphs.
1068
-
1069
- ```typescript
1070
- import { YataUIServer, createYataUIServer } from '@nahisaho/yata-ui';
1071
-
1072
- // Create and start server
1073
- const server = createYataUIServer({
1074
- port: 3000,
1075
- enableRealtime: true
1076
- });
1077
-
1078
- // Set data provider
1079
- server.setDataProvider(async () => ({
1080
- nodes: await getEntities(),
1081
- edges: await getRelationships()
1082
- }));
1083
-
1084
- await server.start();
1085
- console.log(`UI available at ${server.getUrl()}`);
1086
- ```
1087
-
1088
- **UI Features:**
1089
- - Interactive graph visualization
1090
- - Real-time updates via WebSocket
1091
- - Namespace filtering
1092
- - Entity/Relationship editing
1093
- - Export/Import functionality
1094
-
1095
- ### v1.7.0 Package Summary
1096
-
1097
- | Package | Description |
1098
- |---------|-------------|
1099
- | `@nahisaho/yata-local` | IndexOptimizer, ExportPipeline, CodeGenerator |
1100
- | `@nahisaho/yata-global` | GlobalSyncClient, SyncEngine, CacheManager |
1101
- | `@nahisaho/yata-ui` | YataUIServer, Graph visualization |
1102
-
1103
- ---
1104
-
1105
- ## Formal Verification
1106
-
1107
- *(v1.7.5)*
1108
-
1109
- The `@nahisaho/musubix-formal-verify` package provides formal verification capabilities using the Z3 SMT solver.
1110
-
1111
- ### Installation
1112
-
1113
- ```bash
1114
- npm install @nahisaho/musubix-formal-verify
1115
- # Optional: Install z3-solver for WebAssembly support
1116
- npm install z3-solver
1117
- ```
1118
-
1119
- ### Z3 SMT Solver Integration
1120
-
1121
- ```typescript
1122
- import { Z3Adapter, PreconditionVerifier, PostconditionVerifier } from '@nahisaho/musubix-formal-verify';
1123
-
1124
- // Create Z3 adapter (auto-selects backend)
1125
- const z3 = await Z3Adapter.create();
1126
-
1127
- // Precondition verification
1128
- const preVerifier = new PreconditionVerifier(z3);
1129
- const result = await preVerifier.verify({
1130
- condition: { expression: 'amount > 0 && balance >= amount', format: 'javascript' },
1131
- variables: [
1132
- { name: 'amount', type: 'Int' },
1133
- { name: 'balance', type: 'Int' },
1134
- ],
1135
- });
1136
-
1137
- console.log(result.status); // 'valid' | 'invalid' | 'unknown' | 'error'
1138
- ```
1139
-
1140
- ### Hoare Triple Verification
1141
-
1142
- ```typescript
1143
- // Verify {P} C {Q}
1144
- const postVerifier = new PostconditionVerifier(z3);
1145
- const hoareResult = await postVerifier.verify({
1146
- precondition: { expression: 'balance >= amount', format: 'javascript' },
1147
- postcondition: { expression: 'balance_new == balance - amount', format: 'javascript' },
1148
- preVariables: [{ name: 'balance', type: 'Int' }, { name: 'amount', type: 'Int' }],
1149
- postVariables: [{ name: 'balance_new', type: 'Int' }],
1150
- transition: 'balance_new == balance - amount',
1151
- });
1152
- ```
1153
-
1154
- ### EARS to SMT Conversion
1155
-
1156
- ```typescript
1157
- import { EarsToSmtConverter } from '@nahisaho/musubix-formal-verify';
1158
-
1159
- const converter = new EarsToSmtConverter();
1160
-
1161
- // Convert EARS requirements to SMT-LIB2
1162
- const results = converter.convertMultiple([
1163
- 'THE system SHALL validate inputs', // ubiquitous
1164
- 'WHEN error, THE system SHALL notify user', // event-driven
1165
- 'WHILE busy, THE system SHALL queue requests', // state-driven
1166
- 'THE system SHALL NOT expose secrets', // unwanted
1167
- 'IF admin, THEN THE system SHALL allow edit', // optional
1168
- ]);
1169
-
1170
- results.forEach(r => {
1171
- console.log(`Pattern: ${r.formula?.metadata.earsPattern.type}`);
1172
- console.log(`SMT: ${r.formula?.smtLib2}`);
1173
- });
1174
- ```
1175
-
1176
- ### Traceability Database
1177
-
1178
- ```typescript
1179
- import { TraceabilityDB, ImpactAnalyzer } from '@nahisaho/musubix-formal-verify';
1180
-
1181
- // Create SQLite-based traceability database
1182
- const db = new TraceabilityDB('./trace.db');
1183
-
1184
- // Add nodes
1185
- await db.addNode({ id: 'REQ-001', type: 'requirement', title: 'User Auth' });
1186
- await db.addNode({ id: 'DES-001', type: 'design', title: 'AuthService' });
1187
- await db.addNode({ id: 'CODE-001', type: 'code', title: 'auth.ts' });
1188
-
1189
- // Add traceability links
1190
- await db.addLink({ source: 'DES-001', target: 'REQ-001', type: 'satisfies' });
1191
- await db.addLink({ source: 'CODE-001', target: 'DES-001', type: 'implements' });
1192
-
1193
- // Impact analysis
1194
- const analyzer = new ImpactAnalyzer(db);
1195
- const impact = await analyzer.analyze('REQ-001');
1196
- console.log(`Impacted nodes: ${impact.totalImpacted}`);
1197
- ```
1198
-
1199
- ### v1.7.5 Package Summary
1200
-
1201
- | Package | Description |
1202
- |---------|-------------|
1203
- | `@nahisaho/musubix-formal-verify` | Z3 integration, Hoare verification, EARS→SMT, TraceabilityDB |
1204
-
1205
- ### Supported Variable Types
1206
-
1207
- | Type | Description |
1208
- |------|-------------|
1209
- | `Int` | Integer values |
1210
- | `Real` | Real numbers |
1211
- | `Bool` | Boolean values |
1212
- | `String` | String values |
1213
- | `Array` | Array types |
1214
- | `BitVec` | Bit vectors |
1215
-
1216
- ---
1217
-
1218
- ## Security Analysis
1219
-
1220
- *(v1.8.0)*
1221
-
1222
- The `@nahisaho/musubix-security` package provides comprehensive security analysis capabilities for TypeScript/JavaScript projects.
1223
-
1224
- ### Installation
1225
-
1226
- ```bash
1227
- npm install @nahisaho/musubix-security
1228
- ```
1229
-
1230
- ### Vulnerability Scanning
1231
-
1232
- Detects OWASP Top 10 and CWE Top 25 vulnerabilities using AST analysis:
1233
-
1234
- ```typescript
1235
- import { VulnerabilityScanner, createSecurityService } from '@nahisaho/musubix-security';
1236
-
1237
- // Scan a single file
1238
- const scanner = new VulnerabilityScanner();
1239
- const vulnerabilities = scanner.scanFile('src/api.ts');
1240
-
1241
- // Scan a directory
1242
- const result = await scanner.scanDirectory('./src');
1243
- console.log(`Found ${result.vulnerabilities.length} vulnerabilities`);
1244
- console.log(`Scanned ${result.scannedFiles} files`);
1245
- ```
1246
-
1247
- ### Detected Vulnerabilities
1248
-
1249
- | Category | CWE | Severity |
1250
- |----------|-----|----------|
1251
- | SQL Injection | CWE-89 | Critical |
1252
- | Command Injection | CWE-78 | Critical |
1253
- | XSS | CWE-79 | High |
1254
- | Path Traversal | CWE-22 | High |
1255
- | Code Injection | CWE-94 | Critical |
1256
- | NoSQL Injection | CWE-943 | High |
1257
-
1258
- ### Secret Detection
1259
-
1260
- Detects hardcoded credentials and sensitive information:
1261
-
1262
- ```typescript
1263
- import { SecretDetector } from '@nahisaho/musubix-security';
1264
-
1265
- const detector = new SecretDetector();
1266
- const secrets = detector.scanContent(content, 'config.ts');
1267
- const result = await detector.scan('./src');
1268
-
1269
- console.log(`Found ${result.summary.total} secrets`);
1270
- ```
1271
-
1272
- ### Detected Secret Types
1273
-
1274
- | Type | Pattern |
1275
- |------|--------|
1276
- | AWS Access Key | `AKIA...` |
1277
- | AWS Secret Key | 40-char base64 |
1278
- | GitHub Token | `ghp_*`, `gho_*`, `ghu_*` |
1279
- | Private Key | PEM format |
1280
- | Database URL | `postgres://`, `mongodb://` |
1281
- | JWT Secret | JWT signing secrets |
1282
- | Stripe Key | `sk_live_*`, `sk_test_*` |
1283
-
1284
- ### Taint Analysis
1285
-
1286
- Tracks data flow from user input (sources) to dangerous functions (sinks):
1287
-
1288
- ```typescript
1289
- import { TaintAnalyzer } from '@nahisaho/musubix-security';
1290
-
1291
- const analyzer = new TaintAnalyzer();
1292
- const result = analyzer.analyze('./src');
1293
-
1294
- console.log(`Sources: ${result.sources.length}`);
1295
- console.log(`Sinks: ${result.sinks.length}`);
1296
- console.log(`Taint paths: ${result.paths.length}`);
1297
- ```
1298
-
1299
- ### Dependency Auditing
1300
-
1301
- Integrates with npm audit to detect vulnerable dependencies:
1302
-
1303
- ```typescript
1304
- import { DependencyAuditor } from '@nahisaho/musubix-security';
1305
-
1306
- const auditor = new DependencyAuditor();
1307
- const result = await auditor.audit('./project');
1308
-
1309
- console.log(`Critical: ${result.summary.critical}`);
1310
- console.log(`High: ${result.summary.high}`);
1311
- ```
1312
-
1313
- ### Integrated Security Service
1314
-
1315
- Combines all security analysis features:
1316
-
1317
- ```typescript
1318
- import { createSecurityService } from '@nahisaho/musubix-security';
1319
-
1320
- const service = createSecurityService();
1321
-
1322
- // Full security scan
1323
- const result = await service.scan({
1324
- target: './src',
1325
- vulnerabilities: true,
1326
- taint: true,
1327
- secrets: true,
1328
- dependencies: true,
1329
- generateFixes: true,
1330
- });
1331
-
1332
- console.log(`Total vulnerabilities: ${result.summary.totalVulnerabilities}`);
1333
- console.log(`Total secrets: ${result.summary.totalSecrets}`);
1334
- console.log(`Fixes generated: ${result.summary.fixesGenerated}`);
1335
- ```
1336
-
1337
- ### Report Generation
1338
-
1339
- Generate reports in multiple formats:
1340
-
1341
- ```typescript
1342
- // SARIF format (GitHub Code Scanning compatible)
1343
- const sarifReport = await service.generateReport(result, 'sarif');
1344
-
1345
- // Markdown format
1346
- const mdReport = await service.generateReport(result, 'markdown');
1347
-
1348
- // HTML format
1349
- const htmlReport = await service.generateReport(result, 'html');
1350
- ```
1351
-
1352
- ### CLI Usage
1353
-
1354
- ```bash
1355
- # Full security scan
1356
- npx musubix-security scan ./src
1357
-
1358
- # Vulnerability scan only
1359
- npx musubix-security scan ./src --vulnerabilities-only
1360
-
1361
- # Secret detection
1362
- npx musubix-security secrets ./src
1363
-
1364
- # Taint analysis
1365
- npx musubix-security taint ./src
1366
-
1367
- # Dependency audit
1368
- npx musubix-security audit ./project
1369
-
1370
- # Generate SARIF report
1371
- npx musubix-security scan ./src --format sarif --output report.sarif
1372
- ```
1373
-
1374
- ### v1.8.0 Package Summary
1375
-
1376
- | Package | Description |
1377
- |---------|-------------|
1378
- | `@nahisaho/musubix-security` | Vulnerability scanning, secret detection, taint analysis, dependency auditing |
1379
-
1380
- ---
1381
-
1382
- ## DFG/CFG Extraction
1383
-
1384
- *(v2.0.0)*
1385
-
1386
- The `@nahisaho/musubix-dfg` package provides Data Flow Graph (DFG) and Control Flow Graph (CFG) extraction for TypeScript and JavaScript code analysis.
1387
-
1388
- ### Installation
1389
-
1390
- ```bash
1391
- npm install @nahisaho/musubix-dfg
1392
- ```
1393
-
1394
- ### DFG Extraction
1395
-
1396
- Extract data flow graphs from source code:
1397
-
1398
- ```typescript
1399
- import { extractDFG, DFGExtractor } from '@nahisaho/musubix-dfg';
1400
-
1401
- // Simple extraction
1402
- const dfg = extractDFG(sourceCode, 'typescript');
1403
-
1404
- // With configuration
1405
- const extractor = new DFGExtractor({
1406
- includeImplicitFlows: true,
1407
- trackConstants: true,
1408
- });
1409
- const result = extractor.extract(sourceCode);
1410
-
1411
- console.log(`Nodes: ${result.nodes.length}`);
1412
- console.log(`Edges: ${result.edges.length}`);
1413
- ```
1414
-
1415
- ### CFG Extraction
1416
-
1417
- Extract control flow graphs:
1418
-
1419
- ```typescript
1420
- import { extractCFG, CFGExtractor } from '@nahisaho/musubix-dfg';
1421
-
1422
- const cfg = extractCFG(sourceCode);
1423
-
1424
- // Traverse CFG
1425
- for (const block of cfg.blocks) {
1426
- console.log(`Block ${block.id}: ${block.statements.length} statements`);
1427
- console.log(`Successors: ${block.successors.join(', ')}`);
1428
- }
1429
- ```
1430
-
1431
- ### Def-Use Chain Analysis
1432
-
1433
- Build definition-use chains for variable tracking:
1434
-
1435
- ```typescript
1436
- import { analyzeDefUse } from '@nahisaho/musubix-dfg';
1437
-
1438
- const chains = analyzeDefUse(dfg);
1439
-
1440
- for (const chain of chains) {
1441
- console.log(`Variable: ${chain.variable}`);
1442
- console.log(`Defined at: line ${chain.definition.line}`);
1443
- console.log(`Used at: ${chain.uses.map(u => u.line).join(', ')}`);
1444
- }
1445
- ```
1446
-
1447
- ### Data Dependency Analysis
1448
-
1449
- Analyze data dependencies between statements:
1450
-
1451
- ```typescript
1452
- import { analyzeDataDependencies } from '@nahisaho/musubix-dfg';
1453
-
1454
- const deps = analyzeDataDependencies(dfg);
1455
-
1456
- for (const dep of deps) {
1457
- console.log(`${dep.from} -> ${dep.to}: ${dep.type}`);
1458
- }
1459
- ```
1460
-
1461
- ---
1462
-
1463
- ## Lean 4 Integration
1464
-
1465
- *(v2.0.0)*
1466
-
1467
- The `@nahisaho/musubix-lean` package provides integration with the Lean 4 theorem prover for formal verification of requirements.
1468
-
1469
- ### Installation
1470
-
1471
- ```bash
1472
- npm install @nahisaho/musubix-lean
1473
- ```
1474
-
1475
- ### EARS to Lean Conversion
1476
-
1477
- Convert EARS requirements to Lean 4 theorems:
1478
-
1479
- ```typescript
1480
- import { EarsToLeanConverter } from '@nahisaho/musubix-lean';
1481
-
1482
- const converter = new EarsToLeanConverter();
1483
-
1484
- // Convert EARS requirement
1485
- const earsRequirement = {
1486
- id: 'REQ-001',
1487
- type: 'event-driven',
1488
- trigger: 'user clicks submit',
1489
- response: 'system saves form data',
1490
- };
1491
-
1492
- const theorem = converter.convert(earsRequirement);
1493
- console.log(theorem.leanCode);
1494
- // theorem REQ_001 : ∀ (s : State),
1495
- // user_clicks_submit s → saves_form_data (next s)
1496
- ```
1497
-
1498
- ### Lean AST Parsing
1499
-
1500
- Parse and manipulate Lean 4 code:
1501
-
1502
- ```typescript
1503
- import { LeanParser, LeanAST } from '@nahisaho/musubix-lean';
1504
-
1505
- const parser = new LeanParser();
1506
- const ast = parser.parse(leanCode);
1507
-
1508
- // Traverse AST
1509
- for (const decl of ast.declarations) {
1510
- if (decl.type === 'theorem') {
1511
- console.log(`Theorem: ${decl.name}`);
1512
- console.log(`Statement: ${decl.statement}`);
1513
- }
1514
- }
1515
- ```
1516
-
1517
- ### Proof Engine
1518
-
1519
- Execute proofs using Lean 4:
1520
-
1521
- ```typescript
1522
- import { LeanProofEngine } from '@nahisaho/musubix-lean';
1523
-
1524
- const engine = new LeanProofEngine({
1525
- leanPath: '/usr/bin/lean',
1526
- timeout: 30000,
1527
- });
1528
-
1529
- const result = await engine.prove(theorem);
1530
-
1531
- if (result.success) {
1532
- console.log('Proof verified!');
1533
- console.log(`Proof: ${result.proof}`);
1534
- } else {
1535
- console.log(`Failed: ${result.error}`);
1536
- }
1537
- ```
1538
-
1539
- ### ReProver Integration
1540
-
1541
- Use ReProver for automated proof search:
1542
-
1543
- ```typescript
1544
- import { ReProverClient } from '@nahisaho/musubix-lean';
1545
-
1546
- const reprover = new ReProverClient({
1547
- endpoint: 'http://localhost:8080',
1548
- maxDepth: 10,
1549
- });
1550
-
1551
- const proof = await reprover.searchProof(theorem);
1552
-
1553
- if (proof.found) {
1554
- console.log('Proof found!');
1555
- console.log(proof.tactics);
1556
- }
1557
- ```
1558
-
1559
- ---
1560
-
1561
- ## YATA Scale
1562
-
1563
- *(v2.0.0)*
1564
-
1565
- The `@nahisaho/yata-scale` package provides distributed knowledge graph capabilities with sharding, caching, and synchronization.
1566
-
1567
- ### Installation
1568
-
1569
- ```bash
1570
- npm install @nahisaho/yata-scale
1571
- ```
1572
-
1573
- ### High-Level API
1574
-
1575
- Use `YataScaleManager` for simplified access:
1576
-
1577
- ```typescript
1578
- import { YataScaleManager } from '@nahisaho/yata-scale';
1579
-
1580
- const yata = new YataScaleManager({
1581
- shards: 16,
1582
- cacheConfig: {
1583
- l1MaxSize: 1000,
1584
- l2MaxSize: 10000,
1585
- l3Path: './cache',
1586
- },
1587
- });
1588
-
1589
- // Store entity
1590
- await yata.putEntity({
1591
- id: 'entity-1',
1592
- type: 'Document',
1593
- properties: { title: 'Example' },
1594
- });
1595
-
1596
- // Query
1597
- const results = await yata.query('SELECT ?s WHERE { ?s rdf:type Document }');
1598
- ```
1599
-
1600
- ### Sharding
1601
-
1602
- Distribute data across shards using consistent hashing:
1603
-
1604
- ```typescript
1605
- import { ShardManager, HashPartitionStrategy } from '@nahisaho/yata-scale';
1606
-
1607
- const shardManager = new ShardManager({
1608
- shardCount: 16,
1609
- virtualNodes: 150,
1610
- strategy: new HashPartitionStrategy(),
1611
- });
1612
-
1613
- // Get shard for entity
1614
- const shard = shardManager.getShardForEntity('entity-id');
1615
- console.log(`Entity assigned to shard ${shard.id}`);
1616
-
1617
- // Rebalance on node changes
1618
- await shardManager.addNode('node-5');
1619
- ```
1620
-
1621
- ### Multi-Tier Caching
1622
-
1623
- Three-tier caching for optimal performance:
1624
-
1625
- ```typescript
1626
- import { CacheManager, L1Cache, L2Cache, L3Cache } from '@nahisaho/yata-scale';
1627
-
1628
- const cache = new CacheManager({
1629
- l1: new L1Cache({ maxSize: 1000 }), // LRU cache
1630
- l2: new L2Cache({ maxSize: 10000 }), // LFU cache
1631
- l3: new L3Cache({ path: './cache' }), // Disk cache
1632
- });
1633
-
1634
- // Cache operations
1635
- await cache.set('key', value, { ttl: 3600 });
1636
- const result = await cache.get('key');
1637
-
1638
- // Invalidation
1639
- await cache.invalidate('key');
1640
- await cache.invalidatePattern('user:*');
1641
- ```
1642
-
1643
- ### Index Management
1644
-
1645
- Multiple index types for efficient queries:
1646
-
1647
- ```typescript
1648
- import { IndexManager, BPlusTreeIndex, FullTextIndex, GraphIndex } from '@nahisaho/yata-scale';
1649
-
1650
- const indexManager = new IndexManager();
1651
-
1652
- // B+ Tree for range queries
1653
- indexManager.addIndex('timestamp', new BPlusTreeIndex());
1654
-
1655
- // Full-text for search
1656
- indexManager.addIndex('content', new FullTextIndex());
1657
-
1658
- // Graph for traversal
1659
- indexManager.addIndex('relationships', new GraphIndex());
1660
- ```
1661
-
1662
- ### Vector Clock Synchronization
1663
-
1664
- Distributed synchronization with conflict resolution:
1665
-
1666
- ```typescript
1667
- import { SyncController, VectorClock, ConflictResolver } from '@nahisaho/yata-scale';
1668
-
1669
- const sync = new SyncController({
1670
- nodeId: 'node-1',
1671
- conflictStrategy: 'last-write-wins',
1672
- });
1673
-
1674
- // Synchronize with peers
1675
- await sync.synchronize();
1676
-
1677
- // Manual conflict resolution
1678
- sync.onConflict((conflict) => {
1679
- console.log(`Conflict on ${conflict.key}`);
1680
- return conflict.local; // or conflict.remote
1681
- });
1682
- ```
1683
-
1684
- ### v2.0.0 Package Summary
1685
-
1686
- | Package | Tests | Description |
1687
- |---------|-------|-------------|
1688
- | `@nahisaho/musubix-dfg` | 30 | DFG/CFG extraction, Def-Use analysis |
1689
- | `@nahisaho/musubix-lean` | 151 | Lean 4 theorem proving, EARS conversion |
1690
- | `@nahisaho/yata-scale` | 57 | Distributed sharding, caching, sync |
1691
- | **Total** | **238** | **Phase 1: Deep Symbolic Integration** |
1692
-
1693
- ---
1694
-
1695
- ## Library Learning
1696
-
1697
- *(v2.0.0 NEW!)*
1698
-
1699
- The `@nahisaho/musubix-library-learner` package provides intelligent API pattern extraction and documentation from TypeScript libraries, enabling the system to learn and suggest library usage patterns.
1700
-
1701
- ### Installation
1702
-
1703
- ```bash
1704
- npm install @nahisaho/musubix-library-learner
1705
- ```
1706
-
1707
- ### Library Analysis
1708
-
1709
- Analyze and learn patterns from TypeScript libraries:
1710
-
1711
- ```typescript
1712
- import { LibraryLearner, LibraryAnalyzer } from '@nahisaho/musubix-library-learner';
1713
-
1714
- const learner = new LibraryLearner();
1715
-
1716
- // Analyze a library
1717
- const patterns = await learner.analyze({
1718
- libraryName: 'lodash',
1719
- sourceDir: './node_modules/lodash',
1720
- includeExamples: true,
1721
- });
1722
-
1723
- console.log(`Found ${patterns.length} API patterns`);
1724
- for (const pattern of patterns) {
1725
- console.log(`- ${pattern.name}: ${pattern.description}`);
1726
- }
1727
- ```
1728
-
1729
- ### Pattern Extraction
1730
-
1731
- Extract usage patterns from code examples:
1732
-
1733
- ```typescript
1734
- import { PatternExtractor } from '@nahisaho/musubix-library-learner';
1735
-
1736
- const extractor = new PatternExtractor();
1737
-
1738
- const patterns = await extractor.extract({
1739
- code: sourceCode,
1740
- libraryContext: 'express',
1741
- });
1742
-
1743
- // Get common patterns
1744
- for (const pattern of patterns) {
1745
- console.log(`Pattern: ${pattern.type}`);
1746
- console.log(`Example: ${pattern.example}`);
1747
- console.log(`Frequency: ${pattern.frequency}`);
1748
- }
1749
- ```
1750
-
1751
- ### API Documentation Generation
1752
-
1753
- Generate documentation from learned patterns:
1754
-
1755
- ```typescript
1756
- import { DocGenerator } from '@nahisaho/musubix-library-learner';
1757
-
1758
- const generator = new DocGenerator();
1759
-
1760
- const docs = await generator.generate({
1761
- patterns: learnedPatterns,
1762
- format: 'markdown',
1763
- includeExamples: true,
1764
- });
1765
-
1766
- await fs.writeFile('API-PATTERNS.md', docs);
1767
- ```
1768
-
1769
- ### TypeScript Analysis
1770
-
1771
- Deep analysis of TypeScript declarations:
1772
-
1773
- ```typescript
1774
- import { TypeScriptAnalyzer } from '@nahisaho/musubix-library-learner';
1775
-
1776
- const analyzer = new TypeScriptAnalyzer();
1777
-
1778
- const analysis = await analyzer.analyze('./src/index.ts');
1779
-
1780
- // Get exported types
1781
- for (const type of analysis.exports) {
1782
- console.log(`${type.name}: ${type.kind}`);
1783
- if (type.kind === 'function') {
1784
- console.log(` Params: ${type.parameters.join(', ')}`);
1785
- console.log(` Returns: ${type.returnType}`);
1786
- }
1787
- }
1788
- ```
1789
-
1790
- ---
1791
-
1792
- ## Neural Search
1793
-
1794
- *(v2.0.0 NEW!)*
1795
-
1796
- The `@nahisaho/musubix-neural-search` package provides semantic code search using embeddings and neural ranking, enabling context-aware code discovery across your codebase.
1797
-
1798
- ### Installation
1799
-
1800
- ```bash
1801
- npm install @nahisaho/musubix-neural-search
1802
- ```
1803
-
1804
- ### Semantic Search
1805
-
1806
- Search code by meaning, not just keywords:
1807
-
1808
- ```typescript
1809
- import { NeuralSearchEngine } from '@nahisaho/musubix-neural-search';
1810
-
1811
- const search = new NeuralSearchEngine({
1812
- embeddingModel: 'code-bert',
1813
- indexPath: './search-index',
1814
- });
1815
-
1816
- // Index your codebase
1817
- await search.index('./src');
1818
-
1819
- // Semantic search
1820
- const results = await search.search({
1821
- query: 'function that validates email addresses',
1822
- limit: 10,
1823
- });
1824
-
1825
- for (const result of results) {
1826
- console.log(`${result.file}:${result.line} (score: ${result.score})`);
1827
- console.log(` ${result.snippet}`);
1828
- }
1829
- ```
1830
-
1831
- ### Code Embeddings
1832
-
1833
- Generate embeddings for code snippets:
1834
-
1835
- ```typescript
1836
- import { CodeEmbedder } from '@nahisaho/musubix-neural-search';
1837
-
1838
- const embedder = new CodeEmbedder();
1839
-
1840
- const embedding = await embedder.embed({
1841
- code: 'function add(a: number, b: number) { return a + b; }',
1842
- language: 'typescript',
1843
- });
1844
-
1845
- // Compare similarity
1846
- const similarity = embedder.cosineSimilarity(embedding1, embedding2);
1847
- console.log(`Similarity: ${similarity}`);
1848
- ```
1849
-
1850
- ### Hybrid Search
1851
-
1852
- Combine lexical and semantic search:
1853
-
1854
- ```typescript
1855
- import { HybridSearchEngine } from '@nahisaho/musubix-neural-search';
1856
-
1857
- const hybrid = new HybridSearchEngine({
1858
- lexicalWeight: 0.3,
1859
- semanticWeight: 0.7,
1860
- });
1861
-
1862
- const results = await hybrid.search({
1863
- query: 'authentication middleware express',
1864
- filters: {
1865
- language: 'typescript',
1866
- path: 'src/middleware/**',
1867
- },
1868
- });
1869
- ```
1870
-
1871
- ### Code Ranking
1872
-
1873
- Neural ranking for search results:
1874
-
1875
- ```typescript
1876
- import { CodeRanker } from '@nahisaho/musubix-neural-search';
1877
-
1878
- const ranker = new CodeRanker();
1879
-
1880
- const ranked = await ranker.rank({
1881
- query: 'parse JSON safely',
1882
- candidates: searchResults,
1883
- context: {
1884
- currentFile: './src/utils.ts',
1885
- recentFiles: ['./src/api.ts', './src/config.ts'],
1886
- },
1887
- });
1888
- ```
1889
-
1890
- ---
1891
-
1892
- ## Program Synthesis
1893
-
1894
- *(v2.0.0 NEW!)*
1895
-
1896
- The `@nahisaho/musubix-synthesis` package provides neural-guided program synthesis, generating code from specifications using symbolic constraints and neural networks.
1897
-
1898
- ### Installation
1899
-
1900
- ```bash
1901
- npm install @nahisaho/musubix-synthesis
1902
- ```
1903
-
1904
- ### Specification-Based Synthesis
1905
-
1906
- Generate code from formal specifications:
1907
-
1908
- ```typescript
1909
- import { ProgramSynthesizer } from '@nahisaho/musubix-synthesis';
1910
-
1911
- const synthesizer = new ProgramSynthesizer();
1912
-
1913
- const result = await synthesizer.synthesize({
1914
- specification: {
1915
- input: 'array of numbers',
1916
- output: 'array of numbers (sorted ascending)',
1917
- constraints: ['stable sort', 'O(n log n) complexity'],
1918
- },
1919
- language: 'typescript',
1920
- });
1921
-
1922
- console.log(result.code);
1923
- // function sort(arr: number[]): number[] {
1924
- // return [...arr].sort((a, b) => a - b);
1925
- // }
1926
- ```
1927
-
1928
- ### Example-Based Synthesis
1929
-
1930
- Generate code from input/output examples:
1931
-
1932
- ```typescript
1933
- import { ExampleBasedSynthesizer } from '@nahisaho/musubix-synthesis';
1934
-
1935
- const synthesizer = new ExampleBasedSynthesizer();
1936
-
1937
- const result = await synthesizer.synthesize({
1938
- examples: [
1939
- { input: ['hello', 'world'], output: 'hello world' },
1940
- { input: ['foo', 'bar', 'baz'], output: 'foo bar baz' },
1941
- ],
1942
- language: 'typescript',
1943
- });
1944
-
1945
- console.log(result.code);
1946
- // function join(arr: string[]): string {
1947
- // return arr.join(' ');
1948
- // }
1949
- ```
1950
-
1951
- ### Sketch-Based Synthesis
1952
-
1953
- Fill in holes in partial programs:
1954
-
1955
- ```typescript
1956
- import { SketchSynthesizer } from '@nahisaho/musubix-synthesis';
1957
-
1958
- const synthesizer = new SketchSynthesizer();
1959
-
1960
- const result = await synthesizer.complete({
1961
- sketch: `
1962
- function validate(email: string): boolean {
1963
- const pattern = ??; // hole to fill
1964
- return pattern.test(email);
1965
- }
1966
- `,
1967
- constraints: ['must validate common email formats'],
1968
- });
1969
-
1970
- console.log(result.code);
1971
- // const pattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1972
- ```
1973
-
1974
- ### Neural-Guided Search
1975
-
1976
- Use neural networks to guide synthesis search:
1977
-
1978
- ```typescript
1979
- import { NeuralGuidedSynthesizer } from '@nahisaho/musubix-synthesis';
1980
-
1981
- const synthesizer = new NeuralGuidedSynthesizer({
1982
- model: 'codegen-2B',
1983
- beamWidth: 5,
1984
- maxDepth: 10,
1985
- });
1986
-
1987
- const result = await synthesizer.synthesize({
1988
- description: 'Parse a CSV string into array of objects with headers as keys',
1989
- tests: [
1990
- {
1991
- input: 'name,age\\nAlice,30\\nBob,25',
1992
- output: [{ name: 'Alice', age: '30' }, { name: 'Bob', age: '25' }],
1993
- },
1994
- ],
1995
- });
1996
-
1997
- if (result.verified) {
1998
- console.log('All tests pass!');
1999
- console.log(result.code);
2000
- }
2001
- ```
2002
-
2003
- ### Synthesis Verification
2004
-
2005
- Verify synthesized code against specifications:
2006
-
2007
- ```typescript
2008
- import { SynthesisVerifier } from '@nahisaho/musubix-synthesis';
2009
-
2010
- const verifier = new SynthesisVerifier();
2011
-
2012
- const verification = await verifier.verify({
2013
- code: synthesizedCode,
2014
- specification: originalSpec,
2015
- tests: testCases,
2016
- });
2017
-
2018
- console.log(`Verified: ${verification.passed}`);
2019
- console.log(`Coverage: ${verification.testCoverage}%`);
2020
- for (const issue of verification.issues) {
2021
- console.log(`Issue: ${issue.message}`);
2022
- }
2023
- ```
2024
-
2025
- ### v2.0.0 Package Summary
2026
-
2027
- | Package | Tests | Description |
2028
- |---------|-------|-------------|
2029
- | **Phase 1: Deep Symbolic Integration** | | |
2030
- | `@nahisaho/musubix-dfg` | 30 | DFG/CFG extraction, Def-Use analysis |
2031
- | `@nahisaho/musubix-lean` | 151 | Lean 4 theorem proving, EARS conversion |
2032
- | `@nahisaho/yata-scale` | 57 | Distributed sharding, caching, sync |
2033
- | **Phase 2: Advanced Learning** | | |
2034
- | `@nahisaho/musubix-library-learner` | 132 | API pattern extraction, documentation |
2035
- | `@nahisaho/musubix-neural-search` | 144 | Semantic code search, embeddings |
2036
- | `@nahisaho/musubix-synthesis` | 146 | Neural-guided program synthesis |
2037
- | **Total v2.0.0 New** | **660** | **6 new packages** |
2038
-
2039
- ---
2040
-
2041
- ## Advanced Learning Enhancement
2042
-
2043
- *(v2.2.0 NEW!)*
2044
-
2045
- MUSUBIX v2.2.0では、Neural Search、Library Learner、Synthesisの3パッケージに対して高度な学習機能を追加しました。
2046
-
2047
- ### Neural Search Enhancement
2048
-
2049
- #### ContextAwareEmbedder
2050
-
2051
- AST構造を認識したコンテキスト埋め込み:
2052
-
2053
- ```typescript
2054
- import { ContextAwareEmbedder } from '@nahisaho/musubix-neural-search';
2055
-
2056
- const embedder = new ContextAwareEmbedder({
2057
- windowSize: 5,
2058
- includeAST: true,
2059
- });
2060
-
2061
- const embedding = embedder.embed(code, {
2062
- surrounding: surroundingCode,
2063
- imports: importStatements,
2064
- });
2065
- ```
2066
-
2067
- #### HybridRanker
2068
-
2069
- BM25とベクトル類似度のハイブリッドランキング:
2070
-
2071
- ```typescript
2072
- import { HybridRanker } from '@nahisaho/musubix-neural-search';
2073
-
2074
- const ranker = new HybridRanker({ alpha: 0.6 });
2075
- const results = ranker.rank(query, documents);
2076
- ```
2077
-
2078
- #### EmbeddingCache
2079
-
2080
- LRU + TTL管理キャッシュ:
2081
-
2082
- ```typescript
2083
- import { EmbeddingCache } from '@nahisaho/musubix-neural-search';
2084
-
2085
- const cache = new EmbeddingCache({
2086
- maxSize: 10000,
2087
- ttlMs: 3600000,
2088
- });
2089
-
2090
- cache.set('key', embedding);
2091
- const stats = cache.getStats(); // { hits, misses, hitRate }
2092
- ```
2093
-
2094
- #### TrajectoryLogger
2095
-
2096
- 検索軌跡のロギング:
2097
-
2098
- ```typescript
2099
- import { createTrajectoryLogger } from '@nahisaho/musubix-neural-search';
2100
-
2101
- const logger = createTrajectoryLogger();
2102
- logger.logBranch({ depth: 1, score: 0.85, action: 'expand' });
2103
-
2104
- const trajectory = logger.getTrajectory();
2105
- const parquet = logger.export('parquet');
2106
- ```
2107
-
2108
- ### Library Learner Enhancement
2109
-
2110
- #### SemanticChunker
2111
-
2112
- AST境界認識チャンキング:
2113
-
2114
- ```typescript
2115
- import { SemanticChunker } from '@nahisaho/musubix-library-learner';
2116
-
2117
- const chunker = new SemanticChunker({
2118
- minSize: 50,
2119
- maxSize: 500,
2120
- respectBoundaries: true,
2121
- });
2122
-
2123
- const chunks = chunker.chunk(code);
2124
- ```
2125
-
2126
- #### PatternVersionManager
2127
-
2128
- Git風バージョン管理:
2129
-
2130
- ```typescript
2131
- import { PatternVersionManager } from '@nahisaho/musubix-library-learner';
2132
-
2133
- const manager = new PatternVersionManager();
2134
- manager.commit(pattern, 'Add validation pattern');
2135
- const history = manager.getHistory(patternId);
2136
- manager.rollback(patternId, commitId);
2137
- ```
2138
-
2139
- #### MetricsExporter
2140
-
2141
- 学習メトリクスのエクスポート:
2142
-
2143
- ```typescript
2144
- import { createMetricsExporter } from '@nahisaho/musubix-library-learner';
2145
-
2146
- const exporter = createMetricsExporter(library);
2147
- const json = exporter.export('json');
2148
- const markdown = exporter.export('markdown');
2149
- const summary = exporter.getSummary();
2150
- // { totalPatterns, averageConfidence, healthStatus }
2151
- ```
2152
-
2153
- ### Synthesis Enhancement
2154
-
2155
- #### MetaLearningEngine
2156
-
2157
- タスク類似度ベースの戦略選択:
2158
-
2159
- ```typescript
2160
- import { createMetaLearningEngine } from '@nahisaho/musubix-synthesis';
2161
-
2162
- const meta = createMetaLearningEngine({
2163
- historySize: 100,
2164
- similarityThreshold: 0.7,
2165
- });
2166
-
2167
- meta.recordTask(task, result);
2168
- const strategy = meta.selectStrategy(newTask);
2169
- ```
2170
-
2171
- #### DSLExtender
2172
-
2173
- パターンからのDSL演算子自動生成:
2174
-
2175
- ```typescript
2176
- import { createDSLExtender } from '@nahisaho/musubix-synthesis';
2177
-
2178
- const extender = createDSLExtender(baseDSL);
2179
- const gaps = extender.detectGaps(patterns);
2180
- const suggestions = extender.suggestOperators(gaps);
2181
- ```
2182
-
2183
- #### ExampleAnalyzer
2184
-
2185
- 例題品質分析:
2186
-
2187
- ```typescript
2188
- import { createExampleAnalyzer } from '@nahisaho/musubix-synthesis';
2189
-
2190
- const analyzer = createExampleAnalyzer();
2191
- const quality = analyzer.analyzeQuality(examples);
2192
- const coverage = analyzer.analyzeCoverage(examples, dsl);
2193
- ```
2194
-
2195
- #### ExplanationGenerator
2196
-
2197
- 合成プログラムの自然言語説明:
2198
-
2199
- ```typescript
2200
- import { createExplanationGenerator } from '@nahisaho/musubix-synthesis';
2201
-
2202
- const explainer = createExplanationGenerator();
2203
- const explanation = explainer.generate(program);
2204
- const summary = explainer.summarize(program);
2205
- // "Converts to uppercase"
2206
- ```
2207
-
2208
- ### v2.2.0 CLI Commands
2209
-
2210
- ```bash
2211
- # プログラム合成
2212
- npx musubix synthesize <examples.json>
2213
- npx musubix syn <examples.json> # エイリアス
2214
-
2215
- # パターンライブラリ管理
2216
- npx musubix library learn <file>
2217
- npx musubix library query <query>
2218
- npx musubix library stats
2219
- npx musubix lib stats # エイリアス
2220
- ```
2221
-
2222
- ### v2.2.0 Test Statistics
2223
-
2224
- | EPIC | Tasks | Tests |
2225
- |------|-------|-------|
2226
- | Neural Search | 7 | 138 |
2227
- | Library Learner | 7 | 145 |
2228
- | Synthesis | 6 | 108 |
2229
- | Integration | 4 | 73 |
2230
- | **Total** | **28** | **464** |
2231
-
2232
- ---
2233
-
2234
- ## MCP Server Integration
2235
-
2236
- ### CLI Startup
2237
-
2238
- ```bash
2239
- # Default (stdio transport)
2240
- musubix-mcp
2241
-
2242
- # SSE transport
2243
- musubix-mcp --transport sse --port 3000
2244
-
2245
- # WebSocket transport
2246
- musubix-mcp --transport websocket --port 3001
2247
- ```
2248
-
2249
- ### Programmatic Startup
2250
-
2251
- ```typescript
2252
- import { startServer, createMCPServer } from '@nahisaho/musubix-mcp-server';
2253
-
2254
- // Simple startup
2255
- await startServer();
2256
-
2257
- // Startup with options
2258
- const server = createMCPServer({
2259
- transport: 'sse',
2260
- port: 3000
2261
- });
2262
- await server.start();
2263
- ```
2264
-
2265
- ### AI Platform Integration
2266
-
2267
- #### GitHub Copilot (VS Code)
2268
-
2269
- Add to `.vscode/settings.json`:
2270
-
2271
- ```json
2272
- {
2273
- "github.copilot.chat.mcpServers": {
2274
- "musubix": {
2275
- "command": "musubix-mcp",
2276
- "args": ["--transport", "stdio"]
2277
- }
2278
- }
2279
- }
2280
- ```
2281
-
2282
- #### Claude Desktop
2283
-
2284
- Add to Claude configuration file (`~/.config/claude/config.json` or similar):
2285
-
2286
- ```json
2287
- {
2288
- "mcpServers": {
2289
- "musubix": {
2290
- "command": "musubix-mcp",
2291
- "args": []
2292
- }
2293
- }
2294
- }
2295
- ```
2296
-
2297
- #### Cursor
2298
-
2299
- Add to `.cursor/mcp.json`:
2300
-
2301
- ```json
2302
- {
2303
- "mcpServers": {
2304
- "musubix": {
2305
- "command": "musubix-mcp",
2306
- "args": ["--transport", "stdio"]
2307
- }
2308
- }
2309
- }
2310
- ```
2311
-
2312
- ### Available MCP Tools
2313
-
2314
- | Tool Name | Description |
2315
- |-----------|-------------|
2316
- | `create_requirement` | Create EARS-format requirement |
2317
- | `validate_requirements` | Validate requirements |
2318
- | `create_design` | Create C4 design element |
2319
- | `create_adr` | Create ADR |
2320
- | `create_task` | Create implementation task |
2321
- | `validate_all` | Full 9 Articles compliance check |
2322
- | `get_traceability` | Get traceability matrix |
2323
-
2324
- ---
2325
-
2326
- ## Symbolic Reasoning
2327
-
2328
- *(v1.2.0 New Feature)*
2329
-
2330
- ### Overview
2331
-
2332
- Symbolic reasoning enhances LLM outputs by applying formal verification and knowledge-graph backed reasoning. This hybrid approach (Neuro-Symbolic) combines the creativity of neural networks with the precision of symbolic logic.
2333
-
2334
- ### Key Components
2335
-
2336
- | Component | Description |
2337
- |-----------|-------------|
2338
- | `SemanticCodeFilterPipeline` | Filter LLM outputs for code quality |
2339
- | `HallucinationDetector` | Detect and prevent hallucinated outputs |
2340
- | `EarsToFormalSpecConverter` | Convert EARS requirements to formal Z3 specifications |
2341
- | `Z3Adapter` | Interface with Z3 solver for formal verification |
2342
- | `QualityGateValidator` | Validate against 17 quality gate checks |
2343
-
2344
- ### Usage
2345
-
2346
- #### Semantic Code Filtering
2347
-
2348
- ```typescript
2349
- import { SemanticCodeFilterPipeline } from '@nahisaho/musubix-core';
2350
-
2351
- const pipeline = new SemanticCodeFilterPipeline({
2352
- enableHallucinationDetection: true,
2353
- maxRetries: 3
2354
- });
2355
-
2356
- const result = await pipeline.filter({
2357
- code: generatedCode,
2358
- context: { language: 'typescript', domain: 'authentication' }
2359
- });
2360
-
2361
- if (result.isValid) {
2362
- console.log('Code passed validation:', result.filteredCode);
2363
- } else {
2364
- console.log('Issues found:', result.issues);
2365
- }
2366
- ```
2367
-
2368
- #### Hallucination Detection
2369
-
2370
- ```typescript
2371
- import { HallucinationDetector } from '@nahisaho/musubix-core';
2372
-
2373
- const detector = new HallucinationDetector();
2374
-
2375
- const analysis = await detector.analyze({
2376
- response: llmResponse,
2377
- groundTruth: knownFacts,
2378
- context: projectContext
2379
- });
2380
-
2381
- console.log('Confidence score:', analysis.confidence);
2382
- console.log('Hallucination risks:', analysis.risks);
2383
- ```
2384
-
2385
- #### EARS to Formal Specification
2386
-
2387
- ```typescript
2388
- import { EarsToFormalSpecConverter } from '@nahisaho/musubix-core';
2389
-
2390
- const converter = new EarsToFormalSpecConverter();
2391
-
2392
- const formalSpec = await converter.convert({
2393
- earsRequirement: 'WHEN user clicks login, THE system SHALL authenticate within 2 seconds',
2394
- requirementId: 'REQ-AUTH-001'
2395
- });
2396
-
2397
- // Returns Z3-compatible specification
2398
- console.log(formalSpec.z3Expression);
2399
- ```
2400
-
2401
- #### Quality Gate Validation
2402
-
2403
- ```typescript
2404
- import { QualityGateValidator } from '@nahisaho/musubix-core';
2405
-
2406
- const validator = new QualityGateValidator();
2407
-
2408
- const gateResult = await validator.validate({
2409
- requirements: requirementsList,
2410
- designs: designDocuments,
2411
- tasks: taskList
2412
- });
2413
-
2414
- console.log('All gates passed:', gateResult.allPassed);
2415
- console.log('Gate details:', gateResult.gates);
2416
- // 17 quality checks including EARS compliance, traceability, etc.
2417
- ```
2418
-
2419
- ### Quality Gate Checks
2420
-
2421
- | Gate | Description |
2422
- |------|-------------|
2423
- | EARS Compliance | Requirements follow EARS patterns |
2424
- | Unique IDs | All artifacts have unique identifiers |
2425
- | Traceability | Full traceability chain exists |
2426
- | Design Coverage | All requirements have designs |
2427
- | Task Coverage | All designs have tasks |
2428
- | No Orphans | No orphaned requirements or tasks |
2429
- | Completeness | All required fields are present |
2430
- | ... | And 10 more quality checks |
2431
-
2432
- ---
2433
-
2434
- ## Consistency Validation
2435
-
2436
- *(v1.4.1 New Feature)*
2437
-
2438
- ### Overview
2439
-
2440
- Consistency validation ensures data integrity when adding triples to the knowledge graph. Based on OWL constraints, it detects violations before they corrupt the knowledge base.
2441
-
2442
- ### Validation Types
2443
-
2444
- | Type | Description | Severity |
2445
- |------|-------------|----------|
2446
- | `disjoint-class-membership` | Instance belongs to disjoint classes | error |
2447
- | `functional-property-violation` | Multiple values for functional property | error |
2448
- | `inverse-functional-violation` | Same value maps to multiple subjects | error |
2449
- | `asymmetric-violation` | Inverse relation exists for asymmetric property | error |
2450
- | `irreflexive-violation` | Self-reference for irreflexive property | error |
2451
- | `duplicate-triple` | Exact duplicate triple | warning |
2452
- | `circular-dependency` | Circular subClassOf chain | error |
2453
-
2454
- ### Usage
2455
-
2456
- #### Validated Triple Addition
2457
-
2458
- ```typescript
2459
- import { N3Store } from '@nahisaho/musubix-ontology-mcp';
2460
-
2461
- // Enable validation on add
2462
- const store = new N3Store({}, true);
2463
-
2464
- // Add with validation
2465
- const result = store.addTripleValidated({
2466
- subject: 'http://example.org/Person1',
2467
- predicate: 'http://example.org/hasMother',
2468
- object: 'http://example.org/Mother1'
2469
- });
2470
-
2471
- if (!result.success) {
2472
- console.error('Validation errors:', result.validation.errors);
2473
- }
2474
- ```
2475
-
2476
- #### Store-wide Consistency Check
2477
-
2478
- ```typescript
2479
- // Check entire store
2480
- const consistency = store.checkConsistency();
2481
-
2482
- if (!consistency.consistent) {
2483
- for (const violation of consistency.violations) {
2484
- console.log(`${violation.type}: ${violation.message}`);
2485
- console.log('Affected triples:', violation.triples);
2486
- }
2487
-
2488
- // Get fix suggestions
2489
- for (const suggestion of consistency.suggestions) {
2490
- console.log(`Suggestion: ${suggestion.suggestion}`);
2491
- console.log(`Auto-fixable: ${suggestion.autoFixable}`);
2492
- }
2493
- }
2494
- ```
2495
-
2496
- #### Direct Validator Usage
2497
-
2498
- ```typescript
2499
- import { ConsistencyValidator } from '@nahisaho/musubix-ontology-mcp';
2500
-
2501
- const validator = new ConsistencyValidator({
2502
- checkDisjointClasses: true,
2503
- checkFunctionalProperties: true,
2504
- checkDuplicates: true,
2505
- checkCircularDependencies: true
2506
- });
2507
-
2508
- // Validate before adding
2509
- const validation = validator.validateTriple(newTriple, existingTriples);
2510
- if (!validation.valid) {
2511
- console.error(validation.errors);
2512
- }
2513
-
2514
- // Find duplicates
2515
- const duplicates = validator.findDuplicates(allTriples);
2516
- const semanticDuplicates = validator.findSemanticDuplicates(allTriples);
2517
- ```
2518
-
2519
- ---
2520
-
2521
- ## Advanced Inference
2522
-
2523
- *(v1.4.5 New Feature)*
2524
-
2525
- ### Overview
2526
-
2527
- 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.
2528
-
2529
- ### Key Components
2530
-
2531
- | Component | Description |
2532
- |-----------|-------------|
2533
- | `OWL2RLReasoner` | OWL 2 RL profile reasoning with 20+ built-in rules |
2534
- | `DatalogEngine` | Stratified Datalog evaluation engine |
2535
- | `InferenceExplainer` | Natural language explanation generator |
2536
- | `ProgressReporter` | Real-time inference progress tracking |
2537
-
2538
- ### OWL 2 RL Reasoning
2539
-
2540
- ```typescript
2541
- import { OWL2RLReasoner } from '@nahisaho/musubix-ontology-mcp';
2542
-
2543
- const reasoner = new OWL2RLReasoner({
2544
- maxIterations: 100,
2545
- enablePropertyChains: true,
2546
- enableInverseProperties: true
2547
- });
2548
-
2549
- // Run reasoning on store
2550
- const result = await reasoner.reason(store, {
2551
- onProgress: (progress) => {
2552
- console.log(`Iteration ${progress.iteration}: ${progress.newTriples} new triples`);
2553
- }
2554
- });
2555
-
2556
- console.log(`Inferred ${result.inferredCount} new facts`);
2557
- console.log(`Rules applied: ${result.rulesApplied.join(', ')}`);
2558
- ```
2559
-
2560
- ### OWL 2 RL Rules
2561
-
2562
- | Rule ID | Name | Description |
2563
- |---------|------|-------------|
2564
- | `prp-dom` | Property Domain | Infer type from property domain |
2565
- | `prp-rng` | Property Range | Infer type from property range |
2566
- | `prp-inv1/2` | Inverse Properties | Infer inverse relationships |
2567
- | `prp-trp` | Transitive Properties | Chain transitive properties |
2568
- | `prp-symp` | Symmetric Properties | Infer symmetric relationships |
2569
- | `cax-sco` | SubClassOf | Propagate class membership |
2570
- | `scm-spo` | SubPropertyOf | Property subsumption |
2571
- | `eq-rep-s/p/o` | SameAs Replacement | Substitute equal individuals |
2572
-
2573
- ### Datalog Evaluation
2574
-
2575
- ```typescript
2576
- import { DatalogEngine } from '@nahisaho/musubix-ontology-mcp';
2577
-
2578
- const engine = new DatalogEngine();
2579
-
2580
- // Define rules
2581
- const rules = [
2582
- {
2583
- head: { predicate: 'ancestor', args: ['?x', '?y'] },
2584
- body: [
2585
- { predicate: 'parent', args: ['?x', '?y'] }
2586
- ]
2587
- },
2588
- {
2589
- head: { predicate: 'ancestor', args: ['?x', '?z'] },
2590
- body: [
2591
- { predicate: 'parent', args: ['?x', '?y'] },
2592
- { predicate: 'ancestor', args: ['?y', '?z'] }
2593
- ]
2594
- }
2595
- ];
2596
-
2597
- // Evaluate rules
2598
- const result = await engine.evaluate(rules, facts, {
2599
- onProgress: (progress) => {
2600
- console.log(`Stratum ${progress.stratum}: evaluating ${progress.rule}`);
2601
- }
2602
- });
2603
-
2604
- console.log(`Derived ${result.derivedFacts.length} new facts`);
2605
- ```
2606
-
2607
- ### Inference Explanation
2608
-
2609
- ```typescript
2610
- import { InferenceExplainer, ExplanationFormat } from '@nahisaho/musubix-ontology-mcp';
2611
-
2612
- const explainer = new InferenceExplainer(reasoner.getProvenanceLog());
2613
-
2614
- // Get explanation for a specific triple
2615
- const explanation = explainer.explain(
2616
- 'http://example.org/Animal',
2617
- 'rdf:type',
2618
- 'owl:Class',
2619
- ExplanationFormat.TEXT
2620
- );
2621
-
2622
- console.log(explanation);
2623
- // Output: "Animal is a Class because it is declared as owl:Class via rule cax-sco"
2624
-
2625
- // Generate HTML explanation
2626
- const htmlExplanation = explainer.explain(
2627
- subject, predicate, object,
2628
- ExplanationFormat.HTML
2629
- );
2630
- ```
2631
-
2632
- ### Progress Reporting
2633
-
2634
- ```typescript
2635
- import { createProgressReporter } from '@nahisaho/musubix-ontology-mcp';
2636
-
2637
- const reporter = createProgressReporter({
2638
- onProgress: (info) => {
2639
- console.log(`Phase: ${info.phase}`);
2640
- console.log(`Iteration: ${info.iteration}/${info.maxIterations}`);
2641
- console.log(`Triples: ${info.totalTriples}`);
2642
- console.log(`New inferences: ${info.newInferences}`);
2643
- },
2644
- throttleMs: 500 // Report every 500ms
2645
- });
2646
-
2647
- await reasoner.reason(store, { progressReporter: reporter });
2648
- ```
2649
-
2650
- ---
2651
-
2652
- ## YATA Integration
2653
-
2654
- ### What is YATA?
2655
-
2656
- **YATA** (Yet Another Thinking Agent) is a knowledge graph management MCP server that stores and retrieves expertise and know-how as structured data. **Note: YATA is a separate Python-based installation.**
2657
-
2658
- ### Architecture
2659
-
2660
- ```
2661
- ┌─────────────────────────────────────────┐
2662
- │ AI Platform │
2663
- │ (GitHub Copilot, Claude, etc.) │
2664
- └─────────────┬───────────────────────────┘
2665
- │ MCP Protocol
2666
- ┌───────┴───────┐
2667
- ↓ ↓
2668
- ┌──────────┐ ┌──────────┐
2669
- │ MUSUBIX │ │ YATA │
2670
- │ MCP │ │ MCP │
2671
- │ Server │ │ Server │
2672
- └────┬─────┘ └────┬─────┘
2673
- │ │
2674
- ↓ ↓
2675
- ┌──────────┐ ┌──────────┐
2676
- │ SDD │ │ Knowledge│
2677
- │ Engine │ │ Graph │
2678
- └──────────┘ └──────────┘
2679
- ```
2680
-
2681
- ### YATA Client (from MUSUBIX)
2682
-
2683
- ```typescript
2684
- import { createYATAClient } from '@nahisaho/musubix-yata-client';
2685
-
2686
- // Create client
2687
- const yata = createYATAClient({
2688
- endpoint: 'http://localhost:8000',
2689
- apiKey: process.env.YATA_API_KEY
2690
- });
2691
-
2692
- // Save knowledge
2693
- await yata.addKnowledge({
2694
- topic: 'jwt-authentication',
2695
- content: 'Best practices for JWT implementation',
2696
- tags: ['security', 'authentication'],
2697
- relatedRequirements: ['REQ-001']
2698
- });
2699
-
2700
- // Search knowledge
2701
- const results = await yata.search({
2702
- query: 'authentication best practices',
2703
- limit: 10
2704
- });
2705
- ```
2706
-
2707
- ### YATA Features
2708
-
2709
- | Feature | Description |
2710
- |---------|-------------|
2711
- | 34 MCP Tools | Read/write/query knowledge graphs |
2712
- | 47 Frameworks | TypeScript, Python, React, etc. |
2713
- | Vector Search | Semantic knowledge search |
2714
- | Relationship Mapping | Connect knowledge nodes |
2715
-
2716
- ---
2717
-
2718
- ## Best Practices
2719
-
2720
- ### 1. Requirements Best Practices
2721
-
2722
- ✅ **Recommended**:
2723
- - Use EARS format
2724
- - Include verifiable acceptance criteria
2725
- - One function per requirement
2726
-
2727
- ❌ **Avoid**:
2728
- - Vague expressions ("appropriately", "quickly", etc.)
2729
- - Multiple functions in one requirement
2730
- - Implementation details in requirements
2731
-
2732
- ### 2. Design Best Practices
2733
-
2734
- ✅ **Recommended**:
2735
- - Utilize all 4 C4 levels
2736
- - Document important decisions with ADR
2737
- - Maintain traceability to requirements
2738
-
2739
- ❌ **Avoid**:
2740
- - Over-detailed initial design
2741
- - Omitting decision rationale
2742
- - Isolated design documents
2743
-
2744
- ### 3. Task Management Best Practices
2745
-
2746
- ✅ **Recommended**:
2747
- - Granularity within 4 hours
2748
- - Clear links to requirements
2749
- - Explicit completion criteria
2750
-
2751
- ❌ **Avoid**:
2752
- - Tasks too large (8+ hours)
2753
- - Tasks without requirement links
2754
- - Vague completion criteria
2755
-
2756
- ---
2757
-
2758
- ## Troubleshooting
2759
-
2760
- ### Common Problems and Solutions
2761
-
2762
- #### Requirements Validation Error
2763
-
2764
- ```
2765
- Error: EARS format not detected
2766
- ```
2767
-
2768
- **Solution**: Include an EARS pattern in your requirement text.
2769
-
2770
- ```typescript
2771
- // Before
2772
- const text = 'Implement authentication feature';
2773
-
2774
- // After
2775
- const text = 'When a user logs in, the system shall perform authentication';
2776
- ```
2777
-
2778
- #### Traceability Warning
2779
-
2780
- ```
2781
- Warning: Requirement REQ-001 has no design reference
2782
- ```
2783
-
2784
- **Solution**: Create a design document and link it.
2785
-
2786
- ```typescript
2787
- requirementsService.linkDesign('REQ-001', 'DES-001');
2788
- ```
2789
-
2790
- #### MCP Server Connection Error
2791
-
2792
- ```
2793
- Error: Cannot connect to MCP server
2794
- ```
2795
-
2796
- **Solution**:
2797
- 1. Verify server is running
2798
- 2. Check port number
2799
- 3. Check firewall settings
2800
-
2801
- ```bash
2802
- # Check server status
2803
- ps aux | grep musubix
2804
- ```
2805
-
2806
- #### YATA Connection Error
2807
-
2808
- ```
2809
- Error: Cannot connect to YATA endpoint
2810
- ```
2811
-
2812
- **Solution**:
2813
- 1. Verify endpoint URL
2814
- 2. Check API key
2815
- 3. Check network settings
2816
-
2817
- ```typescript
2818
- const client = createYATAClient({
2819
- endpoint: 'http://localhost:8000', // Correct URL
2820
- apiKey: process.env.YATA_API_KEY // Verify environment variable
2821
- });
2822
- ```
2823
-
2824
- ---
2825
-
2826
- ## Next Steps
2827
-
2828
- - 📚 See [API Reference](./API-REFERENCE.md)
2829
- - 💡 Check [Sample Projects](./examples/)
2830
- - 🤝 Read [Contribution Guide](./CONTRIBUTING.md)
2831
-
2832
- ---
2833
-
2834
- ## Related Documents
2835
-
2836
- | Document | Description |
2837
- |----------|-------------|
2838
- | [INSTALL-GUIDE.md](INSTALL-GUIDE.md) | Detailed installation guide |
2839
- | [API-REFERENCE.md](API-REFERENCE.md) | API reference |
2840
- | [evolution-from-musubi-to-musubix.md](evolution-from-musubi-to-musubix.md) | Evolution from MUSUBI |
2841
- | [overview/MUSUBIX-v2.2.0-Advanced-Learning.md](overview/MUSUBIX-v2.2.0-Advanced-Learning.md) | v2.2.0 Advanced Learning details |
2842
-
2843
- ---
2844
-
2845
- **Version**: 2.2.0
2846
- **Last Updated**: 2026-01-08
2847
- **MUSUBIX Project**