bantamkit 0.37.0b1__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.37.0b1 → bantamkit-0.37.0b2}/PKG-INFO +8 -7
  2. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/README.md +7 -6
  3. bantamkit-0.37.0b2/_assets/skills/memory-queries.md +12 -0
  4. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/skills/memory.md +6 -0
  5. bantamkit-0.37.0b2/_assets/tools/memory_queries.json +58 -0
  6. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/memory_save.json +7 -0
  7. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/__init__.py +1 -1
  8. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/eventlog.py +5 -4
  9. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/hookadapter.py +95 -1
  10. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/mcpserver.py +30 -1
  11. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/__main__.py +1 -1
  12. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/component.py +203 -13
  13. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/divergence.py +3 -2
  14. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/native.py +6 -3
  15. bantamkit-0.37.0b2/src/bantamkit/memory/queries.py +248 -0
  16. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/retrieval.py +124 -9
  17. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/store.py +109 -17
  18. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/served-tool-surface.json +63 -1
  19. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_eventlog.py +4 -2
  20. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_hookadapter.py +154 -0
  21. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcpserver.py +54 -2
  22. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_compact_tool.py +2 -1
  23. bantamkit-0.37.0b2/tests/test_memory_queries.py +566 -0
  24. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_retrieval.py +49 -0
  25. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_strings.py +70 -0
  26. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_served_tool_count_records.py +11 -11
  27. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_skillaudit.py +1 -1
  28. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_status_surface.py +26 -3
  29. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_tokenledger.py +1 -0
  30. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_tool_annotations.py +2 -2
  31. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_tool_manifest.py +23 -0
  32. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_unknown_arguments.py +1 -1
  33. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/.gitignore +0 -0
  34. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/contracts/default.yaml +0 -0
  35. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/manifest.yaml +0 -0
  36. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/HISTORY.md +0 -0
  37. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/README.md +0 -0
  38. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/docs/architecture.md +0 -0
  39. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/docs/runbook.md +0 -0
  40. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/issues/142-settlement-timeout.md +0 -0
  41. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/patches/0009-retry-budget.patch +0 -0
  42. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/__init__.py +0 -0
  43. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/config.py +0 -0
  44. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/errors.py +0 -0
  45. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/posting.py +0 -0
  46. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/registry.py +0 -0
  47. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/report.py +0 -0
  48. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/retry.py +0 -0
  49. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/settle.py +0 -0
  50. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/src/ledger/validate.py +0 -0
  51. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/tests/test_posting.py +0 -0
  52. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/repo/tests/test_settle.py +0 -0
  53. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-error-contract.yaml +0 -0
  54. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-handler-map.yaml +0 -0
  55. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-patch-before-after.yaml +0 -0
  56. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-retry-attempts.yaml +0 -0
  57. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-settlement-config.yaml +0 -0
  58. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-symbol-home.yaml +0 -0
  59. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-trace-blame.yaml +0 -0
  60. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/devteam/tasks/dt-unread-key.yaml +0 -0
  61. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-137.yaml +0 -0
  62. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-359.yaml +0 -0
  63. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-in-372.yaml +0 -0
  64. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-11764.yaml +0 -0
  65. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-4137.yaml +0 -0
  66. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-large-out-8022.yaml +0 -0
  67. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-137.yaml +0 -0
  68. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-261.yaml +0 -0
  69. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/document/tasks/doc-small-388.yaml +0 -0
  70. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/fixtures/.gitkeep +0 -0
  71. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/fixtures/catalog.json +0 -0
  72. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/perturbations/task-completion.yaml +0 -0
  73. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/.gitkeep +0 -0
  74. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-contact.yaml +0 -0
  75. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-invoice.yaml +0 -0
  76. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-order.yaml +0 -0
  77. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-schedule.yaml +0 -0
  78. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/extract-versions.yaml +0 -0
  79. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/nav-prod-port.yaml +0 -0
  80. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/nav-release-bundle.yaml +0 -0
  81. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-audit-retention.yaml +0 -0
  82. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-cache-ttl.yaml +0 -0
  83. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-db-port.yaml +0 -0
  84. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-deploy.yaml +0 -0
  85. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-env-endpoint.yaml +0 -0
  86. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-oncall-rotation.yaml +0 -0
  87. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-oncall.yaml +0 -0
  88. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-org-quota.yaml +0 -0
  89. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/recall-owner.yaml +0 -0
  90. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-basket-total.yaml +0 -0
  91. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-cheapest.yaml +0 -0
  92. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-compare.yaml +0 -0
  93. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-gadget-value.yaml +0 -0
  94. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-stock-total.yaml +0 -0
  95. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/evals/tasks/shop-total.yaml +0 -0
  96. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/pricing/default.json +0 -0
  97. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/profiles/default.yaml +0 -0
  98. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/profiles/patient.yaml +0 -0
  99. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/rubrics/.gitkeep +0 -0
  100. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/rubrics/code-quality.yaml +0 -0
  101. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/rubrics/grounded-completion.yaml +0 -0
  102. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/rubrics/task-completion.yaml +0 -0
  103. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/schemas/shiftwork-checkpoint.json +0 -0
  104. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/skills/.gitkeep +0 -0
  105. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/skills/file-graph.md +0 -0
  106. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/.gitkeep +0 -0
  107. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/bantamkit_read.json +0 -0
  108. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/bantamkit_status.json +0 -0
  109. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/build_identity.json +0 -0
  110. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/document_list.json +0 -0
  111. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/document_read.json +0 -0
  112. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/file_graph.json +0 -0
  113. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/memory_compact.json +0 -0
  114. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/memory_dream.json +0 -0
  115. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/memory_recall.json +0 -0
  116. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/repo_map.json +0 -0
  117. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_clock_in.json +0 -0
  118. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_clock_out.json +0 -0
  119. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_plan.json +0 -0
  120. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/shiftwork_status.json +0 -0
  121. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/skill_audit.json +0 -0
  122. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/token_ledger.json +0 -0
  123. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/validate_json.json +0 -0
  124. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/_assets/tools/work_plan.json +0 -0
  125. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/hatch_build.py +0 -0
  126. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/pyproject.toml +0 -0
  127. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/agent.py +0 -0
  128. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/assets.py +0 -0
  129. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/budget.py +0 -0
  130. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/client.py +0 -0
  131. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/contract.py +0 -0
  132. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/criticreplay.py +0 -0
  133. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/critique.py +0 -0
  134. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/docmanifest.py +0 -0
  135. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/docread.py +0 -0
  136. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/evalrun.py +0 -0
  137. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/filegraph.py +0 -0
  138. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/hostinstall.py +0 -0
  139. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/loopguard.py +0 -0
  140. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/mcpreport.py +0 -0
  141. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/mcpstdio.py +0 -0
  142. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/__init__.py +0 -0
  143. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/dream.py +0 -0
  144. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/layers.py +0 -0
  145. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/memory/usage.py +0 -0
  146. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/pdfread.py +0 -0
  147. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/pricing.py +0 -0
  148. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/profile.py +0 -0
  149. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/repomap.py +0 -0
  150. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/selfupdate.py +0 -0
  151. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/shiftwork.py +0 -0
  152. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/skillaudit.py +0 -0
  153. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/statusline.py +0 -0
  154. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/__init__.py +0 -0
  155. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/coldindex.py +0 -0
  156. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/hotindex.py +0 -0
  157. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/lock.py +0 -0
  158. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/logsegment.py +0 -0
  159. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/retention.py +0 -0
  160. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/storage/tiers.py +0 -0
  161. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/structured.py +0 -0
  162. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/textutil.py +0 -0
  163. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/tokenledger.py +0 -0
  164. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/__init__.py +0 -0
  165. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/bashturn.py +0 -0
  166. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/context.py +0 -0
  167. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/graph.py +0 -0
  168. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/log.py +0 -0
  169. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/recallfile.py +0 -0
  170. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/refs.py +0 -0
  171. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/repo.py +0 -0
  172. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/touch/summary.py +0 -0
  173. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/updatecheck.py +0 -0
  174. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/src/bantamkit/workplan.py +0 -0
  175. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/cli_exit_status_probe.py +0 -0
  176. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/conftest.py +0 -0
  177. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/bad-crc.docx +0 -0
  178. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/charref-4301-digits.html +0 -0
  179. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/charset-table.json +0 -0
  180. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/compression-method-9.docx +0 -0
  181. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/corrupt-deflate.docx +0 -0
  182. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/encrypted-member.docx +0 -0
  183. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/encrypted-mimetype.odt +0 -0
  184. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/eszett-cell-ref.xlsx +0 -0
  185. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/internal-dtd-entity.docx +0 -0
  186. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/rfc2231-charset.eml +0 -0
  187. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/rfc822-nested-twice.eml +0 -0
  188. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/unicode-digit-shared-string.xlsx +0 -0
  189. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/docread/x-uuencode.eml +0 -0
  190. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/f8404ab-perturbation-baseline.json +0 -0
  191. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/data/platform-assumption-baseline.json +0 -0
  192. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/docread_fixtures.py +0 -0
  193. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/perturbation_baseline_harness.py +0 -0
  194. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/rbp16_effect_probe.py +0 -0
  195. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/rbp18_payload_probe.py +0 -0
  196. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_adapter.py +0 -0
  197. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_agent.py +0 -0
  198. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_amendguard.py +0 -0
  199. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_assets.py +0 -0
  200. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_bantamkit_gitignore.py +0 -0
  201. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_bantamkit_read_tool.py +0 -0
  202. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_budget.py +0 -0
  203. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_build_identity.py +0 -0
  204. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_cli_oneshot.py +0 -0
  205. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_client.py +0 -0
  206. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_compaction_corpus_survey.py +0 -0
  207. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_conformance.py +0 -0
  208. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_conformance_harness_resilience.py +0 -0
  209. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_conformance_suite_table_gate.py +0 -0
  210. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_contract_fanout.py +0 -0
  211. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_contract_patterns.py +0 -0
  212. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_contract_refs.py +0 -0
  213. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_criticreplay.py +0 -0
  214. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_critique.py +0 -0
  215. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_doc_commands_gate.py +0 -0
  216. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_docread.py +0 -0
  217. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_docread_ceilings.py +0 -0
  218. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_document_manifest_parity.py +0 -0
  219. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_document_setup.py +0 -0
  220. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_document_tasks.py +0 -0
  221. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_document_tools.py +0 -0
  222. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_encoding_gate.py +0 -0
  223. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_evalrun.py +0 -0
  224. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_field_program_gates.py +0 -0
  225. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_field_programs.py +0 -0
  226. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_filegraph.py +0 -0
  227. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_hostinstall.py +0 -0
  228. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_hostinstall_hooks.py +0 -0
  229. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_install_shape.py +0 -0
  230. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_ladder_statistics.py +0 -0
  231. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_launcher_which.py +0 -0
  232. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_layers.py +0 -0
  233. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_loopguard.py +0 -0
  234. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcp_endpoint.py +0 -0
  235. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcp_request_guard.py +0 -0
  236. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcpdrift.py +0 -0
  237. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcpreport.py +0 -0
  238. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mcpstdio_frames.py +0 -0
  239. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory.py +0 -0
  240. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_component.py +0 -0
  241. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_divergence.py +0 -0
  242. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_dream.py +0 -0
  243. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_layers.py +0 -0
  244. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_native.py +0 -0
  245. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_store_tripwire.py +0 -0
  246. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_memory_usage.py +0 -0
  247. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_mutmatrix.py +0 -0
  248. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_nativeexport.py +0 -0
  249. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_newline_gate.py +0 -0
  250. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_packaging.py +0 -0
  251. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_pdfread.py +0 -0
  252. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_pinharness_ledger.py +0 -0
  253. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_platform_assumption_gate.py +0 -0
  254. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_pricing.py +0 -0
  255. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_readme_separation.py +0 -0
  256. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_repo_map_tool.py +0 -0
  257. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_repomap.py +0 -0
  258. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_selfupdate.py +0 -0
  259. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_shiftwork.py +0 -0
  260. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_statusline.py +0 -0
  261. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_bar.py +0 -0
  262. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_coldindex.py +0 -0
  263. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_hotindex.py +0 -0
  264. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_log.py +0 -0
  265. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_log_consumers.py +0 -0
  266. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_recall_index.py +0 -0
  267. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_retention.py +0 -0
  268. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_storage_tiers.py +0 -0
  269. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_structured.py +0 -0
  270. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_thread_exception_gate.py +0 -0
  271. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_bashturn.py +0 -0
  272. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_context.py +0 -0
  273. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_graph.py +0 -0
  274. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_log.py +0 -0
  275. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_recall_file.py +0 -0
  276. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_refs.py +0 -0
  277. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_touch_summary.py +0 -0
  278. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_updatecheck.py +0 -0
  279. {bantamkit-0.37.0b1 → bantamkit-0.37.0b2}/tests/test_version_agreement.py +0 -0
  280. {bantamkit-0.37.0b1 → 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.37.0b1
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.37.0b1" -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.37.0b1"
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.37.0b1" -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.37.0b1"
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.
@@ -24,6 +24,12 @@ 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
25
  Fill keywords with the words the user will actually type, in their language — recall matches those too.
26
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.
32
+
27
33
  ## On "duplicate" replies
28
34
 
29
35
  If memory_save answers that a similar memory exists, either update it by
@@ -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
+ }
@@ -50,6 +50,13 @@
50
50
  "type": "string"
51
51
  },
52
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"
53
60
  }
54
61
  },
55
62
  "additionalProperties": false
@@ -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.37.0b1"
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,
@@ -140,6 +140,13 @@ def _home_dir() -> str:
140
140
  SESSION_INJECT_MAX = 3000
141
141
  PROMPT_INJECT_MAX = 700
142
142
  PROMPT_MIN_CHARS = 12
143
+ # #207 amendment 3 (Q3): the session head. A prompt shorter than HEAD_SHORT code points
144
+ # borrows the session's previous prompt (its first HEAD_CUT code points) for its BM25F
145
+ # query; the queries vector keeps the bare prompt. One read of the transcript's last
146
+ # TAIL_BYTES finds it.
147
+ HEAD_SHORT = 80
148
+ HEAD_CUT = 500
149
+ TAIL_BYTES = 262144
143
150
  STOP_NUDGE_MIN_TOOL_CALLS = 20
144
151
  COMPACT_AT = 0.9 # index >= 90% of budget -> compact ...
145
152
  COMPACT_TO = 0.8 # ... down to 80%, past the no-op band measured in job40 (C6)
@@ -1071,6 +1078,17 @@ def _session_start(run: HookRun, payload: dict[str, Any]) -> None:
1071
1078
  "refused once by the filegraph hook; a save nudge fires once at session end when "
1072
1079
  "nothing was saved."
1073
1080
  )
1081
+ # #207 amendment 3 (Q8): S12, only while some fact has no likely-prompt queries, in its
1082
+ # own try -- a nudge is never worth a dead session.
1083
+ try:
1084
+ n, m_ = Memory.layered(cwd, native=native.dir).queries_coverage()
1085
+ if n < m_:
1086
+ parts.append(
1087
+ f"[bantamkit] {m_ - n} of {m_} facts have no likely-prompt queries yet; call "
1088
+ "mcp__bantamkit__memory_queries with {} to list them and write their queries."
1089
+ )
1090
+ except Exception as e: # noqa: BLE001 - a nudge is never worth a dead session
1091
+ _log(run, {"event": "SessionStart", "warn": f"queries: {_message(e)}"})
1074
1092
  # THE STALE-INSTALL LINE THE NODE MODULE APPENDS LAST IS NOT HERE, AND THAT IS RULED
1075
1093
  # (Q2.4), not forgotten. It is decided from the kept npm install under
1076
1094
  # `~/.bantamkit/mcp/node_modules/bantamkit-mcp/package.json` -- `npminstall.ts`, which
@@ -1263,6 +1281,79 @@ def _prompt_fingerprint(prompt: str) -> dict[str, Any]:
1263
1281
  }
1264
1282
 
1265
1283
 
1284
+ _NOT_A_PROMPT = ("<", "[Request interrupted")
1285
+
1286
+
1287
+ def _user_text(message: dict[str, Any]) -> str | None:
1288
+ """`tools/eval/recall/mine_silver._user_text`, the rule the measured head was built with."""
1289
+ c = message.get("content")
1290
+ if isinstance(c, str):
1291
+ return c
1292
+ if isinstance(c, list):
1293
+ parts = [b.get("text", "") for b in c if isinstance(b, dict) and b.get("type") == "text"]
1294
+ return "\n".join(parts) if parts else None
1295
+ return None
1296
+
1297
+
1298
+ def _previous_prompt(transcript: str, current: str) -> str:
1299
+ """The latest main-chain user prompt before `current`, from ONE read of the transcript's
1300
+ last TAIL_BYTES (#207 amendment 3, Q3; orchestrator ruling 1).
1301
+
1302
+ Main chain: `type: user`, not `isSidechain`, not `isMeta`, with text that does not start
1303
+ with `<` or `[Request interrupted`. A tail that does not start at byte 0 drops everything
1304
+ through its first newline (a cut line). Records are split on "\n" only. A trailing run of
1305
+ prompts equal to `current` (compared stripped) is dropped: the host may or may not have
1306
+ written the current prompt before this hook runs. Any failure is "" -- the hook never
1307
+ errors here.
1308
+ """
1309
+ try:
1310
+ if not transcript:
1311
+ return ""
1312
+ with open(transcript, "rb") as f:
1313
+ size = os.fstat(f.fileno()).st_size
1314
+ start = max(0, size - TAIL_BYTES)
1315
+ f.seek(start)
1316
+ raw = f.read(TAIL_BYTES)
1317
+ if start > 0:
1318
+ cut = raw.find(b"\n")
1319
+ raw = b"" if cut < 0 else raw[cut + 1 :]
1320
+ prompts: list[str] = []
1321
+ for line in raw.decode("utf-8", errors="replace").split("\n"):
1322
+ try:
1323
+ r = json.loads(line)
1324
+ except ValueError:
1325
+ continue
1326
+ if (
1327
+ not isinstance(r, dict)
1328
+ or r.get("isSidechain")
1329
+ or r.get("isMeta")
1330
+ or r.get("type") != "user"
1331
+ ):
1332
+ continue
1333
+ msg = r.get("message")
1334
+ if not isinstance(msg, dict):
1335
+ continue
1336
+ x = _user_text(msg)
1337
+ if x is None or not x.strip() or x.lstrip().startswith(_NOT_A_PROMPT):
1338
+ continue
1339
+ prompts.append(x.strip())
1340
+ here = current.strip()
1341
+ while prompts and prompts[-1] == here:
1342
+ prompts.pop()
1343
+ return prompts[-1] if prompts else ""
1344
+ except Exception: # noqa: BLE001 - Q3: any failure is no head
1345
+ return ""
1346
+
1347
+
1348
+ def _head_query(prompt: str, transcript: str) -> str | None:
1349
+ """The BM25F query for a short `prompt`: `prompt + "\n" + prev[:HEAD_CUT]`, or `None`
1350
+ (a long prompt, or no previous prompt to borrow)."""
1351
+ if len(prompt) >= HEAD_SHORT:
1352
+ return None
1353
+ prev = _previous_prompt(transcript, prompt)
1354
+ return f"{prompt}\n{prev[:HEAD_CUT]}" if prev else None
1355
+
1356
+
1266
1357
  def _user_prompt_submit(run: HookRun, payload: dict[str, Any]) -> None:
1267
1358
  _turn_open(run, payload) # #200: before the skip; a command's turn can still run Bash
1268
1359
  prompt = str(payload.get("prompt") or "").strip()
@@ -1286,7 +1377,10 @@ def _user_prompt_submit(run: HookRun, payload: dict[str, Any]) -> None:
1286
1377
  # that name those files (`W_CONTEXT`), and, when the via path is on, admits one of them
1287
1378
  # past the gate. `None` (no repo, no touches, no graph, any error) is today's recall.
1288
1379
  touch = _touch_context(run, payload, m)
1289
- o = m.recall_outcome(prompt, 3, stamp=False, context=touch)
1380
+ # #207 amendment 3 (Q3): a short prompt borrows the session's previous prompt for its
1381
+ # BM25F terms. `memory_recall` never does; only this payload carries `transcript_path`.
1382
+ head = _head_query(prompt, _js_str(payload.get("transcript_path") or ""))
1383
+ o = m.recall_outcome(prompt, 3, stamp=False, context=touch, head=head)
1290
1384
  skipped = [dict(s) for s in o.skipped]
1291
1385
  degraded: dict[str, Any] = {"skipped": skipped} if skipped else {}
1292
1386
  if touch is not None:
@@ -49,6 +49,7 @@ from bantamkit.eventlog import EventLog
49
49
  from bantamkit.mcpreport import build_report as build_mcp_report
50
50
  from bantamkit.mcpreport import resolve_event_log_path
51
51
  from bantamkit.memory import DEFAULT_INDEX_BUDGET, INDEX_PRESSURE_PERCENT, Memory
52
+ from bantamkit.memory import queries as memory_queries_mod
52
53
  from bantamkit.memory import usage as memory_usage
53
54
  from bantamkit.memory.store import MemoryValidationError
54
55
  from bantamkit.pricing import PriceTableError
@@ -1022,6 +1023,9 @@ def status_report(
1022
1023
  # J68-10: an append that could not be written is counted in `memory.usage` and named
1023
1024
  # here, so an unwritable ledger is visible (#199 D5 error row).
1024
1025
  memory_usage.status_line(*memory.usage_census()),
1026
+ # #207 amendment 3 (Q8): how many facts carry likely-prompt queries, LAST, so every
1027
+ # line above keeps its number.
1028
+ _queries_line(memory),
1025
1029
  ]
1026
1030
  if conditions:
1027
1031
  lines.append(f"{_plural(len(conditions), 'problem')}:")
@@ -1029,6 +1033,15 @@ def status_report(
1029
1033
  return "\n".join(lines)
1030
1034
 
1031
1035
 
1036
+ def _queries_line(memory: Memory) -> str:
1037
+ """S10 `queries: <n> of <m> facts`, or S11 when the walk raises: one line never sinks a
1038
+ status report."""
1039
+ try:
1040
+ return memory_queries_mod.status_line(*memory.queries_coverage())
1041
+ except Exception: # noqa: BLE001 - a status report never raises over one line
1042
+ return "queries: unavailable"
1043
+
1044
+
1032
1045
  class _ArgMetadata(FuncMetadata): # type: ignore[misc,valid-type]
1033
1046
  """The SDK's argument metadata, with the JSON pre-parse switched off where Node has none.
1034
1047
 
@@ -1484,9 +1497,12 @@ def build_server(memory: Memory, log: EventLog | None = None) -> Any:
1484
1497
  body: str,
1485
1498
  links: list[str] | None = None,
1486
1499
  keywords: list[str] | None = None,
1500
+ queries: list[str] | None = None,
1487
1501
  ) -> str:
1488
1502
  with _record_raise(log, "memory_save"):
1489
- outcome = memory.save_outcome(type, name, description, body, links, keywords)
1503
+ outcome = memory.save_outcome(
1504
+ type, name, description, body, links, keywords, queries
1505
+ )
1490
1506
  if log.enabled:
1491
1507
  # Only when a log is actually on: `index_accounting` re-parses `facts/`, and
1492
1508
  # a diagnostic must not put that on the path of an operator who did not ask
@@ -1666,6 +1682,18 @@ def build_server(memory: Memory, log: EventLog | None = None) -> Any:
1666
1682
 
1667
1683
  return _noted_dict(_record_result(log, "work_plan", answered))
1668
1684
 
1685
+ def memory_queries(facts: list[dict[str, Any]] | None = None) -> dict[str, Any]:
1686
+ # #207 amendment 3 (Q6): `{}` lists the facts with no likely-prompt queries and the
1687
+ # instructions for writing theirs; `{"facts": [...]}` writes them. The refusal is the
1688
+ # `{"result": "error", "reason"}` shape `work_plan` uses, recorded the same way.
1689
+ return _noted_dict(
1690
+ _record_result(
1691
+ log,
1692
+ "memory_queries",
1693
+ lambda: memory.queries_missing() if facts is None else memory.queries_write(facts),
1694
+ )
1695
+ )
1696
+
1669
1697
  def shiftwork_plan(checkpoint: str) -> dict[str, Any]:
1670
1698
  return _noted_dict(
1671
1699
  _record_result(log, "shiftwork_plan", lambda: shiftwork.plan_batches(checkpoint))
@@ -2042,6 +2070,7 @@ def build_server(memory: Memory, log: EventLog | None = None) -> Any:
2042
2070
  _from_manifest(token_ledger, "token_ledger"),
2043
2071
  _from_manifest(work_plan, "work_plan"),
2044
2072
  _from_manifest(shiftwork_plan, "shiftwork_plan"),
2073
+ _from_manifest(memory_queries, "memory_queries"),
2045
2074
  ]
2046
2075
 
2047
2076
  server = MCPServer(
@@ -2,7 +2,7 @@
2
2
 
3
3
  `docs/memory.md` states, as a design decision, that `lint`, `archived` and
4
4
  `restore` are **not** agent tools — "lifecycle is an operator decision, not a
5
- model decision" — and the fourteen-tool surface holds to it; `compact` is the one
5
+ model decision" — and the fifteen-tool surface holds to it; `compact` is the one
6
6
  exception since job42 (`memory_compact`, the on-refusal path the model reaches
7
7
  itself). That position is only coherent if the operator can actually make the
8
8
  decision. Measured