memleaf 1.0.0__tar.gz → 1.0.2__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 (205) hide show
  1. {memleaf-1.0.0 → memleaf-1.0.2}/CHANGELOG.md +79 -0
  2. {memleaf-1.0.0/src/memleaf.egg-info → memleaf-1.0.2}/PKG-INFO +56 -17
  3. {memleaf-1.0.0 → memleaf-1.0.2}/README.en.md +55 -16
  4. {memleaf-1.0.0 → memleaf-1.0.2}/README.md +55 -16
  5. memleaf-1.0.2/docs/host-v2-contract.md +72 -0
  6. memleaf-1.0.2/docs/stability.md +112 -0
  7. {memleaf-1.0.0 → memleaf-1.0.2}/pyproject.toml +2 -1
  8. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/__init__.py +1 -1
  9. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/adapters/base.py +20 -0
  10. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/adapters/codex.py +6 -2
  11. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/cli.py +14 -2
  12. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/frontmatter.py +7 -3
  13. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/plugin.yaml +1 -1
  14. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/host_events.py +5 -1
  15. memleaf-1.0.2/src/memleaf/host_v2.py +1041 -0
  16. memleaf-1.0.2/src/memleaf/host_v2_auth.py +396 -0
  17. memleaf-1.0.2/src/memleaf/host_v2_cli.py +92 -0
  18. memleaf-1.0.2/src/memleaf/host_v2_common.py +45 -0
  19. memleaf-1.0.2/src/memleaf/host_v2_contracts/schemas/admin-records.schema.json +208 -0
  20. memleaf-1.0.2/src/memleaf/host_v2_contracts/schemas/memleaf-host-v2.schema.json +4865 -0
  21. memleaf-1.0.2/src/memleaf/host_v2_contracts/schemas/read-integrity.schema.json +92 -0
  22. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/cancel_memory.json +1007 -0
  23. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/forget_memory.json +1215 -0
  24. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/memory_capabilities.json +1427 -0
  25. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/memory_work.json +1695 -0
  26. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/prepare_memory.json +1531 -0
  27. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/resume_memory.json +1000 -0
  28. memleaf-1.0.2/src/memleaf/host_v2_contracts/tools/submit_memory.json +2032 -0
  29. memleaf-1.0.2/src/memleaf/host_v2_mcp.py +125 -0
  30. memleaf-1.0.2/src/memleaf/host_v2_owner.py +475 -0
  31. memleaf-1.0.2/src/memleaf/host_v2_proposal.py +644 -0
  32. memleaf-1.0.2/src/memleaf/host_v2_schema.py +423 -0
  33. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/mcp_server.py +50 -6
  34. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/memory_writer.py +14 -4
  35. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/service.py +63 -7
  36. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/state_layout.py +7 -3
  37. {memleaf-1.0.0 → memleaf-1.0.2/src/memleaf.egg-info}/PKG-INFO +56 -17
  38. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf.egg-info/SOURCES.txt +19 -0
  39. memleaf-1.0.0/docs/stability.md +0 -56
  40. {memleaf-1.0.0 → memleaf-1.0.2}/LICENSE +0 -0
  41. {memleaf-1.0.0 → memleaf-1.0.2}/MANIFEST.in +0 -0
  42. {memleaf-1.0.0 → memleaf-1.0.2}/docs/acceptance-evidence-guide.md +0 -0
  43. {memleaf-1.0.0 → memleaf-1.0.2}/docs/automatic-processing-route.md +0 -0
  44. {memleaf-1.0.0 → memleaf-1.0.2}/docs/body-compaction.md +0 -0
  45. {memleaf-1.0.0 → memleaf-1.0.2}/docs/candidate-reconciliation.md +0 -0
  46. {memleaf-1.0.0 → memleaf-1.0.2}/docs/capture-budget-design.md +0 -0
  47. {memleaf-1.0.0 → memleaf-1.0.2}/docs/config-migrations.md +0 -0
  48. {memleaf-1.0.0 → memleaf-1.0.2}/docs/core-refactor.md +0 -0
  49. {memleaf-1.0.0 → memleaf-1.0.2}/docs/development-closeout.md +0 -0
  50. {memleaf-1.0.0 → memleaf-1.0.2}/docs/evidence-retention.md +0 -0
  51. {memleaf-1.0.0 → memleaf-1.0.2}/docs/explicit-memory-update.md +0 -0
  52. {memleaf-1.0.0 → memleaf-1.0.2}/docs/extraction-latency.md +0 -0
  53. {memleaf-1.0.0 → memleaf-1.0.2}/docs/failed-run-recovery.md +0 -0
  54. {memleaf-1.0.0 → memleaf-1.0.2}/docs/gate-evidence-boundary.md +0 -0
  55. {memleaf-1.0.0 → memleaf-1.0.2}/docs/general-processing.md +0 -0
  56. {memleaf-1.0.0 → memleaf-1.0.2}/docs/hermes-mcp-runtime.md +0 -0
  57. {memleaf-1.0.0 → memleaf-1.0.2}/docs/hermes-provider-compatibility.md +0 -0
  58. {memleaf-1.0.0 → memleaf-1.0.2}/docs/hermes-source-comparison-context.md +0 -0
  59. {memleaf-1.0.0 → memleaf-1.0.2}/docs/host-acceptance-runbook.md +0 -0
  60. {memleaf-1.0.0 → memleaf-1.0.2}/docs/immutable-release-assets.md +0 -0
  61. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-commit-contract.md +0 -0
  62. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-execution.md +0 -0
  63. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-native-comparison.md +0 -0
  64. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-partial-recovery.md +0 -0
  65. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-planner-preview.md +0 -0
  66. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-runtime-contract.md +0 -0
  67. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-scope-registration.md +0 -0
  68. {memleaf-1.0.0 → memleaf-1.0.2}/docs/incremental-selected-retention.md +0 -0
  69. {memleaf-1.0.0 → memleaf-1.0.2}/docs/installed-artifact-verification.md +0 -0
  70. {memleaf-1.0.0 → memleaf-1.0.2}/docs/memory-lifecycle-tools.md +0 -0
  71. {memleaf-1.0.0 → memleaf-1.0.2}/docs/memory-state-contract.md +0 -0
  72. {memleaf-1.0.0 → memleaf-1.0.2}/docs/migration-preflight.md +0 -0
  73. {memleaf-1.0.0 → memleaf-1.0.2}/docs/processing-quality-acceptance.md +0 -0
  74. {memleaf-1.0.0 → memleaf-1.0.2}/docs/public-query-integrity.md +0 -0
  75. {memleaf-1.0.0 → memleaf-1.0.2}/docs/query-performance.md +0 -0
  76. {memleaf-1.0.0 → memleaf-1.0.2}/docs/remember-incremental-route.md +0 -0
  77. {memleaf-1.0.0 → memleaf-1.0.2}/docs/runtime-state-retention.md +0 -0
  78. {memleaf-1.0.0 → memleaf-1.0.2}/docs/semantic-extraction-protocol.md +0 -0
  79. {memleaf-1.0.0 → memleaf-1.0.2}/docs/source-work-contract.md +0 -0
  80. {memleaf-1.0.0 → memleaf-1.0.2}/docs/v0.2.26-processing-status.md +0 -0
  81. {memleaf-1.0.0 → memleaf-1.0.2}/examples/README.md +0 -0
  82. {memleaf-1.0.0 → memleaf-1.0.2}/examples/basic_usage.py +0 -0
  83. {memleaf-1.0.0 → memleaf-1.0.2}/examples/mcp_stdio.ndjson +0 -0
  84. {memleaf-1.0.0 → memleaf-1.0.2}/install.ps1 +0 -0
  85. {memleaf-1.0.0 → memleaf-1.0.2}/install.sh +0 -0
  86. {memleaf-1.0.0 → memleaf-1.0.2}/setup.cfg +0 -0
  87. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/__main__.py +0 -0
  88. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/adapters/__init__.py +0 -0
  89. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/adapters/antigravity.py +0 -0
  90. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/adapters/hermes.py +0 -0
  91. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/admission.py +0 -0
  92. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/batch_review.py +0 -0
  93. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/body_preservation.py +0 -0
  94. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/budget.py +0 -0
  95. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/capture.py +0 -0
  96. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/compaction.py +0 -0
  97. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/config.py +0 -0
  98. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/create_coordinator.py +0 -0
  99. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/credentials.py +0 -0
  100. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/evidence_budget.py +0 -0
  101. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/evidence_policy.py +0 -0
  102. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/evidence_structure.py +0 -0
  103. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/evidence_syntax.py +0 -0
  104. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/explicit_text_source.py +0 -0
  105. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/extraction_budget.py +0 -0
  106. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/extraction_capability.py +0 -0
  107. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/extraction_work_state.py +0 -0
  108. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/README.md +0 -0
  109. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/__init__.py +0 -0
  110. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/_mcp_client.py +0 -0
  111. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/_provider.py +0 -0
  112. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/_shared.py +0 -0
  113. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/evidence_budget.py +0 -0
  114. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_provider/provider_compatibility.py +0 -0
  115. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/hermes_runtime.py +0 -0
  116. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/historical_context.py +0 -0
  117. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/host_retention.py +0 -0
  118. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/host_runtime.py +0 -0
  119. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/host_turn_identity.py +0 -0
  120. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/inbox.py +0 -0
  121. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_commit.py +0 -0
  122. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_dates.py +0 -0
  123. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_execution.py +0 -0
  124. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_explicit.py +0 -0
  125. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_failed_recovery.py +0 -0
  126. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_journal.py +0 -0
  127. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_merge.py +0 -0
  128. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_native.py +0 -0
  129. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_partial.py +0 -0
  130. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_preview.py +0 -0
  131. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_prompts.py +0 -0
  132. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_protocol.py +0 -0
  133. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_recovery.py +0 -0
  134. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_run_state.py +0 -0
  135. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_runtime.py +0 -0
  136. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_scopes.py +0 -0
  137. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_selection.py +0 -0
  138. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/incremental_semantics.py +0 -0
  139. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/index.py +0 -0
  140. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/inspection.py +0 -0
  141. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/installer.py +0 -0
  142. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/legacy_update_journal.py +0 -0
  143. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/lifecycle_maintenance.py +0 -0
  144. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/__init__.py +0 -0
  145. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/base.py +0 -0
  146. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/claude_compatible.py +0 -0
  147. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/gemini.py +0 -0
  148. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/openai_compatible.py +0 -0
  149. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/router.py +0 -0
  150. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/llm/thinking.py +0 -0
  151. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/locking.py +0 -0
  152. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/memory_commit.py +0 -0
  153. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/memory_planner.py +0 -0
  154. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/memory_retraction.py +0 -0
  155. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/memory_update.py +0 -0
  156. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/migration.py +0 -0
  157. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/model_capabilities.py +0 -0
  158. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/model_discovery.py +0 -0
  159. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/model_execution.py +0 -0
  160. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/models.py +0 -0
  161. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/native_index.py +0 -0
  162. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/native_registration.py +0 -0
  163. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/parallel_model.py +0 -0
  164. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/planning_candidates.py +0 -0
  165. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/planning_context.py +0 -0
  166. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/process_common.py +0 -0
  167. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/process_jobs.py +0 -0
  168. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/process_journal.py +0 -0
  169. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/process_owner.py +0 -0
  170. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/processing.py +0 -0
  171. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/processing_route.py +0 -0
  172. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/prompts.py +0 -0
  173. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/provenance.py +0 -0
  174. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/provider_compatibility.py +0 -0
  175. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/query_clock.py +0 -0
  176. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/query_progress.py +0 -0
  177. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/query_scan.py +0 -0
  178. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/receipt_codec.py +0 -0
  179. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/recording_policy.py +0 -0
  180. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/redaction.py +0 -0
  181. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/remember_route.py +0 -0
  182. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/retention.py +0 -0
  183. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/retrieval.py +0 -0
  184. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/retrieval_gate.py +0 -0
  185. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/retrieval_lifecycle.py +0 -0
  186. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/runtime_retention.py +0 -0
  187. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/scope_maintenance.py +0 -0
  188. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/scope_state.py +0 -0
  189. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/semantic_maintenance.py +0 -0
  190. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/semantic_protocol.py +0 -0
  191. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/single_pass_memory_planner.py +0 -0
  192. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/single_pass_plan.py +0 -0
  193. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/source_policy.py +0 -0
  194. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/subprocess_flags.py +0 -0
  195. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/summary_batch.py +0 -0
  196. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/target_reconciliation.py +0 -0
  197. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/turn_audit.py +0 -0
  198. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/turn_plan.py +0 -0
  199. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/update_coordinator.py +0 -0
  200. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/update_review.py +0 -0
  201. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/validation.py +0 -0
  202. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf/vault.py +0 -0
  203. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf.egg-info/dependency_links.txt +0 -0
  204. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf.egg-info/entry_points.txt +0 -0
  205. {memleaf-1.0.0 → memleaf-1.0.2}/src/memleaf.egg-info/top_level.txt +0 -0
@@ -5,6 +5,85 @@ All notable changes to memleaf are documented here.
5
5
  ## Unreleased
6
6
 
7
7
 
8
+ ## 1.0.2 — 2026-10-08
9
+
10
+ ### Reliable host recovery and Codex todo retrieval
11
+
12
+ - Freeze host write groups only after every member is serialized and validated.
13
+ Reject empty/incomplete recovery groups and impossible legacy saved receipts;
14
+ verify actual heads and history before settlement, including Owner accounting.
15
+ - Preserve multiline evidence in Markdown metadata through escaped quoted
16
+ strings, with lossless LF/CR/CRLF and Unicode line-separator round trips.
17
+ - Include `list_todos` in Codex retrieval Hooks and accept its current directory
18
+ fields. Reinstallation safely upgrades known older matchers with backup;
19
+ unrelated or shared third-party Hook groups are preserved.
20
+ - Validate the installed host workflow with multiline evidence in the existing
21
+ cross-platform wheel/source-distribution matrix. All 24 added regressions and
22
+ 152 existing host checks passed locally, including real stdio/Hook subprocesses
23
+ and isolated installed-package checks. One additional historical assertion
24
+ failed identically on the original 1.0.1 baseline and remains outside this fix.
25
+ - No model call or retry was added. This patch used deterministic synthetic
26
+ acceptance; the earlier 1.0.1 macOS live-client evidence remains historical,
27
+ and no new real-model or production-Vault acceptance is claimed.
28
+ - Existing Codex model-profile installations need the installer run again to
29
+ update their known old Hook matchers, followed by the existing Hook review and
30
+ trust flow. Updating the Python package alone does not rewrite host settings.
31
+
32
+ ## 1.0.1 — 2026-10-08
33
+
34
+ ### Optional host-model MCP workflow for Codex
35
+
36
+ - Add an explicit `--profile host` route that lets Codex and other compatible
37
+ MCP hosts use their running model to propose memory changes. Memleaf performs
38
+ deterministic validation, persistence and recovery with no independent model
39
+ API key, model discovery, sampling or fallback model calls. The existing
40
+ `model` profile remains the default; native Hermes processing retains its
41
+ independent Model Route and shared five-request extraction/review budget.
42
+ - Add seven host tools for capabilities, preparation, paged work inspection,
43
+ submission, recovery, cancellation and approved forgetting. Local Owner
44
+ commands bind credentials, permissions, scopes and acceptable source trust;
45
+ `host-grant` returns MCP configuration without modifying Codex defaults.
46
+ This route requires deliberate tool calls and does not automatically capture
47
+ or process every conversation turn.
48
+ - Persist source-bound work, cumulative receipts and a default limit of three
49
+ accepted submits per work. Preserve successful items during partial repair,
50
+ request idempotency and target revisions during replay, and frozen operation
51
+ identities during interrupted I/O recovery. Changed connections or request IDs
52
+ do not reset source budgets; new processing budgets require exact Owner approval.
53
+ - Support action tracking independently of content type, including projects;
54
+ distinguish `assignee` from `waiting_on` and retain unknown fields without
55
+ invented evidence. Include source-checked updates, retraction/restoration,
56
+ preserve-union MERGE and approved COMPACT/delete operations. Check permissions
57
+ on every work view, query page, replay and historical deletion target.
58
+ - Render client input schemas without local references or object-union display
59
+ branches, with concise construction examples and safe field-level errors.
60
+ This display adaptation does not relax the original Core contract validation
61
+ or add runtime dependencies. Preserve existing public interfaces, default
62
+ entry points, Markdown memories and history; no formal Vault migration is required.
63
+
64
+ ### Validation and supported scope
65
+
66
+ - All 152 added deterministic checks passed, covering contract shapes, real
67
+ stdio MCP, authorization, source evidence, CAS, recovery, retention and legacy
68
+ data compatibility. Existing affected regression checks were compared with
69
+ their prior baseline; this is not a claim that all historical tests passed.
70
+ - Live macOS acceptance used Codex CLI 0.162.0-alpha.2 with GPT-6.1 Sol and
71
+ Hermes CLI 0.21.5 with DeepSeek v4.1 Flash. Both clients completed eight basic
72
+ behaviors, including independent-process search/read and distinct memories
73
+ with identical titles. Codex also verified preserve-union MERGE, reopening
74
+ and cancelling a project, whole-memory retraction/restoration with the same
75
+ ID, and precisely approved COMPACT: six advanced changes were saved, applied
76
+ and settled. Acceptance included corrective submits and Owner-approved new
77
+ processing budgets; it does not establish universal first-pass success.
78
+ - Memleaf made zero independent model calls in these host runs. Host usage was
79
+ recorded separately: Codex model request counts were unavailable, while
80
+ Hermes reported actual request/token usage. MCP call counts are not model
81
+ request counts, and reusing the host model does not mean zero host usage.
82
+ - These live results do not certify every model or MCP client, Windows/Linux
83
+ real-model behavior, or a formal production-Vault migration/rollback exercise.
84
+ Installed-artifact CI and real-model acceptance remain separate release gates.
85
+
86
+
8
87
  ## 1.0.0 — 2026-10-06
9
88
 
10
89
  ### Stable public interfaces and production-only distributions
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memleaf
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: A local-first Markdown memory core for AI agents
5
5
  Author: memleaf contributors
6
6
  License-Expression: MIT
@@ -24,12 +24,10 @@ Dynamic: license-file
24
24
 
25
25
  [English](README.en.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
26
26
 
27
- > **稳定版:1.0.0。** 公开接口进入稳定维护,版本与兼容范围见[稳定性约定](docs/stability.md)。
28
- > 自动提炼和复核共用同一条“未来记忆价值”标准:模型综合未来复用、信息增量、再次读取时的直接可用性和忘记成本,只保留对未来理解、判断或行动有实质影响的最小核心;没有明确价值的信息不提炼,不按具体业务场景硬编码排除。
29
- > 提炼先比较旧事项中的编号、目标、进展、责任和期限;补全未知信息也应维护原事项,另建独立待办不能替代项目事实更新。确认重复的记忆在现有处理请求中合并,保留历史与来源;项目和独立任务保持各自生命周期,Core 不按标题强行合并。
30
- > 新请求兼容等价的字段表示;未知执行人保持 `null`,新增或变更负责人和期限需要真实来源;等待条件在正文维护,不再提炼 `waiting_on`。行动及相关字段经过有界语义复核,提炼与复核共用每份工作的最多五次模型请求额度,成功即停止;复核失败不写入。来源时间用于解析相对日期,不补造事实日期。
31
- > 待办 `due_date` 只表示待办动作本身明确声明的截止日;属于待办主题或预期结果的日期不会被误作截止日。项目归属由模型按语义判断,不要求项目名在证据里逐字出现。复核阶段会保留首轮已选定的更新目标,避免“状态变更”被降级成新增记忆。Markdown 仍是唯一事实源。
32
- > **当前版本支持 Hermes 和 Codex。** Antigravity(反重力)不检测、不安装、不配置。
27
+ > **稳定版:1.0.2。** 支持 Hermes 和 Codex;版本与兼容范围见[稳定性约定](docs/stability.md)。
28
+ > **Codex 可通过 `--profile host` 使用当前宿主模型完成记忆闭环,无需另配 Memleaf 模型 API Key。** 本地 Owner 仍需配置客户端身份、读写权限及来源信任;客户端主动调用工具,不代表每轮自动记忆。
29
+ > host profile 支持独立于内容类型的 `actionable` 和结构化 `waiting_on`,每份 work 默认最多三次被接受的 submit;Memleaf 负责确定性校验、落盘与恢复。
30
+ > 默认 `model` profile 和 Hermes 原生接入继续使用独立 Model Route,提炼与语义复核共用每份工作的最多五次模型请求。旧接口、现有记忆和默认入口保留,升级无需正式 Vault 迁移。Antigravity(反重力)当前不支持。
33
31
 
34
32
  ## 项目定位
35
33
 
@@ -46,6 +44,8 @@ memleaf 不会把整个 Vault 或整段历史对话自动塞进模型上下文
46
44
 
47
45
  ## 当前工作流
48
46
 
47
+ 原有 `model` profile / Hermes 原生工作流:
48
+
49
49
  ```text
50
50
  可见的 user/assistant 对话
51
51
  │
@@ -90,6 +90,16 @@ Hermes 使用原生 MemoryProvider 维护生命周期,并通过 MCP 获取 Sco
90
90
 
91
91
  ## 记忆提炼规则
92
92
 
93
+ 以下规则适用于原有 `model` profile / Hermes 原生自动提炼;host profile 的动作、字段与预算见下文 [Codex host 接入](#codex)。
94
+
95
+ 自动提炼和复核共用同一条“未来记忆价值”标准:模型综合未来复用、信息增量、再次读取时的直接可用性和忘记成本,只保留对未来理解、判断或行动有实质影响的最小核心;没有明确价值的信息不提炼,不按具体业务场景硬编码排除。
96
+
97
+ 提炼先比较旧事项中的编号、目标、进展、责任和期限;补全未知信息也应维护原事项,另建独立待办不能替代项目事实更新。确认重复的记忆在现有处理请求中合并,保留历史与来源;项目和独立任务保持各自生命周期,Core 不按标题强行合并。
98
+
99
+ 新请求兼容等价的字段表示;未知执行人保持 `null`,新增或变更负责人和期限需要真实来源;等待条件在正文维护,不再提炼 `waiting_on`。行动及相关字段经过有界语义复核,提炼与复核共用每份工作的最多五次模型请求额度,成功即停止;复核失败不写入。来源时间用于解析相对日期,不补造事实日期。
100
+
101
+ 待办 `due_date` 只表示待办动作本身明确声明的截止日;属于待办主题或预期结果的日期不会被误作截止日。项目归属由模型按语义判断,不要求项目名在证据里逐字出现。复核阶段会保留首轮已选定的更新目标,避免“状态变更”被降级成新增记忆。Markdown 仍是唯一事实源。
102
+
93
103
  **10 秒是自动提炼的性能目标,不是失败阈值。** HTTP 请求遵循 `llm.request_timeout`(默认 120 秒);正常返回且通过 Core 校验的结果不会仅因超过 10 秒而丢弃。模型单次请求、有限修复和逐轮提交保留,耗时与是否完成分别统计。详见 [提炼耗时与超时](docs/extraction-latency.md)。
94
104
 
95
105
  memleaf 不把每句话都保存为记忆。处理一轮完整的 user + assistant 可见文本时,模型先判断是否存在明确的未来复用价值:
@@ -112,7 +122,7 @@ memleaf 不把每句话都保存为记忆。处理一轮完整的 user + assista
112
122
 
113
123
  ## 安装
114
124
 
115
- 要求 Python 3.11+;当前版本支持 Hermes 和 Codex。Hermes 是默认安装目标,Codex 使用明确的独立安装命令。
125
+ 要求 Python 3.11+。Hermes 是默认安装目标;Codex 可明确选择下述 host MCP 接入,或保留原有 model profile 自动提炼接入。
116
126
 
117
127
  ### Windows
118
128
 
@@ -181,6 +191,35 @@ Hermes 显式保存使用 MCP `save_turn`:先绑定本轮并排队,轮次完
181
191
 
182
192
  ### Codex
183
193
 
194
+ #### 复用 Codex 当前模型:host profile
195
+
196
+ 安装包后,由本地 Owner 为客户端创建授权:
197
+
198
+ ```bash
199
+ python -m pip install -U memleaf
200
+ python -m memleaf host-grant --vault /path/to/vault --principal codex --accept-caller-asserted --json
201
+ ```
202
+
203
+ `host-grant` 输出 `mcpServers` 的 `command`/`args` 和本地凭据文件路径,不会自动修改 Codex 配置。凭据用于本地授权,是以 `0600` 创建的文件,不是模型 Key;默认路径为 `<vault>/_state/host_credentials/codex.token`,也可通过 `--credential-file` 指定新路径。已有凭据文件不会被覆盖。
204
+
205
+ 默认读写范围为 `global`;需要其他范围时,在创建授权的命令上重复传入 `--read-scope` 和 `--write-scope`。`--accept-caller-asserted` 表示 Owner 信任该客户端如实提交可见对话,不代表 Memleaf 独立验证了用户决定。省略该选项时,应先通过 Owner 确认来源或使用可靠绑定的来源。维护、永久删除等能力需要各自权限和精确审批,详见 [host-v2 合同](docs/host-v2-contract.md)。
206
+
207
+ 将输出中的实际 Python、Vault 和凭据绝对路径显式注册到 Codex,例如:
208
+
209
+ ```bash
210
+ codex mcp add memleaf-host -- /absolute/path/to/python -m memleaf.mcp_server --vault /path/to/vault --profile host --token-file /path/to/credential.token
211
+ ```
212
+
213
+ 注册后重启或重新连接 Codex MCP。`memleaf-host` 是示例服务名;已有接入应先核对其 profile,避免同时配置两条处理同一来源的路线。Memleaf 不读取或复制 Codex 的模型 Key;推理使用正在运行的宿主模型,并计入该宿主自身的用量。
214
+
215
+ 客户端先调用 `memory_capabilities`,再以 `prepare_memory → memory_work(按需分页 sources/targets)→ submit_memory` 完成保存,仅在保存项的 receipt 中 `applied=true` 且 `settled=true` 时确认已保存。部分成功后只在同一 work 内修正未完成项;I/O 中断用 `resume_memory` 恢复。后续会话使用 `search → read` 读取正式 Markdown。host profile 允许项目等非 `todo` 内容携带行动属性,`assignee` 与 `waiting_on` 分别表示执行人和依赖方;未知事实保持未知,变化字段需来源依据。
216
+
217
+ 每份 work 默认最多三次被接受的 submit,错误提案也可能消耗预算;这不是三次模型 API 请求额度。换 request ID、连接或重交同一来源不会重置预算。host profile 提供七个 v2 工具、`capture` 和查询工具;客户端需要主动执行闭环,旧 Model Route Hook 不会自动替它处理每轮记忆。
218
+
219
+ #### 原有自动提炼接入:model profile
220
+
221
+ 以下安装与 Hook 流程继续使用独立 Memleaf Model Route:
222
+
184
223
  先安装或升级 memleaf,再明确选择 Codex:
185
224
 
186
225
  ```bash
@@ -191,7 +230,7 @@ python -m pip install -U memleaf && python -m memleaf install --host codex
191
230
 
192
231
  安装后打开 Codex,运行 `/hooks`,审核并信任 memleaf Hook。完成授权前,MCP 可用不等于自动捕获、检索门控和提炼已经激活;安装结果会明确显示 `pending_user_review`,不会把待审核状态报告为已启用。
193
232
 
194
- Codex 只作为宿主,不作为 memleaf 的提炼模型来源。已有的独立 memleaf Model Route 会继续复用;如果当前 Vault 还没有完整 Model Route,Codex 安装仍可完成 MCP/Hook 配置,但结果会明确返回 `processing_status=model_route_required`,在配置模型前不能把“自动记忆提炼”视为已就绪。memleaf 不读取、不复制也不修改 Codex 的 `model`、`model_provider`、`base_url` 或认证信息,也不会为了提炼偷偷消耗 Codex 会话额度。Codex-only 用户可针对同一个 Vault 运行:
233
+ 在这条原有 model 路线中,Codex 只作为宿主,不作为 memleaf 的提炼模型来源。已有的独立 memleaf Model Route 会继续复用;如果当前 Vault 还没有完整 Model Route,Codex 安装仍可完成 MCP/Hook 配置,但结果会明确返回 `processing_status=model_route_required`,在配置模型前不能把“自动记忆提炼”视为已就绪。memleaf 不读取、不复制也不修改 Codex 的 `model`、`model_provider`、`base_url` 或认证信息,也不会为了提炼偷偷消耗 Codex 会话额度。Codex-only 用户可针对同一个 Vault 运行:
195
234
 
196
235
  ```bash
197
236
  python -m memleaf init --no-hermes --vault /path/to/the/same/vault
@@ -224,9 +263,9 @@ memleaf init --no-model-discovery
224
263
  memleaf init --json
225
264
  ```
226
265
 
227
- `init` 下的 `--no-codex` 和 `--no-antigravity` 为兼容保留的无操作参数;Codex 必须通过 `install --host codex` 明确安装。宿主配置只会在检测证据可靠、结构可识别且没有冲突时修改;修改前会创建备份,未知或冲突配置保持不变。
266
+ `init` 下的 `--no-codex` 和 `--no-antigravity` 为兼容保留的无操作参数;原有 model profile 的 Codex 接入使用 `install --host codex`;host profile 使用上面的显式 MCP 注册。宿主配置只会在检测证据可靠、结构可识别且没有冲突时修改;修改前会创建备份,未知或冲突配置保持不变。
228
267
 
229
- ## Codex 使用方式
268
+ ## Codex 原有 model profile 使用方式
230
269
 
231
270
  - `UserPromptSubmit` 只注入有界 Scope Map 和当前轮次的检索协议,不注入记忆标题或正文;
232
271
  - `PreToolUse` / `PostToolUse` 将 memleaf `search` 和 `read` 绑定到当前 `retrieval_id`,记录真实检索结果与读取预算;
@@ -236,7 +275,7 @@ memleaf init --json
236
275
 
237
276
  Codex Hook 必须经过用户审核和信任。若 Hook 未激活、被禁用或 Codex 版本不支持对应生命周期事件,自动捕获和自动提炼不会生效;MCP 主动工具与 Hook 生命周期是两个独立状态。
238
277
 
239
- ## Hermes 使用方式
278
+ ## Hermes 原生接入使用方式
240
279
 
241
280
  Hermes 的原生 Provider 和 MCP Server 是两个不同入口,但共用同一个 `$HOME/.memleaf`:
242
281
 
@@ -272,7 +311,7 @@ python -m memleaf.mcp_server --vault "$HOME/.memleaf"
272
311
 
273
312
  不传 `--vault` 时默认使用 `~/.memleaf`;也可以设置 `MEMLEAF_VAULT`。正常情况下不需要手工常驻,Hermes 或 Codex 会按需启动它。stdout 只输出 JSON-RPC,日志不会污染协议通道。
274
313
 
275
- 当前提供以下工具:
314
+ 未传 `--profile` 时使用兼容保留的 `model` profile,其工具如下;host profile 的工具和授权流程见上文。
276
315
 
277
316
  | 工具 | 用途 |
278
317
  | --- | --- |
@@ -358,7 +397,7 @@ python -m memleaf.mcp_server --vault /path/to/your/vault \
358
397
  < examples/mcp_stdio.ndjson
359
398
  ```
360
399
 
361
- ## 模型路由
400
+ ## 原有 model profile 的模型路由
362
401
 
363
402
  捕获、索引、目录检索和读取可离线运行;`process()`、`remember()` 和 `compact()` 需要可用的模型能力。
364
403
 
@@ -492,12 +531,12 @@ python -m build --wheel --sdist
492
531
 
493
532
  以下内容不应被 README 或安装结果误解为已交付能力:
494
533
 
495
- - Windows、macOS 和 Linux 都提供 Hermes 安装入口;Codex 通过 `memleaf install --host codex` 明确接入;源码 `install.sh` 仅保留给开发、离线源码安装和故障排查;
534
+ - Windows、macOS 和 Linux 都提供 Hermes 安装入口;Codex 明确选择 host MCP 或 `memleaf install --host codex` 原有 model 接入;源码 `install.sh` 仅保留给开发、离线源码安装和故障排查;
496
535
  - 当前支持 Hermes 和 Codex;Antigravity(反重力)不检测、不安装、不配置;
497
536
  - Codex 生命周期 Hook 需要用户在 `/hooks` 中审核并信任,安装程序不能代替用户完成授权;
498
537
  - Hermes 的检索门控是 Soft Gate,不保证阻止所有未检索回答;
499
- - 没有模型路由时只能捕获和检索,不能完成自动提炼、显式记忆或压缩;
500
- - 真实宿主长期运行效果仍取决于本机 Agent 版本、配置、重启和模型可用性;
538
+ - 原有 model profile / Hermes 原生处理需要 Model Route;host profile 无需独立模型 Key,但仍需 Owner 授权和可接受来源,并由宿主主动执行记忆闭环;
539
+ - 1.0.1 在 macOS 实机验证了 Codex CLI 与 Hermes CLI 的基础 host 行为,以及 Codex 的高级维护行为;该证据不代表所有模型、所有 MCP 客户端或 Windows 真实模型验收;真实宿主长期效果仍取决于本机版本、配置和模型可用性;
501
540
  - 不提供 Obsidian 插件、Web 管理界面、云同步或透明加密层;
502
541
  - 普通只读检索不会触发保留策略写入;历史淘汰和关闭待办退休只在正常处理/维护生命周期中执行。
503
542
 
@@ -4,12 +4,10 @@
4
4
 
5
5
  [中文](README.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
6
6
 
7
- > **Stable release: 1.0.0.** Public interfaces enter stable maintenance; see the [stability policy](docs/stability.md) for versioning and compatibility scope.
8
- > Automatic extraction and review share one future-value standard: the model weighs likely reuse, information gain, direct usability when read again, and the cost of forgetting. It keeps only the smallest core that can materially help future understanding, decisions, or actions; information without clear value is not extracted, and no business-specific exclusion rule is hard-coded.
9
- > Extraction compares existing identifiers, objectives, progress, responsibility and deadlines first. Filling an unknown also maintains the original item; a separate task does not replace updating shared project facts. Confirmed duplicates can be merged in the existing processing requests with their sources and history preserved. Independent project and task lifecycles remain separate; Core does not merge matching titles.
10
- > New requests accept equivalent field representations. Unknown executors remain `null`; new or changed responsibility and deadlines require actual source evidence. Dependencies belong in the body; `waiting_on` is no longer extracted. Proposed actions and related fields undergo bounded semantic verification within a shared five-request limit per work item, stopping on success; failed verification blocks writes. Source time resolves relative dates without inventing factual dates.
11
- > A todo's `due_date` means only the explicit deadline of the todo action; dates describing its subject or desired outcome are not deadlines. Project ownership remains the model's semantic judgement and needs no literal name match. The review stage now keeps the update target chosen by the first pass, so a state change is no longer downgraded into a new memory. Markdown remains the sole source of truth.
12
- > **The current release supports Hermes and Codex.** Antigravity is not detected, installed, or configured.
7
+ > **Stable release: 1.0.2.** Hermes and Codex are supported; see the [stability policy](docs/stability.md) for compatibility scope.
8
+ > **Codex can complete the memory workflow with its current host model through `--profile host`, without a separate Memleaf model API key.** A local Owner still configures client identity, permissions and source trust. Clients invoke the tools deliberately; this does not enable automatic memory on every turn.
9
+ > The host profile supports `actionable` independently of content type and structured `waiting_on`, with at most three accepted submits per work by default. Memleaf validates, persists and recovers deterministically.
10
+ > The default `model` profile and native Hermes integration retain their independent Model Route and shared five-request extraction/review budget. Existing interfaces, memories and default entry points remain; no formal Vault migration is required. Antigravity is not supported.
13
11
 
14
12
  ## Project scope
15
13
 
@@ -26,6 +24,8 @@ memleaf does not automatically put the entire Vault or a whole conversation hist
26
24
 
27
25
  ## Current workflow
28
26
 
27
+ Original `model` profile / native Hermes workflow:
28
+
29
29
  ```text
30
30
  Visible user/assistant conversation
31
31
  │
@@ -67,6 +67,16 @@ Hermes uses a native MemoryProvider for lifecycle handling and obtains the Scope
67
67
 
68
68
  ## Memory admission and maintenance
69
69
 
70
+ The following rules apply to the original `model` profile and native Hermes automatic processing. See [Codex host setup](#codex) below for host actions, fields and budgets.
71
+
72
+ Automatic extraction and review share one future-value standard: the model weighs likely reuse, information gain, direct usability when read again, and the cost of forgetting. It keeps only the smallest core that can materially help future understanding, decisions, or actions; information without clear value is not extracted, and no business-specific exclusion rule is hard-coded.
73
+
74
+ Extraction compares existing identifiers, objectives, progress, responsibility and deadlines first. Filling an unknown also maintains the original item; a separate task does not replace updating shared project facts. Confirmed duplicates can be merged in the existing processing requests with their sources and history preserved. Independent project and task lifecycles remain separate; Core does not merge matching titles.
75
+
76
+ New requests accept equivalent field representations. Unknown executors remain `null`; new or changed responsibility and deadlines require actual source evidence. Dependencies belong in the body; `waiting_on` is no longer extracted. Proposed actions and related fields undergo bounded semantic verification within a shared five-request limit per work item, stopping on success; failed verification blocks writes. Source time resolves relative dates without inventing factual dates.
77
+
78
+ A todo's `due_date` means only the explicit deadline of the todo action; dates describing its subject or desired outcome are not deadlines. Project ownership remains the model's semantic judgement and needs no literal name match. The review stage now keeps the update target chosen by the first pass, so a state change is no longer downgraded into a new memory. Markdown remains the sole source of truth.
79
+
70
80
  **Ten seconds is an extraction performance target, not a failure deadline.** HTTP requests honor `llm.request_timeout` (120 seconds by default). A valid, Core-checked response is not discarded just because processing exceeds ten seconds. Single-pass planning, bounded repair and per-turn commits remain; completion and latency are measured separately. See [extraction latency and timeouts](docs/extraction-latency.md).
71
81
 
72
82
  memleaf does not save every sentence. When a complete visible user + assistant turn is processed, the model first evaluates whether it has concrete future reuse value:
@@ -92,7 +102,7 @@ For current todos, all unfinished work, urgent items, or work due in a date rang
92
102
 
93
103
  ## Installation
94
104
 
95
- Python 3.11+ is required. The current release supports Hermes and Codex. Hermes is the default install target; Codex uses an explicit, separate install command.
105
+ Python 3.11+ is required. Hermes is the default install target. For Codex, explicitly select the host MCP setup below or retain the original model profile with automatic processing.
96
106
 
97
107
  ### Windows
98
108
 
@@ -161,6 +171,35 @@ The repository `install.sh` remains for source development, offline source insta
161
171
 
162
172
  ### Codex
163
173
 
174
+ #### Reuse the current Codex model: host profile
175
+
176
+ Install the package, then have the local Owner authorize the client:
177
+
178
+ ```bash
179
+ python -m pip install -U memleaf
180
+ python -m memleaf host-grant --vault /path/to/vault --principal codex --accept-caller-asserted --json
181
+ ```
182
+
183
+ `host-grant` returns the `mcpServers` command/arguments and a local credential file path; it does not automatically change Codex configuration. The credential binds local authorization, is created with mode `0600`, and is not a model key. Its default path is `<vault>/_state/host_credentials/codex.token`; `--credential-file` can select a new path. Existing credential files are preserved.
184
+
185
+ Read/write scopes default to `global`. Repeat `--read-scope` and `--write-scope` in the grant command for other scopes. `--accept-caller-asserted` means the Owner trusts the client to report visible conversation accurately; it does not independently verify a user decision. Without that option, use Owner-confirmed or reliably bound sources. Maintenance and permanent deletion require their respective permissions and exact approvals; see the [host-v2 contract](docs/host-v2-contract.md).
186
+
187
+ Explicitly register the actual Python, Vault and credential absolute paths from the output with Codex, for example:
188
+
189
+ ```bash
190
+ codex mcp add memleaf-host -- /absolute/path/to/python -m memleaf.mcp_server --vault /path/to/vault --profile host --token-file /path/to/credential.token
191
+ ```
192
+
193
+ Restart or reconnect Codex MCP after registration. `memleaf-host` is an example server name; check the profile of any existing connection before configuring two routes to process the same sources. Memleaf does not read or copy Codex model keys. Reasoning uses the running host model and counts toward that host's usage.
194
+
195
+ Call `memory_capabilities`, then run `prepare_memory → memory_work` (page sources/targets as needed) `→ submit_memory`. Confirm a save only when its receipt has `applied=true` and `settled=true`. Repair only unresolved items in the same work after partial success; use `resume_memory` for interrupted I/O. Later sessions retrieve the committed Markdown with `search → read`. Non-`todo` content, including projects, can carry action fields; `assignee` identifies the executor and `waiting_on` the dependency. Unknown facts remain unknown and field changes require source evidence.
196
+
197
+ Each work permits at most three accepted submits by default; invalid proposals can consume an attempt. This is not a three-call model API budget. Changing the request ID or connection, or replaying the same sources, does not reset it. The host profile exposes seven v2 tools, `capture` and query tools. Clients invoke the workflow deliberately; existing Model Route hooks do not automatically process every turn through this profile.
198
+
199
+ #### Original automatic processing: model profile
200
+
201
+ The following installer and hook flow retains the independent Memleaf Model Route:
202
+
164
203
  Install or upgrade memleaf, then explicitly select Codex:
165
204
 
166
205
  ```bash
@@ -171,7 +210,7 @@ This command reuses the one Vault already configured for Hermes or Codex, or cre
171
210
 
172
211
  After installation, open Codex, run `/hooks`, and review and trust the memleaf hooks. Until that approval is complete, an available MCP server does not mean that automatic capture, retrieval gating, and processing are active. The installer reports `pending_user_review` instead of claiming that unreviewed hooks are enabled.
173
212
 
174
- Codex is a host, not memleaf's extraction-model source. An existing independent memleaf Model Route is reused. If the selected Vault has no complete Model Route yet, Codex MCP/hooks can still be configured, but installation explicitly returns `processing_status=model_route_required`; automatic memory extraction is not ready until that route is configured. memleaf does not read, copy, or modify Codex `model`, `model_provider`, `base_url`, or credentials, and it does not silently spend Codex session quota for extraction. A Codex-only user can configure the same Vault with:
213
+ In this original model route, Codex is a host, not memleaf's extraction-model source. An existing independent memleaf Model Route is reused. If the selected Vault has no complete Model Route yet, Codex MCP/hooks can still be configured, but installation explicitly returns `processing_status=model_route_required`; automatic memory extraction is not ready until that route is configured. memleaf does not read, copy, or modify Codex `model`, `model_provider`, `base_url`, or credentials, and it does not silently spend Codex session quota for extraction. A Codex-only user can configure the same Vault with:
175
214
 
176
215
  ```bash
177
216
  python -m memleaf init --no-hermes --vault /path/to/the/same/vault
@@ -204,9 +243,9 @@ memleaf init --no-model-discovery
204
243
  memleaf init --json
205
244
  ```
206
245
 
207
- Under `init`, `--no-codex` and `--no-antigravity` remain compatibility no-ops; Codex must be installed explicitly with `install --host codex`. Host configuration is changed only when detection evidence is reliable, the structure is understood, and there is no conflict. Backups are created before changes; unknown or conflicting configuration is left unchanged.
246
+ Under `init`, `--no-codex` and `--no-antigravity` remain compatibility no-ops. The original model profile uses `install --host codex`; the host profile uses the explicit MCP registration above. Host configuration is changed only when detection evidence is reliable, the structure is understood, and there is no conflict. Backups are created before changes; unknown or conflicting configuration is left unchanged.
208
247
 
209
- ## Codex integration
248
+ ## Original Codex model profile integration
210
249
 
211
250
  - `UserPromptSubmit` injects only a bounded Scope Map and the current-turn retrieval protocol, never memory titles or bodies.
212
251
  - `PreToolUse` / `PostToolUse` bind memleaf `search` and `read` to the current `retrieval_id` and record the real search result and read budget.
@@ -216,7 +255,7 @@ Under `init`, `--no-codex` and `--no-antigravity` remain compatibility no-ops; C
216
255
 
217
256
  Codex hooks require user review and trust. If the hooks are pending, disabled, or unsupported by the installed Codex version, automatic capture and processing are inactive; MCP tool availability and hook lifecycle activation are separate states.
218
257
 
219
- ## Hermes integration
258
+ ## Native Hermes integration
220
259
 
221
260
  Hermes' native Provider and the MCP server are separate entry points, but they share the same `$HOME/.memleaf` Vault:
222
261
 
@@ -252,7 +291,7 @@ python -m memleaf.mcp_server --vault "$HOME/.memleaf"
252
291
 
253
292
  Without `--vault`, the server uses `~/.memleaf`; `MEMLEAF_VAULT` can also specify the Vault. In normal use the server does not need to be kept running manually: Hermes or Codex starts it on demand. stdout contains only JSON-RPC messages so logs do not corrupt the protocol stream.
254
293
 
255
- The server exposes the following tools:
294
+ Without `--profile`, the server retains the original `model` profile and the tools below. See the host setup above for its tools and authorization flow.
256
295
 
257
296
  | Tool | Purpose |
258
297
  | --- | --- |
@@ -339,7 +378,7 @@ python -m memleaf.mcp_server --vault /path/to/your/vault \
339
378
  < examples/mcp_stdio.ndjson
340
379
  ```
341
380
 
342
- ## Model routing
381
+ ## Original model profile routing
343
382
 
344
383
  Capture, indexing, directory retrieval, and reading work offline. `process()`, `remember()`, and `compact()` require a usable model route.
345
384
 
@@ -471,12 +510,12 @@ python -m build --wheel --sdist
471
510
 
472
511
  The following should not be interpreted as delivered capabilities:
473
512
 
474
- - Windows, macOS, and Linux provide a Hermes installation entry point; Codex is explicitly configured with `memleaf install --host codex`. The source `install.sh` remains only for development, offline source installation, and troubleshooting.
513
+ - Windows, macOS, and Linux provide a Hermes installation entry point; Codex explicitly selects host MCP or the original model setup with `memleaf install --host codex`. The source `install.sh` remains only for development, offline source installation, and troubleshooting.
475
514
  - The current release supports Hermes and Codex. Antigravity is not detected, installed, or configured.
476
515
  - Codex lifecycle hooks require user review and trust through `/hooks`; the installer cannot approve them on the user's behalf.
477
516
  - Hermes retrieval gating is a Soft Gate and does not guarantee that every answer performed retrieval.
478
- - Without a model route, memleaf can capture and retrieve but cannot perform automatic extraction, explicit model-backed memory, or compaction.
479
- - Long-running real-host behavior still depends on the local Agent version, configuration, restart, and model availability.
517
+ - The original model profile and native Hermes processing require a Model Route. The host profile requires no independent model key, but still needs Owner authorization, acceptable sources and deliberate execution by the host.
518
+ - On macOS, 1.0.1 has live Codex CLI and Hermes CLI evidence for basic host behavior, plus advanced Codex maintenance behavior. This does not establish support for every model or MCP client, or live Windows model acceptance. Long-running behavior still depends on local versions, configuration and model availability.
480
519
  - There is no Obsidian plugin, web management UI, cloud sync, or transparent encryption layer.
481
520
  - Routine read-only retrieval never performs retention writes; history pruning and closed-todo retirement run only during normal processing/maintenance lifecycle calls.
482
521
 
@@ -4,12 +4,10 @@
4
4
 
5
5
  [English](README.en.md) · [PyPI](https://pypi.org/project/memleaf/) · [GitHub](https://github.com/miffyblueboo/memleaf)
6
6
 
7
- > **稳定版:1.0.0。** 公开接口进入稳定维护,版本与兼容范围见[稳定性约定](docs/stability.md)。
8
- > 自动提炼和复核共用同一条“未来记忆价值”标准:模型综合未来复用、信息增量、再次读取时的直接可用性和忘记成本,只保留对未来理解、判断或行动有实质影响的最小核心;没有明确价值的信息不提炼,不按具体业务场景硬编码排除。
9
- > 提炼先比较旧事项中的编号、目标、进展、责任和期限;补全未知信息也应维护原事项,另建独立待办不能替代项目事实更新。确认重复的记忆在现有处理请求中合并,保留历史与来源;项目和独立任务保持各自生命周期,Core 不按标题强行合并。
10
- > 新请求兼容等价的字段表示;未知执行人保持 `null`,新增或变更负责人和期限需要真实来源;等待条件在正文维护,不再提炼 `waiting_on`。行动及相关字段经过有界语义复核,提炼与复核共用每份工作的最多五次模型请求额度,成功即停止;复核失败不写入。来源时间用于解析相对日期,不补造事实日期。
11
- > 待办 `due_date` 只表示待办动作本身明确声明的截止日;属于待办主题或预期结果的日期不会被误作截止日。项目归属由模型按语义判断,不要求项目名在证据里逐字出现。复核阶段会保留首轮已选定的更新目标,避免“状态变更”被降级成新增记忆。Markdown 仍是唯一事实源。
12
- > **当前版本支持 Hermes 和 Codex。** Antigravity(反重力)不检测、不安装、不配置。
7
+ > **稳定版:1.0.2。** 支持 Hermes 和 Codex;版本与兼容范围见[稳定性约定](docs/stability.md)。
8
+ > **Codex 可通过 `--profile host` 使用当前宿主模型完成记忆闭环,无需另配 Memleaf 模型 API Key。** 本地 Owner 仍需配置客户端身份、读写权限及来源信任;客户端主动调用工具,不代表每轮自动记忆。
9
+ > host profile 支持独立于内容类型的 `actionable` 和结构化 `waiting_on`,每份 work 默认最多三次被接受的 submit;Memleaf 负责确定性校验、落盘与恢复。
10
+ > 默认 `model` profile 和 Hermes 原生接入继续使用独立 Model Route,提炼与语义复核共用每份工作的最多五次模型请求。旧接口、现有记忆和默认入口保留,升级无需正式 Vault 迁移。Antigravity(反重力)当前不支持。
13
11
 
14
12
  ## 项目定位
15
13
 
@@ -26,6 +24,8 @@ memleaf 不会把整个 Vault 或整段历史对话自动塞进模型上下文
26
24
 
27
25
  ## 当前工作流
28
26
 
27
+ 原有 `model` profile / Hermes 原生工作流:
28
+
29
29
  ```text
30
30
  可见的 user/assistant 对话
31
31
  │
@@ -70,6 +70,16 @@ Hermes 使用原生 MemoryProvider 维护生命周期,并通过 MCP 获取 Sco
70
70
 
71
71
  ## 记忆提炼规则
72
72
 
73
+ 以下规则适用于原有 `model` profile / Hermes 原生自动提炼;host profile 的动作、字段与预算见下文 [Codex host 接入](#codex)。
74
+
75
+ 自动提炼和复核共用同一条“未来记忆价值”标准:模型综合未来复用、信息增量、再次读取时的直接可用性和忘记成本,只保留对未来理解、判断或行动有实质影响的最小核心;没有明确价值的信息不提炼,不按具体业务场景硬编码排除。
76
+
77
+ 提炼先比较旧事项中的编号、目标、进展、责任和期限;补全未知信息也应维护原事项,另建独立待办不能替代项目事实更新。确认重复的记忆在现有处理请求中合并,保留历史与来源;项目和独立任务保持各自生命周期,Core 不按标题强行合并。
78
+
79
+ 新请求兼容等价的字段表示;未知执行人保持 `null`,新增或变更负责人和期限需要真实来源;等待条件在正文维护,不再提炼 `waiting_on`。行动及相关字段经过有界语义复核,提炼与复核共用每份工作的最多五次模型请求额度,成功即停止;复核失败不写入。来源时间用于解析相对日期,不补造事实日期。
80
+
81
+ 待办 `due_date` 只表示待办动作本身明确声明的截止日;属于待办主题或预期结果的日期不会被误作截止日。项目归属由模型按语义判断,不要求项目名在证据里逐字出现。复核阶段会保留首轮已选定的更新目标,避免“状态变更”被降级成新增记忆。Markdown 仍是唯一事实源。
82
+
73
83
  **10 秒是自动提炼的性能目标,不是失败阈值。** HTTP 请求遵循 `llm.request_timeout`(默认 120 秒);正常返回且通过 Core 校验的结果不会仅因超过 10 秒而丢弃。模型单次请求、有限修复和逐轮提交保留,耗时与是否完成分别统计。详见 [提炼耗时与超时](docs/extraction-latency.md)。
74
84
 
75
85
  memleaf 不把每句话都保存为记忆。处理一轮完整的 user + assistant 可见文本时,模型先判断是否存在明确的未来复用价值:
@@ -92,7 +102,7 @@ memleaf 不把每句话都保存为记忆。处理一轮完整的 user + assista
92
102
 
93
103
  ## 安装
94
104
 
95
- 要求 Python 3.11+;当前版本支持 Hermes 和 Codex。Hermes 是默认安装目标,Codex 使用明确的独立安装命令。
105
+ 要求 Python 3.11+。Hermes 是默认安装目标;Codex 可明确选择下述 host MCP 接入,或保留原有 model profile 自动提炼接入。
96
106
 
97
107
  ### Windows
98
108
 
@@ -161,6 +171,35 @@ Hermes 显式保存使用 MCP `save_turn`:先绑定本轮并排队,轮次完
161
171
 
162
172
  ### Codex
163
173
 
174
+ #### 复用 Codex 当前模型:host profile
175
+
176
+ 安装包后,由本地 Owner 为客户端创建授权:
177
+
178
+ ```bash
179
+ python -m pip install -U memleaf
180
+ python -m memleaf host-grant --vault /path/to/vault --principal codex --accept-caller-asserted --json
181
+ ```
182
+
183
+ `host-grant` 输出 `mcpServers` 的 `command`/`args` 和本地凭据文件路径,不会自动修改 Codex 配置。凭据用于本地授权,是以 `0600` 创建的文件,不是模型 Key;默认路径为 `<vault>/_state/host_credentials/codex.token`,也可通过 `--credential-file` 指定新路径。已有凭据文件不会被覆盖。
184
+
185
+ 默认读写范围为 `global`;需要其他范围时,在创建授权的命令上重复传入 `--read-scope` 和 `--write-scope`。`--accept-caller-asserted` 表示 Owner 信任该客户端如实提交可见对话,不代表 Memleaf 独立验证了用户决定。省略该选项时,应先通过 Owner 确认来源或使用可靠绑定的来源。维护、永久删除等能力需要各自权限和精确审批,详见 [host-v2 合同](docs/host-v2-contract.md)。
186
+
187
+ 将输出中的实际 Python、Vault 和凭据绝对路径显式注册到 Codex,例如:
188
+
189
+ ```bash
190
+ codex mcp add memleaf-host -- /absolute/path/to/python -m memleaf.mcp_server --vault /path/to/vault --profile host --token-file /path/to/credential.token
191
+ ```
192
+
193
+ 注册后重启或重新连接 Codex MCP。`memleaf-host` 是示例服务名;已有接入应先核对其 profile,避免同时配置两条处理同一来源的路线。Memleaf 不读取或复制 Codex 的模型 Key;推理使用正在运行的宿主模型,并计入该宿主自身的用量。
194
+
195
+ 客户端先调用 `memory_capabilities`,再以 `prepare_memory → memory_work(按需分页 sources/targets)→ submit_memory` 完成保存,仅在保存项的 receipt 中 `applied=true` 且 `settled=true` 时确认已保存。部分成功后只在同一 work 内修正未完成项;I/O 中断用 `resume_memory` 恢复。后续会话使用 `search → read` 读取正式 Markdown。host profile 允许项目等非 `todo` 内容携带行动属性,`assignee` 与 `waiting_on` 分别表示执行人和依赖方;未知事实保持未知,变化字段需来源依据。
196
+
197
+ 每份 work 默认最多三次被接受的 submit,错误提案也可能消耗预算;这不是三次模型 API 请求额度。换 request ID、连接或重交同一来源不会重置预算。host profile 提供七个 v2 工具、`capture` 和查询工具;客户端需要主动执行闭环,旧 Model Route Hook 不会自动替它处理每轮记忆。
198
+
199
+ #### 原有自动提炼接入:model profile
200
+
201
+ 以下安装与 Hook 流程继续使用独立 Memleaf Model Route:
202
+
164
203
  先安装或升级 memleaf,再明确选择 Codex:
165
204
 
166
205
  ```bash
@@ -171,7 +210,7 @@ python -m pip install -U memleaf && python -m memleaf install --host codex
171
210
 
172
211
  安装后打开 Codex,运行 `/hooks`,审核并信任 memleaf Hook。完成授权前,MCP 可用不等于自动捕获、检索门控和提炼已经激活;安装结果会明确显示 `pending_user_review`,不会把待审核状态报告为已启用。
173
212
 
174
- Codex 只作为宿主,不作为 memleaf 的提炼模型来源。已有的独立 memleaf Model Route 会继续复用;如果当前 Vault 还没有完整 Model Route,Codex 安装仍可完成 MCP/Hook 配置,但结果会明确返回 `processing_status=model_route_required`,在配置模型前不能把“自动记忆提炼”视为已就绪。memleaf 不读取、不复制也不修改 Codex 的 `model`、`model_provider`、`base_url` 或认证信息,也不会为了提炼偷偷消耗 Codex 会话额度。Codex-only 用户可针对同一个 Vault 运行:
213
+ 在这条原有 model 路线中,Codex 只作为宿主,不作为 memleaf 的提炼模型来源。已有的独立 memleaf Model Route 会继续复用;如果当前 Vault 还没有完整 Model Route,Codex 安装仍可完成 MCP/Hook 配置,但结果会明确返回 `processing_status=model_route_required`,在配置模型前不能把“自动记忆提炼”视为已就绪。memleaf 不读取、不复制也不修改 Codex 的 `model`、`model_provider`、`base_url` 或认证信息,也不会为了提炼偷偷消耗 Codex 会话额度。Codex-only 用户可针对同一个 Vault 运行:
175
214
 
176
215
  ```bash
177
216
  python -m memleaf init --no-hermes --vault /path/to/the/same/vault
@@ -204,9 +243,9 @@ memleaf init --no-model-discovery
204
243
  memleaf init --json
205
244
  ```
206
245
 
207
- `init` 下的 `--no-codex` 和 `--no-antigravity` 为兼容保留的无操作参数;Codex 必须通过 `install --host codex` 明确安装。宿主配置只会在检测证据可靠、结构可识别且没有冲突时修改;修改前会创建备份,未知或冲突配置保持不变。
246
+ `init` 下的 `--no-codex` 和 `--no-antigravity` 为兼容保留的无操作参数;原有 model profile 的 Codex 接入使用 `install --host codex`;host profile 使用上面的显式 MCP 注册。宿主配置只会在检测证据可靠、结构可识别且没有冲突时修改;修改前会创建备份,未知或冲突配置保持不变。
208
247
 
209
- ## Codex 使用方式
248
+ ## Codex 原有 model profile 使用方式
210
249
 
211
250
  - `UserPromptSubmit` 只注入有界 Scope Map 和当前轮次的检索协议,不注入记忆标题或正文;
212
251
  - `PreToolUse` / `PostToolUse` 将 memleaf `search` 和 `read` 绑定到当前 `retrieval_id`,记录真实检索结果与读取预算;
@@ -216,7 +255,7 @@ memleaf init --json
216
255
 
217
256
  Codex Hook 必须经过用户审核和信任。若 Hook 未激活、被禁用或 Codex 版本不支持对应生命周期事件,自动捕获和自动提炼不会生效;MCP 主动工具与 Hook 生命周期是两个独立状态。
218
257
 
219
- ## Hermes 使用方式
258
+ ## Hermes 原生接入使用方式
220
259
 
221
260
  Hermes 的原生 Provider 和 MCP Server 是两个不同入口,但共用同一个 `$HOME/.memleaf`:
222
261
 
@@ -252,7 +291,7 @@ python -m memleaf.mcp_server --vault "$HOME/.memleaf"
252
291
 
253
292
  不传 `--vault` 时默认使用 `~/.memleaf`;也可以设置 `MEMLEAF_VAULT`。正常情况下不需要手工常驻,Hermes 或 Codex 会按需启动它。stdout 只输出 JSON-RPC,日志不会污染协议通道。
254
293
 
255
- 当前提供以下工具:
294
+ 未传 `--profile` 时使用兼容保留的 `model` profile,其工具如下;host profile 的工具和授权流程见上文。
256
295
 
257
296
  | 工具 | 用途 |
258
297
  | --- | --- |
@@ -338,7 +377,7 @@ python -m memleaf.mcp_server --vault /path/to/your/vault \
338
377
  < examples/mcp_stdio.ndjson
339
378
  ```
340
379
 
341
- ## 模型路由
380
+ ## 原有 model profile 的模型路由
342
381
 
343
382
  捕获、索引、目录检索和读取可离线运行;`process()`、`remember()` 和 `compact()` 需要可用的模型能力。
344
383
 
@@ -472,12 +511,12 @@ python -m build --wheel --sdist
472
511
 
473
512
  以下内容不应被 README 或安装结果误解为已交付能力:
474
513
 
475
- - Windows、macOS 和 Linux 都提供 Hermes 安装入口;Codex 通过 `memleaf install --host codex` 明确接入;源码 `install.sh` 仅保留给开发、离线源码安装和故障排查;
514
+ - Windows、macOS 和 Linux 都提供 Hermes 安装入口;Codex 明确选择 host MCP 或 `memleaf install --host codex` 原有 model 接入;源码 `install.sh` 仅保留给开发、离线源码安装和故障排查;
476
515
  - 当前支持 Hermes 和 Codex;Antigravity(反重力)不检测、不安装、不配置;
477
516
  - Codex 生命周期 Hook 需要用户在 `/hooks` 中审核并信任,安装程序不能代替用户完成授权;
478
517
  - Hermes 的检索门控是 Soft Gate,不保证阻止所有未检索回答;
479
- - 没有模型路由时只能捕获和检索,不能完成自动提炼、显式记忆或压缩;
480
- - 真实宿主长期运行效果仍取决于本机 Agent 版本、配置、重启和模型可用性;
518
+ - 原有 model profile / Hermes 原生处理需要 Model Route;host profile 无需独立模型 Key,但仍需 Owner 授权和可接受来源,并由宿主主动执行记忆闭环;
519
+ - 1.0.1 在 macOS 实机验证了 Codex CLI 与 Hermes CLI 的基础 host 行为,以及 Codex 的高级维护行为;该证据不代表所有模型、所有 MCP 客户端或 Windows 真实模型验收;真实宿主长期效果仍取决于本机版本、配置和模型可用性;
481
520
  - 不提供 Obsidian 插件、Web 管理界面、云同步或透明加密层;
482
521
  - 普通只读检索不会触发保留策略写入;历史淘汰和关闭待办退休只在正常处理/维护生命周期中执行。
483
522