llmesh-llive 0.1.1__tar.gz

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 (102) hide show
  1. llmesh_llive-0.1.1/.gitignore +44 -0
  2. llmesh_llive-0.1.1/LICENSE +21 -0
  3. llmesh_llive-0.1.1/PKG-INFO +88 -0
  4. llmesh_llive-0.1.1/README.md +49 -0
  5. llmesh_llive-0.1.1/docs/SESSION_SUMMARY.md +40 -0
  6. llmesh_llive-0.1.1/docs/architecture.md +243 -0
  7. llmesh_llive-0.1.1/docs/data_model.md +250 -0
  8. llmesh_llive-0.1.1/docs/evaluation_metrics.md +169 -0
  9. llmesh_llive-0.1.1/docs/family_integration.md +245 -0
  10. llmesh_llive-0.1.1/docs/glossary.md +291 -0
  11. llmesh_llive-0.1.1/docs/model_templates.md +179 -0
  12. llmesh_llive-0.1.1/docs/observability_schema.md +245 -0
  13. llmesh_llive-0.1.1/docs/requirements_v0.1.md +130 -0
  14. llmesh_llive-0.1.1/docs/requirements_v0.2_addendum.md +310 -0
  15. llmesh_llive-0.1.1/docs/requirements_v0.3_triz_self_evolution.md +317 -0
  16. llmesh_llive-0.1.1/docs/requirements_v0.4_llm_wiki.md +189 -0
  17. llmesh_llive-0.1.1/docs/roadmap.md +169 -0
  18. llmesh_llive-0.1.1/docs/security_model.md +200 -0
  19. llmesh_llive-0.1.1/docs/testing_strategy.md +179 -0
  20. llmesh_llive-0.1.1/docs/yaml_schemas.md +277 -0
  21. llmesh_llive-0.1.1/pyproject.toml +116 -0
  22. llmesh_llive-0.1.1/scripts/inspect_hf_model.py +102 -0
  23. llmesh_llive-0.1.1/specs/README.md +58 -0
  24. llmesh_llive-0.1.1/specs/candidates/example_001.yaml +25 -0
  25. llmesh_llive-0.1.1/specs/containers/adaptive_reasoning_v1.yaml +20 -0
  26. llmesh_llive-0.1.1/specs/containers/fast_path_v1.yaml +10 -0
  27. llmesh_llive-0.1.1/specs/resources/triz_features.yaml +288 -0
  28. llmesh_llive-0.1.1/specs/resources/triz_matrix_compact.yaml +70 -0
  29. llmesh_llive-0.1.1/specs/resources/triz_principles.yaml +381 -0
  30. llmesh_llive-0.1.1/specs/routes/default.yaml +9 -0
  31. llmesh_llive-0.1.1/specs/schemas/candidate-diff.v1.json +114 -0
  32. llmesh_llive-0.1.1/specs/schemas/container-spec.v1.json +102 -0
  33. llmesh_llive-0.1.1/specs/schemas/subblock-spec.v1.json +44 -0
  34. llmesh_llive-0.1.1/specs/subblocks/attention.yaml +78 -0
  35. llmesh_llive-0.1.1/specs/subblocks/common.yaml +36 -0
  36. llmesh_llive-0.1.1/specs/subblocks/ffn.yaml +65 -0
  37. llmesh_llive-0.1.1/specs/subblocks/llive_extensions.yaml +133 -0
  38. llmesh_llive-0.1.1/specs/templates/llama3_1_8b.yaml +95 -0
  39. llmesh_llive-0.1.1/specs/templates/mistral_7b_v0_3.yaml +87 -0
  40. llmesh_llive-0.1.1/specs/templates/phi_3_5_mini.yaml +89 -0
  41. llmesh_llive-0.1.1/specs/templates/qwen2_5_0_5b.yaml +17 -0
  42. llmesh_llive-0.1.1/specs/templates/qwen2_5_7b.yaml +97 -0
  43. llmesh_llive-0.1.1/src/llive/__init__.py +5 -0
  44. llmesh_llive-0.1.1/src/llive/_specs/candidates/example_001.yaml +25 -0
  45. llmesh_llive-0.1.1/src/llive/_specs/containers/adaptive_reasoning_v1.yaml +20 -0
  46. llmesh_llive-0.1.1/src/llive/_specs/containers/fast_path_v1.yaml +10 -0
  47. llmesh_llive-0.1.1/src/llive/_specs/resources/triz_features.yaml +288 -0
  48. llmesh_llive-0.1.1/src/llive/_specs/resources/triz_matrix_compact.yaml +70 -0
  49. llmesh_llive-0.1.1/src/llive/_specs/resources/triz_principles.yaml +381 -0
  50. llmesh_llive-0.1.1/src/llive/_specs/routes/default.yaml +9 -0
  51. llmesh_llive-0.1.1/src/llive/_specs/schemas/candidate-diff.v1.json +114 -0
  52. llmesh_llive-0.1.1/src/llive/_specs/schemas/container-spec.v1.json +102 -0
  53. llmesh_llive-0.1.1/src/llive/_specs/schemas/subblock-spec.v1.json +44 -0
  54. llmesh_llive-0.1.1/src/llive/_specs/templates/llama3_1_8b.yaml +95 -0
  55. llmesh_llive-0.1.1/src/llive/_specs/templates/mistral_7b_v0_3.yaml +87 -0
  56. llmesh_llive-0.1.1/src/llive/_specs/templates/phi_3_5_mini.yaml +89 -0
  57. llmesh_llive-0.1.1/src/llive/_specs/templates/qwen2_5_0_5b.yaml +17 -0
  58. llmesh_llive-0.1.1/src/llive/_specs/templates/qwen2_5_7b.yaml +97 -0
  59. llmesh_llive-0.1.1/src/llive/cli/__init__.py +5 -0
  60. llmesh_llive-0.1.1/src/llive/cli/main.py +333 -0
  61. llmesh_llive-0.1.1/src/llive/container/__init__.py +12 -0
  62. llmesh_llive-0.1.1/src/llive/container/executor.py +141 -0
  63. llmesh_llive-0.1.1/src/llive/container/registry.py +69 -0
  64. llmesh_llive-0.1.1/src/llive/container/subblocks/__init__.py +5 -0
  65. llmesh_llive-0.1.1/src/llive/container/subblocks/builtin.py +202 -0
  66. llmesh_llive-0.1.1/src/llive/core/__init__.py +5 -0
  67. llmesh_llive-0.1.1/src/llive/core/adapter.py +163 -0
  68. llmesh_llive-0.1.1/src/llive/evolution/__init__.py +24 -0
  69. llmesh_llive-0.1.1/src/llive/evolution/bench.py +222 -0
  70. llmesh_llive-0.1.1/src/llive/evolution/change_op.py +243 -0
  71. llmesh_llive-0.1.1/src/llive/memory/__init__.py +17 -0
  72. llmesh_llive-0.1.1/src/llive/memory/encoder.py +98 -0
  73. llmesh_llive-0.1.1/src/llive/memory/episodic.py +135 -0
  74. llmesh_llive-0.1.1/src/llive/memory/provenance.py +35 -0
  75. llmesh_llive-0.1.1/src/llive/memory/semantic.py +197 -0
  76. llmesh_llive-0.1.1/src/llive/memory/surprise.py +42 -0
  77. llmesh_llive-0.1.1/src/llive/observability/__init__.py +15 -0
  78. llmesh_llive-0.1.1/src/llive/observability/logging.py +48 -0
  79. llmesh_llive-0.1.1/src/llive/observability/metrics.py +100 -0
  80. llmesh_llive-0.1.1/src/llive/observability/trace.py +84 -0
  81. llmesh_llive-0.1.1/src/llive/orchestration/__init__.py +1 -0
  82. llmesh_llive-0.1.1/src/llive/orchestration/pipeline.py +134 -0
  83. llmesh_llive-0.1.1/src/llive/router/__init__.py +6 -0
  84. llmesh_llive-0.1.1/src/llive/router/engine.py +149 -0
  85. llmesh_llive-0.1.1/src/llive/router/explanation.py +58 -0
  86. llmesh_llive-0.1.1/src/llive/schema/__init__.py +27 -0
  87. llmesh_llive-0.1.1/src/llive/schema/models.py +198 -0
  88. llmesh_llive-0.1.1/src/llive/schema/validator.py +112 -0
  89. llmesh_llive-0.1.1/src/llive/triz/__init__.py +19 -0
  90. llmesh_llive-0.1.1/src/llive/triz/loader.py +160 -0
  91. llmesh_llive-0.1.1/tests/component/test_bench.py +33 -0
  92. llmesh_llive-0.1.1/tests/component/test_cli.py +63 -0
  93. llmesh_llive-0.1.1/tests/component/test_container_executor.py +50 -0
  94. llmesh_llive-0.1.1/tests/component/test_pipeline.py +40 -0
  95. llmesh_llive-0.1.1/tests/conftest.py +31 -0
  96. llmesh_llive-0.1.1/tests/data/mvr_bench/prompts.txt +12 -0
  97. llmesh_llive-0.1.1/tests/property/test_change_op_invert.py +87 -0
  98. llmesh_llive-0.1.1/tests/unit/test_memory.py +124 -0
  99. llmesh_llive-0.1.1/tests/unit/test_observability.py +58 -0
  100. llmesh_llive-0.1.1/tests/unit/test_router.py +65 -0
  101. llmesh_llive-0.1.1/tests/unit/test_schema_validator.py +131 -0
  102. llmesh_llive-0.1.1/tests/unit/test_triz.py +44 -0
@@ -0,0 +1,44 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ dist/
8
+ *.egg-info/
9
+ .eggs/
10
+ .venv/
11
+ venv/
12
+ env/
13
+
14
+ .pytest_cache/
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+ .coverage
18
+ htmlcov/
19
+ coverage.xml
20
+ .tox/
21
+
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *~
26
+
27
+ .DS_Store
28
+ Thumbs.db
29
+
30
+ out/
31
+ runs/
32
+ checkpoints/
33
+ *.ckpt
34
+ *.pt
35
+ *.safetensors
36
+
37
+ .env
38
+ .env.local
39
+ *.local.yaml
40
+
41
+ # llive-specific transient artifacts
42
+ candidates/_tmp/
43
+ memory/_cache/
44
+ bench/_runs/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kazufumi Furuse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.4
2
+ Name: llmesh-llive
3
+ Version: 0.1.1
4
+ Summary: Self-evolving modular memory LLM framework — biological memory × formal verification × industrial IoT mesh × TUI HITL
5
+ Project-URL: Homepage, https://github.com/furuse-kazufumi/llive
6
+ Project-URL: Documentation, https://github.com/furuse-kazufumi/llive/tree/main/docs
7
+ Project-URL: Issues, https://github.com/furuse-kazufumi/llive/issues
8
+ Project-URL: Family, https://github.com/furuse-kazufumi/llmesh-suite
9
+ Author-email: Kazufumi Furuse <kazufumi@furuse.work>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: continual-learning,industrial-iot,llm,modular-memory,neural-architecture-search,self-evolution,tui
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: <3.12,>=3.11
19
+ Requires-Dist: duckdb>=0.10
20
+ Requires-Dist: jsonschema>=4.21
21
+ Requires-Dist: numpy>=1.26
22
+ Requires-Dist: pydantic>=2.6
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: structlog>=24.1
25
+ Requires-Dist: typer>=0.12
26
+ Provides-Extra: dev
27
+ Requires-Dist: hypothesis>=6.100; extra == 'dev'
28
+ Requires-Dist: mypy>=1.10; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=4.1; extra == 'dev'
30
+ Requires-Dist: pytest>=8; extra == 'dev'
31
+ Requires-Dist: ruff>=0.4; extra == 'dev'
32
+ Provides-Extra: torch
33
+ Requires-Dist: accelerate>=0.30; extra == 'torch'
34
+ Requires-Dist: faiss-cpu>=1.8; extra == 'torch'
35
+ Requires-Dist: sentence-transformers>=2.7; extra == 'torch'
36
+ Requires-Dist: torch>=2.2; extra == 'torch'
37
+ Requires-Dist: transformers>=4.40; extra == 'torch'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # llive
41
+
42
+ > **Self-evolving modular memory LLM framework** — 生物学的記憶モデル × 形式検証 × 産業 IoT メッシュ × TUI HITL の交差点で設計された自己進化型 LLM 基盤。
43
+
44
+ llive は、固定された Decoder-only LLM コアの周辺に、可変長 BlockContainer・4 層外部記憶(semantic / episodic / structural / parameter)・審査付き構造進化を組み合わせることで、コア重みを再学習せず新能力を継続的に取り込める研究開発フレームワークです。
45
+
46
+ llmesh(マルチプロトコル LLM ゲートウェイ)と llove(TUI dashboard)の両ファミリーと統合運用できることを第一級要件としています。
47
+
48
+ ## 設計の核
49
+
50
+ 1. **固定コア + 可変周辺** — Adapter / LoRA / 外部記憶 / 可変 BlockContainer で能力を吸収
51
+ 2. **4 層メモリの責務分離** — semantic(知識)/ episodic(経験)/ structural(関係)/ parameter(差分重み)
52
+ 3. **宣言的構造記述** — sub-block 列を YAML で表現、AI が提案・比較しやすい
53
+ 4. **審査付き自己進化** — オンラインは memory write と軽微 routing のみ、構造変更はオフライン審査経由
54
+ 5. **生物学的記憶モデル直接埋め込み** — 海馬-皮質 consolidation cycle、surprise score、phase transition
55
+ 6. **形式検証付き promotion** — Lean / Z3 / TLA+ による構造的不変量検査を LLM 評価前に挟む
56
+ 7. **llmesh / llove ファミリー統合** — 産業 IoT センサを直接 episodic memory に、TUI で HITL 完結
57
+ 8. **TRIZ アイデア出しを内蔵** — 40 原理 + 39×39 矛盾マトリクス + ARIZ + 9 画法を mutation policy として組込み、メトリクスから矛盾を自動検出 → 原理マッピング → RAD 裏付け → CandidateDiff 生成までを自走
58
+
59
+ ## 既存類似研究との位置づけ
60
+
61
+ | 既存系 | 重なる範囲 | llive の差別化 |
62
+ |---|---|---|
63
+ | MemGPT / LongMem | 階層メモリ | 4 層分離 + phase transition + 署名 zone |
64
+ | AutoML-Zero / NAS-LLM | 構造探索 | 形式検証 gate + multi-precision shadow + 失敗データ化 |
65
+ | Self-Refine / Reflexion | 自己批評 | online/offline 分離 + llove TUI HITL staging |
66
+ | MERA / ModularLLM | モジュラー化 | 可変長 BlockContainer YAML + plugin registry |
67
+ | AutoGPT 系 | エージェント | llmesh 産業 IoT 直結 + llove TUI |
68
+
69
+ ## ステータス
70
+
71
+ - **2026-05-13**: プロジェクト発足。要件定義 v0.1 → v0.2 拡充完了。
72
+ - 現在: Phase 0 — schema / interface 設計、ディレクトリ構造の確立フェーズ。
73
+
74
+ ## ドキュメント
75
+
76
+ - [要件定義 v0.1(原型)](docs/requirements_v0.1.md)
77
+ - [要件定義 v0.2 追補章(TRIZ + 設計パターン + llmesh/llove 統合)](docs/requirements_v0.2_addendum.md)
78
+
79
+ ## ファミリー
80
+
81
+ - **[llmesh](https://github.com/furuse-kazufumi/llmesh)** — マルチプロトコル LLM ゲートウェイ、産業 IoT 対応
82
+ - **[llove](https://github.com/furuse-kazufumi/llove)** — TUI dashboard、可視化と HITL
83
+ - **[llmesh-suite](https://github.com/furuse-kazufumi/llmesh-suite)** — llmesh + llove のメタパッケージ
84
+ - **llive** — 自己進化型モジュラー記憶 LLM 基盤(本リポジトリ)
85
+
86
+ ## ライセンス
87
+
88
+ MIT
@@ -0,0 +1,49 @@
1
+ # llive
2
+
3
+ > **Self-evolving modular memory LLM framework** — 生物学的記憶モデル × 形式検証 × 産業 IoT メッシュ × TUI HITL の交差点で設計された自己進化型 LLM 基盤。
4
+
5
+ llive は、固定された Decoder-only LLM コアの周辺に、可変長 BlockContainer・4 層外部記憶(semantic / episodic / structural / parameter)・審査付き構造進化を組み合わせることで、コア重みを再学習せず新能力を継続的に取り込める研究開発フレームワークです。
6
+
7
+ llmesh(マルチプロトコル LLM ゲートウェイ)と llove(TUI dashboard)の両ファミリーと統合運用できることを第一級要件としています。
8
+
9
+ ## 設計の核
10
+
11
+ 1. **固定コア + 可変周辺** — Adapter / LoRA / 外部記憶 / 可変 BlockContainer で能力を吸収
12
+ 2. **4 層メモリの責務分離** — semantic(知識)/ episodic(経験)/ structural(関係)/ parameter(差分重み)
13
+ 3. **宣言的構造記述** — sub-block 列を YAML で表現、AI が提案・比較しやすい
14
+ 4. **審査付き自己進化** — オンラインは memory write と軽微 routing のみ、構造変更はオフライン審査経由
15
+ 5. **生物学的記憶モデル直接埋め込み** — 海馬-皮質 consolidation cycle、surprise score、phase transition
16
+ 6. **形式検証付き promotion** — Lean / Z3 / TLA+ による構造的不変量検査を LLM 評価前に挟む
17
+ 7. **llmesh / llove ファミリー統合** — 産業 IoT センサを直接 episodic memory に、TUI で HITL 完結
18
+ 8. **TRIZ アイデア出しを内蔵** — 40 原理 + 39×39 矛盾マトリクス + ARIZ + 9 画法を mutation policy として組込み、メトリクスから矛盾を自動検出 → 原理マッピング → RAD 裏付け → CandidateDiff 生成までを自走
19
+
20
+ ## 既存類似研究との位置づけ
21
+
22
+ | 既存系 | 重なる範囲 | llive の差別化 |
23
+ |---|---|---|
24
+ | MemGPT / LongMem | 階層メモリ | 4 層分離 + phase transition + 署名 zone |
25
+ | AutoML-Zero / NAS-LLM | 構造探索 | 形式検証 gate + multi-precision shadow + 失敗データ化 |
26
+ | Self-Refine / Reflexion | 自己批評 | online/offline 分離 + llove TUI HITL staging |
27
+ | MERA / ModularLLM | モジュラー化 | 可変長 BlockContainer YAML + plugin registry |
28
+ | AutoGPT 系 | エージェント | llmesh 産業 IoT 直結 + llove TUI |
29
+
30
+ ## ステータス
31
+
32
+ - **2026-05-13**: プロジェクト発足。要件定義 v0.1 → v0.2 拡充完了。
33
+ - 現在: Phase 0 — schema / interface 設計、ディレクトリ構造の確立フェーズ。
34
+
35
+ ## ドキュメント
36
+
37
+ - [要件定義 v0.1(原型)](docs/requirements_v0.1.md)
38
+ - [要件定義 v0.2 追補章(TRIZ + 設計パターン + llmesh/llove 統合)](docs/requirements_v0.2_addendum.md)
39
+
40
+ ## ファミリー
41
+
42
+ - **[llmesh](https://github.com/furuse-kazufumi/llmesh)** — マルチプロトコル LLM ゲートウェイ、産業 IoT 対応
43
+ - **[llove](https://github.com/furuse-kazufumi/llove)** — TUI dashboard、可視化と HITL
44
+ - **[llmesh-suite](https://github.com/furuse-kazufumi/llmesh-suite)** — llmesh + llove のメタパッケージ
45
+ - **llive** — 自己進化型モジュラー記憶 LLM 基盤(本リポジトリ)
46
+
47
+ ## ライセンス
48
+
49
+ MIT
@@ -0,0 +1,40 @@
1
+ # Session Summary (auto-generated)
2
+
3
+ > 自動生成: `libexec/raptor-auto-summary` (Stop hook)
4
+ > 次回 ccr 起動時に CLAUDE.md SESSION START で自動的に読み取られる。
5
+
6
+ - **最終更新**: 2026-05-13 21:11:11
7
+ - **プロジェクト**: `D:/projects/llive`
8
+ - **ブランチ**: `main`
9
+
10
+ ## 直近の git log
11
+
12
+ ```
13
+ 3627188 docs: regenerate SESSION_SUMMARY.md via Stop hook
14
+ 612f2d0 docs(01-mvr): Phase 1 complete — SESSION_SUMMARY + verification report
15
+ 2ff5c4c auto: SESSION_SUMMARY.md 編集前 (2026-05-13 08:27)
16
+ 28010f4 auto: REQUIREMENTS.md 編集前 (2026-05-13 08:26)
17
+ 9a3728e auto: test_memory.py 編集前 (2026-05-13 08:25)
18
+ 3d4cbce feat(01-mvr): implement Phase 1 minimum viable research platform
19
+ 853e6d0 auto: main.py 編集前 (2026-05-13 08:22)
20
+ 3b50dfc auto: change_op.py 編集前 (2026-05-13 08:19)
21
+ b98323b auto: change_op.py 編集前 (2026-05-13 08:18)
22
+ 9242d2e auto: loader.py 編集前 (2026-05-13 08:17)
23
+ ```
24
+
25
+ ## 現在の git status
26
+
27
+ ```
28
+ (clean)
29
+ ```
30
+
31
+ ## 直近 2 時間に変更されたファイル
32
+
33
+ ```
34
+ (直近 2h の変更なし)
35
+ ```
36
+
37
+ ---
38
+
39
+ > このファイルは毎ターン自動上書きされます。**手動で書いた内容は失われます。**
40
+ > 永続化したいメモは `docs/PROGRESS.md` または `docs/NOTES.md` を使ってください。
@@ -0,0 +1,243 @@
1
+ # llive アーキテクチャ図
2
+
3
+ > v0.2 で 6 層 → 8 層に再構成。Mermaid 図で各層・各パターン・各データフローを可視化。
4
+
5
+ ## 1. 全体構成(8 層 + llmesh I/O bus)
6
+
7
+ ```mermaid
8
+ flowchart TB
9
+ subgraph L8["L8: llove HITL (TUI)"]
10
+ direction LR
11
+ L8A[Review Pane]
12
+ L8B[Memory Viz]
13
+ L8C[Candidate Arena]
14
+ end
15
+
16
+ subgraph L7["L7: Observability & Benchmark"]
17
+ L7A[Tracing]
18
+ L7B[Metrics]
19
+ L7C[BenchmarkHarness]
20
+ end
21
+
22
+ subgraph L6["L6: Evolution Manager"]
23
+ L6A[Proposal]
24
+ L6B[Mutation]
25
+ L6C[Static Verifier]
26
+ L6D[Shadow Eval]
27
+ L6E[Promote / Rollback]
28
+ end
29
+
30
+ subgraph L5["L5: Memory Fabric"]
31
+ L5A[Semantic]
32
+ L5B[Episodic]
33
+ L5C[Structural]
34
+ L5D[Parameter]
35
+ L5E[Quarantine Zone]
36
+ end
37
+
38
+ subgraph L4["L4: Block Container Engine"]
39
+ L4A[Container Registry]
40
+ L4B[Sub-block Plugin Registry]
41
+ L4C[Composer]
42
+ L4D[Executor]
43
+ end
44
+
45
+ subgraph L3["L3: Core Model Adapter"]
46
+ L3A[HF Adapter]
47
+ L3B[vLLM Adapter]
48
+ L3C[TGI Adapter]
49
+ end
50
+
51
+ subgraph L2["L2: Orchestration"]
52
+ L2A[Pipeline]
53
+ L2B[Router]
54
+ L2C[Consolidation Scheduler]
55
+ end
56
+
57
+ subgraph L1["L1: Interface"]
58
+ L1A[CLI]
59
+ L1B[MCP]
60
+ L1C[REST]
61
+ L1D[Batch]
62
+ end
63
+
64
+ BUS[(llmesh I/O Bus<br/>MQTT / OPC-UA)]
65
+
66
+ L1 --> L2
67
+ L2 --> L3
68
+ L2 --> L4
69
+ L4 --> L3
70
+ L2 --> L5
71
+ L4 --> L5
72
+ L6 --> L4
73
+ L6 --> L5
74
+ L6 -.candidate state.-> L8
75
+ L5 -.events.-> L7
76
+ L4 -.traces.-> L7
77
+ L6 -.eval results.-> L7
78
+ L7 --> L8
79
+ L8 -.HITL commands.-> L6
80
+ BUS <--> L5
81
+ BUS <--> L8
82
+ ```
83
+
84
+ ## 2. 推論パイプライン(Pipes & Filters)
85
+
86
+ ```mermaid
87
+ flowchart LR
88
+ IN[Input] --> PP[Preprocess]
89
+ PP --> RT[Memory Retrieval]
90
+ RT --> RO[Router]
91
+ RO --> BC{BlockContainer<br/>選択}
92
+ BC -->|reasoning| C1[adaptive_reasoning_v1]
93
+ BC -->|short context| C2[fast_path_v1]
94
+ BC -->|long context| C3[memory_heavy_v1]
95
+ C1 --> WR[Memory Write Gate]
96
+ C2 --> WR
97
+ C3 --> WR
98
+ WR -->|surprise > θ| EP[(Episodic)]
99
+ WR -->|否| OUT[Output]
100
+ EP --> OUT
101
+ ```
102
+
103
+ ## 3. BlockContainer 内部(Composite + Chain of Responsibility)
104
+
105
+ ```mermaid
106
+ flowchart TB
107
+ subgraph BC["BlockContainer: adaptive_reasoning_v1"]
108
+ direction TB
109
+ S1[pre_norm] --> S2[causal_attention]
110
+ S2 --> S3[memory_read<br/>top_k=8]
111
+ S3 --> S4[cross_memory_attention]
112
+ S4 --> S5[adapter<br/>task_conditioned]
113
+ S5 --> S6[ffn_large]
114
+ S6 --> S7[reflective_probe]
115
+ S7 --> S8{surprise > θ?}
116
+ S8 -->|yes| S9[memory_write]
117
+ S8 -->|no| S10[residual]
118
+ S9 --> S10
119
+ end
120
+ ```
121
+
122
+ ## 4. Memory Fabric(CQRS + Event Sourcing)
123
+
124
+ ```mermaid
125
+ flowchart LR
126
+ subgraph WRITE["Write Path"]
127
+ W1[Write Gate] --> W2[Surprise-Bayesian]
128
+ W2 --> W3[Provenance Stamp]
129
+ W3 --> W4[Zone Router]
130
+ W4 -->|trusted| W5[(Main Zone)]
131
+ W4 -->|untrusted| W6[(Quarantine Zone)]
132
+ end
133
+
134
+ subgraph READ["Read Path"]
135
+ R1[Query] --> R2[Multi-layer Search]
136
+ R2 --> R3{Cross-zone?}
137
+ R3 -->|yes| R4[Signature Verify]
138
+ R3 -->|no| R5[Direct Return]
139
+ R4 --> R5
140
+ end
141
+
142
+ subgraph CONSOL["Consolidation Cycle"]
143
+ C1[Episodic Stream] --> C2[Replay Selector]
144
+ C2 --> C3[Summarize via LLM]
145
+ C3 --> C4[Semantic Write]
146
+ C3 --> C5[Structural Edge Update]
147
+ end
148
+
149
+ W5 --> R2
150
+ W5 --> C1
151
+ ```
152
+
153
+ ## 5. Evolution Lifecycle(State + Saga)
154
+
155
+ ```mermaid
156
+ stateDiagram-v2
157
+ [*] --> draft: AI proposal
158
+ draft --> proposed: schema validate
159
+ proposed --> verifying: Static Verifier
160
+ verifying --> rejected: refute
161
+ verifying --> shadow_eval: prove or unprovable
162
+ shadow_eval --> rejected: low score
163
+ shadow_eval --> short_eval: top-N
164
+ short_eval --> long_eval: pass
165
+ long_eval --> hitl_review: pass
166
+ hitl_review --> staging: approve
167
+ hitl_review --> rejected: deny
168
+ staging --> production: regression+forgetting pass
169
+ staging --> rolled_back: forgetting detected
170
+ production --> rolled_back: Reverse-Evolution Monitor
171
+ rejected --> [*]
172
+ rolled_back --> [*]
173
+ production --> [*]: archived
174
+ ```
175
+
176
+ ## 6. llmesh / llove 統合フロー
177
+
178
+ ```mermaid
179
+ sequenceDiagram
180
+ participant Sensor as llmesh Sensor<br/>(MQTT/OPC-UA)
181
+ participant Bus as llmesh I/O Bus
182
+ participant Mem as Memory Fabric<br/>(L5)
183
+ participant Evo as Evolution Manager<br/>(L6)
184
+ participant TUI as llove HITL<br/>(L8)
185
+ participant Op as Human Op
186
+
187
+ Sensor->>Bus: sensor stream event
188
+ Bus->>Mem: episodic write (FR-19)
189
+ Mem->>Mem: surprise score (Bayesian)
190
+ Mem->>Evo: trigger candidate proposal
191
+ Evo->>Evo: AI generate diff
192
+ Evo->>Evo: Static Verifier (FR-13)
193
+ Evo->>Evo: Multi-precision shadow (FR-14)
194
+ Evo->>TUI: surface top candidate
195
+ TUI->>Op: render diff + score + viz
196
+ Op->>TUI: approve / deny
197
+ TUI->>Evo: Command(approve)
198
+ Evo->>Mem: signed adapter publish (FR-18)
199
+ Mem->>Bus: P2P distribute
200
+ Bus->>Sensor: ack
201
+ ```
202
+
203
+ ## 7. パターン適用マップ(簡易)
204
+
205
+ ```mermaid
206
+ mindmap
207
+ root((llive))
208
+ L1 Interface
209
+ Facade
210
+ Command
211
+ CoR
212
+ L2 Orchestration
213
+ Pipes&Filters
214
+ Mediator
215
+ L3 CoreAdapter
216
+ Adapter
217
+ Proxy
218
+ L4 Container
219
+ Composite
220
+ Strategy
221
+ Builder
222
+ Plugin
223
+ L5 Memory
224
+ Repository
225
+ CQRS
226
+ EventSourcing
227
+ Proxy
228
+ L6 Evolution
229
+ Command
230
+ Memento
231
+ State
232
+ Saga
233
+ L7 Observability
234
+ Decorator
235
+ Observer
236
+ L8 HITL
237
+ MVVM
238
+ Command
239
+ Bus llmesh
240
+ Adapter
241
+ Bridge
242
+ PubSub
243
+ ```