mindforge-memory 6.6.3__tar.gz → 6.6.4__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.
- {mindforge_memory-6.6.3/mindforge_memory.egg-info → mindforge_memory-6.6.4}/PKG-INFO +14 -4
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/README.md +13 -3
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/storage.py +12 -3
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/version.py +2 -2
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/daemon/server.py +6 -1
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4/mindforge_memory.egg-info}/PKG-INFO +14 -4
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/SOURCES.txt +2 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v568_fixes.py +1 -1
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v575_release_consistency.py +2 -2
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v612_fixes.py +2 -2
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v643_fixes.py +1 -1
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v645_fixes.py +1 -1
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v646_fixes.py +1 -1
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v649_fixes.py +2 -2
- mindforge_memory-6.6.4/tests/test_v663_bench_header.py +71 -0
- mindforge_memory-6.6.4/tests/test_v663_conn_registry.py +152 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/LICENSE +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/MindForge.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/claude_adapter.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/crewai_memory.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/generic_api.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/langgraph_store.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/adapters/openclaw_adapter.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/api/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/api/server.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/cli/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/cli/main.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/embedding.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/encryption.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/indexer.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/mindforge.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/paths.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/query.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/core/types.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/daemon/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/mcp/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/mcp/server.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/__init__.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/categorizer.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/conflict_detector.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/connectors.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/context_window.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/event_bus.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/evolution.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/experience.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/federated.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/federated_acl.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/follow_up.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/hybrid_search.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/importer.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/integrator.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/intent_router.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/knowledge_graph.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/memory_compressor.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/memory_decay.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/memory_passport.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/multi_agent.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/multimodal.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/outcome_learning.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/personality.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/principled_forgetting.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/privacy.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/recall.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/session_focus.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/share_conflict.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/skill_extractor.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/skill_pack.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/timeline_viz.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/v6.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/dependency_links.txt +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/entry_points.txt +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/requires.txt +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/top_level.txt +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/pyproject.toml +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/setup.cfg +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/setup.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_core.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_security_hardening.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_trash_hard_delete.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v546_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v547_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v548_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v550_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v552_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v554_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v556_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v557_banner_insight_wal.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v557_security_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v557_webhook_sig_export.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v558_audit_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v558_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v560_decay_gc.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v560_kdf_versioning.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v560_module_coverage.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v561_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v562_p2_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v563_entry_coverage.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v563_perf_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v565_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v566_encrypted_search.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v567_security_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v569_fts_sync.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v570_coverage_expansion.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v570_drama_and_utils.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v570_encrypted_fallback.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v571_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v572_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v573_encrypted_export.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v573_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v576_bitemporal.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v576_gdpr.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v577_agent_governance.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v578_embedding.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v579_graph.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v580_experience.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v5812_bugfixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v583_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v584_adapters.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v585_benchmark.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v586_federated_mcp.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v590_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v592_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v593_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v595_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v600_forgetting_followup.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v600_import_timeline.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v600_multi_agent_formal.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v600_outcome_passport.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v600_skillpack_evolution.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v611_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v612_cascade_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v613_integrity.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v620_growth_governance.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v630_search_explain.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v631_scrypt.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v632_explain_interfaces.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v635_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v635_integration.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v636_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v648_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v652_context_expansion.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v654_search_multi.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v655_temporal_norm.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v656_security.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v657_six_path.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v65_features.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v660_pending_guard.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v661_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v661_llm_judge.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v662_crypto.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v662_iface.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v662_search.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v662_stability.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v663_fixes.py +0 -0
- {mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/tests/test_v6_ports.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mindforge-memory
|
|
3
|
-
Version: 6.6.
|
|
3
|
+
Version: 6.6.4
|
|
4
4
|
Summary: AI Agent 终身记忆系统 - 四层记忆架构 · 知识图谱 · 多模态支持
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/opok-ops/MindForge
|
|
@@ -42,7 +42,7 @@ MindForge gives AI agents a persistent, structured long-term memory: a four-tier
|
|
|
42
42
|
|
|
43
43
|
[](https://www.python.org/downloads/)
|
|
44
44
|
[](LICENSE)
|
|
45
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
46
46
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
47
47
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
48
48
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -116,7 +116,7 @@ MindForge stats
|
|
|
116
116
|
|
|
117
117
|
v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,400+ tests**.
|
|
118
118
|
|
|
119
|
-
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry.
|
|
119
|
+
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry. 40 new contract tests (`tests/test_v663_fixes.py`, `test_v663_bench_header.py`); full suite 1,481 green. LoCoMo re-judge pending an external API key.
|
|
120
120
|
|
|
121
121
|
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
122
122
|
|
|
@@ -195,7 +195,7 @@ v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,40
|
|
|
195
195
|
|
|
196
196
|
```
|
|
197
197
|
┌──────────────────────────────────────────────────────┐
|
|
198
|
-
│ MindForge v6.6.
|
|
198
|
+
│ MindForge v6.6.4 │
|
|
199
199
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
200
200
|
│ MemoryEvolution · FederatedMemory │
|
|
201
201
|
├──────────────────────────────────────────────────────┤
|
|
@@ -306,6 +306,16 @@ See [SECURITY.md](SECURITY.md) for the full security policy.
|
|
|
306
306
|
- [Contributing guide](CONTRIBUTING.md)
|
|
307
307
|
- [Security policy](SECURITY.md)
|
|
308
308
|
|
|
309
|
+
## About the Author
|
|
310
|
+
|
|
311
|
+
Solo maintainer building **open-source memory infrastructure for AI agents** — systems that remember, forget, and retrieve knowledge the way humans do.
|
|
312
|
+
|
|
313
|
+
Focus areas: agent memory architecture · local-first AI infrastructure (no cloud lock-in) · privacy-preserving AI (encryption, access control, on-device data) · hybrid retrieval (vector + lexical + graph + fuzzy).
|
|
314
|
+
|
|
315
|
+
Tech stack: `Python` · `TypeScript` · `SQLite` · `FastAPI` · `MCP` · `Embeddings` · `Knowledge Graphs`
|
|
316
|
+
|
|
317
|
+
Official plugin: [dsh-mindforge](https://github.com/opok-ops/dsh-mindforge) — encrypted memory bridge for DeepSeek Harness.
|
|
318
|
+
|
|
309
319
|
## License
|
|
310
320
|
|
|
311
321
|
[MIT](LICENSE) — Copyright (c) 2026 MindForge Project. If MindForge is useful to you, consider starring it on GitHub — it helps the project stay active and visible.
|
|
@@ -12,7 +12,7 @@ MindForge gives AI agents a persistent, structured long-term memory: a four-tier
|
|
|
12
12
|
|
|
13
13
|
[](https://www.python.org/downloads/)
|
|
14
14
|
[](LICENSE)
|
|
15
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
16
16
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
17
17
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
18
18
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -86,7 +86,7 @@ MindForge stats
|
|
|
86
86
|
|
|
87
87
|
v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,400+ tests**.
|
|
88
88
|
|
|
89
|
-
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry.
|
|
89
|
+
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry. 40 new contract tests (`tests/test_v663_fixes.py`, `test_v663_bench_header.py`); full suite 1,481 green. LoCoMo re-judge pending an external API key.
|
|
90
90
|
|
|
91
91
|
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
92
92
|
|
|
@@ -165,7 +165,7 @@ v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,40
|
|
|
165
165
|
|
|
166
166
|
```
|
|
167
167
|
┌──────────────────────────────────────────────────────┐
|
|
168
|
-
│ MindForge v6.6.
|
|
168
|
+
│ MindForge v6.6.4 │
|
|
169
169
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
170
170
|
│ MemoryEvolution · FederatedMemory │
|
|
171
171
|
├──────────────────────────────────────────────────────┤
|
|
@@ -276,6 +276,16 @@ See [SECURITY.md](SECURITY.md) for the full security policy.
|
|
|
276
276
|
- [Contributing guide](CONTRIBUTING.md)
|
|
277
277
|
- [Security policy](SECURITY.md)
|
|
278
278
|
|
|
279
|
+
## About the Author
|
|
280
|
+
|
|
281
|
+
Solo maintainer building **open-source memory infrastructure for AI agents** — systems that remember, forget, and retrieve knowledge the way humans do.
|
|
282
|
+
|
|
283
|
+
Focus areas: agent memory architecture · local-first AI infrastructure (no cloud lock-in) · privacy-preserving AI (encryption, access control, on-device data) · hybrid retrieval (vector + lexical + graph + fuzzy).
|
|
284
|
+
|
|
285
|
+
Tech stack: `Python` · `TypeScript` · `SQLite` · `FastAPI` · `MCP` · `Embeddings` · `Knowledge Graphs`
|
|
286
|
+
|
|
287
|
+
Official plugin: [dsh-mindforge](https://github.com/opok-ops/dsh-mindforge) — encrypted memory bridge for DeepSeek Harness.
|
|
288
|
+
|
|
279
289
|
## License
|
|
280
290
|
|
|
281
291
|
[MIT](LICENSE) — Copyright (c) 2026 MindForge Project. If MindForge is useful to you, consider starring it on GitHub — it helps the project stay active and visible.
|
|
@@ -832,7 +832,10 @@ class StorageEngine:
|
|
|
832
832
|
# v6.6.1:记录属主线程——_close_conns 只关属主已死亡的
|
|
833
833
|
# 遗留连接,绝不从外部关闭存活线程正在使用的连接
|
|
834
834
|
# (实测会触发 SQLite 原生层 access violation)。
|
|
835
|
-
|
|
835
|
+
# v6.6.4(缺陷 #10):存 Thread 对象而非 ident——pthread
|
|
836
|
+
# handle 复用会让死线程 ident 撞上新线程(实测 5 连发全
|
|
837
|
+
# 同),ident 判活系统性误判;is_alive() 与复用无关。
|
|
838
|
+
self._conn_owners[id(conn)] = threading.current_thread()
|
|
836
839
|
except Exception:
|
|
837
840
|
pass
|
|
838
841
|
conn.row_factory = sqlite3.Row
|
|
@@ -7799,11 +7802,17 @@ class StorageEngine:
|
|
|
7799
7802
|
# 层 access violation 硬崩溃,test_v576 TestAPI 复现);存活线程
|
|
7800
7803
|
# 的连接由其自己的 close_thread_conn 关闭。
|
|
7801
7804
|
with self._access_lock:
|
|
7802
|
-
|
|
7805
|
+
# v6.6.4 修复(缺陷 #10):属主存活判定不得用 enumerate().ident。
|
|
7806
|
+
# 实测 pthread handle 复用是常态(连续 5 线程 ident 全同)——
|
|
7807
|
+
# ThreadingHTTPServer 每请求一线程,死线程的连接属主 ident 会
|
|
7808
|
+
# 被下一个请求线程撞上 → 误判「属主存活」→ skip → 连接永久
|
|
7809
|
+
# 悬挂,Windows WinError 32 只是概率性躲过、未根除(v6.6.1
|
|
7810
|
+
# 缺陷 #5 / v6.6.2 P3-7 的残余)。改为存 Thread 对象 +
|
|
7811
|
+
# is_alive()(基于 tstate_lock 状态,与 ident 复用无关)。
|
|
7803
7812
|
owners = getattr(self, "_conn_owners", None) or {}
|
|
7804
7813
|
for c in list(getattr(self, "_all_conns", ()) or ()):
|
|
7805
7814
|
owner = owners.get(id(c))
|
|
7806
|
-
if owner is not None and owner
|
|
7815
|
+
if owner is not None and owner.is_alive():
|
|
7807
7816
|
continue # 属主存活:留给它自己关
|
|
7808
7817
|
try:
|
|
7809
7818
|
c.close()
|
|
@@ -20,10 +20,10 @@ core/mindforge.py、cli/main.py、mcp/server.py),每处都带一份硬编码
|
|
|
20
20
|
from typing import Tuple
|
|
21
21
|
|
|
22
22
|
#: 当前发布版本(唯一真值)
|
|
23
|
-
__version__: str = "6.6.
|
|
23
|
+
__version__: str = "6.6.4"
|
|
24
24
|
|
|
25
25
|
#: 结构化版本元组,便于比较(如 `VERSION_INFO >= (6, 1, 0)`)
|
|
26
|
-
VERSION_INFO: Tuple[int, int, int] = (6, 6,
|
|
26
|
+
VERSION_INFO: Tuple[int, int, int] = (6, 6, 4)
|
|
27
27
|
|
|
28
28
|
#: 下一个大版本的目标版本号(供 v6 端口预留引用)
|
|
29
29
|
NEXT_MAJOR_TARGET: str = "7.0.0"
|
|
@@ -290,7 +290,12 @@ def run_daemon(db_path: str, key_file: str | None = None, encrypted: bool = Fals
|
|
|
290
290
|
# v6.6.3(次要-2):handler 返回的 dict 若自带 error 字段(如
|
|
291
291
|
# memory-recall/memory-context 在 agent 为空时返回的错误 dict),
|
|
292
292
|
# 是调用方配置错误,不能包装成 ok:true 静默吞掉——转 ok:false。
|
|
293
|
-
|
|
293
|
+
# v6.6.4 修复(缺陷 #11):判定收紧为 error 非空——compress 域
|
|
294
|
+
# (decompress 等)的返回契约里 error 是状态位,成功时为空串,
|
|
295
|
+
# v6.6.3 的存在性判定把这类成功响应误转成 ok:false + 空 error,
|
|
296
|
+
# e2e「decompress 可逆原子契约」因此拿不到 restored_count 而
|
|
297
|
+
# 失败(376dad1 起 CI e2e 红的根因)。非空 error 才是失败。
|
|
298
|
+
if isinstance(data, dict) and "ok" not in data and data.get("error"):
|
|
294
299
|
sys.stdout.write(
|
|
295
300
|
json.dumps(
|
|
296
301
|
{"id": rid, "ok": False, "error": str(data.get("error"))},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mindforge-memory
|
|
3
|
-
Version: 6.6.
|
|
3
|
+
Version: 6.6.4
|
|
4
4
|
Summary: AI Agent 终身记忆系统 - 四层记忆架构 · 知识图谱 · 多模态支持
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/opok-ops/MindForge
|
|
@@ -42,7 +42,7 @@ MindForge gives AI agents a persistent, structured long-term memory: a four-tier
|
|
|
42
42
|
|
|
43
43
|
[](https://www.python.org/downloads/)
|
|
44
44
|
[](LICENSE)
|
|
45
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
46
46
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
47
47
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
48
48
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -116,7 +116,7 @@ MindForge stats
|
|
|
116
116
|
|
|
117
117
|
v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,400+ tests**.
|
|
118
118
|
|
|
119
|
-
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry.
|
|
119
|
+
- **v6.6.3 — ultimate bug-fix pack + retrieval enhancement for the named v6.6 targets** (2026-11-17). Three externally-found must-fix stability bugs closed (daemon dies on any invalid-UTF-8 input line — strict→replace decoding; REST double HTTP response after 413; lone-surrogate crash in the encrypted write path), plus rekey race honest-error and daemon error-dict forwarding. Temporal parsing overhauled: year-month queries (2024年5月 / 2024-05) no longer parse to None (full-month window now), English month-name dates (17 July 2023 / May 2023) parsed and matched on the evidence side, N-quantity windows actually multiply (two weeks ago had a 2-day window since v6.5.7), weekday expressions (last Wednesday / 上周三) resolved precisely, and Chinese phrases now flow through assembly-layer normalization. New retrieval layer (zero LLM, all rule-based): `search_chain` (hop1 evidence → entity extraction → hop2, the structural fix behind the multi-hop 25.2% bucket), path-aware graph retrieval (A-B shortest-path bridge evidence at 0.65), `decompose_two_hop` rule split, and `search_broad` open-domain entry. 40 new contract tests (`tests/test_v663_fixes.py`, `test_v663_bench_header.py`); full suite 1,481 green. LoCoMo re-judge pending an external API key.
|
|
120
120
|
|
|
121
121
|
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
122
122
|
|
|
@@ -195,7 +195,7 @@ v6.1.3 – v6.6.3 shipped in two weeks (2026-11-01 → 11-17), guarded by **1,40
|
|
|
195
195
|
|
|
196
196
|
```
|
|
197
197
|
┌──────────────────────────────────────────────────────┐
|
|
198
|
-
│ MindForge v6.6.
|
|
198
|
+
│ MindForge v6.6.4 │
|
|
199
199
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
200
200
|
│ MemoryEvolution · FederatedMemory │
|
|
201
201
|
├──────────────────────────────────────────────────────┤
|
|
@@ -306,6 +306,16 @@ See [SECURITY.md](SECURITY.md) for the full security policy.
|
|
|
306
306
|
- [Contributing guide](CONTRIBUTING.md)
|
|
307
307
|
- [Security policy](SECURITY.md)
|
|
308
308
|
|
|
309
|
+
## About the Author
|
|
310
|
+
|
|
311
|
+
Solo maintainer building **open-source memory infrastructure for AI agents** — systems that remember, forget, and retrieve knowledge the way humans do.
|
|
312
|
+
|
|
313
|
+
Focus areas: agent memory architecture · local-first AI infrastructure (no cloud lock-in) · privacy-preserving AI (encryption, access control, on-device data) · hybrid retrieval (vector + lexical + graph + fuzzy).
|
|
314
|
+
|
|
315
|
+
Tech stack: `Python` · `TypeScript` · `SQLite` · `FastAPI` · `MCP` · `Embeddings` · `Knowledge Graphs`
|
|
316
|
+
|
|
317
|
+
Official plugin: [dsh-mindforge](https://github.com/opok-ops/dsh-mindforge) — encrypted memory bridge for DeepSeek Harness.
|
|
318
|
+
|
|
309
319
|
## License
|
|
310
320
|
|
|
311
321
|
[MIT](LICENSE) — Copyright (c) 2026 MindForge Project. If MindForge is useful to you, consider starring it on GitHub — it helps the project stay active and visible.
|
|
@@ -40,8 +40,8 @@ class TestVersionTruth(unittest.TestCase):
|
|
|
40
40
|
def test_core_version_matches_release(self):
|
|
41
41
|
# 版本推进时必须一并更新此处的钉值(与 test_v568_fixes 的
|
|
42
42
|
# _EXPECTED_VERSION 同一约定:让「忘记 bump 版本」在测试里显形)。
|
|
43
|
-
self.assertEqual(core_version.__version__, "6.6.
|
|
44
|
-
self.assertEqual(core_version.VERSION_INFO, (6, 6,
|
|
43
|
+
self.assertEqual(core_version.__version__, "6.6.4")
|
|
44
|
+
self.assertEqual(core_version.VERSION_INFO, (6, 6, 4))
|
|
45
45
|
|
|
46
46
|
def test_pyproject_matches_core_version(self):
|
|
47
47
|
# v5.8.13 起 pyproject 不再写死静态版本:
|
|
@@ -662,8 +662,8 @@ class TestVersionConsistency(unittest.TestCase):
|
|
|
662
662
|
def test_version_is_612(self):
|
|
663
663
|
from mindforge.core.version import VERSION_INFO, __version__
|
|
664
664
|
# v6.1.3:版本钉值随发版推进更新(历史方法名保留)
|
|
665
|
-
self.assertEqual(__version__, "6.6.
|
|
666
|
-
self.assertEqual(VERSION_INFO, (6, 6,
|
|
665
|
+
self.assertEqual(__version__, "6.6.4")
|
|
666
|
+
self.assertEqual(VERSION_INFO, (6, 6, 4))
|
|
667
667
|
|
|
668
668
|
def test_json_round_trip_safety_of_preview(self):
|
|
669
669
|
"""save_evolution 的预览序列化不得抛(不可 json 化的对象走 str 兜底)。"""
|
|
@@ -109,7 +109,7 @@ class TestVersionBump(unittest.TestCase):
|
|
|
109
109
|
钉点集合随版本数递增,发版链清单必须扫全部 test_v*fixes.py。"""
|
|
110
110
|
|
|
111
111
|
def test_version_is_current(self):
|
|
112
|
-
self.assertEqual(__version__, "6.6.
|
|
112
|
+
self.assertEqual(__version__, "6.6.4")
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
if __name__ == "__main__":
|
|
@@ -118,8 +118,8 @@ class TestVersionBump(unittest.TestCase):
|
|
|
118
118
|
"""版本钉值(每版随发版一并 bump,v6.4.5 教训)。"""
|
|
119
119
|
|
|
120
120
|
def test_version_is_649(self):
|
|
121
|
-
self.assertEqual(__version__, "6.6.
|
|
122
|
-
self.assertEqual(VERSION_INFO, (6, 6,
|
|
121
|
+
self.assertEqual(__version__, "6.6.4")
|
|
122
|
+
self.assertEqual(VERSION_INFO, (6, 6, 4))
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""v6.6.3 契约:benchmarks/repro_benchmark.py 头部完整性守卫。
|
|
3
|
+
|
|
4
|
+
回归背景:该脚本入仓时(v6.5.12–v6.6.2 窗口)文件头部常量与 import 整块
|
|
5
|
+
缺失(DEFAULT_N / _REPO / MindForge / MemoryConfig / time / threading /
|
|
6
|
+
pathlib.Path / CONTENT_TMPL / QUERY_CN),任何人按文档命令直接运行都在
|
|
7
|
+
main() 处 NameError。本测试在 CI 里静态守卫全部必需名字,防再次回归。
|
|
8
|
+
"""
|
|
9
|
+
import ast
|
|
10
|
+
import unittest
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
_BENCH = Path(__file__).resolve().parent.parent / "benchmarks" / "repro_benchmark.py"
|
|
14
|
+
|
|
15
|
+
_REQUIRED_NAMES = {
|
|
16
|
+
# 常量(此前缺失即 NameError)
|
|
17
|
+
"_REPO", "DEFAULT_N", "DEFAULT_ROUNDS", "DEFAULT_LATENCY_ROUNDS",
|
|
18
|
+
"CONTENT_TMPL", "QUERY_CN",
|
|
19
|
+
}
|
|
20
|
+
_REQUIRED_IMPORTS = {"time", "threading"}
|
|
21
|
+
_REQUIRED_FROM_IMPORTS = {"pathlib": {"Path"}}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TestReproBenchmarkHeader(unittest.TestCase):
|
|
25
|
+
|
|
26
|
+
@classmethod
|
|
27
|
+
def setUpClass(cls):
|
|
28
|
+
cls.src = _BENCH.read_text(encoding="utf-8")
|
|
29
|
+
cls.tree = ast.parse(cls.src)
|
|
30
|
+
|
|
31
|
+
def test_all_required_names_defined(self):
|
|
32
|
+
defined = set()
|
|
33
|
+
for node in ast.walk(self.tree):
|
|
34
|
+
if isinstance(node, ast.Assign):
|
|
35
|
+
for tgt in node.targets:
|
|
36
|
+
if isinstance(tgt, ast.Name):
|
|
37
|
+
defined.add(tgt.id)
|
|
38
|
+
elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
|
39
|
+
defined.add(node.name)
|
|
40
|
+
missing = _REQUIRED_NAMES - defined
|
|
41
|
+
self.assertEqual(missing, set(),
|
|
42
|
+
f"repro_benchmark.py 缺少必需定义:{missing}")
|
|
43
|
+
|
|
44
|
+
def test_required_imports_present(self):
|
|
45
|
+
imported = set()
|
|
46
|
+
from_map = {}
|
|
47
|
+
for node in self.tree.body: # 顶层 import 即可
|
|
48
|
+
if isinstance(node, ast.Import):
|
|
49
|
+
for a in node.names:
|
|
50
|
+
imported.add(a.name.split(".")[0])
|
|
51
|
+
elif isinstance(node, ast.ImportFrom):
|
|
52
|
+
from_map.setdefault(node.module, set()).update(
|
|
53
|
+
a.name for a in node.names)
|
|
54
|
+
missing = _REQUIRED_IMPORTS - imported
|
|
55
|
+
self.assertEqual(missing, set(), f"缺少顶层 import:{missing}")
|
|
56
|
+
for mod, names in _REQUIRED_FROM_IMPORTS.items():
|
|
57
|
+
have = from_map.get(mod, set())
|
|
58
|
+
self.assertTrue(
|
|
59
|
+
names <= have,
|
|
60
|
+
f"缺少 from {mod} import {names - have}")
|
|
61
|
+
|
|
62
|
+
def test_mindforge_package_imported(self):
|
|
63
|
+
self.assertIn("from mindforge import MindForge", self.src)
|
|
64
|
+
self.assertIn("MemoryConfig", self.src)
|
|
65
|
+
|
|
66
|
+
def test_script_compiles(self):
|
|
67
|
+
compile(self.src, str(_BENCH), "exec")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
unittest.main()
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""v6.6.4 连接登记守护契约测试
|
|
3
|
+
|
|
4
|
+
针对缺陷 #10(pthread handle 复用导致属主判活系统性误判)与
|
|
5
|
+
v6.6.2 P3-7(clear 拆登记)的回归守护:
|
|
6
|
+
|
|
7
|
+
背景链:
|
|
8
|
+
- v6.5.7 引入「遍历全连接表关闭死线程遗留连接」
|
|
9
|
+
- v6.6.1 缺陷 #5:check_same_thread=False + _access_lock 串行化 +
|
|
10
|
+
`_conn_owners` 记录属主(存 ident,enumerate 判活)
|
|
11
|
+
- v6.6.2 P3-7:删除 _close_conns 末尾无条件 _all_conns.clear()
|
|
12
|
+
- v6.6.4 缺陷 #10(本轮):实测 pthread handle 复用是常态——连续
|
|
13
|
+
5 线程 ident 全同。ThreadingHTTPServer 每请求一线程,死线程连接
|
|
14
|
+
的属主 ident 被下一个请求线程撞上 → 误判「属主存活」→ skip →
|
|
15
|
+
连接永久悬挂 → Windows WinError 32 文件锁只是概率性躲过、未根除。
|
|
16
|
+
探针实测:B 收尾后死线程 A 的连接残留(owner=tA ident ∈ live)。
|
|
17
|
+
|
|
18
|
+
修复:_conn_owners 存 Thread 对象,判定 owner.is_alive()(基于
|
|
19
|
+
tstate_lock 状态,与 ident 复用无关)。
|
|
20
|
+
|
|
21
|
+
契约:
|
|
22
|
+
- 线程 B 收尾后,死亡线程 A 的连接必须被关闭并移出登记表
|
|
23
|
+
- 存活线程(主线程)的连接登记必须原样保留
|
|
24
|
+
- close 失败(对象已坏)的连接被丢弃且不 crash(v6.6.1 既定语义)
|
|
25
|
+
- 源码守护:不再存在 ident 判活(_live_idents)与全清(.clear())
|
|
26
|
+
"""
|
|
27
|
+
import os
|
|
28
|
+
import sqlite3
|
|
29
|
+
import tempfile
|
|
30
|
+
import threading
|
|
31
|
+
import unittest
|
|
32
|
+
|
|
33
|
+
from mindforge.core.mindforge import MindForge
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _make_mf(tmp, encrypted=True):
|
|
37
|
+
mf = MindForge(db_path=os.path.join(tmp, "m.db"),
|
|
38
|
+
key_file=os.path.join(tmp, ".key"),
|
|
39
|
+
encrypted=encrypted)
|
|
40
|
+
if encrypted:
|
|
41
|
+
mf.init_with_password("pw-v664")
|
|
42
|
+
return mf
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class TestConnRegistry(unittest.TestCase):
|
|
46
|
+
"""缺陷 #10:属主判活与连接登记生命周期"""
|
|
47
|
+
|
|
48
|
+
def setUp(self):
|
|
49
|
+
self.tmp = tempfile.mkdtemp(prefix="mf_v664_")
|
|
50
|
+
self.mf = _make_mf(self.tmp, encrypted=False)
|
|
51
|
+
self.se = self.mf.storage
|
|
52
|
+
|
|
53
|
+
def tearDown(self):
|
|
54
|
+
self.mf.close()
|
|
55
|
+
|
|
56
|
+
def _dead_thread_conn_snapshot(self):
|
|
57
|
+
"""起一个线程建连接后立即死亡(模拟 finally 未执行的异常线程)。
|
|
58
|
+
|
|
59
|
+
只返回属主已死的连接(不含主线程等存活属主的连接——保留登记
|
|
60
|
+
是正确行为,不能混进「应被回收」的断言)。
|
|
61
|
+
"""
|
|
62
|
+
holder = [None]
|
|
63
|
+
holder[0] = threading.Thread(target=self.se._get_conn, name="tA-dead")
|
|
64
|
+
holder[0].start()
|
|
65
|
+
holder[0].join()
|
|
66
|
+
with self.se._access_lock:
|
|
67
|
+
dead = {c for c in self.se._all_conns
|
|
68
|
+
if (o := self.se._conn_owners.get(id(c))) is not None
|
|
69
|
+
and not o.is_alive()}
|
|
70
|
+
return dead, holder[0]
|
|
71
|
+
|
|
72
|
+
def test_owner_records_thread_object(self):
|
|
73
|
+
"""登记表存 Thread 对象而非 ident(缺陷 #10 修复本体)"""
|
|
74
|
+
self.se._get_conn()
|
|
75
|
+
with self.se._access_lock:
|
|
76
|
+
owners = list(self.se._conn_owners.values())
|
|
77
|
+
self.assertTrue(owners)
|
|
78
|
+
for owner in owners:
|
|
79
|
+
self.assertIsInstance(owner, threading.Thread,
|
|
80
|
+
"属主必须是 Thread 对象(ident 会被复用)")
|
|
81
|
+
self.assertTrue(owner.is_alive())
|
|
82
|
+
|
|
83
|
+
def test_dead_thread_conn_closed_by_other_thread_exit(self):
|
|
84
|
+
"""死亡线程的连接必须被下一次 _close_conns 关闭并移出"""
|
|
85
|
+
snapshot, _tA = self._dead_thread_conn_snapshot()
|
|
86
|
+
# B 正常收尾(顺带触发对死连接的回收)
|
|
87
|
+
t = threading.Thread(target=lambda: (
|
|
88
|
+
self.se._get_conn(), self.se.close_thread_conn()), name="tB")
|
|
89
|
+
t.start()
|
|
90
|
+
t.join()
|
|
91
|
+
with self.se._access_lock:
|
|
92
|
+
leftover = snapshot & self.se._all_conns
|
|
93
|
+
self.assertEqual(
|
|
94
|
+
leftover, set(),
|
|
95
|
+
"死亡线程的连接未被关闭移出——悬挂 fd(Windows WinError 32 回归)")
|
|
96
|
+
# 被移出的连接确实已关闭(无法再操作)
|
|
97
|
+
with self.se._access_lock:
|
|
98
|
+
remaining = set(self.se._all_conns)
|
|
99
|
+
for c in snapshot - remaining:
|
|
100
|
+
with self.assertRaises((sqlite3.ProgrammingError, sqlite3.Error)):
|
|
101
|
+
c.execute("SELECT 1")
|
|
102
|
+
|
|
103
|
+
def test_live_registration_survives_other_thread_close(self):
|
|
104
|
+
"""线程 B 收尾后,存活线程(主线程)的连接登记必须保留"""
|
|
105
|
+
main_conn = self.se._get_conn() # 主线程连接:注册
|
|
106
|
+
t = threading.Thread(target=lambda: (
|
|
107
|
+
self.se._get_conn(), self.se.close_thread_conn()), name="tB2")
|
|
108
|
+
t.start()
|
|
109
|
+
t.join()
|
|
110
|
+
with self.se._access_lock:
|
|
111
|
+
self.assertIn(main_conn, self.se._all_conns,
|
|
112
|
+
"存活线程的连接登记被清除——死线程连接将永久悬挂")
|
|
113
|
+
self.assertTrue(self.se._conn_owners.get(id(main_conn)).is_alive())
|
|
114
|
+
|
|
115
|
+
def test_failed_close_discarded_without_crash(self):
|
|
116
|
+
"""close 失败(对象已坏)的连接被丢弃且不 crash:不留死对象重试"""
|
|
117
|
+
snapshot, _tA = self._dead_thread_conn_snapshot()
|
|
118
|
+
victim = next(iter(snapshot))
|
|
119
|
+
victim.close() # 预先关闭,再次 close 抛 ProgrammingError
|
|
120
|
+
self.se._close_conns() # 不应抛异常
|
|
121
|
+
with self.se._access_lock:
|
|
122
|
+
self.assertNotIn(victim, self.se._all_conns,
|
|
123
|
+
"坏对象残留——每次遍历都会重试 close")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class TestSourceGuards(unittest.TestCase):
|
|
127
|
+
"""源码级守护:防倒退"""
|
|
128
|
+
|
|
129
|
+
def _body(self):
|
|
130
|
+
import inspect
|
|
131
|
+
from mindforge.core.storage import StorageEngine
|
|
132
|
+
src = inspect.getsource(StorageEngine._close_conns)
|
|
133
|
+
# 剥注释后再断言,避免注释文本误报
|
|
134
|
+
return "\n".join(line.split("#")[0] for line in src.splitlines())
|
|
135
|
+
|
|
136
|
+
def test_alive_check_not_ident(self):
|
|
137
|
+
"""属主判活必须用 is_alive(),不得回退到 enumerate ident"""
|
|
138
|
+
body = self._body()
|
|
139
|
+
self.assertIn("owner.is_alive()", body,
|
|
140
|
+
"属主判活必须用 is_alive()(缺陷 #10)")
|
|
141
|
+
self.assertNotIn("_live_idents", body,
|
|
142
|
+
"ident 判活已废除——pthread handle 复用会误判")
|
|
143
|
+
|
|
144
|
+
def test_no_clear_in_close_conns(self):
|
|
145
|
+
"""_close_conns 不得全清登记表(v6.6.2 P3-7 守护延续)"""
|
|
146
|
+
body = self._body()
|
|
147
|
+
self.assertNotIn(".clear()", body,
|
|
148
|
+
"全清登记表会让死线程连接永久悬挂(P3-7)")
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge/modules/principled_forgetting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{mindforge_memory-6.6.3 → mindforge_memory-6.6.4}/mindforge_memory.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|