memleaf 0.2.24__tar.gz → 0.2.26__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 (146) hide show
  1. {memleaf-0.2.24 → memleaf-0.2.26}/CHANGELOG.md +23 -0
  2. {memleaf-0.2.24 → memleaf-0.2.26}/MANIFEST.in +2 -0
  3. {memleaf-0.2.24/src/memleaf.egg-info → memleaf-0.2.26}/PKG-INFO +47 -4
  4. {memleaf-0.2.24 → memleaf-0.2.26}/README.en.md +48 -3
  5. {memleaf-0.2.24 → memleaf-0.2.26}/README.md +46 -3
  6. memleaf-0.2.26/docs/core-refactor.md +129 -0
  7. memleaf-0.2.26/docs/evidence-retention.md +58 -0
  8. memleaf-0.2.26/docs/general-processing.md +161 -0
  9. memleaf-0.2.26/docs/hermes-mcp-runtime.md +208 -0
  10. memleaf-0.2.26/docs/v0.2.26-processing-status.md +22 -0
  11. memleaf-0.2.26/examples/live_processing_acceptance.py +126 -0
  12. {memleaf-0.2.24 → memleaf-0.2.26}/pyproject.toml +1 -1
  13. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/__init__.py +1 -1
  14. memleaf-0.2.26/src/memleaf/admission.py +417 -0
  15. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/capture.py +16 -32
  16. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/cli.py +25 -1
  17. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/compaction.py +2 -4
  18. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/config.py +7 -1
  19. memleaf-0.2.26/src/memleaf/evidence_policy.py +80 -0
  20. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/hermes_provider/__init__.py +137 -8
  21. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/hermes_provider/plugin.yaml +1 -1
  22. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/host_events.py +11 -3
  23. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/host_runtime.py +121 -3
  24. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/inbox.py +2 -21
  25. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/index.py +6 -0
  26. memleaf-0.2.26/src/memleaf/inspection.py +174 -0
  27. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/locking.py +42 -13
  28. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/mcp_server.py +5 -1
  29. memleaf-0.2.26/src/memleaf/memory_commit.py +452 -0
  30. memleaf-0.2.26/src/memleaf/memory_planner.py +1044 -0
  31. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/memory_writer.py +22 -1
  32. memleaf-0.2.26/src/memleaf/model_execution.py +305 -0
  33. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/models.py +1 -0
  34. memleaf-0.2.26/src/memleaf/planning_context.py +936 -0
  35. memleaf-0.2.26/src/memleaf/process_common.py +695 -0
  36. memleaf-0.2.26/src/memleaf/process_journal.py +621 -0
  37. memleaf-0.2.26/src/memleaf/process_owner.py +41 -0
  38. memleaf-0.2.26/src/memleaf/processing.py +246 -0
  39. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/prompts.py +74 -3
  40. memleaf-0.2.26/src/memleaf/provenance.py +264 -0
  41. memleaf-0.2.26/src/memleaf/recording_policy.py +63 -0
  42. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/service.py +18 -39
  43. memleaf-0.2.26/src/memleaf/turn_audit.py +128 -0
  44. memleaf-0.2.26/src/memleaf/turn_plan.py +267 -0
  45. memleaf-0.2.26/src/memleaf/update_coordinator.py +200 -0
  46. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/validation.py +33 -59
  47. {memleaf-0.2.24 → memleaf-0.2.26/src/memleaf.egg-info}/PKG-INFO +47 -4
  48. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf.egg-info/SOURCES.txt +32 -0
  49. memleaf-0.2.26/tests/semantic_fixtures.py +77 -0
  50. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_admission_noise.py +14 -5
  51. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_cross_turn_dedupe_regressions.py +3 -0
  52. memleaf-0.2.26/tests/test_email_actionable_coverage.py +405 -0
  53. memleaf-0.2.26/tests/test_evidence_retention_policy.py +201 -0
  54. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_extraction_quality_regressions.py +14 -7
  55. memleaf-0.2.26/tests/test_general_evidence_admission.py +229 -0
  56. memleaf-0.2.26/tests/test_general_tool_provenance.py +59 -0
  57. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_global_todo_acceptance.py +3 -0
  58. memleaf-0.2.26/tests/test_global_todo_query_no_write.py +451 -0
  59. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_hermes_provider.py +4 -0
  60. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_host_events.py +3 -0
  61. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_install.py +1 -0
  62. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_maintenance_v2.py +12 -7
  63. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_model_discovery.py +4 -2
  64. memleaf-0.2.26/tests/test_model_owned_fields.py +251 -0
  65. memleaf-0.2.26/tests/test_phase2_model_decisions.py +331 -0
  66. memleaf-0.2.26/tests/test_process_owner_locking.py +96 -0
  67. memleaf-0.2.26/tests/test_processing_contract_v026.py +323 -0
  68. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_session_lineage.py +3 -0
  69. memleaf-0.2.26/tests/test_shared_memory_refactor.py +255 -0
  70. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b1.py +12 -5
  71. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b2a.py +144 -173
  72. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b2b.py +14 -7
  73. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3b_native_context.py +2 -1
  74. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3b_scope.py +11 -2
  75. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3c_retrieval.py +3 -0
  76. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3d_scope_maintenance.py +9 -6
  77. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_c2_init.py +27 -3
  78. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_todo_state_recovery.py +32 -11
  79. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_update_target_recovery.py +50 -77
  80. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v023_scope_correction.py +12 -8
  81. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v2_host_flow.py +4 -0
  82. memleaf-0.2.24/src/memleaf/processing.py +0 -4469
  83. {memleaf-0.2.24 → memleaf-0.2.26}/IMPLEMENTATION_PLAN.md +0 -0
  84. {memleaf-0.2.24 → memleaf-0.2.26}/LICENSE +0 -0
  85. {memleaf-0.2.24 → memleaf-0.2.26}/RELEASE_CHECKLIST.md +0 -0
  86. {memleaf-0.2.24 → memleaf-0.2.26}/examples/README.md +0 -0
  87. {memleaf-0.2.24 → memleaf-0.2.26}/examples/basic_usage.py +0 -0
  88. {memleaf-0.2.24 → memleaf-0.2.26}/examples/mcp_stdio.ndjson +0 -0
  89. {memleaf-0.2.24 → memleaf-0.2.26}/install.ps1 +0 -0
  90. {memleaf-0.2.24 → memleaf-0.2.26}/install.sh +0 -0
  91. {memleaf-0.2.24 → memleaf-0.2.26}/setup.cfg +0 -0
  92. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/__main__.py +0 -0
  93. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/adapters/__init__.py +0 -0
  94. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/adapters/antigravity.py +0 -0
  95. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/adapters/base.py +0 -0
  96. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/adapters/codex.py +0 -0
  97. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/adapters/hermes.py +0 -0
  98. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/budget.py +0 -0
  99. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/credentials.py +0 -0
  100. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/frontmatter.py +0 -0
  101. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/hermes_provider/README.md +0 -0
  102. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/hermes_runtime.py +0 -0
  103. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/installer.py +0 -0
  104. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/__init__.py +0 -0
  105. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/base.py +0 -0
  106. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/claude_compatible.py +0 -0
  107. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/gemini.py +0 -0
  108. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/openai_compatible.py +0 -0
  109. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/llm/router.py +0 -0
  110. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/model_discovery.py +0 -0
  111. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/native_index.py +0 -0
  112. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/native_registration.py +0 -0
  113. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/redaction.py +0 -0
  114. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/retrieval.py +0 -0
  115. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/retrieval_gate.py +0 -0
  116. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/scope_maintenance.py +0 -0
  117. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/scope_state.py +0 -0
  118. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf/vault.py +0 -0
  119. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf.egg-info/dependency_links.txt +0 -0
  120. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf.egg-info/entry_points.txt +0 -0
  121. {memleaf-0.2.24 → memleaf-0.2.26}/src/memleaf.egg-info/top_level.txt +0 -0
  122. {memleaf-0.2.24 → memleaf-0.2.26}/tests/__init__.py +0 -0
  123. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_codex_install.py +0 -0
  124. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_codex_native_cli.py +0 -0
  125. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_context_budget.py +0 -0
  126. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_credential_safety.py +0 -0
  127. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_cross_host_acceptance.py +0 -0
  128. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_global_todo_retrieval.py +0 -0
  129. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_hermes_native_registration.py +0 -0
  130. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_hermes_runtime_install.py +0 -0
  131. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_hermes_stdio_transport.py +0 -0
  132. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_host_runtime_contract.py +0 -0
  133. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_pypi_install.py +0 -0
  134. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_retrieval_gate.py +0 -0
  135. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_retrieval_v2.py +0 -0
  136. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_a.py +0 -0
  137. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3a_commit.py +0 -0
  138. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3a_contract.py +0 -0
  139. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_b3b_native_index.py +0 -0
  140. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_c1_mcp.py +0 -0
  141. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_stage_c3_packaging.py +0 -0
  142. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_upgrade_preserves_vault.py +0 -0
  143. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v2_gate_limits.py +0 -0
  144. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v2_mcp_flow.py +0 -0
  145. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v2_nomatch_semantics.py +0 -0
  146. {memleaf-0.2.24 → memleaf-0.2.26}/tests/test_v2_search_gate_acceptance.py +0 -0
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to memleaf are documented here.
4
4
 
5
+ ## 0.2.26 — 2026-09-05
6
+
7
+ - Refactor automatic processing into explicit model execution, planning, update coordination, commit, journal and audit owners while preserving Markdown Vaults, memory IDs, Hermes MemoryProvider and cross-Agent retrieval contracts. No runtime dependency or independent service is added.
8
+ - Remove post-Gate completion/rework generation, forced status/type/Scope rewrites, local last-retry candidate splitting, wrong-target UPDATE-to-CREATE conversion and automatic old/new body concatenation. Invalid proposals receive bounded model correction, then explicit candidate-local deferral; valid siblings proceed.
9
+ - Add source-neutral exact evidence bindings and one bounded coverage correction. Assistant synthesis, recalled memory and truncated observations do not independently authorize new facts; evidence and candidate outcomes are accounted separately.
10
+ - Reconcile compatible same-target updates into one model-owned write/history operation with all contributing receipts. Preserve actual outcomes on replay and reject stale target revisions under the shared Vault lock.
11
+ - Freeze complete change payloads; explicit forget cancels matching pending operations before deletion. Explicit remember enforces selected Scope and target revisions. Automatic/explicit writes, forget, raw-library writes and compaction share the lock/recovery entry boundary without conflating their authorization.
12
+ - Honor leading recording controls and record=False before persistence, consume only safely captured tool caches, and retry unresolved coverage at most once through natural lifecycle triggers. Keep unresolved source evidence after exhaustion.
13
+ - Unify bounded/metadata/off tool-evidence retention across direct capture, Hermes, Codex and planning. Preserve legacy disabled settings and document-source exclusions; configuration changes do not fabricate missing source content.
14
+ - Add read-only audit, isolated dry-run, Windows native process-liveness and cross-process file-lock safeguards. Run complete regression suites on Linux, Windows and macOS plus wheel/sdist installation checks.
15
+ - Deterministic contract tests do not establish real-model semantic quality. The maintainer selected local live-model acceptance rather than repository model credentials; no real-model result is claimed by this release.
16
+
17
+ ## 0.2.25 — 2026-09-04
18
+
19
+ - Keep global todo questions and cross-session recaps strictly read-only,
20
+ without creating memories, appending sources, or producing history; an
21
+ explicit user assertion before a follow-up question remains write-eligible.
22
+ - Recover project-grounded, explicitly counted repair items omitted from a
23
+ mailbox extraction gate, split concrete detail lines into independent todos,
24
+ and reuse an existing same-scope item when it is an update.
25
+ - Record compact candidate-level `CREATE`, `UPDATE`, `NO_CHANGE`, and
26
+ `DEFERRED` dispositions in the processed-turn ledger for auditable coverage.
27
+
5
28
  ## 0.2.24 — 2026-09-04
6
29
 
7
30
  - Make Hermes MCP installation reliably persistent: write `mcp_servers.memleaf` through Hermes' canonical `config set` interface, disable the entry while command/arguments are updated, then read `config.yaml` back and require an exact command plus `--vault` match before reporting success.
@@ -8,3 +8,5 @@ include RELEASE_CHECKLIST.md
8
8
  include IMPLEMENTATION_PLAN.md
9
9
  recursive-include tests *.py
10
10
  recursive-include examples *.md *.ndjson *.py
11
+
12
+ include docs/*.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memleaf
3
- Version: 0.2.24
3
+ Version: 0.2.26
4
4
  Summary: A local-first Markdown memory core for AI agents
5
5
  Author: memleaf contributors
6
6
  License-Expression: MIT
@@ -23,8 +23,8 @@ Dynamic: license-file
23
23
 
24
24
  [English](README.en.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
25
25
 
26
- > **当前版本:0.2.24。**
27
- > 核心库、Vault、stdio MCP Server、初始化 CLI、模型路由、提炼流程、受控检索协议和宿主适配器已经实现。memleaf 0.2.24 通过 PyPI 分发。
26
+ > **版本:0.2.26。**
27
+ > 核心库、Vault、stdio MCP Server、初始化 CLI、模型路由、提炼流程、受控检索协议和宿主适配器已经实现。本版完成共享记忆核心重构;真实模型语义效果仍需结合本地模型和业务样本验收。
28
28
  > **当前版本支持 Hermes 和 Codex。** Antigravity(反重力)不检测、不安装、不配置。
29
29
 
30
30
  ## 项目定位
@@ -421,7 +421,7 @@ $HOME/.memleaf/
421
421
 
422
422
  ## 隐私与安全边界
423
423
 
424
- - 捕获默认只接收调用方明确传入的 user/assistant 可见文本;不捕获 system prompt、developer prompt、隐藏推理、原始工具输出或附件全文;
424
+ - 对话捕获只接收 user/assistant 可见文本,不捕获 system/developer 指令或隐藏推理。匹配到当前轮工具调用的证据另由 `capture.tool_evidence_mode` 控制;新建 Vault 默认 `bounded`(脱敏、有界正文),文件/附件正文默认不留存。旧配置显式关闭工具输出时不自动升级为保留正文;
425
425
  - 捕获落盘前尽力脱敏常见 API key、Bearer token、Cookie、JWT 和私钥,但脱敏不是加密,也不能保证识别所有敏感信息;
426
426
  - 路径校验、符号链接检查、Vault 锁、同目录临时文件、fsync 和原子替换用于保护本地写入;
427
427
  - memleaf 不主动上传整个 Vault,也没有托管后台、遥测或账号系统;
@@ -466,3 +466,46 @@ MIT,见 [LICENSE](LICENSE)。
466
466
 
467
467
  **memleaf**
468
468
  *Your memories, in files you own.*
469
+
470
+
471
+ ## 通用处理与只读验收(0.2.26)
472
+
473
+ 邮件、日历、工单、文件、浏览器与普通对话共用证据准入、覆盖检查和写入路径。
474
+ 自动摘要只能使用获准引用的原文;助手复述和旧记忆回读不能单独授权新增写入。
475
+ 模型负责语义判断,代码验证来源和原文引用。通过引用校验并不保证模型的语义判断一定正确。
476
+
477
+ ```bash
478
+ memleaf audit --vault /path/to/existing/vault --json
479
+ memleaf process --vault /path/to/existing/vault --source hermes --session-id SESSION --dry-run --json
480
+ ```
481
+
482
+ `audit` 完全本地、只读,不调用模型,不推断旧记忆由哪个版本创建,也不自动清理。
483
+ `--dry-run` 在私有临时副本运行正常处理,可能调用配置的独立 Model Route;不会改写原 Vault。
484
+ 检测到原 Vault 并发变化时会拒绝输出可用预览。没有一键应用预览的功能。
485
+
486
+ 工具执行状态与证据完整性分别记录;超限、丢失或不完整内容不会被模型的 NO_CHANGE 升级为完整。
487
+ 执行成功但尚有未解决项时,结果显示 `coverage_status=partial`,并保留来源以供有界重试或补充证据。
488
+ 行为、限制、测试协议变更见 [通用处理说明](docs/general-processing.md)。
489
+
490
+ ### 工具证据留存配置
491
+
492
+ ```yaml
493
+ capture:
494
+ tool_evidence_mode: bounded # bounded | metadata | off
495
+ include_attachments: false
496
+ ```
497
+
498
+ `bounded` 允许当前轮真实工具观察保留有界、脱敏的正文;小结果可能完整保留,
499
+ 不是承诺只保存模型总结。`metadata` 仅留工具调用标识等元数据(仍可能包含标题),
500
+ 不保留证据正文,也不把主动排除误报成提炼漏项。`off` 不保存工具证据记录。
501
+ 三种模式均不允许把助手复述或旧记忆回读变成独立的新事实。
502
+
503
+ 现有配置未提供新字段时,旧 `include_tool_output: false` 或未设置该开关均按
504
+ `metadata` 处理,旧 `true` 按 `bounded` 处理。显式新字段优先;新建 Vault 只写
505
+ 新字段,不再同时写含义冲突的旧开关。`include_attachments: true` 仍受上述总模式限制。
506
+ 宿主通过结构化文件路径、文件/附件标识识别文档;不承诺识别任意 Shell 命令或不透明工具
507
+ 隐藏读取的文件。用户粘贴的可见文档和显式 `remember` 内容不属于自动附件抓取。
508
+
509
+ 策略在待捕获缓存、inbox 写入和新模型提炼输入处共同执行。配置收紧不会自动删除已提交
510
+ 记忆或改写已捕获 inbox;失败前已经冻结的提交计划也不作为新的模型调用重新提炼。
511
+ 已捕获工具原文的清理仍遵守原有安全期,明确忘记使用 `forget_memory/forget_about`。
@@ -4,8 +4,8 @@
4
4
 
5
5
  [中文](README.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
6
6
 
7
- > **Version: 0.2.24.**
8
- > The core library, Vault, stdio MCP server, initialization CLI, model routing, memory extraction, controlled retrieval protocol, and host adapters are implemented. memleaf 0.2.24 is distributed through PyPI.
7
+ > **Version: 0.2.26.**
8
+ > The core library, Vault, stdio MCP server, initialization CLI, model routing, memory extraction, controlled retrieval protocol, and host adapters are implemented. This version completes the shared memory core refactor; real-model semantics still require local acceptance with the selected model and representative inputs.
9
9
  > **The current release supports Hermes and Codex.** Antigravity is not detected, installed, or configured.
10
10
 
11
11
  ## Project scope
@@ -404,7 +404,7 @@ Directories are normally created with mode `0700`, and files are stored as plain
404
404
 
405
405
  ## Privacy and security boundaries
406
406
 
407
- - By default, capture accepts only explicitly supplied visible user/assistant text; it excludes system prompts, developer prompts, hidden reasoning, raw tool output, and full attachment bodies.
407
+ - Conversation capture accepts visible user/assistant text, never system/developer instructions or hidden reasoning. Matched current-turn tool evidence is controlled separately by `capture.tool_evidence_mode`: new Vaults use bounded/redacted observations; document/attachment bodies are excluded by default. Legacy configurations disabling tool output are not silently opted into body retention.
408
408
  - Common API keys, Bearer tokens, cookies, JWTs, and private keys are redacted on a best-effort basis before capture is written. Redaction is not encryption and cannot detect every secret.
409
409
  - Path validation, symlink checks, Vault locks, same-directory temporary files, fsync, and atomic replacement protect local writes.
410
410
  - memleaf does not upload the entire Vault and has no hosted backend, telemetry, or account system.
@@ -450,3 +450,48 @@ MIT; see [LICENSE](LICENSE).
450
450
  **memleaf**
451
451
 
452
452
  *Your memories, in files you own.*
453
+
454
+
455
+ ## General processing and read-only inspection (0.2.26 candidate)
456
+
457
+ Dialogue, calendars, tickets, files, web results and other tools share the evidence, coverage and write path.
458
+ Models interpret semantics; Core validates physical provenance and exact original quotations.
459
+ A valid quotation establishes provenance, not the truth or entailment of a generated claim.
460
+
461
+ ```bash
462
+ memleaf audit --vault /path/to/existing/vault --json
463
+ memleaf process --vault /path/to/existing/vault --source hermes --session-id SESSION --dry-run --json
464
+ ```
465
+
466
+ Audit is local/read-only, never calls a model, never infers producing versions and never repairs automatically.
467
+ Dry-run executes the normal processor on a private temporary copy and may call the configured Model Route.
468
+ It does not modify the source Vault; concurrent source changes invalidate the preview. There is no apply-preview mode.
469
+ Execution success is separate from evidence completeness: `coverage_status=partial` reports unresolved work.
470
+ See [general processing](docs/general-processing.md) for the protocol, limits and verification boundaries.
471
+
472
+ ### Tool-evidence retention
473
+
474
+ ```yaml
475
+ capture:
476
+ tool_evidence_mode: bounded # bounded | metadata | off
477
+ include_attachments: false
478
+ ```
479
+
480
+ `bounded` keeps bounded, redacted current-turn observations; small tool results may be
481
+ retained in full, not just as model summaries. `metadata` keeps identifiers and permitted
482
+ metadata (which may include titles), not bodies; intentional exclusions are not reported
483
+ as unresolved extraction. `off` retains no tool-evidence records. None of these modes makes
484
+ assistant synthesis or retrieved old memory independent evidence of new facts.
485
+
486
+ For an existing file without the new mode, legacy `include_tool_output: false` or an
487
+ absent boolean means `metadata`; true means `bounded`. An explicit new mode takes
488
+ precedence. New Vaults write only the new mode. Attachment opt-in remains subject to the
489
+ mode. Adapters classify structural file paths, file IDs and attachment handles, not
490
+ arbitrary opaque shell commands. Pasted visible documents and explicit remember text
491
+ are not automatic attachment capture.
492
+
493
+ The policy applies to pending cache, inbox writes, and new model-planning inputs.
494
+ Tightening it is not a retroactive rewrite of committed memories or captured inbox files.
495
+ Previously frozen operations are recovered as existing plans, not new model calls.
496
+ Captured evidence retains its existing cleanup grace period; use explicit forget for
497
+ memory deletion. See `docs/evidence-retention.md` for limits and scope.
@@ -4,8 +4,8 @@
4
4
 
5
5
  [English](README.en.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
6
6
 
7
- > **当前版本:0.2.24。**
8
- > 核心库、Vault、stdio MCP Server、初始化 CLI、模型路由、提炼流程、受控检索协议和宿主适配器已经实现。memleaf 0.2.24 通过 PyPI 分发。
7
+ > **版本:0.2.26。**
8
+ > 核心库、Vault、stdio MCP Server、初始化 CLI、模型路由、提炼流程、受控检索协议和宿主适配器已经实现。本版完成共享记忆核心重构;真实模型语义效果仍需结合本地模型和业务样本验收。
9
9
  > **当前版本支持 Hermes 和 Codex。** Antigravity(反重力)不检测、不安装、不配置。
10
10
 
11
11
  ## 项目定位
@@ -402,7 +402,7 @@ $HOME/.memleaf/
402
402
 
403
403
  ## 隐私与安全边界
404
404
 
405
- - 捕获默认只接收调用方明确传入的 user/assistant 可见文本;不捕获 system prompt、developer prompt、隐藏推理、原始工具输出或附件全文;
405
+ - 对话捕获只接收 user/assistant 可见文本,不捕获 system/developer 指令或隐藏推理。匹配到当前轮工具调用的证据另由 `capture.tool_evidence_mode` 控制;新建 Vault 默认 `bounded`(脱敏、有界正文),文件/附件正文默认不留存。旧配置显式关闭工具输出时不自动升级为保留正文;
406
406
  - 捕获落盘前尽力脱敏常见 API key、Bearer token、Cookie、JWT 和私钥,但脱敏不是加密,也不能保证识别所有敏感信息;
407
407
  - 路径校验、符号链接检查、Vault 锁、同目录临时文件、fsync 和原子替换用于保护本地写入;
408
408
  - memleaf 不主动上传整个 Vault,也没有托管后台、遥测或账号系统;
@@ -447,3 +447,46 @@ MIT,见 [LICENSE](LICENSE)。
447
447
 
448
448
  **memleaf**
449
449
  *Your memories, in files you own.*
450
+
451
+
452
+ ## 通用处理与只读验收(0.2.26)
453
+
454
+ 邮件、日历、工单、文件、浏览器与普通对话共用证据准入、覆盖检查和写入路径。
455
+ 自动摘要只能使用获准引用的原文;助手复述和旧记忆回读不能单独授权新增写入。
456
+ 模型负责语义判断,代码验证来源和原文引用。通过引用校验并不保证模型的语义判断一定正确。
457
+
458
+ ```bash
459
+ memleaf audit --vault /path/to/existing/vault --json
460
+ memleaf process --vault /path/to/existing/vault --source hermes --session-id SESSION --dry-run --json
461
+ ```
462
+
463
+ `audit` 完全本地、只读,不调用模型,不推断旧记忆由哪个版本创建,也不自动清理。
464
+ `--dry-run` 在私有临时副本运行正常处理,可能调用配置的独立 Model Route;不会改写原 Vault。
465
+ 检测到原 Vault 并发变化时会拒绝输出可用预览。没有一键应用预览的功能。
466
+
467
+ 工具执行状态与证据完整性分别记录;超限、丢失或不完整内容不会被模型的 NO_CHANGE 升级为完整。
468
+ 执行成功但尚有未解决项时,结果显示 `coverage_status=partial`,并保留来源以供有界重试或补充证据。
469
+ 行为、限制、测试协议变更见 [通用处理说明](docs/general-processing.md)。
470
+
471
+ ### 工具证据留存配置
472
+
473
+ ```yaml
474
+ capture:
475
+ tool_evidence_mode: bounded # bounded | metadata | off
476
+ include_attachments: false
477
+ ```
478
+
479
+ `bounded` 允许当前轮真实工具观察保留有界、脱敏的正文;小结果可能完整保留,
480
+ 不是承诺只保存模型总结。`metadata` 仅留工具调用标识等元数据(仍可能包含标题),
481
+ 不保留证据正文,也不把主动排除误报成提炼漏项。`off` 不保存工具证据记录。
482
+ 三种模式均不允许把助手复述或旧记忆回读变成独立的新事实。
483
+
484
+ 现有配置未提供新字段时,旧 `include_tool_output: false` 或未设置该开关均按
485
+ `metadata` 处理,旧 `true` 按 `bounded` 处理。显式新字段优先;新建 Vault 只写
486
+ 新字段,不再同时写含义冲突的旧开关。`include_attachments: true` 仍受上述总模式限制。
487
+ 宿主通过结构化文件路径、文件/附件标识识别文档;不承诺识别任意 Shell 命令或不透明工具
488
+ 隐藏读取的文件。用户粘贴的可见文档和显式 `remember` 内容不属于自动附件抓取。
489
+
490
+ 策略在待捕获缓存、inbox 写入和新模型提炼输入处共同执行。配置收紧不会自动删除已提交
491
+ 记忆或改写已捕获 inbox;失败前已经冻结的提交计划也不作为新的模型调用重新提炼。
492
+ 已捕获工具原文的清理仍遵守原有安全期,明确忘记使用 `forget_memory/forget_about`。
@@ -0,0 +1,129 @@
1
+ # Shared memory core — controlled refactor
2
+
3
+ Baseline: `bc7622e0f4c5c7b6658336c4deb71fce6a370f11` (the unreleased 0.2.26
4
+ candidate). This document describes the completed four-increment design, not
5
+ an assertion that arbitrary model outputs are correct. The maintainer chose to
6
+ perform live-model acceptance locally; scripted fixtures are contract tests.
7
+
8
+ ## Product boundaries
9
+
10
+ Markdown in `knowledge/` and `history/` remains the permanent source of truth.
11
+ Existing Vaults, paths, frontmatter, memory IDs and public tools remain compatible.
12
+ No database, vector engine, model weights, queue service, daemon, telemetry or
13
+ third-party runtime dependency is introduced. The existing host-managed stdio
14
+ MCP subprocess remains supported; no separate service needs deployment.
15
+
16
+ Hermes still registers `MemleafMemoryProvider` with the official plugin API.
17
+ Native MEMORY.md / USER.md stay read-only cooperating sources. Hermes and Codex
18
+ use the same Core and selected Vault. Source/session identifiers describe
19
+ provenance and lifecycle, never permanent-memory visibility. Scope Map -> search
20
+ -> selected read, retrieval enforcement levels, budget, global todo paging,
21
+ installation and the independent Model Route remain intact.
22
+
23
+ ## Ownership
24
+
25
+ | Component | Responsibility |
26
+ | --- | --- |
27
+ | Processor | Orchestrate process/remember, compose components explicitly |
28
+ | ModelExecutor | Existing Model Route, bounded correction, diagnostics |
29
+ | PlanningContext | Read related memories, Scope evidence and target context |
30
+ | MemoryPlanner | Validate model proposals and construct change requests |
31
+ | UpdateCoordinator | One bounded reconciliation for an exceptional same-target group |
32
+ | MemoryCommitter | Validate revisions, freeze/execute writes, coordinate forget cancellation |
33
+ | ProcessJournal | Claims, progress, temporary evidence cleanup and retained retry state |
34
+ | TurnAudit | Per-candidate/evidence outcomes and uncommitted lookup overlay |
35
+ | recording_policy | Pre-capture permission controls, no business extraction |
36
+ | evidence_policy | One retention rule for capture, host caches and new planning |
37
+
38
+ There is one automatic pipeline, not parallel old/new writers, mixin inheritance
39
+ or a dynamic attribute proxy. `Memleaf._mutation_boundary()` is the common Vault
40
+ lock plus interrupted-compaction recovery boundary for automatic/explicit
41
+ commits, raw-library writes, forget and compaction snapshot/commit. Each operation
42
+ retains its own authorization, revision checks and journal. Models execute outside
43
+ this critical section. Pending automatic writes are NOT replayed by entering the
44
+ boundary: forget must be able to cancel them first.
45
+
46
+ ## Semantic ownership
47
+
48
+ The model selects type, Scope, target and content. Deterministic code validates
49
+ identity, allowed source spans, schema, explicit constraints and local conflicts.
50
+ It can reject a proposal, but must not silently change its business meaning.
51
+
52
+ Removed paths include completion/rework post-Gate candidate factories, forced
53
+ summary status/timestamp insertion, keyword-based fact/project/todo conversion,
54
+ last-retry Scope reassignment, local splitting of rejected candidates, formal-plan
55
+ preference that changes type, and old/new body concatenation. A persistent wrong
56
+ UPDATE target is DEFERRED, not converted into CREATE. Valid sibling candidates
57
+ continue. The model may correct its proposal during bounded retries.
58
+
59
+ `NO_CHANGE` remains a valid no-write decision. Missing required todo-update state
60
+ is returned for model correction, not guessed locally. A model-declared ambiguous
61
+ target can be represented as coverage DEFERRED / target_ambiguous. An exact title
62
+ lookup with more than one target cannot select one. Source-local rejection and
63
+ retrieval heuristics remain conservative checks, not a guarantee of semantic
64
+ entailment. Only exact full-statement matching is used for legacy unbound outputs.
65
+
66
+ For an UPDATE, the model must return the complete intended current state, retaining
67
+ still-valid facts and omitting retired facts. Code no longer appends old paragraphs
68
+ to an incomplete summary. The prior complete version is preserved in history.
69
+ Real-model quality still needs local evaluation, including preservation of old
70
+ facts and recognition of new assertions mixed with questions.
71
+
72
+ Multiple admitted updates to one target are reconciled using the existing Model
73
+ Route and original target revision. One compatible summary produces one write and
74
+ one history record with all contributing receipts. True conflicts defer the group;
75
+ unrelated targets proceed. Single updates incur no group call. Oversized groups
76
+ are retained, not split into competing writes. Scope-retirement/native-shadowing
77
+ authorizations are not silently combined.
78
+
79
+ ## Lifecycle and privacy
80
+
81
+ Capture preserves process-owned root journal fields. Frozen requests keep complete
82
+ payloads and checksums; recovery uses the saved payload without another model call.
83
+ Revision checks under lock refuse stale overwrites. Replay preserves the actual
84
+ CREATE/UPDATE outcome for each contributing candidate. This is forward recovery,
85
+ not a database-style atomic transaction across every file in a Vault.
86
+
87
+ Explicit forget cancels matching frozen operations before deleting files. Unrelated
88
+ siblings survive, stale cancelled owners cannot commit, and a new explicitly
89
+ authorized remember event can store the fact again. No permanent topic blacklist
90
+ is added. Explicit remember skips value classification, not its supplied Scope or
91
+ target-revision constraints.
92
+
93
+ Successfully captured tool cache records are consumed only after their presence in
94
+ inbox is confirmed. Failed capture retains evidence; historical loss cannot taint
95
+ unrelated future turns. Retention modes and old-config compatibility are specified
96
+ in `evidence-retention.md`. Historical abandoned cache entries are not globally
97
+ purged as part of upgrade; no destructive migration is performed.
98
+
99
+ Leading recording controls and `record=False` suppress user/assistant/tool content
100
+ before persistence. Session off/resume state survives rebuild/restart, and late
101
+ callbacks for private turns remain private. Examples and quoted controls cannot
102
+ change permission. The command vocabulary is intentionally bounded (for example
103
+ `这段不要记录`, `接下来不要记录`, `恢复记录`, `Don't record this`, `stop recording this session`);
104
+ this is not arbitrary-language privacy inference. Integrations may use record=False.
105
+ Permission state stores only booleans and hashed identifiers, never private text.
106
+
107
+ Coverage-unresolved evidence receives at most one subsequent natural retry, capped
108
+ to four old turns per process call alongside new complete work. Missing-source,
109
+ Scope/target and ownership ambiguities wait for relevant new information or explicit
110
+ retry instead of spending model budget forever. Exhaustion retains unresolved input.
111
+
112
+ ## Validation and test-contract migration
113
+
114
+ The existing suite is retained. Renamed tests distinguish a MODEL correcting its
115
+ Scope/type/target from the removed local repair. Public outcomes remain checked:
116
+ stable ID, complete new content, one prior history version, no wrong-Scope write,
117
+ retained inbox and independent sibling progress. Prior tests that expected invalid
118
+ proposals to be rewritten now assert bounded model correction or explicit DEFERRED.
119
+
120
+ A test that required creation of a fact absent from its input and attached to an
121
+ unrelated target now requires zero writes; the valid duplicate sibling remains
122
+ unchanged. Ambiguity fixtures explicitly return evidence-level DEFERRED and assert
123
+ retention, rather than relying on plan-title keywords. Dedicated raw-response tests
124
+ cover malformed evidence and illegal targets without the fixture binding adapter.
125
+
126
+ Final-source testing must include the full Linux, Windows and macOS matrix, wheel
127
+ entry points and the matching sdist suite. Native CLI registration is not live
128
+ semantic acceptance. Test results are tied to exact commits/artifacts, not to a
129
+ mutable local worktree or a percentage-complete estimate.
@@ -0,0 +1,58 @@
1
+ # Shared tool-evidence retention — refactor phase 3
2
+
3
+ One deterministic policy governs direct capture, HostRuntime hooks and the copied
4
+ Hermes MemoryProvider. It grants no semantic write permission and adds no service,
5
+ runtime dependency, storage engine or model call.
6
+
7
+ ## Modes and compatibility
8
+
9
+ | Effective setting | Bodies | Observation metadata |
10
+ | --- | --- | --- |
11
+ | bounded | Redacted, bounded | Retained |
12
+ | metadata | Excluded | Retained |
13
+ | off | Excluded | Excluded |
14
+
15
+ New Vaults explicitly choose bounded; existing files without a mode preserve the
16
+ legacy boolean (false/absent -> metadata, true -> bounded). An explicit new mode
17
+ wins over the legacy boolean. Invalid strings and non-boolean flags fail closed.
18
+ Loading config does not rewrite it. Normal saves make the effective mode explicit.
19
+
20
+ The inherited limits remain eight records, 2,000 characters per body, and 320 per
21
+ metadata field. Oversized eligible evidence remains incomplete; its prefix is
22
+ never promoted into a complete fact. Policy-excluded observations are marked
23
+ retention=metadata, have no content, and are not retried as missing evidence.
24
+ No later relaxation recreates discarded original content.
25
+
26
+ Document/attachment bodies require include_attachments=true and bounded mode.
27
+ HostRuntime and the standalone Hermes adapter classify structural file arguments
28
+ using the same tested contract (path/file_path/file_id/attachment_id/file URI,
29
+ including bounded nesting). This is not a claim to identify every file hidden
30
+ behind arbitrary terminal commands or undocumented remote tools. Direct callers
31
+ must truthfully identify document evidence with source_type=document.
32
+
33
+ ## Lifecycle
34
+
35
+ - Pre-capture recording permission takes precedence over every retention mode.
36
+ - New host observations and pending-cache reads obey the effective mode.
37
+ - Core capture validates and reapplies it before inbox persistence.
38
+ - New planning calls filter evidence from already captured inbox events too,
39
+ without mutating the original event identity or frozen-plan input checksum.
40
+ - Successful capture consumes only evidence verified in inbox under the same
41
+ policy; failed capture does not discard eligible observations.
42
+ - No retrospective deletion of knowledge/history/inbox is implied. Frozen plans
43
+ already prepared before a policy change recover via their existing contract.
44
+ Explicit forget coordinates cancellation; a retention toggle is not forget.
45
+ - Old abandoned host sessions are not scanned by a daemon or globally purged.
46
+ Current sessions consume their caches through the normal lifecycle.
47
+
48
+ Metadata is not anonymization: identifiers/titles may remain sensitive. Redaction
49
+ is best effort and local plaintext backups remain the user's responsibility.
50
+
51
+ ## Verification
52
+
53
+ Contract tests cover legacy/no-capture config compatibility, round trips, explicit
54
+ precedence, denied documents, shared Hermes/core classification, bounded redaction,
55
+ cache-policy changes, direct and MCP fields, no model input after tightening,
56
+ no false coverage/retry from deliberate exclusion, and no reconstruction on opt-in.
57
+ Existing general evidence, native memory, lifecycle, retrieval and packaging tests
58
+ remain part of the full suite; no live model credentials are required here.
@@ -0,0 +1,161 @@
1
+ # General processing reliability contract — 0.2.26 candidate
2
+
3
+ This is source-neutral processing, not a mail extractor. Dialogue, documents,
4
+ calendars, issue trackers and terminal/tool observations use the same admission
5
+ and commit boundaries. No tool/topic keyword grants write permission.
6
+
7
+ ## Evidence and semantic decisions
8
+
9
+ The host supplies physical user events or actual matched current-turn tool
10
+ call/results. Assistant synthesis, a caller-supplied digest, and read-back of
11
+ memleaf knowledge cannot independently authorize new writes. Standard memleaf
12
+ resource names and explicit paths into the current Vault are treated as
13
+ read-back, including aliased filesystem tools. Undeclared/relative resources
14
+ cannot always be identified; adapters must supply meaningful resource identity.
15
+
16
+ Evidence inventory IDs depend on captured event/source locations, not candidate
17
+ numbering or unrelated inventory order. User origin/syntax labels are hints,
18
+ not the final semantic classification. One example request does not mark an
19
+ independent real assertion as hypothetical. Actual pasted documents/code may
20
+ be evidence; examples, suggestions and hypothetical content are not new facts.
21
+
22
+ The Gate still decides future value, entailment, semantic role, ownership and
23
+ CREATE/UPDATE/NO_CHANGE. Each writable candidate quotes actual evidence units.
24
+ Core validates the unit/event identity, physical source, exact text and bounds.
25
+ Start/end are relative to unit.text; they may both be omitted for a unique exact
26
+ quotation, in which case Core locates it without model character counting.
27
+ Malformed/ambiguous references fail the contract. Matching a quote proves
28
+ provenance, not semantic truth. This mechanism is not a universal NLP proof.
29
+
30
+ Legacy candidate-only output has no n-gram or short-text authorization bypass.
31
+ It must repeat a complete non-query source statement, or produce an explicit
32
+ validated quotation via the bounded correction path. Automatic summarization
33
+ sees only admitted spans, candidate semantics and the bounded existing-target
34
+ context. Its source references must stay within admitted event keys. Final
35
+ scope/type/target/date checks remain active.
36
+
37
+ ## Coverage, limits and no-op behavior
38
+
39
+ A Gate may map multiple facts in one evidence unit to several candidates, or
40
+ one candidate to several units. Coverage is checked against real supplied IDs.
41
+ One source-neutral correction can classify missing units; its candidates pass
42
+ the same validator/deduplication path, never a post-Gate business-pattern writer.
43
+ Already valid siblings survive a malformed correction. Work that remains
44
+ ambiguous is retained and explicitly reported, not guessed into a global scope.
45
+
46
+ Evidence decisions, candidate dispositions and filesystem operations are
47
+ separate ledgers. `execution_status=ok` is not complete extraction:
48
+ `coverage_status=partial` plus `unresolved_evidence_count` describes remaining
49
+ work. Known incomplete/missing observations remain unresolved even when a model
50
+ labels them NO_CHANGE. Incomplete turns retain their source instead of being
51
+ cleaned after the usual grace period. Scope-filtered retries may revisit them;
52
+ no endless automatic model retry or extra external tool call is introduced.
53
+
54
+ Tool evidence is bounded to eight records with at most 2,000 content characters
55
+ per captured result record and 320-character metadata fields, with redaction at
56
+ Core capture. Large unambiguous top-level record collections retain complete
57
+ records and enclosing context within that budget. Per-record provenance takes
58
+ precedence over common source metadata. An overflow slot reports omitted
59
+ records. Arbitrary large prose is not split into falsely complete facts;
60
+ unsupported/incomplete content needs a supported complete source excerpt or a
61
+ later source input. Execution outcome and completeness are distinct.
62
+
63
+ Codex pending tool data retains sixteen turns; bounded tombstones make evicted
64
+ uncaptured evidence visible as incomplete. Older loss beyond 256 tombstones
65
+ leaves a session diagnostic only; it does not mark unrelated future turns as
66
+ incomplete. Successfully captured observations are consumed from the host cache.
67
+ No old observation is attached as a new fact to a different turn.
68
+
69
+ Automatic NO_CHANGE does not modify permanent Markdown, sources or history.
70
+ Processing watermarks/diagnostics may still advance: these are not permanent
71
+ memory ownership. Existing native-memory coexistence, global shared Vault
72
+ visibility and Scope Map/search/read contracts remain unchanged.
73
+
74
+ ## Commit and recovery
75
+
76
+ Final requests, source identifiers, candidate/evidence decisions and scope
77
+ operations are frozen to a checksum-protected local plan before mutation.
78
+ Limits are 8 MiB per plan and 16 MiB for the pending plan inventory. No raw tool
79
+ transcript is duplicated into the plan. Plans contain the final memory payload,
80
+ which remains private Vault data. A checksum detects corruption, not a malicious
81
+ local filesystem owner.
82
+
83
+ Under the existing Vault lock, current target revisions are checked before
84
+ commit. A stale update cannot overwrite another agent's change. Exact
85
+ commit-time duplicates include title and complete state-bearing content, so two
86
+ independent titled tasks are not merged solely because their bodies match.
87
+ Model-assisted same-future-use matching still uses bounded existing candidates;
88
+ it is not replaced with fuzzy string authorization or embeddings.
89
+
90
+ A retry resumes a matching persisted plan without asking the model for a new
91
+ summary. CREATE/UPDATE outcomes survive interrupted final-ledger writes.
92
+ Explicit cross-project correction and retirement preserve their original
93
+ history identity and do not resurrect the wrong target on replay. Ordinary
94
+ cross-project target selection does not inherit this special authorization.
95
+ Conflicting same-turn writes to one target are deferred/rejected rather than
96
+ silently applied in sequence. This remains forward recovery, not a database
97
+ transaction across the whole Vault filesystem.
98
+
99
+ ## Read-only inspection
100
+
101
+ ```bash
102
+ memleaf audit --vault /path/to/existing/vault --json
103
+ memleaf process --vault /path/to/existing/vault --source hermes --session-id SESSION --dry-run --json
104
+ ```
105
+
106
+ Audit is local, creates no source lock/index and makes no model call. It reports
107
+ verifiable identical active payloads and invalid/pending accounting; it does not
108
+ infer which release produced old data or automatically delete/repair anything.
109
+
110
+ Dry-run executes the normal processor on a private temporary copy. It can call
111
+ the configured independent Model Route and read configured native sources, but
112
+ never writes them or the original Vault. It returns candidate decisions and
113
+ knowledge/history changes, not configuration credentials. The copy is deleted.
114
+ Snapshots are limited to 256 MiB/100,000 relevant files, reject symlinked children
115
+ and compare original content before/after. Concurrent source changes invalidate
116
+ the preview. There is deliberately no apply-preview command.
117
+
118
+ ## Verification boundaries
119
+
120
+ Deterministic backends test schema and filesystem behavior, not hosted-model
121
+ accuracy. tests/semantic_fixtures.py adapts prescribed old Gate judgments to the
122
+ quote protocol for update/history/maintenance tests. It does not run in product
123
+ code and is not proof those judgments are semantically sound. New adversarial
124
+ protocol tests choose their quotations explicitly. No model score or absolute
125
+ "all languages/all scenarios" accuracy claim is made.
126
+
127
+ Before release, separately inspect live Model Route behavior on held-out real
128
+ shaped inputs, without writing the real Vault. Validate pure queries, mixed
129
+ assertions/questions/examples, negation, user confirmations, multilingual
130
+ paraphrases, multiple scopes and several external tool categories. Record actual
131
+ model/provider, counts of false writes/omissions/deferrals, and failures without
132
+ including credentials or private transcripts. Unit-test success cannot replace
133
+ that acceptance.
134
+
135
+ ## Native Windows verification boundaries
136
+
137
+ Windows processing-owner liveness is queried through a process handle with
138
+ SYNCHRONIZE access, never by sending a signal. Shared-Vault writes use a
139
+ native byte-range lock between processes, not only a Python thread mutex.
140
+ Native child-process tests run on Linux, macOS and Windows.
141
+
142
+ The full Python suite runs on all three OS families. Only the `install.sh`
143
+ shell-harness class is POSIX-only; Windows retains installation, upgrade,
144
+ PowerShell syntax, host lifecycle and native Codex acceptance. Test launchers
145
+ use native `.cmd` wrappers on Windows. Byte-preservation assertions compare
146
+ actual before/after bytes, including CRLF. POSIX mode-bit checks are conditional:
147
+ Windows file privacy follows the Vault directory's inherited ACLs, and Unix
148
+ `0600` must not be interpreted as proof of a Windows owner-only DACL.
149
+
150
+ Real-model acceptance requires an explicit model route in repository Actions:
151
+ secret `MEMLEAF_LIVE_MODEL_TOKEN` and variables `MEMLEAF_LIVE_BASE_URL` and
152
+ `MEMLEAF_LIVE_MODEL`. Missing configuration is a blocked acceptance result,
153
+ not a passing semantic test. Never publish based only on deterministic mocks.
154
+
155
+ ## Capture policy (shared-core refactor)
156
+
157
+ Tool evidence is controlled by `capture.tool_evidence_mode` and document opt-in,
158
+ not the presence of business words. The same policy runs before cache/inbox writes
159
+ and new model-planning calls. Intentional exclusion is not missing evidence.
160
+ See [retention contract](evidence-retention.md) for legacy settings, plaintext
161
+ metadata, opaque-resource limitations and the distinction from explicit forget.