@herbertgao/pi-extensions 2026.9.6 → 2026.9.7

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 (240) hide show
  1. package/README.md +3 -8
  2. package/THIRD_PARTY_NOTICES.md +0 -4
  3. package/node_modules/@narumitw/pi-btw/README.md +2 -0
  4. package/node_modules/@narumitw/pi-btw/dist/index.ts +284 -365
  5. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
  6. package/node_modules/@narumitw/pi-btw/package.json +52 -53
  7. package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +494 -547
  8. package/node_modules/@narumitw/pi-btw/src/btw.ts +814 -856
  9. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +673 -674
  10. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +228 -270
  11. package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +309 -318
  12. package/node_modules/@narumitw/pi-btw/src/menu.ts +416 -454
  13. package/node_modules/@narumitw/pi-btw/src/settings.ts +203 -219
  14. package/node_modules/@narumitw/pi-btw/src/side-thread.ts +173 -201
  15. package/node_modules/@narumitw/pi-btw/src/text.ts +21 -23
  16. package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +65 -0
  17. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +611 -662
  18. package/node_modules/pi-lens/CHANGELOG.md +239 -0
  19. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -0
  20. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +30 -4
  21. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +2 -0
  22. package/node_modules/pi-lens/dist/clients/bash-file-access.js +26 -0
  23. package/node_modules/pi-lens/dist/clients/biome-client.js +1 -1
  24. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +403 -35
  25. package/node_modules/pi-lens/dist/clients/bootstrap.js +6 -1
  26. package/node_modules/pi-lens/dist/clients/cascade-format.js +200 -4
  27. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +10 -2
  28. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +16 -1
  29. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +12 -1
  30. package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +65 -0
  31. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +28 -0
  32. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +9 -2
  33. package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +222 -0
  34. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +389 -13
  35. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +175 -25
  36. package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +62 -0
  37. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +21 -41
  38. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +6 -1
  39. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +7 -7
  40. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -12
  41. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +2 -21
  42. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
  43. package/node_modules/pi-lens/dist/clients/dispatch/types.js +4 -1
  44. package/node_modules/pi-lens/dist/clients/disposition-publish.js +1 -0
  45. package/node_modules/pi-lens/dist/clients/effective-config.js +1 -1
  46. package/node_modules/pi-lens/dist/clients/file-kinds.js +26 -1
  47. package/node_modules/pi-lens/dist/clients/file-role.js +21 -21
  48. package/node_modules/pi-lens/dist/clients/file-utils.js +156 -10
  49. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +56 -9
  50. package/node_modules/pi-lens/dist/clients/format-service.js +39 -21
  51. package/node_modules/pi-lens/dist/clients/formatters.js +60 -13
  52. package/node_modules/pi-lens/dist/clients/generation-guard.js +2 -2
  53. package/node_modules/pi-lens/dist/clients/git-guard.js +11 -3
  54. package/node_modules/pi-lens/dist/clients/indent-retarget.js +78 -8
  55. package/node_modules/pi-lens/dist/clients/installer/index.js +333 -114
  56. package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +7 -0
  57. package/node_modules/pi-lens/dist/clients/instance-reaper.js +20 -10
  58. package/node_modules/pi-lens/dist/clients/language-profile.js +23 -1
  59. package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
  60. package/node_modules/pi-lens/dist/clients/latency-logger.js +4 -1
  61. package/node_modules/pi-lens/dist/clients/lens-engine.js +12 -3
  62. package/node_modules/pi-lens/dist/clients/lens-events.js +2 -1
  63. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +79 -0
  64. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +2 -1
  65. package/node_modules/pi-lens/dist/clients/lsp/client.js +25 -21
  66. package/node_modules/pi-lens/dist/clients/lsp/config.js +2 -2
  67. package/node_modules/pi-lens/dist/clients/lsp/index.js +7 -0
  68. package/node_modules/pi-lens/dist/clients/lsp/launch.js +16 -4
  69. package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -2
  70. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +2 -1
  71. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +5 -3
  72. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +12 -8
  73. package/node_modules/pi-lens/dist/clients/mcp/session.js +36 -4
  74. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +24 -7
  75. package/node_modules/pi-lens/dist/clients/observed-mutation.js +40 -2
  76. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +23 -3
  77. package/node_modules/pi-lens/dist/clients/opengrep-client.js +110 -15
  78. package/node_modules/pi-lens/dist/clients/path-utils.js +123 -3
  79. package/node_modules/pi-lens/dist/clients/performance-report.js +5 -1
  80. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +1 -1
  81. package/node_modules/pi-lens/dist/clients/pipeline.js +74 -5
  82. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +37 -5
  83. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +145 -18
  84. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +4 -1
  85. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +59 -3
  86. package/node_modules/pi-lens/dist/clients/project-lens-config.js +45 -2
  87. package/node_modules/pi-lens/dist/clients/read-guard.js +70 -11
  88. package/node_modules/pi-lens/dist/clients/resource-sampler.js +147 -9
  89. package/node_modules/pi-lens/dist/clients/ruff-client.js +1 -1
  90. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +33 -5
  91. package/node_modules/pi-lens/dist/clients/runtime-context.js +6 -2
  92. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +77 -7
  93. package/node_modules/pi-lens/dist/clients/runtime-session.js +21 -2
  94. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +43 -12
  95. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +330 -85
  96. package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -17
  97. package/node_modules/pi-lens/dist/clients/safe-spawn.js +258 -5
  98. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +6 -0
  99. package/node_modules/pi-lens/dist/clients/session-event-guard.js +50 -5
  100. package/node_modules/pi-lens/dist/clients/sg-runner.js +23 -11
  101. package/node_modules/pi-lens/dist/clients/sgconfig.js +79 -2
  102. package/node_modules/pi-lens/dist/clients/test-runner-client.js +6 -41
  103. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +43 -0
  104. package/node_modules/pi-lens/dist/clients/tool-agreement.js +423 -0
  105. package/node_modules/pi-lens/dist/clients/tool-config.js +50 -0
  106. package/node_modules/pi-lens/dist/clients/tool-cwd.js +47 -76
  107. package/node_modules/pi-lens/dist/clients/tool-policy.js +163 -7
  108. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +120 -0
  109. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +127 -189
  110. package/node_modules/pi-lens/dist/clients/widget-state.js +98 -0
  111. package/node_modules/pi-lens/dist/clients/word-index.js +5 -2
  112. package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +7 -0
  113. package/node_modules/pi-lens/dist/index.js +27416 -24153
  114. package/node_modules/pi-lens/dist/mcp/server.js +5 -2
  115. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +7 -1
  116. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +168 -53
  117. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +244 -72
  118. package/node_modules/pi-lens/docs/audit1.md +5 -5
  119. package/node_modules/pi-lens/docs/dependencies.md +11 -0
  120. package/node_modules/pi-lens/docs/dispositions.md +52 -0
  121. package/node_modules/pi-lens/docs/environment-variables.md +2 -2
  122. package/node_modules/pi-lens/docs/features.md +4 -4
  123. package/node_modules/pi-lens/docs/globalconfig.md +3 -1
  124. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  125. package/node_modules/pi-lens/docs/pi-lens-fixer.md +53 -94
  126. package/node_modules/pi-lens/docs/pi-lens-investigator.md +43 -38
  127. package/node_modules/pi-lens/docs/pi-lens-retro.md +97 -0
  128. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +53 -66
  129. package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -0
  130. package/node_modules/pi-lens/docs/settings.md +7 -4
  131. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
  132. package/node_modules/pi-lens/docs/usage.md +2 -0
  133. package/node_modules/pi-lens/package.json +1 -1
  134. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +24 -12
  135. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +40 -0
  136. package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +15 -0
  137. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +7 -0
  138. package/package.json +5 -11
  139. package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +0 -376
  140. package/node_modules/@luxusai/pi-hindsight/README.md +0 -92
  141. package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +0 -56
  142. package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +0 -169
  143. package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +0 -107
  144. package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +0 -89
  145. package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +0 -189
  146. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
  147. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
  148. package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +0 -54
  149. package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +0 -75
  150. package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +0 -300
  151. package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +0 -158
  152. package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +0 -164
  153. package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +0 -139
  154. package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +0 -74
  155. package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +0 -261
  156. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +0 -151
  157. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +0 -18
  158. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +0 -46
  159. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +0 -383
  160. package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +0 -240
  161. package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +0 -176
  162. package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +0 -178
  163. package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +0 -41
  164. package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +0 -386
  165. package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +0 -39
  166. package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +0 -34
  167. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +0 -140
  168. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +0 -61
  169. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +0 -925
  170. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +0 -247
  171. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +0 -547
  172. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +0 -480
  173. package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +0 -182
  174. package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +0 -86
  175. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +0 -1010
  176. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +0 -175
  177. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +0 -425
  178. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +0 -210
  179. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +0 -817
  180. package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +0 -25
  181. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +0 -319
  182. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +0 -196
  183. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +0 -189
  184. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +0 -65
  185. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +0 -260
  186. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +0 -244
  187. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +0 -59
  188. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +0 -82
  189. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +0 -45
  190. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +0 -331
  191. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +0 -354
  192. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +0 -66
  193. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +0 -132
  194. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +0 -228
  195. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +0 -74
  196. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +0 -16
  197. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +0 -648
  198. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +0 -105
  199. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +0 -68
  200. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +0 -71
  201. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +0 -13
  202. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +0 -162
  203. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +0 -131
  204. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +0 -104
  205. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +0 -37
  206. package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +0 -893
  207. package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +0 -35
  208. package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +0 -177
  209. package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +0 -7
  210. package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +0 -21
  211. package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +0 -112
  212. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +0 -111
  213. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +0 -214
  214. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +0 -70
  215. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +0 -392
  216. package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +0 -45
  217. package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +0 -9
  218. package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +0 -860
  219. package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +0 -105
  220. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +0 -189
  221. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +0 -299
  222. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +0 -201
  223. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +0 -47
  224. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +0 -239
  225. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +0 -50
  226. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +0 -259
  227. package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +0 -77
  228. package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +0 -534
  229. package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +0 -319
  230. package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +0 -325
  231. package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +0 -42
  232. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +0 -244
  233. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +0 -56
  234. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +0 -50
  235. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +0 -167
  236. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +0 -207
  237. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +0 -120
  238. package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +0 -8
  239. package/node_modules/@luxusai/pi-hindsight/package.json +0 -118
  240. package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +0 -75
@@ -1,75 +0,0 @@
1
- # Compatibility matrix
2
-
3
- Pi Hindsight 1.0 is a Pi-first Hindsight integration. This page is the support contract for the 1.0 line.
4
-
5
- ## Supported runtime matrix
6
-
7
- | Component | 1.0 support policy | Source of truth |
8
- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
9
- | Node.js | `>=20` | `package.json#engines.node` |
10
- | npm | `>=10` | `package.json#engines.npm` |
11
- | Pi runtime packages | Tested with the `@earendil-works/pi-*` versions pinned in `devDependencies`; peer dependencies accept Pi runtime packages supplied by the host Pi installation. | `package.json#devDependencies` and `package.json#peerDependencies` |
12
- | TypeBox | `>=1.1.24 <2` | `package.json#peerDependencies.typebox` |
13
- | Hindsight TypeScript client | `@vectorize-io/hindsight-client ^0.9.0` | `package.json#dependencies` |
14
- | Hindsight server | **Hindsight 0.8+** with append `update_mode` support, compatible with `@vectorize-io/hindsight-client ^0.9.0`. Knowledge pages need server routes that match the 0.9 client; other advanced surfaces stay capability-gated. | `/hindsight:doctor`, live smoke, and official Hindsight API behavior |
15
-
16
- ## Required Hindsight capabilities
17
-
18
- The automatic memory path requires:
19
-
20
- - retain
21
- - recall
22
- - reflect
23
- - append-style retain updates (`updateMode: "append"`)
24
- - deterministic document IDs accepted by retain
25
- - tag filters for scoped recall
26
-
27
- If append retain is unavailable, live automatic retain is not considered supported for 1.0. Upgrade to Hindsight 0.8+; `/hindsight:doctor` documents the server floor and remediation action.
28
-
29
- ## Capability-gated surfaces
30
-
31
- These surfaces are part of the 1.0 Pi surface, but the exact fields and behavior can depend on the connected Hindsight server version:
32
-
33
- - advanced recall/reflect options such as trace, source facts, included chunks, response schemas, and tool-call facts
34
- - knowledge pages (`hindsight_knowledge` tree/search/get/export and dry-run mutating ops) — requires `@vectorize-io/hindsight-client ^0.9.0` and a server that exposes knowledge-base APIs
35
- - read-only bank config/stats facts in status
36
-
37
- When a server does not expose one of these endpoints or fields, Pi Hindsight should fail with a clear unsupported-capability message rather than silently changing request shape. Admin and browsing surfaces (documents, entities, graphs, tags, memory units, mental models, directives, bank templates, operations) live in the Hindsight control-plane web UI.
38
-
39
- ## 1.0 scope decision
40
-
41
- For 1.0, Pi Hindsight chooses **stable Pi-first integration** over full upstream global-admin parity.
42
-
43
- In scope:
44
-
45
- - Pi lifecycle recall/retain integration
46
- - queue-first retain and diagnostics
47
- - deterministic project/user bank routing
48
- - explicit retain/recall/reflect tools
49
- - Pi session import
50
- - live smoke and package/release verification
51
-
52
- Out of scope for 1.0 unless a follow-up issue explicitly pulls them in:
53
-
54
- - cross-bank `list_banks`
55
- - arbitrary cross-bank `create_bank`
56
- - full-bank `delete_bank`
57
- - platform-wide bank statistics/admin dashboards
58
- - audit log and webhook administration
59
- - generic non-Pi framework adapters in this package
60
-
61
- Rationale: global-admin and platform surfaces carry broader safety, permission, and UX obligations than the Pi memory lifecycle. Pi Hindsight can still expose scoped bank operations that directly help Pi users inspect, repair, or configure their selected project/user banks.
62
-
63
- ## Diagnostics contract
64
-
65
- `/hindsight:doctor` and status-style diagnostics should report:
66
-
67
- - Pi Hindsight package version and user agent
68
- - supported runtime ranges from this matrix
69
- - configured Hindsight base URL without secrets
70
- - official Hindsight client package and supported range
71
- - health reachability
72
- - server floor (Hindsight 0.8+ append retain) and remediation action
73
- - memory profile, routes, selected banks, queue state, import state, and activity
74
-
75
- Diagnostics must redact API keys and avoid printing raw retained payloads in normal mode.
@@ -1,300 +0,0 @@
1
- # Hindsight core functions
2
-
3
- This page is infographic copy and onboarding text for explaining how Hindsight memory works.
4
-
5
- ## One-sentence model
6
-
7
- **Hindsight is a memory system that separates storage, retrieval, and reasoning.**
8
-
9
- ```text
10
- Retain = store memory
11
- Recall = retrieve memory
12
- Reflect = analyze memory
13
- ```
14
-
15
- Everything happens inside a **Memory Bank**, which controls memory scope and prevents leakage.
16
-
17
- ## Core functions
18
-
19
- ### Memory Bank — isolated memory namespace
20
-
21
- A memory bank decides which memories belong together.
22
-
23
- Use memory banks to separate users, projects, agents, work vs personal memory, and sensitive vs general memory. A bank can have its own mission, such as “remember durable project architecture decisions” or “remember cross-project user preferences.”
24
-
25
- **Why it matters:** memory banks prevent leakage, simplify governance, and make memory easier to inspect.
26
-
27
- ### Retain — store raw experience
28
-
29
- Retain writes source material into Hindsight after a conversation turn, agent session, document, note, log, decision, or event.
30
-
31
- Best input:
32
-
33
- - structured JSON conversation
34
- - raw notes
35
- - documents
36
- - logs with context
37
- - session deltas
38
- - decisions with source information
39
-
40
- Avoid:
41
-
42
- - pre-summarized content when raw content exists
43
- - random `document_id`s
44
- - missing `context`
45
- - mixing unrelated projects
46
- - retaining recalled memory back into memory
47
-
48
- Retain does not mean “store this exact wording as final truth.” It means “here is source material; extract useful memory from it.”
49
-
50
- **Purpose:** store raw data so the system can extract truth.
51
-
52
- ### Recall — retrieve relevant memory candidates
53
-
54
- Recall searches memory before an AI generates an answer.
55
-
56
- Recall answers: “What past memories are relevant to this current query?”
57
-
58
- Recall is query-dependent. Different prompts should retrieve different memories. Recall may use semantic search, keyword matching, graph relationships, temporal ranking, tags, and filters.
59
-
60
- Use recall for giving an agent useful context, retrieving past facts, remembering project decisions, recalling user preferences, and grounding current work in past sessions.
61
-
62
- **Killer rule:** recall returns candidates, not answers.
63
-
64
- **Purpose:** bring relevant past memory into the current moment.
65
-
66
- ### Reflect — analyze memory for this question
67
-
68
- Reflect performs ad-hoc, agentic analysis over memory. It is not normal search. It asks Hindsight to reason across memories and synthesize an answer for a specific question.
69
-
70
- Reflect answers: “Analyze the memories and reason through this question now.”
71
-
72
- Use reflect for:
73
-
74
- - investigating patterns
75
- - comparing past decisions
76
- - finding contradictions
77
- - understanding changes over time
78
- - synthesizing lessons from many sessions
79
- - answering complex “why did this happen?” questions
80
- - doing ad-hoc project or workflow analysis
81
-
82
- Reflect is less ideal for stable recurring summaries like user profiles, coding preferences, project architecture overviews, or always-on assistant guidance. Those fit better as mental models.
83
-
84
- **Purpose:** memory-grounded reasoning for one specific question.
85
-
86
- ### Observations — facts learned from repetition
87
-
88
- Observations are consolidated beliefs created from retained memories. They are usually not written directly by the app. Hindsight creates and updates them after retain.
89
-
90
- Examples:
91
-
92
- - “User consistently prefers simple, minimal tooling.”
93
- - “This project favors project-scoped memory over global shared memory.”
94
-
95
- Observations can gather repeated evidence, strengthen over time, weaken when contradicted, become stale, and preserve supporting source memories.
96
-
97
- **Brutal distinction:** observations are facts learned from repetition.
98
-
99
- **Purpose:** reduce duplicate evidence into durable knowledge.
100
-
101
- ### Mental Models — reusable answers to recurring questions
102
-
103
- Mental models are persistent syntheses over memory. They are useful when the same kind of memory question comes up often.
104
-
105
- Good mental model examples:
106
-
107
- - “What are this user’s coding preferences?”
108
- - “What is this project’s architecture?”
109
- - “How should this agent collaborate with this user?”
110
- - “What recurring workflow habits matter?”
111
- - “What does this project consider good design?”
112
-
113
- Mental models are not raw recall. They are reusable synthesized answers. In Pi Hindsight they are explicit advanced resources (setup / hub `t` / agent control plane). The extension must not auto-create mental models from routine sessions. Starter suggestions are documented in [`starter-mental-model-suggestions.md`](starter-mental-model-suggestions.md). Evaluation alignment notes: [`coding-memory-evaluation.md`](coding-memory-evaluation.md).
114
-
115
- Creating a mental model preserves a source query. Hindsight runs that query through reflect and stores the generated content. Bundled templates set `trigger.mode: delta` and `refresh_after_consolidation: true` so consolidation folds new observations without full rewrites every time (server-side; not a Pi background job).
116
-
117
- Agents should treat missions and mental models as tunable policy: propose improvements with dry-run tools, do not mutate silently. See [Mission and mental-model quality](mission-and-mental-model-quality.md).
118
-
119
- ```text
120
- Observations = facts learned from repetition
121
- Mental Models = answers built from remembered facts
122
- ```
123
-
124
- **Purpose:** provide fast, consistent high-level memory understanding.
125
-
126
- ## Do / Don’t
127
-
128
- ### Do
129
-
130
- - Store raw, contextual data.
131
- - Use consistent `document_id`s.
132
- - Set useful `context`.
133
- - Tag aggressively.
134
- - Separate unrelated memory into banks.
135
- - Use recall before answer generation.
136
- - Use reflect for deeper ad-hoc analysis.
137
- - Use mental models for recurring stable context.
138
-
139
- ### Don’t
140
-
141
- - Summarize before retain when raw data exists.
142
- - Use random document IDs for the same source.
143
- - Mix unrelated projects in one memory bank.
144
- - Store recalled memory back into memory.
145
- - Use metadata as the main filter.
146
- - Rely on recall alone for complex analysis.
147
- - Treat observations and mental models as the same thing.
148
-
149
- ## Common failure modes
150
-
151
- | Failure | Result | Fix |
152
- | ---------------- | ----------------------------------------------- | ------------------------------------------------------------------------- |
153
- | Bad retain | missing context → weak extraction → weak recall | retain raw structured data, add clear `context`, use stable `document_id` |
154
- | No tags | wrong memories retrieved | tag by project, user, source; use strict filtering when scope matters |
155
- | No reflect | shallow answers for complex questions | use recall for candidates and reflect for analysis |
156
- | Too many banks | fragmented knowledge | separate only meaningful scopes; use tags inside banks when enough |
157
- | Too much summary | lost evidence | retain raw source when possible |
158
-
159
- ## Important supporting fields
160
-
161
- ### `context`
162
-
163
- Tells Hindsight what kind of content is being retained.
164
-
165
- Example: `Pi coding session for repo pi-hindsight`
166
-
167
- **Purpose:** improve extraction quality.
168
-
169
- ### `document_id`
170
-
171
- Stable ID for the same source document or session.
172
-
173
- Same `document_id` means: “this is more content for the same memory source.”
174
-
175
- **Purpose:** prevent duplicate memory documents.
176
-
177
- ### `update_mode`
178
-
179
- Controls how retained content updates an existing document.
180
-
181
- Use `append` for live ongoing sessions and incremental logs. Use `replace` for deterministic historical imports, full rebuilds, or reprocessing the same source from scratch.
182
-
183
- **Purpose:** control whether new memory extends or replaces a source document.
184
-
185
- ### `tags`
186
-
187
- Tags control scope and filtering.
188
-
189
- Examples: `user:luxus`, `repo:pi-hindsight`, `session:abc123`, `source:pi`, `harness:pi`.
190
-
191
- **Purpose:** recall the right memories and avoid cross-scope leakage.
192
-
193
- ### `metadata`
194
-
195
- Metadata stores provenance.
196
-
197
- Use tags for filtering. Use metadata for traceability.
198
-
199
- **Purpose:** trace memory back to its source.
200
-
201
- ### `timestamp`
202
-
203
- Gives temporal context.
204
-
205
- **Purpose:** support recency ranking, timeline reasoning, change detection, and stale-vs-current judgment.
206
-
207
- ### Observation scopes
208
-
209
- Observation scopes tell Hindsight how to group evidence when creating observations.
210
-
211
- Examples: `["harness:pi"]`, `["repo:pi-hindsight"]`, `["user:luxus"]`.
212
-
213
- **Purpose:** keep consolidated knowledge in the right scope.
214
-
215
- ## Simple flow
216
-
217
- ```mermaid
218
- flowchart TD
219
- A[Conversation happens] --> B[Retain raw structured content]
220
- B --> C[Extract facts, entities, events, relationships]
221
- C --> D[Observations consolidate repeated evidence]
222
- D --> E[Mental models provide reusable understanding]
223
- F[Future prompt arrives] --> G[Recall retrieves memory candidates]
224
- G --> H{Need deeper reasoning?}
225
- H -- Yes --> I[Reflect analyzes memory]
226
- H -- No --> J[Answer with retrieved context]
227
- I --> K[Answer with retrieved + synthesized context]
228
- ```
229
-
230
- ## Function summary
231
-
232
- ```text
233
- Memory Bank = isolated memory namespace
234
- Retain = store raw experience
235
- Recall = retrieve relevant memory candidates
236
- Reflect = ad-hoc analysis over memory
237
- Observations = facts learned from repetition
238
- Mental Models = answers built from remembered facts
239
- ```
240
-
241
- ## Infographic generation prompt
242
-
243
- Use this prompt with ChatGPT or another image/layout model:
244
-
245
- ```text
246
- Create a clean technical infographic explaining Hindsight memory core functions for AI agents.
247
-
248
- Audience: developers and technical product people. Style: modern, minimal, high-contrast, readable in 30 seconds. Use a dark or light professional SaaS style. Avoid clutter. Use simple icons and clear arrows.
249
-
250
- Main title:
251
- Hindsight Core Functions
252
-
253
- Top banner:
254
- Hindsight separates storage, retrieval, and reasoning.
255
- Retain = store memory. Recall = retrieve memory candidates. Reflect = analyze memory.
256
-
257
- Section 1: Memory Bank
258
- Label: Isolated memory namespace
259
- Text: Controls which memories belong together. Prevents leakage and simplifies governance.
260
- Examples: users, projects, agents, work vs personal.
261
-
262
- Section 2: Retain
263
- Label: Store raw experience
264
- Text: Writes raw contextual source material into memory so Hindsight can extract facts, entities, relationships, observations, and changes over time.
265
- Do: raw JSON, notes, documents, logs with context.
266
- Avoid: summaries when raw data exists, random document IDs, missing context.
267
-
268
- Section 3: Recall
269
- Label: Retrieve relevant memory candidates
270
- Text: Searches memory before an answer. Recall returns candidates, not answers.
271
- Signals: semantic search, keywords, graph relationships, time, tags.
272
-
273
- Section 4: Reflect
274
- Label: Analyze memory for this question
275
- Text: Ad-hoc agentic analysis over memories. Use for patterns, contradictions, decision evolution, lessons, and why/how questions.
276
- Note: user profiles and recurring summaries fit Mental Models better.
277
-
278
- Section 5: Observations
279
- Label: Facts learned from repetition
280
- Text: Auto-generated beliefs created from repeated evidence. Can strengthen, weaken, or become stale.
281
-
282
- Section 6: Mental Models
283
- Label: Answers built from remembered facts
284
- Text: Reusable stable understanding for recurring questions like user preferences, project architecture, and collaboration style.
285
-
286
- Add a small distinction strip:
287
- Observations = facts learned from repetition.
288
- Mental Models = answers built from those facts.
289
- Reflect = ad-hoc analysis for one question.
290
-
291
- Add a DO / DON’T strip:
292
- DO: store raw contextual data; use stable document_id; tag aggressively; separate unrelated memory.
293
- DON’T: summarize before retain; use random IDs; mix unrelated memory; treat recall as final answer.
294
-
295
- Add a flow diagram:
296
- Conversation → Retain → Extraction → Observations → Mental Models
297
- Future prompt → Recall → optional Reflect → Answer with retrieved + synthesized context
298
-
299
- Output: one-page infographic, strong visual hierarchy, concise text, enough whitespace, developer-friendly.
300
- ```
@@ -1,158 +0,0 @@
1
- # Mission and mental-model quality (agent guide)
2
-
3
- How bank **missions** and **mental models** should look in pi-hindsight — and when the agent should **propose** create / update / refresh (never silent bank mutation).
4
-
5
- Official Hindsight guidance: [Best practices](https://hindsight.vectorize.io/best-practices), [Mental models](https://hindsight.vectorize.io/developer/api/mental-models). Seeds: [Starter mental model suggestions](starter-mental-model-suggestions.md). Eval context: [Coding memory evaluation](coding-memory-evaluation.md).
6
-
7
- ## Hard rules (always)
8
-
9
- - **Propose, don’t invent silently.** Create/update/refresh/delete use tools with **dry-run first** (`hindsight_mental_model`, `hindsight_bank`); user confirms via dry-run false or hub `t`.
10
- - **Tags ⊆ retain tags.** Project models need `source:pi` + `project:<id>`; bank-global prefs: `source:pi` only. Tags not written at retain → empty refresh.
11
- - **One dimension per mental model.** Not “everything about the user/project.”
12
- - **Lean inject:** prefs ~600 tokens, project ~800. Fat content burns every turn.
13
- - **Refresh:** prefer `mode: delta` + `refresh_after_consolidation` on templates; agent create may only set consolidation refresh until the TS client maps full trigger fields.
14
- - **Missions** steer extraction/consolidation/reflect — vague missions → noisy memory (Hindsight #1 quality failure).
15
-
16
- ## Bank missions — what “good” looks like
17
-
18
- Three strings per bank (retain / observations / reflect):
19
-
20
- | Mission | Job | Good | Bad |
21
- | ---------------- | ------------------------------------------ | ------------------------------------------------------------------ | ---------------------------------- |
22
- | **retain** | What to extract / ignore from raw sessions | Concrete fact types + ignore list (greets, secrets, probe harness) | “Be helpful”, “extract everything” |
23
- | **observations** | Durable patterns after retain | Patterns, contradictions, durable only | Transient task state |
24
- | **reflect** | Persona for synthesis | Domain role + grounded + opinionated when supported | Generic chatbot |
25
-
26
- ### Coding bank (project)
27
-
28
- - Retain: decisions, trade-offs, blockers, conventions, durable project prefs.
29
- - Observations: stable architecture/process patterns; not TODOs of the day.
30
- - Reflect: senior developer for _this_ repo.
31
-
32
- ### Coding user bank (life bank **off** / cross-project prefs)
33
-
34
- - Retain: cross-project assistant prefs, workflows, clarification style.
35
- - **Not** file paths, project bugs, PR noise unless it generalizes.
36
-
37
- ### Life / conversation user bank
38
-
39
- - Retain: commitments, people/context, planning habits, communication prefs.
40
- - **Not** repo engineering detail unless it’s truly personal durable preference.
41
- - Reflect: personal/life-task assistant, not code reviewer.
42
-
43
- Defaults live in `extensions/banks/bank-operations.ts` (`defaultProjectBankMissions`, `defaultGlobalBankMissions`, `defaultLifeBankMissions`).
44
-
45
- ### When to propose mission changes
46
-
47
- Propose `hindsight_bank` `update_mission` (dry-run) when:
48
-
49
- - Extraction is consistently wrong (too much noise / missing decisions).
50
- - User says prefs are “wrong” or “missing” after several sessions.
51
- - Switching coding ↔ conversation use without matching missions.
52
-
53
- Do **not** churn missions every session.
54
-
55
- ## When optimization is worth it (signals)
56
-
57
- Optimize only when a **repeatable problem** shows up—not because content is imperfect once.
58
-
59
- ### Mental-model signals (inspect inject + `hindsight_mental_model` list/get)
60
-
61
- | Signal | What you see | Likely fix | Priority |
62
- | ----------------------------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
63
- | **Broken / empty content** | Inject or get shows `"#"`, empty body, “Generating…”, or only a title | `refresh`; if still empty: tags ⊆ retain tags; **prefs** MMs need `fact_types` world+experience+observation (not observation-only after clear); clear+full rebuild if needed | **High** — do this session |
64
- | **Wrong durable policy** | Prefs MM contradicts the user’s stated preference (e.g. “never ask” vs wants high-signal questions) | Explicit `hindsight_retain` of the correct pref → then refresh prefs MM; tighten `source_query` if probe noise keeps winning | **High** |
65
- | **Missing project starters** | Active `project:<id>` has no architecture/conventions/decisions models; bank only has other projects’ models | Propose apply/create starters for **this** project (+ bank-global prefs if missing) | **High** on setup / first real work in repo |
66
- | **Inject always truncated** | Blocks end mid-sentence; one model dominates (multi‑k chars, e.g. 8k–12k) while others starve | Cap `max_tokens` (600–800), refresh fat model; don’t add more models | **Medium** |
67
- | **Stale after big decisions** | User finished a real architecture/product choice; MM still describes the old world | Wait until retain finished (next turn+); refresh `project-decisions` (and architecture if seams changed) | **Medium** — after the decision is retained |
68
- | **Recurring same question** | Every session user asks the same durable “how do we X?” | One new MM for that **single** dimension, lean max_tokens | **Medium** |
69
- | **Cross-project bleed** | Prefs or decisions clearly about another repo appear under this project’s inject | Fix tags (project vs bank-global); never “fix” by editing another project’s ids while working here | **High** if isolation broken |
70
- | **Noise as “facts”** | Probe/bait/test harness text treated as durable prefs | Retain correction + refresh; mission ignore-list for probes; don’t import bait sessions | **Medium** |
71
- | **Slightly imperfect prose** | Wording could be nicer but policy is right | Leave it; delta refresh after consolidation is enough | **Low** — do not nag |
72
-
73
- ### Mission signals (`hindsight_bank` get + memory quality over several sessions)
74
-
75
- | Signal | What you see | Likely fix | Priority |
76
- | --------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------- |
77
- | **Noise flood** | Recall full of greets, scheduling, tool-probe rules, one-off chat | Tighten **retain** mission ignore-list | Medium–High if multi-session |
78
- | **Missing decisions** | Real architecture choices never appear in recall/MMs after real work | Broaden retain “extract decisions/trade-offs”; keep ignore list | Medium |
79
- | **Transient as durable** | Observations track active TODOs / “today we…” as eternal truth | Observations mission: durable only, contradictions, not task state | Medium |
80
- | **Wrong persona** | Reflect answers like a generic chatbot or wrong domain (coding vs life) | Align reflect mission with bank role (coding project vs life user) | Medium when reflect is used |
81
- | **Coding vs life mismatch** | Life bank extract file paths/PRs; coding bank extract pure calendar chit-chat | Use life vs global defaults (`defaultLifeBankMissions` vs coding user) | High only if life bank is enabled |
82
-
83
- ### Cadence (how often to even look)
84
-
85
- | Cadence | Action |
86
- | ---------------------------------------------- | ------------------------------------------------------------------------------------- |
87
- | **Session start / first work in a repo** | Quick: expected project starters present? Prefs MM non-empty and not obviously wrong? |
88
- | **After a major decision or multi-hour slice** | Optional: refresh decisions/architecture **after** retain has had a chance to land |
89
- | **User complains about memory** | Full inspect (status, scope, list MMs, bank missions); propose a **small** patch list |
90
- | **Not every turn** | No “shall I refresh mental models?” spam |
91
-
92
- ### Priority order when several things look off
93
-
94
- 1. Broken/empty MM content or isolation bleed
95
- 2. Prefs contradicting the user
96
- 3. Missing starters for **this** project
97
- 4. Fat inject / truncation
98
- 5. Mission noise (only if pattern spans sessions)
99
- 6. Polish / “could be nicer”
100
-
101
- ### Cost check before proposing
102
-
103
- Ask: will this change save **future** turns or only rephrase once?
104
-
105
- - **Yes (optimize):** empty prefs, wrong “never ask”, 12k decisions eating inject, missing project MMs.
106
- - **No (skip):** single awkward sentence, one stale bullet that recall already covers, speculative “maybe add 5 more models.”
107
-
108
- ## Mental models — what “good” looks like
109
-
110
- | Field | Good | Bad |
111
- | ---------------- | ------------------------------------------------------------------------ | ------------------------------------ |
112
- | **name** | Short dimension label | Marketing fluff |
113
- | **source_query** | Natural-language reflect question; “durable only”; exclude probe/one-off | Keyword dump; “summarize everything” |
114
- | **tags** | Subset of retain tags; project vs bank-global deliberate | Random tags never retained |
115
- | **max_tokens** | 600–800 for seeds | Unbounded essays |
116
- | **content** | Stable background; inject preamble says not instructions | Session task lists, secrets |
117
-
118
- ### Standard dimensions (coding)
119
-
120
- | Id pattern | Dimension |
121
- | ---------------------------------------- | ------------------------------------ |
122
- | `coding-assistant-operating-preferences` | Bank-global agent prefs |
123
- | `project-architecture-and-seams--<slug>` | Where changes belong |
124
- | `project-conventions--<slug>` | Build/test/review style |
125
- | `project-decisions--<slug>` | Durable product/architecture choices |
126
-
127
- Conversation/life seeds: goals, people/context, decisions/preferences (see starter doc).
128
-
129
- ### When to propose mental-model actions
130
-
131
- Use the **signals table above** (broken content, wrong prefs, missing starters, fat inject, post-decision refresh, recurring questions). Same tool path: dry-run create/update/refresh → user confirms.
132
-
133
- ### When **not** to propose
134
-
135
- - Every turn “should we refresh mental models?”
136
- - Creating models from probe/bait sessions.
137
- - Duplicating recall (raw facts) as a mental model.
138
- - Editing other projects’ tagged models while working in this project.
139
- - Optimizing for polish when policy and inject budget are already fine.
140
-
141
- ## Agent workflow (copy pattern)
142
-
143
- On user **memory complaints**, load skill `hindsight-memory-doctor` (`/skill:hindsight-memory-doctor`) — same inspect → diagnose → dry-run propose flow.
144
-
145
- 1. **Inspect:** `hindsight_status`, `hindsight_scope`, `hindsight_mental_model` list/get, `hindsight_bank` get.
146
- 2. **Diagnose** against this doc (tags, size, empty content, wrong prefs, missing project starters).
147
- 3. **Propose** in plain language: what changes, why, dry-run payload.
148
- 4. **Apply** only after user ok: `dryRun: false` on the same tool, or hub `t`.
149
- 5. **Verify:** list/get again; warn that inject list cache can lag (~`mentalModels.cacheTtlMs`).
150
-
151
- ## Anti-patterns
152
-
153
- - Pre-summarizing before retain.
154
- - Random `document_id`s / missing `context` on retain.
155
- - Metadata for filtering (use tags).
156
- - One mega mental model.
157
- - Mission “extract all information.”
158
- - Refreshing before new retains are available (same turn).