@herbertgao/pi-extensions 2026.9.5 → 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 (276) hide show
  1. package/README.md +5 -22
  2. package/THIRD_PARTY_NOTICES.md +0 -4
  3. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +1 -1
  4. package/node_modules/@herbertgao/sol-pi/package.json +1 -1
  5. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +0 -5
  6. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +3 -1
  7. package/node_modules/@narumitw/pi-btw/README.md +2 -0
  8. package/node_modules/@narumitw/pi-btw/dist/index.ts +284 -365
  9. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
  10. package/node_modules/@narumitw/pi-btw/package.json +52 -53
  11. package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +494 -547
  12. package/node_modules/@narumitw/pi-btw/src/btw.ts +814 -856
  13. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +673 -674
  14. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +228 -270
  15. package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +309 -318
  16. package/node_modules/@narumitw/pi-btw/src/menu.ts +416 -454
  17. package/node_modules/@narumitw/pi-btw/src/settings.ts +203 -219
  18. package/node_modules/@narumitw/pi-btw/src/side-thread.ts +173 -201
  19. package/node_modules/@narumitw/pi-btw/src/text.ts +21 -23
  20. package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +65 -0
  21. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +611 -662
  22. package/node_modules/pi-lens/CHANGELOG.md +239 -0
  23. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -0
  24. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +30 -4
  25. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +2 -0
  26. package/node_modules/pi-lens/dist/clients/bash-file-access.js +26 -0
  27. package/node_modules/pi-lens/dist/clients/biome-client.js +1 -1
  28. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +403 -35
  29. package/node_modules/pi-lens/dist/clients/bootstrap.js +6 -1
  30. package/node_modules/pi-lens/dist/clients/cascade-format.js +200 -4
  31. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +10 -2
  32. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +16 -1
  33. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +12 -1
  34. package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +65 -0
  35. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +28 -0
  36. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +9 -2
  37. package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +222 -0
  38. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +389 -13
  39. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +175 -25
  40. package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +62 -0
  41. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +21 -41
  42. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +6 -1
  43. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +7 -7
  44. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -12
  45. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +2 -21
  46. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
  47. package/node_modules/pi-lens/dist/clients/dispatch/types.js +4 -1
  48. package/node_modules/pi-lens/dist/clients/disposition-publish.js +1 -0
  49. package/node_modules/pi-lens/dist/clients/effective-config.js +1 -1
  50. package/node_modules/pi-lens/dist/clients/file-kinds.js +26 -1
  51. package/node_modules/pi-lens/dist/clients/file-role.js +21 -21
  52. package/node_modules/pi-lens/dist/clients/file-utils.js +156 -10
  53. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +56 -9
  54. package/node_modules/pi-lens/dist/clients/format-service.js +39 -21
  55. package/node_modules/pi-lens/dist/clients/formatters.js +60 -13
  56. package/node_modules/pi-lens/dist/clients/generation-guard.js +2 -2
  57. package/node_modules/pi-lens/dist/clients/git-guard.js +11 -3
  58. package/node_modules/pi-lens/dist/clients/indent-retarget.js +78 -8
  59. package/node_modules/pi-lens/dist/clients/installer/index.js +333 -114
  60. package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +7 -0
  61. package/node_modules/pi-lens/dist/clients/instance-reaper.js +20 -10
  62. package/node_modules/pi-lens/dist/clients/language-profile.js +23 -1
  63. package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
  64. package/node_modules/pi-lens/dist/clients/latency-logger.js +4 -1
  65. package/node_modules/pi-lens/dist/clients/lens-engine.js +12 -3
  66. package/node_modules/pi-lens/dist/clients/lens-events.js +2 -1
  67. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +79 -0
  68. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +2 -1
  69. package/node_modules/pi-lens/dist/clients/lsp/client.js +25 -21
  70. package/node_modules/pi-lens/dist/clients/lsp/config.js +2 -2
  71. package/node_modules/pi-lens/dist/clients/lsp/index.js +7 -0
  72. package/node_modules/pi-lens/dist/clients/lsp/launch.js +16 -4
  73. package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -2
  74. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +2 -1
  75. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +5 -3
  76. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +12 -8
  77. package/node_modules/pi-lens/dist/clients/mcp/session.js +36 -4
  78. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +24 -7
  79. package/node_modules/pi-lens/dist/clients/observed-mutation.js +40 -2
  80. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +23 -3
  81. package/node_modules/pi-lens/dist/clients/opengrep-client.js +110 -15
  82. package/node_modules/pi-lens/dist/clients/path-utils.js +123 -3
  83. package/node_modules/pi-lens/dist/clients/performance-report.js +5 -1
  84. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +1 -1
  85. package/node_modules/pi-lens/dist/clients/pipeline.js +74 -5
  86. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +37 -5
  87. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +145 -18
  88. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +4 -1
  89. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +59 -3
  90. package/node_modules/pi-lens/dist/clients/project-lens-config.js +45 -2
  91. package/node_modules/pi-lens/dist/clients/read-guard.js +70 -11
  92. package/node_modules/pi-lens/dist/clients/resource-sampler.js +147 -9
  93. package/node_modules/pi-lens/dist/clients/ruff-client.js +1 -1
  94. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +33 -5
  95. package/node_modules/pi-lens/dist/clients/runtime-context.js +6 -2
  96. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +77 -7
  97. package/node_modules/pi-lens/dist/clients/runtime-session.js +21 -2
  98. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +43 -12
  99. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +330 -85
  100. package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -17
  101. package/node_modules/pi-lens/dist/clients/safe-spawn.js +258 -5
  102. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +6 -0
  103. package/node_modules/pi-lens/dist/clients/session-event-guard.js +50 -5
  104. package/node_modules/pi-lens/dist/clients/sg-runner.js +23 -11
  105. package/node_modules/pi-lens/dist/clients/sgconfig.js +79 -2
  106. package/node_modules/pi-lens/dist/clients/test-runner-client.js +6 -41
  107. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +43 -0
  108. package/node_modules/pi-lens/dist/clients/tool-agreement.js +423 -0
  109. package/node_modules/pi-lens/dist/clients/tool-config.js +50 -0
  110. package/node_modules/pi-lens/dist/clients/tool-cwd.js +47 -76
  111. package/node_modules/pi-lens/dist/clients/tool-policy.js +163 -7
  112. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +120 -0
  113. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +127 -189
  114. package/node_modules/pi-lens/dist/clients/widget-state.js +98 -0
  115. package/node_modules/pi-lens/dist/clients/word-index.js +5 -2
  116. package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +7 -0
  117. package/node_modules/pi-lens/dist/index.js +27416 -24153
  118. package/node_modules/pi-lens/dist/mcp/server.js +5 -2
  119. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +7 -1
  120. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +168 -53
  121. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +244 -72
  122. package/node_modules/pi-lens/docs/audit1.md +5 -5
  123. package/node_modules/pi-lens/docs/dependencies.md +11 -0
  124. package/node_modules/pi-lens/docs/dispositions.md +52 -0
  125. package/node_modules/pi-lens/docs/environment-variables.md +2 -2
  126. package/node_modules/pi-lens/docs/features.md +4 -4
  127. package/node_modules/pi-lens/docs/globalconfig.md +3 -1
  128. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  129. package/node_modules/pi-lens/docs/pi-lens-fixer.md +53 -94
  130. package/node_modules/pi-lens/docs/pi-lens-investigator.md +43 -38
  131. package/node_modules/pi-lens/docs/pi-lens-retro.md +97 -0
  132. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +53 -66
  133. package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -0
  134. package/node_modules/pi-lens/docs/settings.md +7 -4
  135. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
  136. package/node_modules/pi-lens/docs/usage.md +2 -0
  137. package/node_modules/pi-lens/package.json +1 -1
  138. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +24 -12
  139. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +40 -0
  140. package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +15 -0
  141. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +7 -0
  142. package/package.json +6 -17
  143. package/examples/pi-footer.json +0 -275
  144. package/node_modules/@czottmann/pi-automode/CHANGELOG.md +0 -70
  145. package/node_modules/@czottmann/pi-automode/LICENSE.md +0 -21
  146. package/node_modules/@czottmann/pi-automode/README.md +0 -215
  147. package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +0 -39
  148. package/node_modules/@czottmann/pi-automode/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +0 -46
  149. package/node_modules/@czottmann/pi-automode/docs/adr/ADR-002-global-config-in-extension-data-directory.md +0 -60
  150. package/node_modules/@czottmann/pi-automode/docs/adr/INDEX.md +0 -6
  151. package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +0 -428
  152. package/node_modules/@czottmann/pi-automode/docs/configuration.md +0 -171
  153. package/node_modules/@czottmann/pi-automode/docs/defaults.md +0 -178
  154. package/node_modules/@czottmann/pi-automode/docs/diagnostics.md +0 -90
  155. package/node_modules/@czottmann/pi-automode/docs/observability-logging.md +0 -160
  156. package/node_modules/@czottmann/pi-automode/examples/automode.local.json +0 -44
  157. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/bash.ts +0 -692
  158. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +0 -852
  159. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +0 -904
  160. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +0 -228
  161. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +0 -954
  162. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +0 -429
  163. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/log.ts +0 -173
  164. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/model-selector.ts +0 -113
  165. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/model.ts +0 -13
  166. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +0 -297
  167. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +0 -623
  168. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/state.ts +0 -102
  169. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/transcript.ts +0 -236
  170. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/types.ts +0 -205
  171. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/utils.ts +0 -54
  172. package/node_modules/@czottmann/pi-automode/extensions/auto-mode.ts +0 -26
  173. package/node_modules/@czottmann/pi-automode/package.json +0 -61
  174. package/node_modules/@czottmann/pi-automode/skills/automode-diagnostics/SKILL.md +0 -63
  175. package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +0 -376
  176. package/node_modules/@luxusai/pi-hindsight/README.md +0 -92
  177. package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +0 -56
  178. package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +0 -169
  179. package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +0 -107
  180. package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +0 -89
  181. package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +0 -189
  182. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
  183. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
  184. package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +0 -54
  185. package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +0 -75
  186. package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +0 -300
  187. package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +0 -158
  188. package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +0 -164
  189. package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +0 -139
  190. package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +0 -74
  191. package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +0 -261
  192. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +0 -151
  193. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +0 -18
  194. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +0 -46
  195. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +0 -383
  196. package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +0 -240
  197. package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +0 -176
  198. package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +0 -178
  199. package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +0 -41
  200. package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +0 -386
  201. package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +0 -39
  202. package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +0 -34
  203. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +0 -140
  204. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +0 -61
  205. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +0 -925
  206. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +0 -247
  207. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +0 -547
  208. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +0 -480
  209. package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +0 -182
  210. package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +0 -86
  211. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +0 -1010
  212. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +0 -175
  213. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +0 -425
  214. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +0 -210
  215. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +0 -817
  216. package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +0 -25
  217. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +0 -319
  218. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +0 -196
  219. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +0 -189
  220. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +0 -65
  221. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +0 -260
  222. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +0 -244
  223. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +0 -59
  224. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +0 -82
  225. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +0 -45
  226. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +0 -331
  227. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +0 -354
  228. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +0 -66
  229. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +0 -132
  230. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +0 -228
  231. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +0 -74
  232. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +0 -16
  233. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +0 -648
  234. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +0 -105
  235. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +0 -68
  236. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +0 -71
  237. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +0 -13
  238. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +0 -162
  239. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +0 -131
  240. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +0 -104
  241. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +0 -37
  242. package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +0 -893
  243. package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +0 -35
  244. package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +0 -177
  245. package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +0 -7
  246. package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +0 -21
  247. package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +0 -112
  248. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +0 -111
  249. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +0 -214
  250. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +0 -70
  251. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +0 -392
  252. package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +0 -45
  253. package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +0 -9
  254. package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +0 -860
  255. package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +0 -105
  256. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +0 -189
  257. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +0 -299
  258. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +0 -201
  259. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +0 -47
  260. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +0 -239
  261. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +0 -50
  262. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +0 -259
  263. package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +0 -77
  264. package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +0 -534
  265. package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +0 -319
  266. package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +0 -325
  267. package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +0 -42
  268. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +0 -244
  269. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +0 -56
  270. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +0 -50
  271. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +0 -167
  272. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +0 -207
  273. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +0 -120
  274. package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +0 -8
  275. package/node_modules/@luxusai/pi-hindsight/package.json +0 -118
  276. package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +0 -75
@@ -1,169 +0,0 @@
1
- # ADR 002: Explicit routing strategy seam
2
-
3
- ## Status
4
-
5
- Superseded by [ADR-004](004-lifeos-dual-bank-design.md) (2026-07-03). Kept for historical record; not a live contract.
6
-
7
- The typed strategy seam, richer dry-run presenter output, and expanded eval fixtures shipped and were later removed. This ADR's routing-input/output shapes, safety policy, and eval-fixture taxonomy below describe the router as it existed, not current behavior. `userRetain.mode`/`globalRetain.mode` is `"explicit-only"` in every profile today; there is no router mode.
8
-
9
- Amendment (2026-06): the `hindsight_route_memory` dry-run tool was removed in the slim-surface rewrite (#417). References to the tool below are historical.
10
-
11
- Amendment (2026-07): ADR-004 decided to remove the heuristic memory router entirely rather than revive its dry-run visibility, because it only ever auto-engaged in the narrow "User Only" profile, its own dry-run visibility was already gone, and an unexplainable heuristic classifier making automatic User Bank writes was exactly the silent-pollution risk this ADR warned against. The router, the `RoutingStrategy` seam, and the `"router"` config value were removed; personal-fact retain routing is explicit tools/commands only, matching every other profile.
12
-
13
- ## Context
14
-
15
- Pi Hindsight defaults to safe project-local automatic retain. User Bank automatic retain is disabled unless the user selects a profile or config mode that explicitly enables it. Legacy config/tool aliases still use `global` for this User Bank route.
16
-
17
- The current router is intentionally conservative and heuristic. It classifies candidate memory as `project`, `global`, `both`, or `skip`, where `global` is the legacy route name for the configured User Bank. `hindsight_route_memory` exposes the decision as a dry run in explicit-only mode. This is useful, but the seam needs a clear product contract before adding richer bank topologies such as per-user, per-agent, shared-knowledge, or explicit named banks.
18
-
19
- The main safety risk is silent User Bank pollution. Better routing must not make User Bank writes the default.
20
-
21
- ## Decision
22
-
23
- Routing remains opt-in for automatic writes. `userRetain.mode = "explicit-only"` stays the default. `globalRetain.mode` remains a legacy compatibility alias, not the preferred user-facing term.
24
-
25
- Pi Hindsight treats routing as an explicit strategy seam with stable input and output shapes. The default strategy keeps today's project/User Bank behavior while preserving legacy route values (`project`, `global`, `both`, `skip`) for compatibility. Future strategies may route to additional bank topologies only behind explicit configuration and dry-run inspection.
26
-
27
- ## Routing input shape
28
-
29
- Current implementation uses a compact typed seam:
30
-
31
- ```ts
32
- interface RoutingCandidate {
33
- content: string;
34
- context?: string;
35
- config: ResolvedConfig;
36
- cwd?: string;
37
- projectBankId?: string;
38
- sessionFile?: string;
39
- }
40
-
41
- interface RoutingStrategyInput {
42
- content: string;
43
- context?: string;
44
- config: ResolvedConfig;
45
- missions: {
46
- project: string;
47
- global: string; // legacy route name for User Bank mission
48
- };
49
- cwd?: string;
50
- projectBankId?: string;
51
- sessionFile?: string;
52
- }
53
- ```
54
-
55
- Future strategies may add normalized identity or channel context only after the source of that identity is documented.
56
-
57
- ## Routing output shape
58
-
59
- The dry-run operation returns an explainable decision:
60
-
61
- ```ts
62
- type MemoryRoute = "project" | "global" | "both" | "skip";
63
- type RoutingBankRole = "project" | "global";
64
-
65
- interface MemoryRouteDecision {
66
- route: MemoryRoute;
67
- confidence: number;
68
- signals: Array<"project" | "global" | "skip">;
69
- matchedSignals: string[];
70
- reason: string;
71
- mode: "explicit-only" | "router";
72
- writes: RoutingBankRole[];
73
- targets: Array<{
74
- bankRole: RoutingBankRole;
75
- bankId: string;
76
- tags: string[];
77
- willWrite: boolean;
78
- }>;
79
- safetyNotes: string[];
80
- projectMission: string;
81
- globalMission: string; // legacy route name for User Bank mission
82
- }
83
- ```
84
-
85
- The legacy `global` route name should be preserved until a compatibility break is intentional. User-facing copy should describe that target as User Bank memory.
86
-
87
- ## Safety policy
88
-
89
- - `explicit-only` means dry-run only. No automatic User Bank writes.
90
- - Router mode must be opt-in and visible in `/hindsight` status/config.
91
- - User Bank writes require high confidence or explicit user action.
92
- - Ambiguous project/User Bank content should prefer `both` with conservative tags, or ask/dry-run rather than silently picking User Bank.
93
- - Secrets, private URLs, bearer tokens, cookies, and transient artifact paths should route to `skip` or require redaction before retain.
94
- - Metadata records provenance; tags control scope and visibility.
95
- - Recalled memory must not be routed back into retain.
96
-
97
- ## Strategy seam
98
-
99
- Implemented strategy:
100
-
101
- 1. `project-global-default`: current project/User Bank/both/skip classifier using missions and heuristics. The implementation keeps `global` in type names as a legacy route value.
102
-
103
- Future strategies:
104
-
105
- 1. `dry-run-only`: always produces an explainable decision but writes nothing.
106
- 2. `named-bank`: resolves explicit named bank targets once config supports them.
107
- 3. `identity-aware`: includes per-user/per-agent context only after identity source is documented.
108
-
109
- The seam should not know Pi provider internals. It should receive normalized routing input from lifecycle/tool code.
110
-
111
- ## Eval fixture taxonomy
112
-
113
- Routing evals should continue to cover at least:
114
-
115
- - durable User Bank preference
116
- - stable identity preference
117
- - cross-project workflow habit
118
- - project architecture fact
119
- - project implementation decision
120
- - project delivery state
121
- - project-scoped user preference
122
- - identity-like fact embedded in project work
123
- - ambiguous project/User Bank content
124
- - secret or credential-like content
125
- - transient screenshot/artifact
126
- - temporary command/test output
127
-
128
- Fixtures should assert:
129
-
130
- - route
131
- - confidence band or minimum confidence
132
- - matched signal categories
133
- - safety notes where relevant
134
- - write targets in router mode
135
- - no writes in explicit-only mode
136
-
137
- ## Tool and TUI implications
138
-
139
- `hindsight_route_memory` remains the primary dry-run surface for routing decisions. It should show:
140
-
141
- - suggested route
142
- - confidence
143
- - target bank roles and IDs
144
- - tags that would be applied
145
- - reason and matched signals
146
- - safety notes
147
- - whether the current mode would write or only preview
148
-
149
- A future `/hindsight` TUI route preview can call the same operation and should avoid duplicating routing logic.
150
-
151
- ## Consequences
152
-
153
- - Safe defaults remain unchanged.
154
- - Future routing work has a stable contract instead of adding ad hoc conditions to lifecycle retain.
155
- - Richer bank topologies remain possible without coupling core to a specific platform identity model.
156
- - More tests are required before enabling any new automatic route.
157
-
158
- ## Follow-up implementation status
159
-
160
- Completed:
161
-
162
- - #154: Update `hindsight_route_memory` presenter to include target bank roles, tags, safety notes, and explicit write/no-write status.
163
- - #155: Expand router eval fixtures with secret/noise/ambiguous confidence cases and safety-note assertions.
164
- - #156: Add a `RoutingStrategy` type and adapter boundary separate from current heuristic implementation.
165
-
166
- Still future:
167
-
168
- - Add a TUI route-preview action that calls the shared routing operation.
169
- - Design named-bank resolver config before supporting per-user/per-agent/shared-bank targets.
@@ -1,107 +0,0 @@
1
- # ADR 003: TUI memory mode vocabulary
2
-
3
- ## Status
4
-
5
- Accepted and implemented for `normal`, `read-only`, and `ignored`. Reviewed 2026-05-09; still relevant.
6
-
7
- `tools-only` remains reserved vocabulary and must not appear as an enabled mode until behavior is implemented.
8
-
9
- ## Context
10
-
11
- Pi Hindsight has separate controls for recall, automatic retain, explicit tools, imports, flush, and one-turn opt-out. Those controls are correct but too implementation-shaped for the `/hindsight` TUI. Users need a small vocabulary that explains what memory will do without changing the underlying safe defaults.
12
-
13
- The design should not add provider recall caching, prompt hashtag controls, automatic reflect prefetch, or new routing behavior.
14
-
15
- ## Decision
16
-
17
- The TUI (and historically `/hindsight:mode`) describe session memory behavior with three implemented user-facing modes and one reserved future mode:
18
-
19
- 1. `normal`
20
- 2. `read-only`
21
- 3. `ignored`
22
- 4. future `tools-only`
23
-
24
- `normal` is the default mode. `read-only` and `ignored` map to existing session behavior. `tools-only` is reserved vocabulary for a future slice and must not appear as an enabled option until implemented.
25
-
26
- These names are TUI vocabulary, not a replacement for the lower-level config model. Existing config keys remain source of truth for recall, retain, import, and routing behavior.
27
-
28
- ## Mode matrix
29
-
30
- | Mode | Automatic recall | Automatic retain | Explicit tools and commands | Import | Flush queued jobs | Intended use |
31
- | ------------------- | ---------------- | ---------------- | ----------------------------------------------------------------- | ------- | ----------------- | -------------------------------------------------------- |
32
- | `normal` | on if configured | on if configured | allowed | allowed | allowed | Default coding with project memory continuity. |
33
- | `read-only` | on if configured | off | read tools allowed; explicit retain is blocked until mode changes | allowed | allowed | Use existing memory without adding new transcript facts. |
34
- | `ignored` | off | off | explicit operations remain available from commands/tools | allowed | allowed | Work without automatic memory participation. |
35
- | future `tools-only` | off | off | allowed | allowed | allowed | No automatic memory; user manually calls tools. |
36
-
37
- ## Semantics
38
-
39
- ### `normal`
40
-
41
- `normal` means Pi Hindsight follows configured automatic behavior:
42
-
43
- - recall injects ephemeral memory before answer generation when enabled
44
- - retain queues sanitized transcript deltas at agent end when enabled
45
- - User Bank automatic retain stays governed by `userRetain.mode` and profile choices; `globalRetain.mode` remains only a legacy alias
46
- - explicit tools and TUI actions are available
47
- - imports and queue flushes are available
48
-
49
- ### `read-only`
50
-
51
- `read-only` means automatic writes are disabled while reads stay available:
52
-
53
- - automatic recall can still run
54
- - automatic retain does not enqueue new transcript deltas
55
- - explicit retain is blocked until the session returns to `normal`; other deliberate write operations such as imports keep their own confirmations
56
- - imports remain deliberate operations, not automatic session retention
57
- - queue flush remains allowed because it drains already accepted jobs
58
-
59
- ### `ignored`
60
-
61
- `ignored` means automatic memory is out of the provider path:
62
-
63
- - no automatic recall injection
64
- - no automatic retain
65
- - explicit commands and tools still exist for power users
66
- - imports and queue maintenance are not disabled by the mode
67
- - status should make the automatic-memory-off state obvious
68
-
69
- ### future `tools-only`
70
-
71
- `tools-only` is a reserved term for a future mode where automatic memory is off but explicit tools are first-class. It should only ship after the command/tool behavior is tested and documented as distinct from `ignored`.
72
-
73
- ## TUI presentation
74
-
75
- The `/hindsight` TUI should prefer these labels when explaining session memory state:
76
-
77
- - `normal`: "Automatic recall/retain follow config."
78
- - `read-only`: "Recall can read; automatic retain is off."
79
- - `ignored`: "Automatic recall and retain are off."
80
- - future `tools-only`: "Automatic memory is off; explicit tools stay available."
81
-
82
- The TUI should still expose underlying facts where useful, such as recall enabled/disabled, retain enabled/disabled, User Bank retain mode, queue state, and bank status.
83
-
84
- ## Non-goals
85
-
86
- - Do not change defaults.
87
- - Do not add prompt hashtag controls.
88
- - Do not add provider recall caching.
89
- - Do not prefetch reflect results automatically.
90
- - Do not collapse import or explicit retain semantics into automatic retain.
91
- - Do not make User Bank automatic retain default.
92
-
93
- ## Follow-up implementation status
94
-
95
- Completed:
96
-
97
- 1. Add a presenter that derives the TUI mode label from resolved config plus session metadata.
98
- 2. Add status facts for the mode matrix row currently in effect.
99
- 3. Add TUI copy for `normal`, `read-only`, and `ignored`.
100
-
101
- Still future:
102
-
103
- 1. Keep `tools-only` documented as reserved until behavior is implemented.
104
-
105
- ## Consequences
106
-
107
- This gives the TUI a stable mental model without changing memory behavior. It also keeps safety boundaries explicit: automatic read/write behavior is separate from deliberate user operations such as imports, explicit retain, and queue flushing.
@@ -1,89 +0,0 @@
1
- # ADR 004: lifeOS dual-bank design (project + user memory)
2
-
3
- ## Status
4
-
5
- Accepted 2026-07-03.
6
-
7
- Amendment (2026-07-10): **ADR-005** changes the long-term default **Project Bank** shape from “one path-derived bank per repo” toward a **coding domain bank + project tags**, and renames the user-facing cross-project bank path toward **Life Bank**. This ADR’s decision **(b)** still holds: Life/User Bank stays **opt-in**, automatic retain never writes there, and dual-bank recall budgets remain. Topology and agent-first surface details live in ADR-005; do not re-read this ADR as requiring one bank per absolute path forever.
8
-
9
- Amendment (2026-07): the "What stays in the web UI" section below cited `docs/surface-reference.md`'s deferred-surfaces table for "template management remains a Hindsight control-plane responsibility." That table (generated from the operation catalog) never actually listed template management as a row; the citation was inaccurate, not a decision this ADR made. Separately, #467 narrowed the underlying claim: `pi-hindsight` now bundles a small, fixed set of starter bank templates (`/hindsight:templates`, `/hindsight:template-apply`) applied via the official Hindsight client's bank-template import endpoint. Arbitrary template authoring, editing, export, and cross-bank template catalog browsing remain control-plane-only; applying one of the two bundled, reviewed templates to the already-selected bank does not. ADR-005 further allows **agent tools** for selected-bank mental-model and mission maintenance as core.
10
-
11
- ## Context
12
-
13
- Pi Hindsight already supports two kinds of memory: a per-repo **Project Bank** and an optional cross-project **User Bank** (the "lifeOS" memory — durable preferences, recurring workflows, coding habits). #420 built tag-group scope isolation specifically so recall could merge both banks safely. This ADR answers the question #424 asked: should the User Bank become a first-class default next to the Project Bank, or stay opt-in, and what should happen to the heuristic memory router along the way.
14
-
15
- ### Current state
16
-
17
- - Dual-bank recall already works. When a repo's config enables `banks.user`, `selectMemoryScopes` returns both a project scope and a user scope; `recallForContext` queries each bank independently and merges the rendered blocks. This is exposed today as the **"Project + User"** guided-setup profile (`docs-site/src/content/docs/start/memory-profiles.md`), alongside "Project Only", "User Only", and "Recall Only".
18
- - Automatic retain is project-only in every profile except "User Only". Even in "Project + User", the User Bank only receives writes through explicit tools (`hindsight_retain_global`) or commands — never automatically. This is a deliberate safety choice from ADR-002 ("User Bank writes require high confidence or explicit user action") and is unchanged by this ADR.
19
- - A heuristic memory router (`extensions/operations/memory-router.ts`, `extensions/lifecycle/routing-strategy.ts`) exists to auto-classify candidate retain content as `project`/`global`/`both`/`skip` using regex keyword patterns and mission-term matching. It only auto-engages when `userRetain.mode: "router"`, which the guided-setup writer only sets for the **"User Only"** profile (no project bank to fall back to). Its own dry-run inspection tool (`hindsight_route_memory`) was already removed in the slim-surface rewrite (#417), so it now runs with no user-visible explanation of its decisions. It carries ~580 lines of implementation plus 38 parametrized eval-fixture tests.
20
- - **Recall token budget is not split across banks.** `recallForContext` requests the full `config.recall.maxTokens` independently for every active scope. Enabling the User Bank alongside the Project Bank can silently double (or more) the memory tokens injected into every turn; nothing documents or bounds this today.
21
- - Config migration from the legacy `global` naming (`banks.global` → `banks.user`, `globalRetain` → `userRetain`, `globalQueryPreamble` → `userQueryPreamble`) already exists and is unaffected by this ADR.
22
-
23
- ## Options considered
24
-
25
- **(a) Dual-bank default.** Enable both banks out of the box for new setups, with merged recall and routed retain.
26
- **(b) Opt-in User Bank with polished setup.** Keep today's model — User Bank is a deliberate choice via guided setup — and harden the gaps (budget split, router observability) rather than changing the default.
27
- **(c) Single project bank with user-visibility tags.** Drop the separate User Bank; mark durable facts with a tag inside the project bank instead.
28
-
29
- (c) is rejected outright: Hindsight banks are the isolation boundary, not tags. A single project bank is tied to one repo's bank ID (`deriveProjectBankId`); there is no way to recall those tagged facts while working in a _different_ repository without querying a different bank, which defeats the entire cross-project ("lifeOS") purpose. Collapsing to one bank would also regress ADR-001's invariant that project recall is repo-scoped, since "user-visible" facts would need to leak across repo tag boundaries to be found at all.
30
-
31
- The real choice is (a) vs (b).
32
-
33
- ## Decision
34
-
35
- **(b): keep the User Bank opt-in; harden the existing design instead of changing the default.**
36
-
37
- This repo has a consistent, deliberate pattern of conservative defaults — `postRetainReflect` off, `userRetain.mode` explicit-only, User Bank disabled — and ADR-002 already states "Do not make User Bank automatic retain default" as a standing invariant. Defaulting the User Bank on would also mean every new install needs a second Hindsight bank configured before first use, and would silently increase the default token cost of every recall. Given Pi Hindsight's "Pi-first 1.0" scope and existing safe-by-default posture, that tradeoff is not justified today. Nothing here forecloses revisiting (a) once usage data suggests otherwise — that would be a new ADR, not a reinterpretation of this one.
38
-
39
- **The heuristic memory router is removed.** It only ever auto-engaged in the narrow "User Only" profile, its own dry-run visibility was already deleted, and a regex/keyword classifier with no user-facing explanation is exactly the kind of unmonitorable automatic write ADR-002 warned against ("The main safety risk is silent User Bank pollution"). The issue's own framing — "whether the pattern router earns its complexity or is replaced by explicit tools/commands" — is answered: replaced. "User Only" automatic retain falls back to the same explicit-only model every other profile already uses; users write User Bank memory with `hindsight_retain_global` or a command, same as "Project + User" users do today.
40
-
41
- ## Recall merging and token budget split
42
-
43
- Each active scope must have a bounded, independent budget so enabling the User Bank cannot silently balloon per-turn token cost. Concretely:
44
-
45
- - `recall.maxTokens` keeps its current meaning and default (800) and continues to bound the **Project Bank** scope only. Existing project-only and project+user users see no change in Project Bank recall behavior.
46
- - A new `recall.userMaxTokens` (default: half of `recall.maxTokens`, i.e. 400) bounds the **User Bank** scope specifically when it participates in a recall call. User memory is meant to be a smaller, durable supplement to project context, not an equal-weight second corpus.
47
- - Both caps apply independently per bank query (as today), not as a shared pool — this keeps the change backward compatible and avoids new cross-scope coordination logic. The ceiling that changes is that User Bank recall no longer defaults to the same size as Project Bank recall.
48
- - This is a new config field with a real default, not a documentation-only fix, so it is implementation work for a follow-up issue, not this ADR.
49
-
50
- ## Retain routing policy for personal vs. project facts
51
-
52
- - Automatic retain stays project-bank-only in every profile. There is no automatic classifier deciding "this fact is personal, route it to the User Bank."
53
- - Personal/durable facts reach the User Bank only through deliberate action: the `hindsight_retain_global` tool, or a future `/hindsight:retain-global`-style command if usage shows a need for one (not requested by this ADR).
54
- - `userRetain.mode` drops the `"router"` variant. The type becomes effectively single-valued (`"explicit-only"`) going forward; keeping the field (rather than deleting it outright) preserves config-file compatibility and gives room for a future, better-specified routing strategy without another rename.
55
- - Migration: existing configs with `userRetain.mode: "router"` (or the legacy `globalRetain.mode: "router"`) must normalize to `"explicit-only"` rather than erroring, consistent with how `enumValue()` already falls back to the default for invalid enum values today.
56
-
57
- ## Bank missions and dispositions per use case
58
-
59
- No changes. `defaultProjectBankMissions()` and `defaultGlobalBankMissions()` (`extensions/banks/bank-operations.ts`) already give the Project Bank a repo-architecture/engineering-decision mission and the User Bank a durable-preferences/cross-project-workflow mission, and both are overridable via bank config. This split already matches "lifeOS vs coding" use cases well and needs no rework here.
60
-
61
- ## Migration for existing configs
62
-
63
- - The existing `banks.global` → `banks.user` / `globalRetain` → `userRetain` / `globalQueryPreamble` → `userQueryPreamble` migration (`migrateUserMemoryConfigFile`) is unaffected.
64
- - New: `userRetain.mode: "router"` (and the legacy `globalRetain.mode: "router"`) must migrate/normalize to `"explicit-only"` once the router is removed, so existing "User Only" adopters keep working without a config error, just with automatic User Bank writes disabled until they explicitly retain.
65
-
66
- ## What stays in the web UI
67
-
68
- Unchanged from the existing 1.0 support scope (`docs/surface-reference.md`'s "Deferred or non-goal upstream surfaces" table): cross-bank listing and bank deletion remain Hindsight control-plane responsibilities. Template management is narrower after #467: `pi-hindsight` bundles a small, fixed set of reviewed starter templates and can apply one to the already-selected bank, but arbitrary template authoring, editing, export, and a general template catalog stay control-plane-only. This ADR is only about which already-selected banks participate in a given repo's recall/retain and how routing between them works — not about managing banks themselves.
69
-
70
- ## Consequences
71
-
72
- - No default behavior changes for existing Project Only, Recall Only, or Project + User users, other than the new `recall.userMaxTokens` cap (once #460 lands) applying to whichever of them already have the User Bank enabled.
73
- - "User Only" lost automatic classifier-driven retain; those users must use explicit retain (tool or future command) for User Bank writes going forward. This is a narrower, more predictable contract, consistent with every other profile.
74
- - `extensions/operations/memory-router.ts`, `extensions/lifecycle/routing-strategy.ts`, and `tests/memory-router.test.ts` are removed, along with the `"router"` value from `userRetain.mode`/`globalRetain.mode` and the router-eval-fixture taxonomy documented in ADR-002.
75
- - ADR-002 (explicit routing strategy seam) is superseded by this decision for the router's future; its routing-input/output shape documentation is historical context, not a live contract to maintain (see the amendment added to ADR-002).
76
- - A new `recall.userMaxTokens` config field, default value, and normalization will ship once #460 lands.
77
-
78
- ## Follow-up implementation issues
79
-
80
- Filed from this ADR's acceptance, per #424's acceptance criteria:
81
-
82
- Completed:
83
-
84
- - #459: remove the heuristic memory router (`memory-router.ts`, `routing-strategy.ts`, router eval tests), drop `"router"` from the `userRetain.mode`/`globalRetain.mode` type, and add config migration/normalization so existing `"router"`-mode configs fall back to `"explicit-only"` without erroring. Also updated `CONTEXT.md`, `CONTRIBUTING.md`, `docs/architecture-todos.md`, `docs/memory-behavior.md`, and this ADR's ADR-002 amendment.
85
-
86
- Still future:
87
-
88
- - #460: add `recall.userMaxTokens` (default 400) and apply it to the User Bank recall scope in `recallForContext`, independent of `recall.maxTokens`.
89
- - Update `docs-site/src/content/docs/start/memory-profiles.md`, `docs-site/src/content/docs/concepts/memory-banks.md`, and `docs/compatibility.md` to reflect the per-bank token budget split once #460 lands.
@@ -1,189 +0,0 @@
1
- # ADR 005: Domain banks, project tags, and agent-first surface
2
-
3
- ## Status
4
-
5
- Accepted 2026-07-10 (direction). Implementation is phased via GitHub issues; defaults change only when the corresponding phase lands.
6
-
7
- Amends:
8
-
9
- - ADR-001 (scope: project isolation remains required; **how** isolation is achieved moves from “per-repo bank + path-hash tag” toward “domain bank + stable project tag”)
10
- - ADR-004 (User Bank stays opt-in; rename path toward **Life Bank**; “project bank = one bank per repo path” is no longer the long-term default)
11
- - Resolves direction for #450 (shared/untagged observations are **opt-in**, never implicit)
12
-
13
- Supersedes the temporary handoff note on mental-model tools + tag opacity (content moved to issues).
14
-
15
- ## Context
16
-
17
- Three problems stacked:
18
-
19
- 1. **Topology.** Default path-hashed Project Bank + `repo:<slug>-<pathHash>` is opaque, fragile on machine/path moves, and multiplies banks without improving mission quality.
20
- 2. **Hindsight alignment.** Official best practices treat banks as hard walls (missions, privacy) and tags as soft scope. Mental models use tags for refresh and visibility. Observation scopes must not key on volatile session tags. Multi-client MCP is per-bank.
21
- 3. **Surface.** Early TUI exposed too many edit/default/reset paths, then was cut back. Kai’s product intent: **the Pi agent does hard work** (missions, mental models, config, tags); the human gets **status + short onboarding + emergency actions**. Config remains the durable artifact on disk.
22
-
23
- oh-my-pi’s `per-project-tagged` default is a useful sketch (shared bank + project tags + two-tier MMs). We deliberately do **better**: strict project isolation by default, domain split (coding vs life), stable project identity (not basename-only), designed observation scopes, setup gate, migration, agent-first control plane, official client.
24
-
25
- ## Decision
26
-
27
- ### 1. Domain banks + project tags (target topology)
28
-
29
- | Role (config slot) | What it is | Typical Hindsight `bankId` |
30
- | ------------------ | ------------------------------------------------------------- | ------------------------------- |
31
- | **Coding bank** | Domain bank for engineering memory across repos | e.g. `kai-coding` (user-chosen) |
32
- | **Life bank** | Domain bank for personal/assistant memory (evolves User Bank) | e.g. `kai-life` |
33
- | **Isolated bank** | Escape hatch: one bank dedicated to a sensitive repo | e.g. `client-acme` |
34
-
35
- **Role vs bankId (review clarification):**
36
-
37
- - `coding` / `life` are **stable role identifiers** in Pi config and tools (aliases), like today’s `project` / `global`.
38
- - `bankId` is the **concrete Hindsight bank name** and can change without renaming the role.
39
- - Example: `banks.coding.bankId = "kai-coding-v2"` still uses the **coding** slot for automatic project retain/recall; only the server-side bank string changes.
40
-
41
- **Scope mode:**
42
-
43
- | Mode | Meaning |
44
- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
- | **`domain-tagged`** (target default) | Use the **coding** domain bank for all normal repos. Soft-isolate repos with a stable **`project:<id>`** tag on retain and **strict** recall filter on that tag. Optional life bank for cross-cutting personal memory. |
46
- | **`isolated-bank`** | Hard wall: this repo uses its own bank id (legacy-like privacy). Project tags optional inside that bank. |
47
-
48
- **`domain-tagged` in one sentence:** one shared coding bank for many repos; tags say which repo a memory belongs to; the bank’s mission stays “engineering.”
49
-
50
- ### 2. Project identity (not path hash)
51
-
52
- Resolve `projectId` in order:
53
-
54
- 1. Explicit pin (`scope.projectId` in project or global config)
55
- 2. Normalized git remote (when present)
56
- 3. Git root basename
57
- 4. Cwd basename fallback
58
-
59
- Path-hash `repo:` remains only for **legacy detection / migration**, not new writes.
60
-
61
- **Documentation requirement:** `projectIdStrategy` and pin behavior need a dedicated short guide (not only a config field name). Humans and agents must see derivation in status (“`project:finalform` from pin” / “from remote `github.com/…`”).
62
-
63
- ### 3. Where does a per-repo pin go? (review clarification)
64
-
65
- Per-repo `.pi/hindsight.json` fields such as `scope.projectId` **do not choose the life bank**. Routing:
66
-
67
- | Write path | Bank role | Tags |
68
- | --------------------------------- | --------------------------------------------- | ---------------------------------------- |
69
- | Automatic retain (coding profile) | **coding** | `project:<id>`, `source:pi`, `session:…` |
70
- | Explicit project retain | **coding** (or isolated bank if mode says so) | same |
71
- | Explicit life / user retain | **life** | no project tag required; `source:pi` |
72
- | Automatic life retain | **never** (ADR-004 invariant stands) | — |
73
-
74
- So `scope.projectId` answers: **which project tag inside the coding bank**, not “which bank.” Bank selection is profile + `banks.coding` / `banks.life` / isolated mode.
75
-
76
- ### 4. Shared observations (review clarification + #450)
77
-
78
- **Shared observation** means an observation consolidated under Hindsight’s **untagged / global observation scope** inside **one bank** — typically so cross-project coding preferences can form beliefs that are **not** tied to a single `project:` tag.
79
-
80
- It does **not** mean:
81
-
82
- - shared across different Hindsight banks
83
- - shared across users/tenants
84
- - automatic leakage of project A’s facts into project B’s strict recall
85
-
86
- Default recall stays **`any_strict` on `project:<id>`**. Reaching shared/untagged observations requires **explicit opt-in** (config or tool flag), composed as an additional filter path (exact empty tags / documented Hindsight pattern). This is the #450 decision: **(a)-style explicit include**, not silent OR, not “shared is unreachable forever.”
87
-
88
- Observation scopes on retain must **not** put volatile `session:` into the project observation scope (session tags fragment consolidation). Prefer scopes like `[["project:{projectId}"]]` plus optional `"shared"`.
89
-
90
- ### 5. Mental models (two altitudes)
91
-
92
- Inside the coding bank:
93
-
94
- | Tier | Tags on model | Purpose |
95
- | ----------- | --------------------------------- | -------------------------------------------------- |
96
- | Bank-global | none (or non-project only) | How the user codes / collaborates |
97
- | Project | `project:<id>` + stable id suffix | This repo’s architecture / conventions / decisions |
98
-
99
- Inject must filter: bank-global ∪ models matching active project tag.
100
- Refresh tags must be a subset of retain tags (Hindsight `all_strict` footgun).
101
-
102
- Selected-bank mental-model **tools are core**. Full control-plane catalog browsing stays web UI.
103
-
104
- ### 6. Agent-first surface, thin TUI
105
-
106
- **Principle:** API-rich for the agent; UI-thin for the human; config is the durable artifact the agent maintains.
107
-
108
- | Human | Agent |
109
- | ------------------------------------- | -------------------------------------------------- |
110
- | Status (read-only, non-default tones) | Status tool (same fields) |
111
- | Short guided onboarding | Setup / config patch tools |
112
- | Mode, next-opt-out, flush, doctor | Full control plane tools for **selected** banks |
113
- | No edit/default/reset farm | MM CRUD, mission edit, scope info, migrate dry-run |
114
-
115
- **Agent discoverability (review fear):** rich tools only help if the agent knows they exist. Mitigations required in implementation issues:
116
-
117
- 1. Prefer **grouped multi-action tools** with one clear name (`hindsight_mental_model` + `action`, `hindsight_config` + `action`) over a dozen similarly named tools when possible.
118
- 2. Tool descriptions written as **operating instructions** (when to use, which bank role, safety), not one-line stubs.
119
- 3. Generated surface reference + tools-and-commands docs stay truthful.
120
- 4. Optional later: a short ephemeral “memory ops available” line in status/doctor only — not a second settings UI.
121
- 5. Do **not** rely on TUI to teach the agent.
122
-
123
- Thin TUI is intentional; many extensions have no TUI. Status + onboarding + emergencies are enough for humans.
124
-
125
- ### 7. Setup gate (first install **and** upgrades)
126
-
127
- **No bank ensure, auto-retain, or auto-recall network I/O until setup is satisfied.**
128
-
129
- Setup is satisfied when config clearly selects banks/mode, including:
130
-
131
- **New installs:** guided setup or agent setup tool writes bank ids + scope mode + `setupComplete` (or equivalent predicate).
132
-
133
- **Upgrades from older versions (review clarification):** treat as already set up when any of:
134
-
135
- - explicit `banks.project.bankId` / `banks.coding.bankId` / user-life bank id present
136
- - project/global config files already exist with bank/enable settings from prior pi-hindsight versions
137
- - durable local runtime state that only appears after real use (e.g. retain cursor / queue files) **together with** enabled project bank — normalize by writing `setupComplete: true` (or the equivalent flag) on first load so users are not forced through onboarding again
138
-
139
- Never force re-onboarding on upgrade solely because the new flag is missing. Prefer **silent migration to “configured”** for existing adopters; show status tones for “legacy path-hash identity — consider migrate” rather than blocking memory.
140
-
141
- Until configured (true first-run only): status says setup required; tools that need a bank return a clear setup error; **no silent path-derived bank creation**.
142
-
143
- ### 8. Status tones
144
-
145
- Status is the primary human dashboard: banks, project tag + derivation, missions present, MM counts, queue, reachability. Compare to defaults:
146
-
147
- - quiet = default for profile
148
- - accent = non-default but valid
149
- - warn = broken / setup incomplete / scope mismatch
150
- - dim = intentionally disabled
151
-
152
- Read-only; changes go through agent tools or guided setup.
153
-
154
- ## Consequences
155
-
156
- - Implementation is multi-phase (setup gate → stable projectId → domain default → agent tools → MM inject filter → shared recall → migrate). Do not ship a silent topology flip without migration docs.
157
- - ADR-004’s “User Bank opt-in / no automatic user retain” remains. Life Bank is the user-facing name; aliases stay during transition.
158
- - Core-vs-companion: selected-bank MM/mission/config tools move to **core**; platform-wide admin stays web.
159
- - #450: implement explicit include-shared path; document that shared ≠ cross-bank.
160
- - Tests must cover: setup gate, upgrade migration, projectId stability, MM inject isolation, no ensure without setup.
161
-
162
- ## Out of scope for this ADR
163
-
164
- - Implementing all phases in one PR
165
- - One mega-bank for code + life + medical
166
- - Platform-wide bank list/delete in Pi
167
- - In-housing the Hindsight client
168
-
169
- ## Follow-up issues
170
-
171
- Filed from this ADR (titles may be adjusted):
172
-
173
- 1. Setup gate + upgrade migration + short onboarding
174
- 2. Status fields with non-default tones
175
- 3. Stable projectId + doctor scope diagnostics
176
- 4. Domain coding bank default + profiles
177
- 5. Agent tools (config, bank mission, mental models, scope)
178
- 6. Slim TUI hub
179
- 7. MM inject filter + template project tags
180
- 8. includeSharedObservations (#450 implementation)
181
- 9. Scope migrate dry-run / dual-tag
182
- 10. MCP multi-client docs
183
-
184
- ## References
185
-
186
- - Hindsight best practices (banks, tags, missions, MM tag strategy)
187
- - Hindsight 0.7–0.8.4 changelog (observation scopes, shared, exact untagged, export/import, MM stale/cron)
188
- - oh-my-pi Hindsight case study (inspiration, not ceiling)
189
- - #450, ADR-001, ADR-004
@@ -1,54 +0,0 @@
1
- # Coding memory evaluation notes
2
-
3
- What Vectorize’s own evaluation surface implies for **pi-hindsight** defaults. Not a harness in this repo—alignment notes for agents and maintainers.
4
-
5
- ## Sources
6
-
7
- | Source | What it measures | Link |
8
- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
- | Hindsight continuous perf monitor | Retain throughput, recall p95, recall+obs, temporal recall, consolidation throughput, graph maintenance | [dashboard](https://vectorize-io.github.io/hindsight-continuous-performance-monitor) |
10
- | AMB (Agent Memory Benchmark) | Accuracy **and** latency/token cost; modes `rag` / `agentic-rag` / `agent` (native reflect); datasets include PersonaMem (prefs) | [repo](https://github.com/vectorize-io/agent-memory-benchmark), [leaderboard](https://agentmemorybenchmark.ai) |
11
- | sde-bench | Does a **coding agent** benefit from memory on non-guessable project decisions? `conversation` vs `history` source | [repo](https://github.com/vectorize-io/sde-bench) |
12
- | Best practices / oh-my-pi / MM deep dive | Retain/recall/reflect hygiene; MM seeds; delta refresh | [best practices](https://hindsight.vectorize.io/best-practices), [oh-my-pi post](https://hindsight.vectorize.io/blog/2026/06/08/oh-my-pi-hindsight-memory), [MM deep dive](https://hindsight.vectorize.io/blog/2026/06/05/mental-models-deep-dive) |
13
-
14
- ## Implications → pi-hindsight defaults
15
-
16
- | Learning | Extension implication |
17
- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
18
- | Conversation-only decisions are the hard discriminator for strong models (sde-bench) | Auto-**retain** of real Pi sessions is the product; do not rely on git alone |
19
- | Ranking amid noise is the problem | Prefer observations + **narrow** mental models over dumping raw facts every turn |
20
- | Cost is co-equal with accuracy (AMB) | Cap MM `max_tokens` (600–800 seeds); keep recall budgets mid/low unless deep context is required |
21
- | Consolidation is a server hot path (perf monitor) | Client should not re-synthesize every turn: inject cached MMs; use **delta** + `refresh_after_consolidation` |
22
- | Prefs applied to multi-step work (PersonaMem / AMB) | Bank-global prefs MM + explicit retain of durable prefs (not probe harness noise) |
23
- | Life vs coding user banks | Coding user bank: cross-project coding prefs missions; conversation/life: `defaultLifeBankMissions()` |
24
- | Retain then same-turn recall is an anti-pattern | Retain at `agent_end`; recall at `context` (already) |
25
- | One MM for everything is an anti-pattern | One model per knowledge dimension (architecture / conventions / decisions / prefs) |
26
-
27
- ## What we intentionally do **not** do
28
-
29
- - Auto-`reflect` every turn (expensive; tools already expose reflect).
30
- - Mega bank-global “everything about the user” models.
31
- - Pre-summarizing before retain.
32
- - Silent background MM create on every boot (setup / hub `t` is explicit).
33
- - Default session-start `reflect` or per-repo banks (ADR-005 domain-tagged + Pi `context`/`recall` stay).
34
-
35
- ## Conversation / amended-rule eval tasks (in-repo)
36
-
37
- sde-bench treats **non-guessable project decisions from conversation** (including later amendments that must win) as the hard discriminator. We do **not** vendor sde-bench; we encode client-side signals that preserve that evaluation path:
38
-
39
- | Task id | Scenario | What must hold in pi-hindsight | Enforced by |
40
- | ----------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
41
- | `conv-final-state` | User proposes rule A, then amends to rule B in the same session | Project + conversation retain missions require FINAL/LAST state only; superseded proposals only as rejected | `tests/coding-memory-eval.test.ts`, bank missions / `CONVERSATION_RETAIN_MISSION` |
42
- | `conv-not-git-only` | Decision exists only in chat, not in git history | Live session retain uses strategy `conversation` and remains the product core; git seed is opt-in only | retain job strategy + seed tool dry-run defaults |
43
- | `tool-noise` | Assistant runs many tools with large args | Compact tool-call write-back keeps name + target, drops full args by default | `retain.compactToolCalls` + retain projection tests |
44
- | `amended-cross-session` | Later session revises an earlier rule | Append + stable live document IDs + final-state mission text (server consolidation); client does not re-emit intermediate proposals as facts | missions + append/cursor design (docs) |
45
-
46
- Release validation priority: **conversation-amended / cross-session consolidation** over git-only smoke. Prefer live or fixture paths that retain a short decision chat that revises itself, then recall/reflect for the **last** rule.
47
-
48
- ## Related issues
49
-
50
- - Setup ensure project + bank-global starters: #528
51
- - Delta MM triggers on templates: #529
52
- - MM size discipline: #530
53
- - Mission wording vs best practices: #531
54
- - Coding-agents shortlist stack: #557–#562