@herbertgao/pi-extensions 2026.9.6 → 2026.9.8

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 (304) 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/grok-mermaid/CHANGELOG.md +46 -0
  19. package/node_modules/grok-mermaid/LICENSE +205 -0
  20. package/node_modules/grok-mermaid/README.md +191 -0
  21. package/node_modules/grok-mermaid/dist/ansi.d.ts +16 -0
  22. package/node_modules/grok-mermaid/dist/ansi.d.ts.map +1 -0
  23. package/node_modules/grok-mermaid/dist/ansi.js +23 -0
  24. package/node_modules/grok-mermaid/dist/ansi.js.map +1 -0
  25. package/node_modules/grok-mermaid/dist/canvas.d.ts +87 -0
  26. package/node_modules/grok-mermaid/dist/canvas.d.ts.map +1 -0
  27. package/node_modules/grok-mermaid/dist/canvas.js +366 -0
  28. package/node_modules/grok-mermaid/dist/canvas.js.map +1 -0
  29. package/node_modules/grok-mermaid/dist/graph.d.ts +74 -0
  30. package/node_modules/grok-mermaid/dist/graph.d.ts.map +1 -0
  31. package/node_modules/grok-mermaid/dist/graph.js +91 -0
  32. package/node_modules/grok-mermaid/dist/graph.js.map +1 -0
  33. package/node_modules/grok-mermaid/dist/index.d.ts +32 -0
  34. package/node_modules/grok-mermaid/dist/index.d.ts.map +1 -0
  35. package/node_modules/grok-mermaid/dist/index.js +100 -0
  36. package/node_modules/grok-mermaid/dist/index.js.map +1 -0
  37. package/node_modules/grok-mermaid/dist/labels.d.ts +62 -0
  38. package/node_modules/grok-mermaid/dist/labels.d.ts.map +1 -0
  39. package/node_modules/grok-mermaid/dist/labels.js +324 -0
  40. package/node_modules/grok-mermaid/dist/labels.js.map +1 -0
  41. package/node_modules/grok-mermaid/dist/layout-seq.d.ts +12 -0
  42. package/node_modules/grok-mermaid/dist/layout-seq.d.ts.map +1 -0
  43. package/node_modules/grok-mermaid/dist/layout-seq.js +194 -0
  44. package/node_modules/grok-mermaid/dist/layout-seq.js.map +1 -0
  45. package/node_modules/grok-mermaid/dist/layout.d.ts +87 -0
  46. package/node_modules/grok-mermaid/dist/layout.d.ts.map +1 -0
  47. package/node_modules/grok-mermaid/dist/layout.js +881 -0
  48. package/node_modules/grok-mermaid/dist/layout.js.map +1 -0
  49. package/node_modules/grok-mermaid/dist/parse.d.ts +83 -0
  50. package/node_modules/grok-mermaid/dist/parse.d.ts.map +1 -0
  51. package/node_modules/grok-mermaid/dist/parse.js +1151 -0
  52. package/node_modules/grok-mermaid/dist/parse.js.map +1 -0
  53. package/node_modules/grok-mermaid/dist/source-box.d.ts +18 -0
  54. package/node_modules/grok-mermaid/dist/source-box.d.ts.map +1 -0
  55. package/node_modules/grok-mermaid/dist/source-box.js +78 -0
  56. package/node_modules/grok-mermaid/dist/source-box.js.map +1 -0
  57. package/node_modules/grok-mermaid/dist/types.d.ts +42 -0
  58. package/node_modules/grok-mermaid/dist/types.d.ts.map +1 -0
  59. package/node_modules/grok-mermaid/dist/types.js +1 -0
  60. package/node_modules/grok-mermaid/dist/types.js.map +1 -0
  61. package/node_modules/grok-mermaid/dist/width-data.d.ts +2 -0
  62. package/node_modules/grok-mermaid/dist/width-data.d.ts.map +1 -0
  63. package/node_modules/grok-mermaid/dist/width-data.js +994 -0
  64. package/node_modules/grok-mermaid/dist/width-data.js.map +1 -0
  65. package/node_modules/grok-mermaid/dist/width.d.ts +18 -0
  66. package/node_modules/grok-mermaid/dist/width.d.ts.map +1 -0
  67. package/node_modules/grok-mermaid/dist/width.js +76 -0
  68. package/node_modules/grok-mermaid/dist/width.js.map +1 -0
  69. package/node_modules/grok-mermaid/package.json +49 -0
  70. package/node_modules/grok-mermaid/src/ansi.ts +34 -0
  71. package/node_modules/grok-mermaid/src/canvas.ts +373 -0
  72. package/node_modules/grok-mermaid/src/graph.ts +142 -0
  73. package/node_modules/grok-mermaid/src/index.ts +104 -0
  74. package/node_modules/grok-mermaid/src/labels.ts +326 -0
  75. package/node_modules/grok-mermaid/src/layout-seq.ts +203 -0
  76. package/node_modules/grok-mermaid/src/layout.ts +1015 -0
  77. package/node_modules/grok-mermaid/src/parse.ts +1189 -0
  78. package/node_modules/grok-mermaid/src/source-box.ts +89 -0
  79. package/node_modules/grok-mermaid/src/types.ts +43 -0
  80. package/node_modules/grok-mermaid/src/width-data.ts +993 -0
  81. package/node_modules/grok-mermaid/src/width.ts +74 -0
  82. package/node_modules/pi-lens/CHANGELOG.md +239 -0
  83. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -0
  84. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +30 -4
  85. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +2 -0
  86. package/node_modules/pi-lens/dist/clients/bash-file-access.js +26 -0
  87. package/node_modules/pi-lens/dist/clients/biome-client.js +1 -1
  88. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +403 -35
  89. package/node_modules/pi-lens/dist/clients/bootstrap.js +6 -1
  90. package/node_modules/pi-lens/dist/clients/cascade-format.js +200 -4
  91. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +10 -2
  92. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +16 -1
  93. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +12 -1
  94. package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +65 -0
  95. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +28 -0
  96. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +9 -2
  97. package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +222 -0
  98. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +389 -13
  99. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +175 -25
  100. package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +62 -0
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +21 -41
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +6 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +7 -7
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -12
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +2 -21
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/types.js +4 -1
  108. package/node_modules/pi-lens/dist/clients/disposition-publish.js +1 -0
  109. package/node_modules/pi-lens/dist/clients/effective-config.js +1 -1
  110. package/node_modules/pi-lens/dist/clients/file-kinds.js +26 -1
  111. package/node_modules/pi-lens/dist/clients/file-role.js +21 -21
  112. package/node_modules/pi-lens/dist/clients/file-utils.js +156 -10
  113. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +56 -9
  114. package/node_modules/pi-lens/dist/clients/format-service.js +39 -21
  115. package/node_modules/pi-lens/dist/clients/formatters.js +60 -13
  116. package/node_modules/pi-lens/dist/clients/generation-guard.js +2 -2
  117. package/node_modules/pi-lens/dist/clients/git-guard.js +11 -3
  118. package/node_modules/pi-lens/dist/clients/indent-retarget.js +78 -8
  119. package/node_modules/pi-lens/dist/clients/installer/index.js +333 -114
  120. package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +7 -0
  121. package/node_modules/pi-lens/dist/clients/instance-reaper.js +20 -10
  122. package/node_modules/pi-lens/dist/clients/language-profile.js +23 -1
  123. package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
  124. package/node_modules/pi-lens/dist/clients/latency-logger.js +4 -1
  125. package/node_modules/pi-lens/dist/clients/lens-engine.js +12 -3
  126. package/node_modules/pi-lens/dist/clients/lens-events.js +2 -1
  127. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +79 -0
  128. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +2 -1
  129. package/node_modules/pi-lens/dist/clients/lsp/client.js +25 -21
  130. package/node_modules/pi-lens/dist/clients/lsp/config.js +2 -2
  131. package/node_modules/pi-lens/dist/clients/lsp/index.js +7 -0
  132. package/node_modules/pi-lens/dist/clients/lsp/launch.js +16 -4
  133. package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -2
  134. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +2 -1
  135. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +5 -3
  136. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +12 -8
  137. package/node_modules/pi-lens/dist/clients/mcp/session.js +36 -4
  138. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +24 -7
  139. package/node_modules/pi-lens/dist/clients/observed-mutation.js +40 -2
  140. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +23 -3
  141. package/node_modules/pi-lens/dist/clients/opengrep-client.js +110 -15
  142. package/node_modules/pi-lens/dist/clients/path-utils.js +123 -3
  143. package/node_modules/pi-lens/dist/clients/performance-report.js +5 -1
  144. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +1 -1
  145. package/node_modules/pi-lens/dist/clients/pipeline.js +74 -5
  146. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +37 -5
  147. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +145 -18
  148. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +4 -1
  149. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +59 -3
  150. package/node_modules/pi-lens/dist/clients/project-lens-config.js +45 -2
  151. package/node_modules/pi-lens/dist/clients/read-guard.js +70 -11
  152. package/node_modules/pi-lens/dist/clients/resource-sampler.js +147 -9
  153. package/node_modules/pi-lens/dist/clients/ruff-client.js +1 -1
  154. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +33 -5
  155. package/node_modules/pi-lens/dist/clients/runtime-context.js +6 -2
  156. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +77 -7
  157. package/node_modules/pi-lens/dist/clients/runtime-session.js +21 -2
  158. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +43 -12
  159. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +330 -85
  160. package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -17
  161. package/node_modules/pi-lens/dist/clients/safe-spawn.js +258 -5
  162. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +6 -0
  163. package/node_modules/pi-lens/dist/clients/session-event-guard.js +50 -5
  164. package/node_modules/pi-lens/dist/clients/sg-runner.js +23 -11
  165. package/node_modules/pi-lens/dist/clients/sgconfig.js +79 -2
  166. package/node_modules/pi-lens/dist/clients/test-runner-client.js +6 -41
  167. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +43 -0
  168. package/node_modules/pi-lens/dist/clients/tool-agreement.js +423 -0
  169. package/node_modules/pi-lens/dist/clients/tool-config.js +50 -0
  170. package/node_modules/pi-lens/dist/clients/tool-cwd.js +47 -76
  171. package/node_modules/pi-lens/dist/clients/tool-policy.js +163 -7
  172. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +120 -0
  173. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +127 -189
  174. package/node_modules/pi-lens/dist/clients/widget-state.js +98 -0
  175. package/node_modules/pi-lens/dist/clients/word-index.js +5 -2
  176. package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +7 -0
  177. package/node_modules/pi-lens/dist/index.js +27416 -24153
  178. package/node_modules/pi-lens/dist/mcp/server.js +5 -2
  179. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +7 -1
  180. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +168 -53
  181. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +244 -72
  182. package/node_modules/pi-lens/docs/audit1.md +5 -5
  183. package/node_modules/pi-lens/docs/dependencies.md +11 -0
  184. package/node_modules/pi-lens/docs/dispositions.md +52 -0
  185. package/node_modules/pi-lens/docs/environment-variables.md +2 -2
  186. package/node_modules/pi-lens/docs/features.md +4 -4
  187. package/node_modules/pi-lens/docs/globalconfig.md +3 -1
  188. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  189. package/node_modules/pi-lens/docs/pi-lens-fixer.md +53 -94
  190. package/node_modules/pi-lens/docs/pi-lens-investigator.md +43 -38
  191. package/node_modules/pi-lens/docs/pi-lens-retro.md +97 -0
  192. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +53 -66
  193. package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -0
  194. package/node_modules/pi-lens/docs/settings.md +7 -4
  195. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
  196. package/node_modules/pi-lens/docs/usage.md +2 -0
  197. package/node_modules/pi-lens/package.json +1 -1
  198. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +24 -12
  199. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +40 -0
  200. package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +15 -0
  201. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +7 -0
  202. package/package.json +6 -11
  203. package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +0 -376
  204. package/node_modules/@luxusai/pi-hindsight/README.md +0 -92
  205. package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +0 -56
  206. package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +0 -169
  207. package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +0 -107
  208. package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +0 -89
  209. package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +0 -189
  210. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
  211. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
  212. package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +0 -54
  213. package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +0 -75
  214. package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +0 -300
  215. package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +0 -158
  216. package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +0 -164
  217. package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +0 -139
  218. package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +0 -74
  219. package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +0 -261
  220. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +0 -151
  221. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +0 -18
  222. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +0 -46
  223. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +0 -383
  224. package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +0 -240
  225. package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +0 -176
  226. package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +0 -178
  227. package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +0 -41
  228. package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +0 -386
  229. package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +0 -39
  230. package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +0 -34
  231. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +0 -140
  232. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +0 -61
  233. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +0 -925
  234. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +0 -247
  235. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +0 -547
  236. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +0 -480
  237. package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +0 -182
  238. package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +0 -86
  239. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +0 -1010
  240. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +0 -175
  241. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +0 -425
  242. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +0 -210
  243. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +0 -817
  244. package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +0 -25
  245. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +0 -319
  246. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +0 -196
  247. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +0 -189
  248. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +0 -65
  249. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +0 -260
  250. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +0 -244
  251. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +0 -59
  252. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +0 -82
  253. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +0 -45
  254. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +0 -331
  255. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +0 -354
  256. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +0 -66
  257. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +0 -132
  258. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +0 -228
  259. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +0 -74
  260. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +0 -16
  261. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +0 -648
  262. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +0 -105
  263. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +0 -68
  264. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +0 -71
  265. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +0 -13
  266. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +0 -162
  267. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +0 -131
  268. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +0 -104
  269. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +0 -37
  270. package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +0 -893
  271. package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +0 -35
  272. package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +0 -177
  273. package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +0 -7
  274. package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +0 -21
  275. package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +0 -112
  276. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +0 -111
  277. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +0 -214
  278. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +0 -70
  279. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +0 -392
  280. package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +0 -45
  281. package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +0 -9
  282. package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +0 -860
  283. package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +0 -105
  284. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +0 -189
  285. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +0 -299
  286. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +0 -201
  287. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +0 -47
  288. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +0 -239
  289. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +0 -50
  290. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +0 -259
  291. package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +0 -77
  292. package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +0 -534
  293. package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +0 -319
  294. package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +0 -325
  295. package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +0 -42
  296. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +0 -244
  297. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +0 -56
  298. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +0 -50
  299. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +0 -167
  300. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +0 -207
  301. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +0 -120
  302. package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +0 -8
  303. package/node_modules/@luxusai/pi-hindsight/package.json +0 -118
  304. package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +0 -75
@@ -26,6 +26,8 @@ Each runtime toggle is settable from the CLI *and* from `config.json`. The two a
26
26
  | `--lens-actionable-warning-autofix` | `actionableWarnings.autoFix.enabled` | `false` |
27
27
  | `--lens-actionable-warning-all` | `actionableWarnings.deltaOnly` (`false`) | `true` |
28
28
  | `--lens-compact-tool-line` | `ui.compactToolLine` | `false` |
29
+ | `--lens-compact-lsp-status` | `ui.compactLspStatus` | `false` |
30
+ | `--lens-hide-lsp-status` | `ui.hideLspStatus` | `false` |
29
31
  | `--no-lazy-tools` | `tools.lazy` | `true` |
30
32
  | `--lens-turn-end-madge` | `turnEnd.madge.enabled` | `false` |
31
33
  | `--no-knip` | `knip.enabled` | `true` |
@@ -137,7 +139,7 @@ disabled.
137
139
 
138
140
  In addition to the user-level `~/.pi-lens/config.json` above, pi-lens reads a per-project `.pi-lens.json` (or `pi-lens.json`) at the project root. Walked upward from the cwd, so a monorepo can keep the config at the repo root and have every subdir pick it up. The schema is intentionally small — only fields pi-lens actually honors:
139
141
 
140
- Note that most toggles from the table above are **user-level only**. Of them, a project config honors just the three [mutation controls](#mutation-controls) (`format.enabled`, `autofix.enabled`, `actionableWarnings.autoFix.enabled`). Putting a user-level toggle such as `"lsp": { "enabled": false }` in a `.pi-lens.json` is **not** honored at project scope; pi-lens now logs a one-time warning saying so rather than dropping it silently, so you get a signal instead of a setting that quietly does nothing. Set it in `~/.pi-lens/config.json` or pass `--no-lsp` instead. A genuinely unrecognized key (a typo) is likewise logged once. Foreign namespaces that a shared `.pi-lens.json` legitimately carries for the LSP loader (`servers`, `serverOverrides`, `disabledServers`, `warmFiles`) and `$schema` are tolerated without warning.
142
+ Note that most toggles from the table above are **user-level only**. Of them, a project config honors the three [mutation controls](#mutation-controls) (`format.enabled`, `autofix.enabled`, `actionableWarnings.autoFix.enabled`) and the per-tool switches `tools.<name>.enabled` — but not `tools.lazy`, which stays user-level and is reported as such when a project file sets it. Putting a user-level toggle such as `"lsp": { "enabled": false }` in a `.pi-lens.json` is **not** honored at project scope; pi-lens now logs a one-time warning saying so rather than dropping it silently, so you get a signal instead of a setting that quietly does nothing. Set it in `~/.pi-lens/config.json` or pass `--no-lsp` instead. A genuinely unrecognized key (a typo) is likewise logged once. Foreign namespaces that a shared `.pi-lens.json` legitimately carries for the LSP loader (`servers`, `serverOverrides`, `disabledServers`, `warmFiles`) and `$schema` are tolerated without warning.
141
143
 
142
144
  ```json
143
145
  {
@@ -40,6 +40,7 @@ Dispatch is diagnostics-oriented: automatic formatting and safe autofix happen i
40
40
  | Haskell | ✓ | lsp | ormolu |
41
41
  | Elixir | ✓ (ElixirLS default, Expert alternate) | lsp, elixir-check, credo | mix format |
42
42
  | Gleam | ✓ | lsp, gleam-check | gleam format |
43
+ | Typst | ✓ (tinymist) | — | typstyle (`.typ`, `.typc`) |
43
44
  | OCaml | ✓ | lsp | ocamlformat |
44
45
  | Clojure | ✓ | lsp | cljfmt |
45
46
  | Terraform | ✓ | lsp, tflint, trivy-config (opt-in) | terraform fmt |
@@ -1,96 +1,55 @@
1
1
  # Fixer contract
2
2
 
3
- Deliver a root-caused fix with red proof and a reviewable handoff.
4
-
5
- Read the issue, repository instructions, shared delegated worker contract, and
6
- relevant architecture before editing. Reuse the shared seam and existing
7
- machinery. Keep the change localized and compatible with concurrent branches.
8
-
9
- Build the smallest faithful reproduction first. Preserve its pre-fix failure
10
- output. After fixing, prove every new guard mutation-sensitive. Run a pattern
11
- sweep and a population sweep for the defect class. Record per-member verdicts,
12
- the blast radius, and bounded observability. Add a changelog fragment for a code
13
- change.
14
-
15
- ## Tautological tests considered harmful
16
-
17
- Do not assert a value that the test setup already supplied, duplicate the source
18
- predicate in the test, or replace a real in-process seam with a fake to keep the
19
- test green. Drive the production path and assert an independent observable. If
20
- the test passes after deleting the guard, it is tautological and must be
21
- redesigned before the fix is complete.
22
-
23
- Verify the build and every targeted or sibling suite required by repository
24
- policy. Follow the shared contract's Git authority. Report what ran, what was
25
- skipped, and why. Use active, plain prose.
26
-
27
- ## Standard mechanics (apply unless the brief overrides)
28
-
29
- A fix on `clients/lsp/`, the read guard, tool registration, or session lifecycle adds or updates a real-harness scenario when the defect is only observable through the host; the scenario is the red-first proof where a unit seam cannot show it.
30
-
31
- - Every language pi-lens supports (`LANGUAGES` in `clients/language-registry.ts`),
32
- never one: a fix on an LSP, dispatch, cache or tool seam is stated in
33
- language-neutral terms, names which registry entries carry the facts it
34
- needs and which fall to the honest fallback, and its test matrix has at
35
- least one non-TypeScript row (catalog shape 42).
36
- - `npm run build` before any test run; rebuild between mutations. Tests run as
37
- `PI_LENS_HOME=$PWD/.probe-home node_modules/.bin/vitest run <files> --configLoader runner`
38
- (sweeps get `30_000`). A CI-only red is reproduced in the job's shape first
39
- (`npm test` PATH prefix, pinned `HOME`, no `PI_LENS_HOME`).
40
- - When a task regenerates `package-lock.json`, use the exact npm version in
41
- `package.json`'s `packageManager` field, which is also the CI production-install pin.
42
- - Required test set = the named files + every test that mocks (`vi.mock`) or
43
- deep-equals a module or record you touched + `tests/config/` when you add a
44
- real-spawn test or a fixture + the flake-shape ratchet when you touch waits.
45
- - Never `vi.waitFor` with real timers; never a `// flake-shape` admission for
46
- a test you wrote; never `git stash`; never edit `CHANGELOG.md` (one fragment
47
- under `.changelog/`, exactly one top-level entry).
48
- - Every test id, probe id or fixture name you write into a PR-body table
49
- (state-space, writers-by-axis, population) must exist as a grep-able `it(`
50
- title or file name in the tree at handoff. The orchestrator greps each id
51
- before accepting the round; a table whose ids do not exist is a fabricated
52
- claim and fails the round (2026-09-10: #2877 r3 and #2868 r3 each shipped a
53
- 48- to 72-cell table with zero real ids).
54
- - A claim about the HOST or the ENVIRONMENT is a transcript, not a sentence.
55
- "pi does not re-run the factory on resume", "this failure is pre-existing on
56
- master", "the harness cannot fire that event" — each carries the command and
57
- output that measured it in the same environment (a probe extension against
58
- real pi in rpc mode; the same test file run on origin/master in the same
59
- tree). 2026-09-10: three rounds on #2866 and #2878 were built on unmeasured
60
- host claims the verify overturned, and "pre-existing analyze-cli red" was
61
- reported by four workers whose sandbox differed from CI and master.
62
- - When a fix is a RULE (a scanner's scope rule, a lifecycle rule, a
63
- classification), derive it from the source of truth and enumerate from
64
- there — the tree-sitter grammar table, pi's pinned event types measured
65
- live, the client's real return sites — never from a hand-written list of
66
- the cases the reviewer named. Seven rounds on #2877 each closed the named
67
- launderer and left the next scope kind open until round 4 generated the
68
- scope table from the grammar.
69
- - A change to a release-QA row (`docs/release-qa-baseline.md` +
70
- `scripts/release-qa.mjs`) runs `node scripts/release-qa.mjs` end to end
71
- once on the pushed head and quotes the verdict line in the body; the
72
- row↔probe tie test cannot see a row that never passes (#2893).
73
- - Before handoff, run `npm run preflight` last and paste its table in
74
- `PR_BODY.md` — a handoff without it is incomplete.
75
- - One set of template headings per PR. A fix round APPENDS `## Round N` and
76
- edits the existing `## Observability` / `## Tests` sections in place; it
77
- never adds a second `## Observability` (the lint reads the first one, and a
78
- stale first section was the most common `PR body` red on 2026-09-10). Lint
79
- the FULL body you will publish (`gh pr view <n> --json body -q .body` plus
80
- your round), against the real `origin/master...HEAD` diff (fetch first),
81
- not a hand-shaped diff.
82
- - `PR_BODY.md` passes `node scripts/check-pr-body.mjs --lint-local PR_BODY.md`
83
- before handoff. The gate requires the headings `## Summary`, `## Tests`,
84
- `## Blast radius`, `## Class sweep`, `## Observability`, and
85
- `## Test assessment` whenever the diff touches `tests/`; Observability
86
- names a record literal that appears in the runtime diff, and may say
87
- exactly "No new failure path; no record added." only when the diff adds no
88
- failure path (no new catch, fallback or degradation branch). Record: on
89
- 2026-09-10 most open PRs failed the PR-body check on one of these two rules.
90
- - No Git authority unless granted: leave changes uncommitted; hand off
91
- `PR_BODY.md` (template headings, every red and mutation quoted in ≤5 lines)
92
- plus two optional one-liners the reviewer reads first: `Operating rule:`
93
- (the one sentence the change enforces) and `Kept:` (what was deliberately
94
- not changed, so a reviewer does not re-litigate it);
95
- and `COMMIT_MSG.txt` at the worktree root. Final message: verdict line, files
96
- changed, test totals, what could not be verified.
3
+ ## Mission
4
+
5
+ - Read the issue, `AGENTS.md`, `docs/pi-lens-subagent.md`, and this contract.
6
+ - Trace the production entry point before naming a seam.
7
+ - Reproduce the defect on the current tree.
8
+ - Implement the smallest root-caused fix.
9
+ - Preserve contributor authorship and leave Git authority to the orchestrator
10
+ unless the delegation grants it explicitly.
11
+
12
+ ## Evidence
13
+
14
+ - Add a regression test through the production path.
15
+ - Capture the pre-fix assertion failure.
16
+ - Prove the fixed test passes.
17
+ - Mutate or remove every new guard, branch, filter, cap, and fallback; quote the
18
+ compile-valid red result.
19
+ - Sweep the whole codebase for the defect shape and every enumerable member.
20
+ - Record per-member verdicts, blast radius, affected callers, and bounded
21
+ observability.
22
+
23
+ ## Required checks
24
+
25
+ - Run `npm run build` before tests and rebuild between mutations.
26
+ - Run targeted tests through the repository's pinned environment. Include every
27
+ test that mocks or deep-equals a changed module or record.
28
+ - Add `tests/config/` and spawn-heavy lanes for real child or LSP tests.
29
+ - Reproduce CI-only failures in the CI command shape.
30
+ - Use the exact npm pin in `package.json` for lockfile changes.
31
+ - Add one `.changelog/<slug>.md` fragment for code changes. Never edit
32
+ `CHANGELOG.md`.
33
+ - Run release-QA end to end when a release-QA row changes.
34
+
35
+ ## Test screens
36
+
37
+ - Enter through the real production function.
38
+ - Do not use setup-echoing, implementation-mirroring, or mock-only assertions.
39
+ - Do not use ambient stack/caller inspection in doubles.
40
+ - Restore env, timers, cwd, and module state.
41
+ - Make skips explicit and visible.
42
+ - Use independent expected values and behavioral assertions.
43
+ - Keep timing bounds near measured fixed and regressed values.
44
+ - Make every PR-body test id grepable in the tree.
45
+
46
+ ## Handoff
47
+
48
+ - Without Git authority, leave changes uncommitted.
49
+ - Write root-level `PR_BODY.md` and `COMMIT_MSG.txt`; keep both untracked.
50
+ - PR body headings: `## Summary`, `## Tests`, `## Blast radius`,
51
+ `## Class sweep`, `## Observability`, and `## Test assessment` when tests
52
+ changed.
53
+ - Include every red, mutation result, skipped check, and environment block.
54
+ - Answer each finding id with `fixed`, `not fixed`, or `withdrawn (reason)`.
55
+ - Report verdict, changed files, totals, and unverifiable checks.
@@ -1,40 +1,45 @@
1
1
  # Investigator contract
2
2
 
3
- Grep the `turnId` first when correlating rows across telemetry sinks.
4
- Premise-first reproductions of dogfood reports go through the harness with a fixture built from the reporter's shape, before any seam is named.
5
-
6
- Root-cause runtime behavior from reproducible and durable evidence.
7
-
8
- Define the symptom as a question that evidence can answer. Name the time window,
9
- sessions, and build in scope. Prefer a tight reproduction loop before code
10
- reading. Correlate records by stable identifiers, not time alone. Read each
11
- record's producer before trusting its labels. Count a representative population,
12
- and separate worker behavior from daemon behavior.
13
-
14
- Keep the investigation read-only. Rank falsifiable hypotheses with evidence for
15
- and against each hypothesis and the observation that would settle it. Sweep the
16
- tree for the root-cause pattern and every member of the affected population.
17
- State the blast radius and any missing or unbounded observability.
18
-
19
- For a reported defect, the first deliverable is the reporter's symptom
20
- reproduced through the production entry point (the tool handler or host
21
- command the reporter used), red on the current code; a seam named before
22
- that reproduction is a hypothesis and is labelled as one. Write the report
23
- to a file at the worktree root AND, when the delegation grants issue
24
- access, post it on the tracking issue: a file left in a worktree is not a
25
- durable deliverable until it is posted or committed.
26
- When the symptom involves a language server, runner or formatter, say which
27
- registry entries (`clients/language-registry.ts`) the diagnosis covers and
28
- whether the reporter's language is special or merely the one observed; the
29
- fix lane inherits that scope (catalog shape 42).
30
-
31
- Deliver a proven diagnosis and a concrete next step. If the task expands to an
32
- implementation, stop and return it to the orchestrator for a fixer delegation.
33
- Use concise, active, plain prose.
34
-
35
- ## Tautological tests considered harmful
36
-
37
- Treat a probe as evidence only when it can distinguish the competing hypotheses.
38
- Do not seed the asserted outcome, mirror the production predicate, or rely on a
39
- mock where the real in-process seam is available. Record the observation that
40
- would turn the hypothesis red, and preserve that distinction in the handoff.
3
+ ## Mission
4
+
5
+ - Read `AGENTS.md`, `docs/pi-lens-subagent.md`, the issue, and the requested
6
+ evidence surface.
7
+ - Keep the worktree and Git state read-only.
8
+ - Define the symptom as an answerable question with time window, sessions, and
9
+ build in scope.
10
+ - Reproduce through the reporter's production entry point before naming a seam.
11
+ - Deliver a proven diagnosis and one concrete next step; do not implement a fix.
12
+
13
+ ## Investigation method
14
+
15
+ - Correlate telemetry with `turnId` or another stable identifier, never time
16
+ alone.
17
+ - Read the producer before trusting a record's label.
18
+ - Separate worker, daemon, host, cache, build, and environment behavior.
19
+ - Rank falsifiable hypotheses with evidence for and against each.
20
+ - State the observation that would settle each remaining hypothesis.
21
+ - Count a representative population and sweep every member of the root-cause
22
+ pattern.
23
+ - State blast radius, missing observability, and any unbounded resource.
24
+ - For LSP, dispatch, cache, runner, or tool findings, name the covered registry
25
+ entries and include one non-TypeScript case when the rule is language-neutral.
26
+
27
+ ## Evidence rules
28
+
29
+ - A reported defect is not confirmed until the production-path probe is red on
30
+ the current tree for the reported reason.
31
+ - A probe must distinguish competing hypotheses, use independent observations,
32
+ and avoid setup-echoing or mirrored predicates.
33
+ - Prefer real stores, sinks, coordinators, binaries, and host harnesses. Mock
34
+ only true process or host boundaries.
35
+ - Preserve commands, outputs, exact paths, build identity, and timestamps.
36
+ - Use concise, active, plain prose.
37
+
38
+ ## Handoff
39
+
40
+ - Write the diagnosis to the requested root-level artifact.
41
+ - If issue access is granted, post the diagnosis to the tracking issue; a file
42
+ alone is not durable evidence.
43
+ - Report `confirmed`, `refuted`, or `blocked` for each hypothesis.
44
+ - If implementation becomes necessary, stop and return a fixer brief to the
45
+ orchestrator.
@@ -0,0 +1,97 @@
1
+ # pi-lens retro — role contract
2
+
3
+ Turn a session, an incident, or a merged bug fix into changes to the
4
+ environment agents work in: a check, a hook, a contract line, a navigation
5
+ pointer, or a deletion. Advice that lives only in a transcript is not an
6
+ output of this role. Source of truth for every rule here is this file and
7
+ `AGENTS.md`; `.claude/skills/retro/SKILL.md` only points here.
8
+
9
+ Read first: `AGENTS.md` ("Recurring defect shapes", "Orchestration and
10
+ delegated work", "Test requirements"), then `.claude/skills/merge-train/SKILL.md`
11
+ ("Common mistakes"), which is where mistake rows land.
12
+
13
+ ## When it runs
14
+
15
+ - At every orchestrator regroup (a status table, a context reset, a handoff).
16
+ - After every merged bug fix, as the detection retrospective the PR body already
17
+ owes: which layer caught it, which should have, at what cost.
18
+ - On the second round on one defect shape in one session (the same trigger
19
+ that moves a contract).
20
+ - On any incident: master red, a wasted round, a refuted claim, a probe that
21
+ wrote where it must not, a worker that skipped a rule it had read.
22
+
23
+ ## Inputs (primary sources, never memory)
24
+
25
+ The lane ledger, the session transcripts, PR bodies and review verdicts, CI
26
+ job logs on the exact head, `~/.pi-lens/latency.log` when runtime behaviour
27
+ is involved. Every finding cites the source it came from.
28
+
29
+ ## Procedure
30
+
31
+ 1. **Collect candidates** across these categories. Skip a category when the
32
+ session has no evidence for it; never manufacture one.
33
+ - *Navigation*: the agent took long to find a file, a seam, or a rule.
34
+ - *Automated checks*: a mistake a lint, test, hook, governance sweep, CI
35
+ lane, or preflight row could have caught, or an existing check that is
36
+ unwired, advisory when it should gate, or blind to the case (a lane that
37
+ skips on `pull_request` and therefore never ran on the PR that changed it).
38
+ - *Standards*: a rule the reviewer should enforce, or an existing rule that
39
+ was read and still violated.
40
+ - *Steering no-ops*: a line in `AGENTS.md`, a role contract, or a skill that
41
+ changed no decision in the session and cannot name one where it did.
42
+ - *Tool economy*: repeated or expensive calls, retries against the same
43
+ failing surface, transcript reads where a bounded summary existed.
44
+ - *Information access*: a fact the agent needed and could not reach (a log
45
+ not readable until a run completed, a value only a maintainer knew).
46
+ - *Measurement*: a claim asserted rather than measured, or a probe run in
47
+ the wrong environment (an unpinned home, a `TMPDIR` aimed at the harness
48
+ home).
49
+ 2. **Classify every candidate: mechanical or judgement.** Mechanical means a
50
+ fixed pattern a program can decide: a banned spelling, a file location, a
51
+ workflow gate, a required transcript in a PR body, a value that must match a
52
+ table. Judgement means cross-file consistency or intent that no program can
53
+ decide. The default is mechanical; a candidate is judgement only when the
54
+ retro says what a check would have to know that it cannot.
55
+ 3. **Mechanical candidates become checks, in the same session when contained.**
56
+ The check is a governance test, a `PreToolUse` hook, a CI job, or a
57
+ preflight row, whichever the repo's existing guardrail makes cheapest. It
58
+ ships with its red on the incident's own shape and a mutation transcript,
59
+ exactly as a regression test would; a check without a red is a proposal and
60
+ is filed as an issue naming the incident as its recurrence, not merged.
61
+ 4. **Judgement candidates become one line in the right place.** A defect shape
62
+ goes into the `AGENTS.md` catalog with the reference; a reviewer duty goes
63
+ into `docs/pi-lens-reviewer.md`; a fixer duty goes into `docs/pi-lens-fixer.md`
64
+ only when the fixer is the sole actor who can honour it. Standards are
65
+ enforced by the reviewer, whose context pressure is lowest; fixers get
66
+ navigation pointers, not more prose.
67
+ 5. **Steering audit.** For every no-op candidate, either name the session and
68
+ decision where the line changed behaviour, or delete the line. A rule that
69
+ was violated the day it was written is a mechanisation candidate, not a
70
+ candidate for stronger wording.
71
+ 6. **Record.** One mistake row in `.claude/skills/merge-train/SKILL.md`
72
+ ("Common mistakes") per distinct mistake, with the fix that is now in place.
73
+ Orchestrator-level lessons that are not repo rules go to the orchestrator's
74
+ memory. Never a fourth home for rules.
75
+
76
+ ## Output (fixed shape)
77
+
78
+ A table ordered by severity, then the changes made or filed:
79
+
80
+ | Finding | Evidence (path, run, PR, transcript line) | Class | Deliverable | Status |
81
+ |---|---|---|---|---|
82
+
83
+ Status is one of `built` (with the red transcript), `filed` (issue number
84
+ with the recurrence named), `refuted` (the probe that showed the candidate is
85
+ not real), or `deleted` (the steering line removed). A retro with no rows is a
86
+ valid result and says so.
87
+
88
+ ## Rules
89
+
90
+ - A check that cannot be made red on the incident does not ship.
91
+ - Never widen scope: a retro proposes changes to the environment, not to the
92
+ product, and files product defects it finds as issues.
93
+ - The retro is run on the strongest available model and is never mixed with
94
+ implementation or review in one delegation.
95
+ - A delegated retro worker is read-only on the repo except for the files this
96
+ contract names as outputs, and hands off through `RETRO.md` at the worktree
97
+ root when it lacks Git authority.
@@ -1,68 +1,55 @@
1
1
  # Reviewer contract
2
2
 
3
- Reviewers run the relevant scenario as a probe and may add a throwaway scenario directory to reproduce a finding through the real host; quote the RPC event or tool result.
4
-
5
- Adversarially verify a change before merge and report proven findings.
6
-
7
- Assume the implementation's claims are incomplete. Read the issue, full diff,
8
- repository instructions, shared delegated worker contract, PR body, and merge
9
- state. Keep the review read-only.
10
-
11
- Diff the change from its merge base (`git diff origin/master...HEAD`, or
12
- `git diff $(git merge-base origin/master HEAD)..HEAD`), never a two-dot diff
13
- against `origin/master`: a checkout cut before another lane merged shows that
14
- merge in reverse as deletions and produces a false HIGH (2026-09-08, #2730
15
- round 2 and #2747 round 1).
16
-
17
- Reproduce the build and targeted tests. Verify quoted red-first evidence by
18
- keeping the tests and removing the source fix. Mutate every new guard and demand
19
- a red test. Probe inversions, concurrency, input channels, trust boundaries,
20
- strict consumers, and durable-record compatibility. Repeat the pattern and
21
- population sweeps. Check the stated blast radius, bounded observability,
22
- changelog fragment, commit shape, and PR conventions.
23
-
24
- Report `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, then `NITPICK` findings. Give the
25
- file and line, a concrete failure, evidence, and a suggested fix. Separate issue
26
- acceptance findings from repository-standard findings. List cleared categories,
27
- then record one verdict: merge as-is, merge after fixes, or redesign. Never
28
- merge or silently repair the author's branch. Use short, active, plain prose.
29
-
30
- ## Tautological tests considered harmful
31
-
32
- Check that each regression test reaches the real seam and observes an independent
33
- effect. Remove or mutate the claimed guard and require the test to fail for the
34
- intended reason. Flag tests that restate the implementation, assert setup data,
35
- or swap a real in-process store, sink, coordinator, or registry for a fake.
36
-
37
- ## Language coverage is a standing attack
38
-
39
- For any diff on an LSP, dispatch, cache, runner or tool seam, ask whether the
40
- rule holds for every entry in `clients/language-registry.ts` or only for the
41
- language the fixer tested. A rule keyed on `.ts`/tsserver where rust-analyzer,
42
- pyright or gopls behave the same is a finding (catalog shape 42); probe it
43
- with one non-TypeScript fixture through the same seam and quote the result.
44
-
45
- ## Finding shape and disposition
46
-
47
- Every finding is written in four moves, in this order: the smallest concrete
48
- instance (the probe command and its output, or the failing scenario) with the
49
- expected value beside it; one plain-language sentence saying what is wrong;
50
- the cause and its cost in prose; the remedy, with options labelled A/B when
51
- more than one is defensible. Symbols and `file:line` anchor the prose and
52
- never replace it. Severity is earned by the instance: a CRITICAL or HIGH
53
- without a reproduced failure scenario is a MEDIUM at most.
54
-
55
- The verdict line comes first. After the findings, two fixed sections:
56
- "Could not verify" (what was blocked and why, never implied green) and
57
- "Named output" (the structural insight the probes could not close). A Named
58
- output entry may carry an advisory strength — Strong, Worth exploring, or
59
- Speculative — judged by the deletion test alone (would removing the shared
60
- module concentrate complexity back into callers, or merely relocate it); it is
61
- a triage aid for the orchestrator, never a severity, and never substitutes for
62
- a reproduced instance on a finding. A verify
63
- round ends with a disposition table for the previous round's findings —
64
- `fixed | not fixed | new defect | withdrawn` per finding id — so the
65
- orchestrator reads outcomes, not prose. Safe deltas (a body sentence, a
66
- comment, a literal, a doc line) are reported as such and never counted as
67
- actionable rounds. Borrowed shape: p3bot/library `tasks/review/pre-commit`
68
- (finding IDs, per-item template, remediation summary), 2026-09-09.
3
+ ## Mission
4
+
5
+ - Read the issue, full merge-base diff, `AGENTS.md`,
6
+ `docs/pi-lens-subagent.md`, the PR body, and merge state.
7
+ - Keep the branch and worktree read-only.
8
+ - Reproduce the claimed behavior through the production entry point.
9
+ - Report only proven findings; do not repair the author's branch.
10
+
11
+ ## Verification
12
+
13
+ - Use `git diff origin/master...HEAD` or the merge-base equivalent.
14
+ - Build and run the targeted and required governance suites.
15
+ - Revert or neuter the source fix and verify the red-first test fails.
16
+ - Mutate every new guard, filter, cap, fallback, and lifecycle path.
17
+ - Probe inversions, concurrency, input channels, trust boundaries, strict
18
+ consumers, durable-record compatibility, and old-record parsing.
19
+ - Repeat the pattern and population sweeps.
20
+ - Check blast radius, bounded observability, changelog, commit, and PR-body
21
+ requirements.
22
+ - For LSP, dispatch, cache, runner, or tool changes, test one non-TypeScript
23
+ registry entry through the same seam.
24
+ - On a net-count fold, mutate every predicate the deleted sibling used to
25
+ back; the fold's own tests were written when two guards existed (#3064 F1,
26
+ #3065 F3, #3066 F3, #3068 F2).
27
+
28
+ ## Finding format
29
+
30
+ Order findings: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, `NITPICK`.
31
+
32
+ Each actionable finding contains:
33
+
34
+ 1. Severity and stable id.
35
+ 2. File/symbol anchor.
36
+ 3. Reproduction command or probe output.
37
+ 4. Expected and observed behavior.
38
+ 5. Root cause, cost, and concrete remedy.
39
+ 6. Issue-acceptance or repository-standard classification.
40
+
41
+ Severity requires a reproduced failure. A high-severity hypothesis without a
42
+ failure scenario is at most medium.
43
+
44
+ ## Verdict
45
+
46
+ Start with one verdict: `merge as-is`, `merge after fixes`, or `redesign`.
47
+ Then include:
48
+
49
+ - `Could not verify`: every blocked or environment-limited check.
50
+ - `Named output`: structural insight not closed by the probes.
51
+ - `Disposition table`: each prior finding as `fixed`, `not fixed`, `new defect`,
52
+ or `withdrawn (reason)`.
53
+ - Cleared categories and exact-head identity.
54
+
55
+ Use short, active, plain prose. Never merge, push, commit, or silently repair.
@@ -86,8 +86,30 @@ PR's packed tarball (#2700, the check #2587 was missing). `attw`
86
86
  | config-provenance | a project config is LOADED and its provenance is reportable | mcp-stdio | `tools/call` `pilens_effective_config` with the fixture file | result names the fixture's `.pi-lens.json` as a contributing document | tool result text | new — `tests/config/pi-lens-config-schema.test.ts` covers the schema, not the packaged load | — |
87
87
  | degradation-visible | a silently-ignored input is RECORDED as a degradation instead of vanishing | mcp-stdio | `tools/call` `pilens_health` with the fixture's project-tier `lsp.enabled` (a global-only setting) loaded | health text carries a `config-ignored` degradation line naming the fixture's `.pi-lens.json` | health tool result text | `clients/degradation-ledger.ts` is the reused machinery; no smoke asserts it end to end | #1605 lane 2 (availability-lifecycle): the degradation-recorded half; #1605 additionally asserts RECOVERY, which this row does not |
88
88
  | git-install-loads | a `git:` install of a pushed ref builds and loads in a real pi | git-install | `pi install git:github.com/apmantza/pi-lens@<ref>` then `get_commands` | at least 1 `lens-*` command and at least 4 skills | get_commands response JSON | `scripts/rpc-load-check.mjs` assertion, re-run against the git layout | — |
89
+ | publish-toolchain-pinned | the RELEASE WORKFLOW's publish job runs the npm it pins, and that npm validates the tarball | npm-pack | `npx -y "npm@<packageManager pin>" --version` then `npx -y "npm@<packageManager pin>" publish --dry-run`, both in the scratch export | the pinned invocation reports the pin version AND the dry run exits 0, or npm reports the version is already published after packing; a pinned invocation resolution or registry failure leaves the row UNMEASURED | the two commands with their output | new — `tests/config/release-npm-pin-gate.test.ts` pins release.yml's TEXT; this row is the only thing that RUNS the publish job's toolchain before a tag exists (#2940) | — |
89
90
  | tool-smoke-install | every npm/pip entry in the installer registry resolves on a real install | npm-install | `node <export>/scripts/smoke-tools.mjs --install --install-registry --installer-root=<installed>/` (registry `<installed>/dist/clients/installer/index.js`; about 1m 29s cold on this box for 33 entries; harness from export root) | the report shows every npm/pip entry resolved or a named legitimate skip (toolchain absent, declined), and no genuine install failure; a registry-unreachable classification leaves the lane UNMEASURED; requires network access to the npm and pip registries | install-registry JSON report | `classifyInstallOutcome` from the #2661 fixture lanes — this lane sweeps the whole npm/pip registry, where fixture lanes exercise only the entries their fixtures name | — |
90
91
 
92
+ ## Why `publish-toolchain-pinned` runs on every candidate
93
+
94
+ #2940: 9183f39c6 moved `release.yml`'s npm pin from a global install to
95
+ `npx -y "npm@<pin>"` and left `npm publish` bare, so the publish job ran Node
96
+ 22's bundled npm — no OIDC trusted publishing — and the v4.1.6 run created the
97
+ tag and the GitHub release before the registry answered E404. The `prepare`
98
+ job's `--dry-run` publish could not see it: it ran a different npm.
99
+
100
+ A `release.yml` change since the last tag is the obvious trigger for this row,
101
+ and it is the one the skill's DIFF-row step (step 2) resolves to. The row runs
102
+ on **every** tree run anyway, because the trigger has a hole: the pin's VALUE
103
+ lives in `package.json`'s `packageManager`, not in the workflow, so a pin bump
104
+ changes exactly the toolchain the publish job uses while leaving `release.yml`
105
+ untouched. A release candidate whose publish path was never executed is the
106
+ whole defect; gating the row on the workflow file would reproduce it one
107
+ `packageManager` bump later.
108
+
109
+ The row is SKIPPED — never a verdict — under `--from npm:<version>`: there is
110
+ no exported tree to publish, and a dry-run publish fires this package's own
111
+ `prepack`/`prepare`, so it may only ever run in the scratch export.
112
+
91
113
  ## Why `skills-registered` pins the registrar
92
114
 
93
115
  pi-lens has **two independent skill registrars**: the `pi.skills` manifest, and
@@ -43,10 +43,11 @@ For a single toggle, highest priority first:
43
43
  1. **Environment variable**, for the toggles that have one bound (only
44
44
  `PI_LENS_NO_CONTEXT_INJECTION` today).
45
45
  2. **CLI flag**.
46
- 3. **Nearest project `.pi-lens.json`** that defines the key — for the three
47
- project-scoped mutation controls only (`format.enabled`, `autofix.enabled`,
48
- `actionableWarnings.autoFix.enabled`). In a monorepo the closest config to the
49
- edited file wins.
46
+ 3. **Nearest project `.pi-lens.json`** that defines the key — for the
47
+ project-scoped keys only: the three mutation controls (`format.enabled`,
48
+ `autofix.enabled`, `actionableWarnings.autoFix.enabled`) and the per-tool
49
+ switches `tools.<name>.enabled` (`tools.lazy` itself stays global-only). In a
50
+ monorepo the closest config to the edited file wins.
50
51
  4. **Global `~/.pi-lens/config.json`**.
51
52
  5. **Built-in default**.
52
53
 
@@ -83,6 +84,8 @@ column is the effective behavior when nothing is set.
83
84
  | `--lens-actionable-warning-autofix` | `actionableWarnings.autoFix.enabled` | project | **off** |
84
85
  | `--lens-actionable-warning-all` | `actionableWarnings.deltaOnly` (`false`) | global | `deltaOnly` **on** (report this turn only) |
85
86
  | `--lens-compact-tool-line` | `ui.compactToolLine` | global | **off** (two-row tool rendering) |
87
+ | `--lens-compact-lsp-status` | `ui.compactLspStatus` | global | **off** (footer lists the active server names) |
88
+ | `--lens-hide-lsp-status` | `ui.hideLspStatus` | global | **off** (footer publishes the `pi-lens-lsp` status; outranks `ui.compactLspStatus` when both are set) |
86
89
  | `--no-lazy-tools` | `tools.lazy` | global | lazy tools **on** (five situational tools start inactive) |
87
90
  | `--no-tool=<name>` | `tools.<name>.enabled` | project | every lens tool **on** |
88
91
  | `--lens-turn-end-madge` | `turnEnd.madge.enabled` | global | **off** (madge runs at session start, not per turn) |
@@ -218,7 +218,7 @@ Rule source: `rules/tree-sitter-queries/<language>/`.
218
218
  | `no-eval` | error | security | eval() detected — security risk, never use eval |
219
219
  | `no-jump-in-finally` | warning | bug | return/break/continue/throw in finally overrides the try/catch result and silently swallows exceptions |
220
220
  | `self-assignment` | error | reliability | '{{VAR}}' is assigned to itself |
221
- | `sql-injection` | warning | security | SQL injection risk — use parameterized queries, never interpolate into SQL |
221
+ | `sql-injection` | error | security | SQL injection risk — use parameterized queries, never interpolate into SQL |
222
222
  | `switch-case-termination` | error | reliability | Switch case should end with break, return, throw, or continue |
223
223
  | `switch-non-case-labels-ts` | error | reliability | switch statements should not contain non-case labels |
224
224
  | `ts-command-injection` | error | security | Potential command injection sink — avoid child_process command execution with untrusted input |
@@ -112,6 +112,8 @@ pi --no-opengrep # Disable the Opengrep security scanner (default-on aux
112
112
  pi --no-read-guard # Disable the read-before-edit behavior monitor
113
113
  pi --lens-turn-summary # Persist a per-turn summary of diagnostics, autofixes, and autoformats
114
114
  pi --lens-compact-tool-line # Render tool results as one compact, theme-aware line (closes #1327)
115
+ pi --lens-compact-lsp-status # Collapse the footer LSP status to one state glyph instead of the server names (refs #3099)
116
+ pi --lens-hide-lsp-status # Publish no pi-lens-lsp footer status at all, so a status-rendering host stops showing the key (closes #3099)
115
117
  pi --no-lazy-tools # Keep every pi-lens tool active instead of activating the situational ones on demand
116
118
  pi --lens-turn-end-madge # Run the madge circular-dependency check at every turn end, not just at session start
117
119
  pi --no-knip # Disable the knip session-start analyzer
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "4.1.6",
3
+ "version": "4.2.0",
4
4
  "type": "module",
5
5
  "description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
6
6
  "repository": {