liquid-loop 0.8.0__tar.gz → 0.9.0__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 (27) hide show
  1. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/PKG-INFO +15 -4
  2. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/README.md +14 -3
  3. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/__init__.py +2 -2
  4. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/workspace.py +18 -5
  5. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/PKG-INFO +15 -4
  6. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/pyproject.toml +1 -1
  7. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/LICENSE +0 -0
  8. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/__main__.py +0 -0
  9. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/cli.py +0 -0
  10. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/cognitive_budget.py +0 -0
  11. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/entropy.py +0 -0
  12. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/mesh/__init__.py +0 -0
  13. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/mesh/v2.py +0 -0
  14. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop/storage.py +0 -0
  15. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/SOURCES.txt +0 -0
  16. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/dependency_links.txt +0 -0
  17. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/entry_points.txt +0 -0
  18. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/requires.txt +0 -0
  19. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/liquid_loop.egg-info/top_level.txt +0 -0
  20. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/setup.cfg +0 -0
  21. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_consensus_expansion.py +0 -0
  22. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_entropy.py +0 -0
  23. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_nucleate_dual_track.py +0 -0
  24. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_peek_seal.py +0 -0
  25. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_seal_persistence.py +0 -0
  26. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_self_evolve.py +0 -0
  27. {liquid_loop-0.8.0 → liquid_loop-0.9.0}/tests/test_workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liquid-loop
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation
5
5
  Author: fishbook0001
6
6
  Maintainer: fishbook0001
@@ -39,6 +39,8 @@ Dynamic: license-file
39
39
 
40
40
  # Liquid Loop
41
41
 
42
+ ![Liquid Loop Hero Banner](docs/assets/06-hero-banner.jpg)
43
+
42
44
  > **Self-Organizing Cognitive Memory for AI Agents** — Zero LLM dependency, pure Python implementation of the Liquid Loop theory.
43
45
 
44
46
  [![PyPI](https://img.shields.io/pypi/v/liquid-loop.svg)](https://pypi.org/project/liquid-loop/)
@@ -225,9 +227,17 @@ print(health["CCI"], health["consensus_crystals"])
225
227
 
226
228
  ---
227
229
 
228
- ## 定位:Self-Regulating Persistent Memory Dynamics
230
+ ## 定位:Self-Regulating Memory State Evolution
231
+
232
+ > **North-Star 公理(一切代码与论文围绕它校验):**
233
+ >
234
+ > **Liquid Loop is not a memory storage mechanism; it is a self-regulating memory state evolution mechanism.**
235
+ >
236
+ > (液环不是一种记忆存储机制,而是一种自调节的记忆状态演化机制。)
237
+
238
+ 液环的本质不是"AI 意识 / 认知层",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay + Contradiction Track` 组合成闭环,使记忆从"外部管理"转向"内部自组织"。
229
239
 
230
- 液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
240
+ **边界(防止退化为"智能记忆管理器")**:记忆状态本身是一个**演化对象**,而非被管理的数据对象。市场已有的"记忆评分 / 自动删除 / 权重调整"范式把记忆当被管理的数据——液环要保护的是 **memory homeostasis(记忆稳态)**:记忆在变化环境中经 输入→吸收→凝聚→稳定→衰减→重构,自身维持一致性,而非被外部规则调度。
231
241
 
232
242
  ```
233
243
  Input Evidence
@@ -322,7 +332,8 @@ pytest -v
322
332
  - [x] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
323
333
  - [x] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
324
334
  - [x] **[v0.8] 三实验全 PASS**:E2 错误记忆恢复 → E3 多 agent 冲突 → E1 长期漂移(见上节)
325
- - [ ] **[v0.9 优化项]**:`_detect_conflicts` 由每证据 O(g²) 两两扫描改为增量/采样(大规模高频写入性能,非正确性)
335
+ - [x] **[v0.9] 冲突检测 O(g²)→O(d²)**:`_detect_conflicts` 按 content 去重后只对 distinct 内容求两两重叠(d≤g),overlap_cache 复用;语义更纯净(度量不同论点分歧),大规模高频写入性能提升(非正确性变更)
336
+ - [x] **[v0.9] 液态算法正式落地**:时间动力学 / 反证轨 / 双轨成核在 v0.8 已实现并经 E1/E2/E3 三实验背书,v0.9 作为稳定版正式发布(README 顶部 Hero Banner 已上线)
326
337
  - [ ] LoCoMo / LongMemEval 基准对比
327
338
  - [ ] 边缘端部署优化(<50KB)
328
339
 
@@ -1,5 +1,7 @@
1
1
  # Liquid Loop
2
2
 
3
+ ![Liquid Loop Hero Banner](docs/assets/06-hero-banner.jpg)
4
+
3
5
  > **Self-Organizing Cognitive Memory for AI Agents** — Zero LLM dependency, pure Python implementation of the Liquid Loop theory.
4
6
 
5
7
  [![PyPI](https://img.shields.io/pypi/v/liquid-loop.svg)](https://pypi.org/project/liquid-loop/)
@@ -186,9 +188,17 @@ print(health["CCI"], health["consensus_crystals"])
186
188
 
187
189
  ---
188
190
 
189
- ## 定位:Self-Regulating Persistent Memory Dynamics
191
+ ## 定位:Self-Regulating Memory State Evolution
192
+
193
+ > **North-Star 公理(一切代码与论文围绕它校验):**
194
+ >
195
+ > **Liquid Loop is not a memory storage mechanism; it is a self-regulating memory state evolution mechanism.**
196
+ >
197
+ > (液环不是一种记忆存储机制,而是一种自调节的记忆状态演化机制。)
198
+
199
+ 液环的本质不是"AI 意识 / 认知层",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay + Contradiction Track` 组合成闭环,使记忆从"外部管理"转向"内部自组织"。
190
200
 
191
- 液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
201
+ **边界(防止退化为"智能记忆管理器")**:记忆状态本身是一个**演化对象**,而非被管理的数据对象。市场已有的"记忆评分 / 自动删除 / 权重调整"范式把记忆当被管理的数据——液环要保护的是 **memory homeostasis(记忆稳态)**:记忆在变化环境中经 输入→吸收→凝聚→稳定→衰减→重构,自身维持一致性,而非被外部规则调度。
192
202
 
193
203
  ```
194
204
  Input Evidence
@@ -283,7 +293,8 @@ pytest -v
283
293
  - [x] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
284
294
  - [x] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
285
295
  - [x] **[v0.8] 三实验全 PASS**:E2 错误记忆恢复 → E3 多 agent 冲突 → E1 长期漂移(见上节)
286
- - [ ] **[v0.9 优化项]**:`_detect_conflicts` 由每证据 O(g²) 两两扫描改为增量/采样(大规模高频写入性能,非正确性)
296
+ - [x] **[v0.9] 冲突检测 O(g²)→O(d²)**:`_detect_conflicts` 按 content 去重后只对 distinct 内容求两两重叠(d≤g),overlap_cache 复用;语义更纯净(度量不同论点分歧),大规模高频写入性能提升(非正确性变更)
297
+ - [x] **[v0.9] 液态算法正式落地**:时间动力学 / 反证轨 / 双轨成核在 v0.8 已实现并经 E1/E2/E3 三实验背书,v0.9 作为稳定版正式发布(README 顶部 Hero Banner 已上线)
287
298
  - [ ] LoCoMo / LongMemEval 基准对比
288
299
  - [ ] 边缘端部署优化(<50KB)
289
300
 
@@ -1,5 +1,5 @@
1
- """Liquid Loop — Workspace Cognitive Runtime v0.8.0 (反证轨 + 时间动力学, CPE-fused, SEAL dual-opt, dual-track multi-agent, MESH v2 integration)"""
2
- __version__ = "0.8.0"
1
+ """Liquid Loop — Workspace Cognitive Runtime v0.9.0 (反证轨 + 时间动力学, CPE-fused, SEAL dual-opt, dual-track multi-agent, MESH v2 integration)"""
2
+ __version__ = "0.9.0"
3
3
 
4
4
  from .workspace import (
5
5
  WorkspaceState, Anchor, Evidence, Memory, Conflict,
@@ -397,7 +397,11 @@ class WorkspaceState:
397
397
  阈值从环境变量 LIQUID_CONFLICT_THRESHOLD 读取(默认 0.2)。
398
398
  复用 CPE 泛化防线思路:证据间平均关键词重叠 < threshold 且 >= 3 条 -> 潜在冲突/漂移。
399
399
  保守处理:只标记'需人工确认',不武断判相反(避免过度工程化误报)。
400
- 使用 overlap_cache 避免重复计算。
400
+
401
+ 性能(v0.9):原 O(g²) 全量成对扫描。相同 content 的两条证据重叠恒为 1.0,
402
+ 对"内容分歧度"无信息量,故先按 content 去重为 distinct 集,只对 distinct 内容
403
+ 求两两重叠 -> O(d²)(d = distinct content 数 ≤ g)。overlap_cache 复用。
404
+ 语义更纯净:度量"不同论点间的分歧",重复写入不再稀释冲突信号。
401
405
  """
402
406
  import os
403
407
  conflict_threshold = float(os.environ.get('LIQUID_CONFLICT_THRESHOLD', '0.2'))
@@ -405,11 +409,20 @@ class WorkspaceState:
405
409
  group = [e for e in self.evidences if e.anchor_id == anchor_id]
406
410
  if len(group) < 3:
407
411
  return
412
+ # ── O(g²) -> O(d²):content 去重,相同 content 对的重叠恒为 1.0 不参与分歧度量 ──
413
+ distinct: list = []
414
+ seen: set = set()
415
+ for e in group:
416
+ if e.content and e.content not in seen:
417
+ seen.add(e.content)
418
+ distinct.append(e.content)
419
+ n = len(distinct)
420
+ if n < 2:
421
+ return
408
422
  overlaps = []
409
- for i in range(len(group)):
410
- for j in range(i + 1, len(group)):
411
- if group[i].content and group[j].content:
412
- overlaps.append(_keyword_overlap(group[i].content, group[j].content, self.overlap_cache))
423
+ for i in range(n):
424
+ for j in range(i + 1, n):
425
+ overlaps.append(_keyword_overlap(distinct[i], distinct[j], self.overlap_cache))
413
426
  if not overlaps:
414
427
  return
415
428
  avg = sum(overlaps) / len(overlaps)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: liquid-loop
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation
5
5
  Author: fishbook0001
6
6
  Maintainer: fishbook0001
@@ -39,6 +39,8 @@ Dynamic: license-file
39
39
 
40
40
  # Liquid Loop
41
41
 
42
+ ![Liquid Loop Hero Banner](docs/assets/06-hero-banner.jpg)
43
+
42
44
  > **Self-Organizing Cognitive Memory for AI Agents** — Zero LLM dependency, pure Python implementation of the Liquid Loop theory.
43
45
 
44
46
  [![PyPI](https://img.shields.io/pypi/v/liquid-loop.svg)](https://pypi.org/project/liquid-loop/)
@@ -225,9 +227,17 @@ print(health["CCI"], health["consensus_crystals"])
225
227
 
226
228
  ---
227
229
 
228
- ## 定位:Self-Regulating Persistent Memory Dynamics
230
+ ## 定位:Self-Regulating Memory State Evolution
231
+
232
+ > **North-Star 公理(一切代码与论文围绕它校验):**
233
+ >
234
+ > **Liquid Loop is not a memory storage mechanism; it is a self-regulating memory state evolution mechanism.**
235
+ >
236
+ > (液环不是一种记忆存储机制,而是一种自调节的记忆状态演化机制。)
237
+
238
+ 液环的本质不是"AI 意识 / 认知层",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay + Contradiction Track` 组合成闭环,使记忆从"外部管理"转向"内部自组织"。
229
239
 
230
- 液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
240
+ **边界(防止退化为"智能记忆管理器")**:记忆状态本身是一个**演化对象**,而非被管理的数据对象。市场已有的"记忆评分 / 自动删除 / 权重调整"范式把记忆当被管理的数据——液环要保护的是 **memory homeostasis(记忆稳态)**:记忆在变化环境中经 输入→吸收→凝聚→稳定→衰减→重构,自身维持一致性,而非被外部规则调度。
231
241
 
232
242
  ```
233
243
  Input Evidence
@@ -322,7 +332,8 @@ pytest -v
322
332
  - [x] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
323
333
  - [x] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
324
334
  - [x] **[v0.8] 三实验全 PASS**:E2 错误记忆恢复 → E3 多 agent 冲突 → E1 长期漂移(见上节)
325
- - [ ] **[v0.9 优化项]**:`_detect_conflicts` 由每证据 O(g²) 两两扫描改为增量/采样(大规模高频写入性能,非正确性)
335
+ - [x] **[v0.9] 冲突检测 O(g²)→O(d²)**:`_detect_conflicts` 按 content 去重后只对 distinct 内容求两两重叠(d≤g),overlap_cache 复用;语义更纯净(度量不同论点分歧),大规模高频写入性能提升(非正确性变更)
336
+ - [x] **[v0.9] 液态算法正式落地**:时间动力学 / 反证轨 / 双轨成核在 v0.8 已实现并经 E1/E2/E3 三实验背书,v0.9 作为稳定版正式发布(README 顶部 Hero Banner 已上线)
326
337
  - [ ] LoCoMo / LongMemEval 基准对比
327
338
  - [ ] 边缘端部署优化(<50KB)
328
339
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "liquid-loop"
7
- version = "0.8.0"
7
+ version = "0.9.0"
8
8
  description = "Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes