bantamkit 0.36.0__tar.gz → 0.37.0b2__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 (280) hide show
  1. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/PKG-INFO +8 -7
  2. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/README.md +7 -6
  3. bantamkit-0.37.0b2/_assets/skills/memory-queries.md +12 -0
  4. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/skills/memory.md +7 -0
  5. bantamkit-0.37.0b2/_assets/tools/memory_queries.json +58 -0
  6. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/memory_recall.json +11 -4
  7. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/memory_save.json +14 -0
  8. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_status.json +4 -0
  9. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/__init__.py +1 -1
  10. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/eventlog.py +31 -13
  11. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/hookadapter.py +352 -45
  12. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/hostinstall.py +15 -0
  13. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/mcpserver.py +96 -7
  14. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/__main__.py +1 -1
  15. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/component.py +645 -80
  16. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/divergence.py +3 -2
  17. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/dream.py +19 -0
  18. bantamkit-0.37.0b2/src/bantamkit/memory/native.py +209 -0
  19. bantamkit-0.37.0b2/src/bantamkit/memory/queries.py +248 -0
  20. bantamkit-0.37.0b2/src/bantamkit/memory/retrieval.py +476 -0
  21. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/store.py +834 -84
  22. bantamkit-0.37.0b2/src/bantamkit/memory/usage.py +342 -0
  23. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/shiftwork.py +13 -3
  24. bantamkit-0.37.0b2/src/bantamkit/storage/__init__.py +20 -0
  25. bantamkit-0.37.0b2/src/bantamkit/storage/coldindex.py +308 -0
  26. bantamkit-0.37.0b2/src/bantamkit/storage/hotindex.py +1002 -0
  27. bantamkit-0.37.0b2/src/bantamkit/storage/lock.py +53 -0
  28. bantamkit-0.37.0b2/src/bantamkit/storage/logsegment.py +257 -0
  29. bantamkit-0.37.0b2/src/bantamkit/storage/retention.py +804 -0
  30. bantamkit-0.37.0b2/src/bantamkit/storage/tiers.py +207 -0
  31. bantamkit-0.37.0b2/src/bantamkit/touch/__init__.py +85 -0
  32. bantamkit-0.37.0b2/src/bantamkit/touch/bashturn.py +91 -0
  33. bantamkit-0.37.0b2/src/bantamkit/touch/context.py +112 -0
  34. bantamkit-0.37.0b2/src/bantamkit/touch/graph.py +214 -0
  35. bantamkit-0.37.0b2/src/bantamkit/touch/log.py +352 -0
  36. bantamkit-0.37.0b2/src/bantamkit/touch/recallfile.py +99 -0
  37. bantamkit-0.37.0b2/src/bantamkit/touch/refs.py +105 -0
  38. bantamkit-0.37.0b2/src/bantamkit/touch/repo.py +200 -0
  39. bantamkit-0.37.0b2/src/bantamkit/touch/summary.py +196 -0
  40. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/conftest.py +52 -0
  41. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/served-tool-surface.json +85 -5
  42. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_build_identity.py +1 -0
  43. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_conformance_suite_table_gate.py +5 -1
  44. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_docread_ceilings.py +5 -2
  45. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_eventlog.py +4 -2
  46. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_hookadapter.py +518 -14
  47. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_layers.py +2 -0
  48. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcpserver.py +54 -2
  49. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory.py +339 -32
  50. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_compact_tool.py +2 -1
  51. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_component.py +131 -26
  52. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_dream.py +36 -0
  53. bantamkit-0.37.0b2/tests/test_memory_native.py +210 -0
  54. bantamkit-0.37.0b2/tests/test_memory_queries.py +566 -0
  55. bantamkit-0.37.0b2/tests/test_memory_retrieval.py +263 -0
  56. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_strings.py +73 -1
  57. bantamkit-0.37.0b2/tests/test_memory_usage.py +266 -0
  58. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_served_tool_count_records.py +11 -11
  59. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_skillaudit.py +1 -1
  60. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_status_surface.py +83 -3
  61. bantamkit-0.37.0b2/tests/test_storage_bar.py +42 -0
  62. bantamkit-0.37.0b2/tests/test_storage_coldindex.py +174 -0
  63. bantamkit-0.37.0b2/tests/test_storage_hotindex.py +302 -0
  64. bantamkit-0.37.0b2/tests/test_storage_log.py +187 -0
  65. bantamkit-0.37.0b2/tests/test_storage_log_consumers.py +187 -0
  66. bantamkit-0.37.0b2/tests/test_storage_recall_index.py +182 -0
  67. bantamkit-0.37.0b2/tests/test_storage_retention.py +439 -0
  68. bantamkit-0.37.0b2/tests/test_storage_tiers.py +186 -0
  69. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_tokenledger.py +1 -0
  70. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_tool_annotations.py +2 -2
  71. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_tool_manifest.py +23 -0
  72. bantamkit-0.37.0b2/tests/test_touch_bashturn.py +79 -0
  73. bantamkit-0.37.0b2/tests/test_touch_context.py +104 -0
  74. bantamkit-0.37.0b2/tests/test_touch_graph.py +235 -0
  75. bantamkit-0.37.0b2/tests/test_touch_log.py +307 -0
  76. bantamkit-0.37.0b2/tests/test_touch_recall_file.py +187 -0
  77. bantamkit-0.37.0b2/tests/test_touch_refs.py +152 -0
  78. bantamkit-0.37.0b2/tests/test_touch_summary.py +262 -0
  79. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_unknown_arguments.py +2 -2
  80. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_version_agreement.py +99 -2
  81. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/.gitignore +0 -0
  82. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/contracts/default.yaml +0 -0
  83. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/manifest.yaml +0 -0
  84. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/HISTORY.md +0 -0
  85. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/README.md +0 -0
  86. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/docs/architecture.md +0 -0
  87. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/docs/runbook.md +0 -0
  88. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/issues/142-settlement-timeout.md +0 -0
  89. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/patches/0009-retry-budget.patch +0 -0
  90. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/__init__.py +0 -0
  91. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/config.py +0 -0
  92. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/errors.py +0 -0
  93. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/posting.py +0 -0
  94. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/registry.py +0 -0
  95. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/report.py +0 -0
  96. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/retry.py +0 -0
  97. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/settle.py +0 -0
  98. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/validate.py +0 -0
  99. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/tests/test_posting.py +0 -0
  100. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/tests/test_settle.py +0 -0
  101. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-error-contract.yaml +0 -0
  102. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-handler-map.yaml +0 -0
  103. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-patch-before-after.yaml +0 -0
  104. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-retry-attempts.yaml +0 -0
  105. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-settlement-config.yaml +0 -0
  106. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-symbol-home.yaml +0 -0
  107. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-trace-blame.yaml +0 -0
  108. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-unread-key.yaml +0 -0
  109. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-137.yaml +0 -0
  110. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-359.yaml +0 -0
  111. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-372.yaml +0 -0
  112. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-11764.yaml +0 -0
  113. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-4137.yaml +0 -0
  114. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-8022.yaml +0 -0
  115. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-137.yaml +0 -0
  116. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-261.yaml +0 -0
  117. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-388.yaml +0 -0
  118. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/fixtures/.gitkeep +0 -0
  119. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/fixtures/catalog.json +0 -0
  120. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/perturbations/task-completion.yaml +0 -0
  121. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/.gitkeep +0 -0
  122. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-contact.yaml +0 -0
  123. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-invoice.yaml +0 -0
  124. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-order.yaml +0 -0
  125. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-schedule.yaml +0 -0
  126. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-versions.yaml +0 -0
  127. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/nav-prod-port.yaml +0 -0
  128. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/nav-release-bundle.yaml +0 -0
  129. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-audit-retention.yaml +0 -0
  130. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-cache-ttl.yaml +0 -0
  131. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-db-port.yaml +0 -0
  132. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-deploy.yaml +0 -0
  133. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-env-endpoint.yaml +0 -0
  134. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-oncall-rotation.yaml +0 -0
  135. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-oncall.yaml +0 -0
  136. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-org-quota.yaml +0 -0
  137. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-owner.yaml +0 -0
  138. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-basket-total.yaml +0 -0
  139. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-cheapest.yaml +0 -0
  140. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-compare.yaml +0 -0
  141. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-gadget-value.yaml +0 -0
  142. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-stock-total.yaml +0 -0
  143. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-total.yaml +0 -0
  144. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/pricing/default.json +0 -0
  145. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/profiles/default.yaml +0 -0
  146. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/profiles/patient.yaml +0 -0
  147. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/rubrics/.gitkeep +0 -0
  148. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/rubrics/code-quality.yaml +0 -0
  149. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/rubrics/grounded-completion.yaml +0 -0
  150. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/rubrics/task-completion.yaml +0 -0
  151. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/schemas/shiftwork-checkpoint.json +0 -0
  152. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/skills/.gitkeep +0 -0
  153. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/skills/file-graph.md +0 -0
  154. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/.gitkeep +0 -0
  155. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/bantamkit_read.json +0 -0
  156. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/bantamkit_status.json +0 -0
  157. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/build_identity.json +0 -0
  158. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/document_list.json +0 -0
  159. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/document_read.json +0 -0
  160. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/file_graph.json +0 -0
  161. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/memory_compact.json +0 -0
  162. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/memory_dream.json +0 -0
  163. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/repo_map.json +0 -0
  164. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_clock_in.json +0 -0
  165. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_clock_out.json +0 -0
  166. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_plan.json +0 -0
  167. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/skill_audit.json +0 -0
  168. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/token_ledger.json +0 -0
  169. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/validate_json.json +0 -0
  170. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/_assets/tools/work_plan.json +0 -0
  171. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/hatch_build.py +0 -0
  172. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/pyproject.toml +0 -0
  173. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/agent.py +0 -0
  174. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/assets.py +0 -0
  175. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/budget.py +0 -0
  176. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/client.py +0 -0
  177. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/contract.py +0 -0
  178. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/criticreplay.py +0 -0
  179. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/critique.py +0 -0
  180. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/docmanifest.py +0 -0
  181. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/docread.py +0 -0
  182. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/evalrun.py +0 -0
  183. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/filegraph.py +0 -0
  184. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/loopguard.py +0 -0
  185. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/mcpreport.py +0 -0
  186. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/mcpstdio.py +0 -0
  187. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/__init__.py +0 -0
  188. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/memory/layers.py +0 -0
  189. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/pdfread.py +0 -0
  190. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/pricing.py +0 -0
  191. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/profile.py +0 -0
  192. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/repomap.py +0 -0
  193. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/selfupdate.py +0 -0
  194. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/skillaudit.py +0 -0
  195. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/statusline.py +0 -0
  196. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/structured.py +0 -0
  197. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/textutil.py +0 -0
  198. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/tokenledger.py +0 -0
  199. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/updatecheck.py +0 -0
  200. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/src/bantamkit/workplan.py +0 -0
  201. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/cli_exit_status_probe.py +0 -0
  202. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/bad-crc.docx +0 -0
  203. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/charref-4301-digits.html +0 -0
  204. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/charset-table.json +0 -0
  205. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/compression-method-9.docx +0 -0
  206. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/corrupt-deflate.docx +0 -0
  207. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/encrypted-member.docx +0 -0
  208. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/encrypted-mimetype.odt +0 -0
  209. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/eszett-cell-ref.xlsx +0 -0
  210. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/internal-dtd-entity.docx +0 -0
  211. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/rfc2231-charset.eml +0 -0
  212. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/rfc822-nested-twice.eml +0 -0
  213. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/unicode-digit-shared-string.xlsx +0 -0
  214. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/docread/x-uuencode.eml +0 -0
  215. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/f8404ab-perturbation-baseline.json +0 -0
  216. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/data/platform-assumption-baseline.json +0 -0
  217. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/docread_fixtures.py +0 -0
  218. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/perturbation_baseline_harness.py +0 -0
  219. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/rbp16_effect_probe.py +0 -0
  220. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/rbp18_payload_probe.py +0 -0
  221. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_adapter.py +0 -0
  222. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_agent.py +0 -0
  223. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_amendguard.py +0 -0
  224. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_assets.py +0 -0
  225. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_bantamkit_gitignore.py +0 -0
  226. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_bantamkit_read_tool.py +0 -0
  227. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_budget.py +0 -0
  228. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_cli_oneshot.py +0 -0
  229. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_client.py +0 -0
  230. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_compaction_corpus_survey.py +0 -0
  231. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_conformance.py +0 -0
  232. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_conformance_harness_resilience.py +0 -0
  233. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_contract_fanout.py +0 -0
  234. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_contract_patterns.py +0 -0
  235. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_contract_refs.py +0 -0
  236. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_criticreplay.py +0 -0
  237. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_critique.py +0 -0
  238. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_doc_commands_gate.py +0 -0
  239. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_docread.py +0 -0
  240. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_document_manifest_parity.py +0 -0
  241. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_document_setup.py +0 -0
  242. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_document_tasks.py +0 -0
  243. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_document_tools.py +0 -0
  244. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_encoding_gate.py +0 -0
  245. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_evalrun.py +0 -0
  246. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_field_program_gates.py +0 -0
  247. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_field_programs.py +0 -0
  248. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_filegraph.py +0 -0
  249. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_hostinstall.py +0 -0
  250. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_hostinstall_hooks.py +0 -0
  251. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_install_shape.py +0 -0
  252. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_ladder_statistics.py +0 -0
  253. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_launcher_which.py +0 -0
  254. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_loopguard.py +0 -0
  255. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcp_endpoint.py +0 -0
  256. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcp_request_guard.py +0 -0
  257. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcpdrift.py +0 -0
  258. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcpreport.py +0 -0
  259. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mcpstdio_frames.py +0 -0
  260. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_divergence.py +0 -0
  261. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_layers.py +0 -0
  262. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_memory_store_tripwire.py +0 -0
  263. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_mutmatrix.py +0 -0
  264. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_nativeexport.py +0 -0
  265. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_newline_gate.py +0 -0
  266. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_packaging.py +0 -0
  267. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_pdfread.py +0 -0
  268. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_pinharness_ledger.py +0 -0
  269. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_platform_assumption_gate.py +0 -0
  270. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_pricing.py +0 -0
  271. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_readme_separation.py +0 -0
  272. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_repo_map_tool.py +0 -0
  273. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_repomap.py +0 -0
  274. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_selfupdate.py +0 -0
  275. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_shiftwork.py +0 -0
  276. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_statusline.py +0 -0
  277. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_structured.py +0 -0
  278. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_thread_exception_gate.py +0 -0
  279. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_updatecheck.py +0 -0
  280. {bantamkit-0.36.0 → bantamkit-0.37.0b2}/tests/test_workplan.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bantamkit
3
- Version: 0.36.0
3
+ Version: 0.37.0b2
4
4
  Summary: Persistent memory for coding agents: an MCP server for Claude Code, Claude Desktop, Cursor and VS Code Copilot, plus a Python library that lifts small-model agents. Install once, run offline.
5
5
  Project-URL: Homepage, https://github.com/Ink01101011/bantamkit
6
6
  Project-URL: Repository, https://github.com/Ink01101011/bantamkit
@@ -79,7 +79,7 @@ Then restart the host (in Claude Code, open a new session) and ask the agent to
79
79
  ([docs/hooks.md](https://github.com/Ink01101011/bantamkit/blob/main/docs/hooks.md)).
80
80
  - **More than memory.** JSON Schema validation, a token ledger read off the host's transcripts,
81
81
  a skill-catalogue audit, and shift-work tools that plan and hand off multi-step jobs —
82
- [the fourteen tools](#-what-it-serves).
82
+ [the fifteen tools](#-what-it-serves).
83
83
  - **Same answers as the Node server.** The two share a memory store on disk, and every surface
84
84
  is compared between both runtimes by a conformance suite (`node tools/conformance/run.mjs
85
85
  --all` in the repository), so install whichever your host makes easy.
@@ -102,7 +102,7 @@ Then restart the host (in Claude Code, open a new session) and ask the agent to
102
102
  | [Configuration](#-configuration) | Every flag and variable, with its default |
103
103
  | [Update](#-update) | `--update`, pipx, uv, then restart |
104
104
  | [Troubleshooting](#-troubleshooting) | Timeouts, refusals, the wrong store |
105
- | [What it serves](#-what-it-serves) | 14 tools, one prompt, two resource templates |
105
+ | [What it serves](#-what-it-serves) | 15 tools, one prompt, two resource templates |
106
106
  | [Requirements](#-requirements) | Python and dependencies |
107
107
  | [The asset pack](#-the-asset-pack) | `--assets-root`, `BANTAMKIT_ASSETS` |
108
108
  | [The operator CLI: `python -m bantamkit.memory`](#-the-operator-cli-python--m-bantamkitmemory) | status, lint, compact, archived, archive, restore |
@@ -144,9 +144,9 @@ CPU architecture and Python minor version** (some wheels, such as `pydantic_core
144
144
  one platform only), copy `wheels/` across, and install from it:
145
145
 
146
146
  ```bash
147
- python -m pip download "bantamkit[mcp]==0.36.0" -d wheels
147
+ python -m pip download "bantamkit[mcp]==0.37.0b2" -d wheels
148
148
  python -m venv <env>
149
- <env>/bin/pip install --no-index --find-links wheels "bantamkit[mcp]==0.36.0"
149
+ <env>/bin/pip install --no-index --find-links wheels "bantamkit[mcp]==0.37.0b2"
150
150
  <env>/bin/bantamkit-mcp --install cursor
151
151
  ```
152
152
 
@@ -327,7 +327,7 @@ you**; a new version with an old `build_id` means an old process.
327
327
 
328
328
  ## 🧰 What it serves
329
329
 
330
- It serves 14 tools, the `bantamkit_status` prompt and two resource templates
330
+ It serves 15 tools, the `bantamkit_status` prompt and two resource templates
331
331
  (`bantamkit://skills/{name}`, `bantamkit://rubrics/{name}`):
332
332
 
333
333
  | Tool | What it does |
@@ -336,6 +336,7 @@ It serves 14 tools, the `bantamkit_status` prompt and two resource templates
336
336
  | `memory_recall` | retrieve facts matching a query |
337
337
  | `memory_compact` | archive the stalest facts to fit the index budget |
338
338
  | `memory_dream` | consolidate facts the project and profile layers hold under the same name |
339
+ | `memory_queries` | list the facts that have no likely-prompt queries yet, and store the queries written for them; recall matches a prompt against them |
339
340
  | `validate_json` | validate a document against a JSON Schema |
340
341
  | `skill_audit` | audit a skill catalogue for findings |
341
342
  | `shiftwork_clock_in` | open a unit of work and get its brief |
@@ -433,7 +434,7 @@ as a side effect of the package's own imports (`agent`, `assets`, `budget`, `cli
433
434
  | `bantamkit.memory` | the memory store | `Memory`, `MemoryStore` |
434
435
  | **9 modules** | | **30 values, no `__all__`** |
435
436
 
436
- **This is not the npm package's export surface.** Both runtimes serve the same fourteen MCP
437
+ **This is not the npm package's export surface.** Both runtimes serve the same fifteen MCP
437
438
  tools, but what each one exports *to an importer* is a different product: here it is the
438
439
  agent/critique/eval library above; there it is the memory store, the asset pack, the event log,
439
440
  the shift-work tools and a set of CPython-semantics shims — 141 values behind one entry point. Of
@@ -48,7 +48,7 @@ Then restart the host (in Claude Code, open a new session) and ask the agent to
48
48
  ([docs/hooks.md](https://github.com/Ink01101011/bantamkit/blob/main/docs/hooks.md)).
49
49
  - **More than memory.** JSON Schema validation, a token ledger read off the host's transcripts,
50
50
  a skill-catalogue audit, and shift-work tools that plan and hand off multi-step jobs —
51
- [the fourteen tools](#-what-it-serves).
51
+ [the fifteen tools](#-what-it-serves).
52
52
  - **Same answers as the Node server.** The two share a memory store on disk, and every surface
53
53
  is compared between both runtimes by a conformance suite (`node tools/conformance/run.mjs
54
54
  --all` in the repository), so install whichever your host makes easy.
@@ -71,7 +71,7 @@ Then restart the host (in Claude Code, open a new session) and ask the agent to
71
71
  | [Configuration](#-configuration) | Every flag and variable, with its default |
72
72
  | [Update](#-update) | `--update`, pipx, uv, then restart |
73
73
  | [Troubleshooting](#-troubleshooting) | Timeouts, refusals, the wrong store |
74
- | [What it serves](#-what-it-serves) | 14 tools, one prompt, two resource templates |
74
+ | [What it serves](#-what-it-serves) | 15 tools, one prompt, two resource templates |
75
75
  | [Requirements](#-requirements) | Python and dependencies |
76
76
  | [The asset pack](#-the-asset-pack) | `--assets-root`, `BANTAMKIT_ASSETS` |
77
77
  | [The operator CLI: `python -m bantamkit.memory`](#-the-operator-cli-python--m-bantamkitmemory) | status, lint, compact, archived, archive, restore |
@@ -113,9 +113,9 @@ CPU architecture and Python minor version** (some wheels, such as `pydantic_core
113
113
  one platform only), copy `wheels/` across, and install from it:
114
114
 
115
115
  ```bash
116
- python -m pip download "bantamkit[mcp]==0.36.0" -d wheels
116
+ python -m pip download "bantamkit[mcp]==0.37.0b2" -d wheels
117
117
  python -m venv <env>
118
- <env>/bin/pip install --no-index --find-links wheels "bantamkit[mcp]==0.36.0"
118
+ <env>/bin/pip install --no-index --find-links wheels "bantamkit[mcp]==0.37.0b2"
119
119
  <env>/bin/bantamkit-mcp --install cursor
120
120
  ```
121
121
 
@@ -296,7 +296,7 @@ you**; a new version with an old `build_id` means an old process.
296
296
 
297
297
  ## 🧰 What it serves
298
298
 
299
- It serves 14 tools, the `bantamkit_status` prompt and two resource templates
299
+ It serves 15 tools, the `bantamkit_status` prompt and two resource templates
300
300
  (`bantamkit://skills/{name}`, `bantamkit://rubrics/{name}`):
301
301
 
302
302
  | Tool | What it does |
@@ -305,6 +305,7 @@ It serves 14 tools, the `bantamkit_status` prompt and two resource templates
305
305
  | `memory_recall` | retrieve facts matching a query |
306
306
  | `memory_compact` | archive the stalest facts to fit the index budget |
307
307
  | `memory_dream` | consolidate facts the project and profile layers hold under the same name |
308
+ | `memory_queries` | list the facts that have no likely-prompt queries yet, and store the queries written for them; recall matches a prompt against them |
308
309
  | `validate_json` | validate a document against a JSON Schema |
309
310
  | `skill_audit` | audit a skill catalogue for findings |
310
311
  | `shiftwork_clock_in` | open a unit of work and get its brief |
@@ -402,7 +403,7 @@ as a side effect of the package's own imports (`agent`, `assets`, `budget`, `cli
402
403
  | `bantamkit.memory` | the memory store | `Memory`, `MemoryStore` |
403
404
  | **9 modules** | | **30 values, no `__all__`** |
404
405
 
405
- **This is not the npm package's export surface.** Both runtimes serve the same fourteen MCP
406
+ **This is not the npm package's export surface.** Both runtimes serve the same fifteen MCP
406
407
  tools, but what each one exports *to an importer* is a different product: here it is the
407
408
  agent/critique/eval library above; there it is the memory store, the asset pack, the event log,
408
409
  the shift-work tools and a set of CPython-semantics shims — 141 values behind one entry point. Of
@@ -0,0 +1,12 @@
1
+ # Likely-prompt queries
2
+
3
+ For each fact, write the prompts a user would type to a coding assistant when this fact is what they need.
4
+
5
+ - Three in the user's own language and three in English (`queries` holds all six, the user's language first).
6
+ - Short: 5 to 25 words. Vary them: one direct question, one task request, one terse follow-up.
7
+ - Keep technical terms in English where the user would: commands, file names, product names, error codes.
8
+ - Use only what the fact says. Do not invent facts, do not just restate the fact's name, and never copy more than
9
+ five words of the body verbatim.
10
+
11
+ Store them with `memory_queries` (`{"facts": [{"name": ..., "layer": ..., "queries": [...]}]}`), or pass
12
+ `queries` to `memory_save` when you save the fact.
@@ -22,6 +22,13 @@ past-you would have used. Do this before acting, not after.
22
22
 
23
23
  Write it to match the future recall QUERY, not to summarize the body.
24
24
  Ask: "what words will future-me search with?" Put related memory names in links.
25
+ Fill keywords with the words the user will actually type, in their language — recall matches those too.
26
+
27
+ ## Likely-prompt queries
28
+
29
+ When you save, also pass `queries`: three prompts in the user's language and three in English that a user would
30
+ type when this fact is what they need. Short and varied, technical terms kept in English, never more than five
31
+ words copied from the body. When `memory_queries` lists facts without queries, write theirs.
25
32
 
26
33
  ## On "duplicate" replies
27
34
 
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "memory_queries",
3
+ "title": "Likely-prompt queries for saved facts",
4
+ "description": "Call with {} to list up to 10 facts that have no likely-prompt queries yet, with what to write for them. Call with {\"facts\": [{\"name\", \"layer\"?, \"queries\"}]} to store queries you wrote. Recall matches a prompt against these queries.",
5
+ "surfaces": [
6
+ "mcp"
7
+ ],
8
+ "parameters": {
9
+ "type": "object",
10
+ "properties": {
11
+ "facts": {
12
+ "anyOf": [
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "name": {
19
+ "type": "string"
20
+ },
21
+ "layer": {
22
+ "type": "string",
23
+ "description": "project, profile, extra:<name> or native; optional: the first layer holding the name"
24
+ },
25
+ "queries": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ }
31
+ },
32
+ "required": [
33
+ "name",
34
+ "queries"
35
+ ]
36
+ }
37
+ },
38
+ {
39
+ "type": "null"
40
+ }
41
+ ],
42
+ "description": "Omit to list the facts missing queries"
43
+ }
44
+ },
45
+ "title": "memory_queriesArguments",
46
+ "additionalProperties": false
47
+ },
48
+ "output_schema": {
49
+ "type": "object",
50
+ "additionalProperties": true,
51
+ "title": "memory_queriesDictOutput"
52
+ },
53
+ "annotations": {
54
+ "readOnlyHint": false,
55
+ "destructiveHint": false,
56
+ "openWorldHint": false
57
+ }
58
+ }
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "memory_recall",
3
3
  "title": "Recall memories",
4
- "description": "Search persistent memory. Call BEFORE starting a task that resembles past work. Returns the top word matches, never fewer than the store default of 3 when that many match; a query that is exactly a fact's name returns that fact alone.",
4
+ "description": "Search persistent memory. Call BEFORE starting a task that resembles past work. Returns the top word matches, never fewer than the store default of 3 when that many match; a query that is exactly a fact's name returns that fact alone. Pass file instead of query to see the memories linked to a file.",
5
5
  "surfaces": [
6
6
  "agent",
7
7
  "mcp"
8
8
  ],
9
9
  "parameters": {
10
10
  "type": "object",
11
- "required": [
12
- "query"
13
- ],
11
+ "required": [],
14
12
  "properties": {
15
13
  "query": {
16
14
  "type": "string",
@@ -19,6 +17,15 @@
19
17
  "k": {
20
18
  "type": "integer",
21
19
  "description": "Facts wanted, clamped to 1..5. Raised to the store default of 3 when smaller; never lowered below it."
20
+ },
21
+ "include_archived": {
22
+ "type": "boolean",
23
+ "default": false,
24
+ "description": "Also search facts compaction moved to archive/. Archived matches come after the live ones, tagged [archived]."
25
+ },
26
+ "file": {
27
+ "type": "string",
28
+ "description": "A tracked file, or the shortest unique suffix of one (store.ts, memory/store.ts). Returns the facts linked to it and when it was last touched; query is then ignored."
22
29
  }
23
30
  },
24
31
  "additionalProperties": false
@@ -43,6 +43,20 @@
43
43
  "type": "string"
44
44
  },
45
45
  "description": "names of related memories"
46
+ },
47
+ "keywords": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string"
51
+ },
52
+ "description": "Words the user will type when they need this fact, in the user's own language as well as English (e.g. Thai and English terms)"
53
+ },
54
+ "queries": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string"
58
+ },
59
+ "description": "The prompts a user would type when this fact is what they need: three in the user's language and three in English, at most 8, each at most 200 characters"
46
60
  }
47
61
  },
48
62
  "additionalProperties": false
@@ -10,6 +10,10 @@
10
10
  "checkpoint": {
11
11
  "title": "Checkpoint",
12
12
  "type": "string"
13
+ },
14
+ "search": {
15
+ "type": "string",
16
+ "description": "Also search jobs Retention archived under this checkpoint's .shiftwork/archive/: every line holding all the query's words, as {job, file, line}."
13
17
  }
14
18
  },
15
19
  "required": [
@@ -29,4 +29,4 @@ from bantamkit.structured import StructuredOutputError, extract_json, structured
29
29
  # file as its dynamic version source, so the wheel's metadata and the string the MCP
30
30
  # server advertises are the same committed bytes, and neither is a function of when
31
31
  # someone last ran `pip`.
32
- __version__ = "0.36.0"
32
+ __version__ = "0.37.0b2"
@@ -30,12 +30,13 @@ THREE HARD RULES, each with the failure it prevents:
30
30
  byte-compares both runtimes' streams; one stray write breaks the wire suite. Nothing
31
31
  in this module touches `sys.stderr` or `sys.stdout`.
32
32
  * **Metadata only.** Never a tool argument's value, never a memory body, never a
33
- validated output, never a query, never a document row. Nine of the fourteen tools take
33
+ validated output, never a query, never a document row. Nine of the fifteen tools take
34
34
  an unbounded string (counted over `assets/tools/`: a `string` parameter with no `enum`
35
35
  or `maxLength`, or an array of such; `bantamkit_read` and `repo_map` were two more until
36
- job50 I5 retired them from the roster — and `work_plan` is NOT one of them: its `nodes`
37
- is an array of objects, not an array of strings, so the rule does not reach the ids
38
- inside it) and among those `skill_audit`'s `root`,
36
+ job50 I5 retired them from the roster — and `work_plan` and `memory_queries` are NOT
37
+ among them: `nodes` and `facts` are arrays of objects, not arrays of strings, so the
38
+ rule does not reach the strings inside them; `memory_queries` records its `result`
39
+ token only) and among those `skill_audit`'s `root`,
39
40
  `token_ledger`'s `root` and `prices` and the four shift-work tools' `checkpoint` are
40
41
  absolute paths; each record carries counts and tokens from a closed set, never the
41
42
  path, never a part name, never a skill id, never a mapped file, never a session id,
@@ -72,6 +73,7 @@ from pathlib import Path
72
73
  from typing import Any
73
74
 
74
75
  from bantamkit.memory.store import bantamkit_dir_for, ensure_bantamkit_gitignore
76
+ from bantamkit.storage.logsegment import LogSegment
75
77
 
76
78
  #: Environment switch. Unset or `off`/`0`/`false`/`no`/empty -> disabled. `on`/`1`/
77
79
  #: `true`/`yes` -> the default file inside the memory store. Anything else is taken as
@@ -135,15 +137,23 @@ def encode_record(epoch_ms: int, tool: str, outcome: str, detail: dict[str, Any]
135
137
  module is non-ASCII today; the setting is what keeps that a fact about the data
136
138
  rather than a difference between the runtimes if it ever stops being one.
137
139
  """
138
- record = {
140
+ text = json.dumps(
141
+ _record_object(epoch_ms, tool, outcome, detail), ensure_ascii=False, separators=(",", ":")
142
+ )
143
+ return text.encode("utf-8") + b"\n"
144
+
145
+
146
+ def _record_object(
147
+ epoch_ms: int, tool: str, outcome: str, detail: dict[str, Any]
148
+ ) -> dict[str, Any]:
149
+ """The record `encode_record` spells, as the object `LogSegment.append` writes."""
150
+ return {
139
151
  "v": SCHEMA_VERSION,
140
152
  "ts": format_timestamp(epoch_ms),
141
153
  "tool": tool,
142
154
  "outcome": outcome,
143
155
  "detail": {key: detail[key] for key in sorted(detail)},
144
156
  }
145
- text = json.dumps(record, ensure_ascii=False, separators=(",", ":"))
146
- return text.encode("utf-8") + b"\n"
147
157
 
148
158
 
149
159
  def default_path(store_root: Path) -> Path:
@@ -266,9 +276,10 @@ class EventLog:
266
276
  """
267
277
  if self.path is None:
268
278
  return
269
- payload = encode_record(self._clock(), tool, outcome, detail or {})
279
+ obj = _record_object(self._clock(), tool, outcome, detail or {})
280
+ payload = json.dumps(obj, ensure_ascii=False, separators=(",", ":")).encode("utf-8") + b"\n"
270
281
  try:
271
- self._append(payload)
282
+ self._append(obj, payload)
272
283
  except OSError:
273
284
  self.write_failed = True
274
285
  return
@@ -282,8 +293,15 @@ class EventLog:
282
293
  """
283
294
  self.record(tool, "raised", {"type": type(exc).__name__})
284
295
 
285
- def _append(self, payload: bytes) -> None:
286
- """Rotate if this record would cross the cap, then append in BINARY mode.
296
+ def _append(self, obj: dict[str, Any], payload: bytes) -> None:
297
+ """Rotate if this record would cross the cap, then append through `LogSegment`.
298
+
299
+ #204 (J69-4): the line goes through `storage.LogSegment.append` (the shared O_EXCL
300
+ lock, a newline before a cut last line, the same bytes `encode_record` spells). THE
301
+ ROTATION RULE BELOW IS NOT `LogSegment.rotate`'s, on purpose: this log keeps exactly
302
+ one plain `<path>.1` that `--statusline` and `--mcp-report` read in both runtimes, and
303
+ a 2 MiB ceiling with no retention job behind it; docs/eventlog.md says one rotation
304
+ rule cannot be right for both this log and the hook log.
287
305
 
288
306
  Binary, not text: a text-mode write translates `\\n` to `os.linesep`, which is
289
307
  `\\r\\n` on Windows, and a Node reader byte-comparing the file would see a
@@ -332,5 +350,5 @@ class EventLog:
332
350
  size = 0
333
351
  if size and size + len(payload) > self.cap_bytes:
334
352
  os.replace(self.path, self.path.with_name(self.path.name + ".1"))
335
- with open(self.path, "ab") as handle:
336
- handle.write(payload)
353
+ if not LogSegment(self.path).append(obj):
354
+ raise OSError("the record could not be appended") # caught by `record`