@herbertgao/pi-extensions 2026.9.0 → 2026.9.2

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 (360) hide show
  1. package/node_modules/@czottmann/pi-automode/CHANGELOG.md +13 -1
  2. package/node_modules/@czottmann/pi-automode/README.md +20 -0
  3. package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +1 -1
  4. package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +2 -1
  5. package/node_modules/@czottmann/pi-automode/docs/defaults.md +3 -2
  6. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +38 -2
  7. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +5 -3
  8. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +11 -3
  9. package/node_modules/@czottmann/pi-automode/package.json +1 -1
  10. package/node_modules/@narumitw/pi-btw/README.md +57 -141
  11. package/node_modules/@narumitw/pi-btw/dist/index.ts +466 -41
  12. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
  13. package/node_modules/@narumitw/pi-btw/docs/workflows.md +74 -0
  14. package/node_modules/@narumitw/pi-btw/package.json +2 -1
  15. package/node_modules/@narumitw/pi-btw/src/btw.ts +15 -1
  16. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +32 -2
  17. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +330 -0
  18. package/node_modules/@narumitw/pi-btw/src/menu.ts +136 -19
  19. package/node_modules/@narumitw/pi-btw/src/settings.ts +32 -0
  20. package/node_modules/@narumitw/pi-btw/src/side-thread.ts +57 -5
  21. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +52 -30
  22. package/node_modules/@pi-plugins/fast-mode/README.md +5 -3
  23. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  24. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +20 -55
  25. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  26. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  27. package/node_modules/pi-lens/CHANGELOG.md +1072 -0
  28. package/node_modules/pi-lens/README.md +3 -0
  29. package/node_modules/pi-lens/config/biome/core.jsonc +11 -2
  30. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +13 -1
  31. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -9
  32. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +927 -80
  33. package/node_modules/pi-lens/dist/clients/advisory-provenance.js +1 -1
  34. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +13 -4
  35. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +123 -3
  36. package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +60 -5
  37. package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +2 -9
  38. package/node_modules/pi-lens/dist/clients/ast-grep-types.js +2 -0
  39. package/node_modules/pi-lens/dist/clients/bash-file-access.js +133 -3
  40. package/node_modules/pi-lens/dist/clients/biome-client.js +9 -2
  41. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +14 -6
  42. package/node_modules/pi-lens/dist/clients/bootstrap.js +509 -73
  43. package/node_modules/pi-lens/dist/clients/bounded-cache.js +152 -12
  44. package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +1 -1
  45. package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +59 -9
  46. package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +113 -0
  47. package/node_modules/pi-lens/dist/clients/bus-events-logger.js +3 -11
  48. package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +31 -4
  49. package/node_modules/pi-lens/dist/clients/cache-manager.js +105 -6
  50. package/node_modules/pi-lens/dist/clients/cache-observability.js +40 -19
  51. package/node_modules/pi-lens/dist/clients/cargo-manifest.js +422 -0
  52. package/node_modules/pi-lens/dist/clients/cascade-logger.js +2 -9
  53. package/node_modules/pi-lens/dist/clients/child-unref.js +1 -19
  54. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +13 -3
  55. package/node_modules/pi-lens/dist/clients/complexity-client.js +16 -5
  56. package/node_modules/pi-lens/dist/clients/config-core/deny.js +221 -0
  57. package/node_modules/pi-lens/dist/clients/config-core/index.js +50 -0
  58. package/node_modules/pi-lens/dist/clients/config-core/merge.js +357 -0
  59. package/node_modules/pi-lens/dist/clients/config-core/normalize.js +340 -0
  60. package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +248 -0
  61. package/node_modules/pi-lens/dist/clients/config-core/provenance.js +164 -0
  62. package/node_modules/pi-lens/dist/clients/config-core/records.js +218 -0
  63. package/node_modules/pi-lens/dist/clients/config-core/resolve.js +125 -0
  64. package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +78 -0
  65. package/node_modules/pi-lens/dist/clients/config-core/schema.js +165 -0
  66. package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +281 -0
  67. package/node_modules/pi-lens/dist/clients/config-locations.js +160 -0
  68. package/node_modules/pi-lens/dist/clients/config-resolve.js +789 -0
  69. package/node_modules/pi-lens/dist/clients/config-schema.js +234 -0
  70. package/node_modules/pi-lens/dist/clients/config-warn.js +407 -0
  71. package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -14
  72. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +2 -6
  73. package/node_modules/pi-lens/dist/clients/deadline-utils.js +178 -0
  74. package/node_modules/pi-lens/dist/clients/debug-handles.js +2 -2
  75. package/node_modules/pi-lens/dist/clients/debug-heap.js +3 -3
  76. package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +106 -0
  77. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +113 -7
  78. package/node_modules/pi-lens/dist/clients/dependency-checker.js +8 -19
  79. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +1 -1
  80. package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +12 -9
  81. package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +15 -5
  82. package/node_modules/pi-lens/dist/clients/dispatch/collect-later-tier.js +0 -4
  83. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +162 -44
  84. package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +97 -0
  85. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +27 -8
  86. package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +0 -6
  87. package/node_modules/pi-lens/dist/clients/dispatch/pending-runner-findings.js +1 -1
  88. package/node_modules/pi-lens/dist/clients/dispatch/plan.js +0 -3
  89. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-complexity.js +2 -2
  90. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-fan-out.js +1 -1
  91. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -1
  92. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +383 -27
  93. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -1
  94. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +4 -1
  95. package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -1
  96. package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -1
  97. package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -1
  98. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -1
  99. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -1
  100. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -1
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -1
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -1
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -1
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +1 -3
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -1
  108. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -1
  109. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +1 -2
  110. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -1
  111. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -1
  112. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -1
  113. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -1
  114. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -1
  115. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -1
  116. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +14 -18
  117. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -1
  118. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -1
  119. package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -1
  120. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +6 -3
  121. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +7 -4
  122. package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -1
  123. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +1 -2
  124. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -3
  125. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +1 -2
  126. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -1
  127. package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +4 -3
  128. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -1
  129. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -1
  130. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -1
  131. package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -1
  132. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -1
  133. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -1
  134. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -1
  135. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -1
  136. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -1
  137. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +3 -0
  138. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +3 -67
  139. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +194 -80
  140. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +84 -15
  141. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils.js +0 -21
  142. package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -1
  143. package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +2 -20
  144. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +1 -1
  145. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -1
  146. package/node_modules/pi-lens/dist/clients/dispatch/utils/format-utils.js +2 -2
  147. package/node_modules/pi-lens/dist/clients/disposition-logger.js +3 -10
  148. package/node_modules/pi-lens/dist/clients/effective-config.js +403 -0
  149. package/node_modules/pi-lens/dist/clients/error-class.js +23 -0
  150. package/node_modules/pi-lens/dist/clients/event-loop-hold.js +274 -0
  151. package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +2 -2
  152. package/node_modules/pi-lens/dist/clients/extension-log.js +2 -2
  153. package/node_modules/pi-lens/dist/clients/feature-hints.js +2 -1
  154. package/node_modules/pi-lens/dist/clients/file-kinds.js +1 -38
  155. package/node_modules/pi-lens/dist/clients/file-time.js +7 -2
  156. package/node_modules/pi-lens/dist/clients/file-utils.js +117 -10
  157. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +50 -13
  158. package/node_modules/pi-lens/dist/clients/format-service.js +6 -2
  159. package/node_modules/pi-lens/dist/clients/formatters.js +385 -104
  160. package/node_modules/pi-lens/dist/clients/freshness-cadence.js +17 -0
  161. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +116 -22
  162. package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -9
  163. package/node_modules/pi-lens/dist/clients/git-guard.js +6 -1
  164. package/node_modules/pi-lens/dist/clients/go-client.js +39 -0
  165. package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +252 -0
  166. package/node_modules/pi-lens/dist/clients/grammar-source.js +3 -3
  167. package/node_modules/pi-lens/dist/clients/hashline-anchor.js +424 -0
  168. package/node_modules/pi-lens/dist/clients/hook-budgets.js +76 -0
  169. package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +5 -2
  170. package/node_modules/pi-lens/dist/clients/host-ports.js +1 -1
  171. package/node_modules/pi-lens/dist/clients/installer/index.js +289 -59
  172. package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +84 -18
  173. package/node_modules/pi-lens/dist/clients/instance-reaper.js +110 -236
  174. package/node_modules/pi-lens/dist/clients/instance-registry.js +6 -3
  175. package/node_modules/pi-lens/dist/clients/language-profile.js +0 -9
  176. package/node_modules/pi-lens/dist/clients/language-registry.js +599 -0
  177. package/node_modules/pi-lens/dist/clients/latency-logger.js +165 -9
  178. package/node_modules/pi-lens/dist/clients/ledger-bounds.js +34 -1
  179. package/node_modules/pi-lens/dist/clients/lens-config.js +160 -30
  180. package/node_modules/pi-lens/dist/clients/lens-engine.js +33 -41
  181. package/node_modules/pi-lens/dist/clients/lens-events.js +1 -1
  182. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +77 -6
  183. package/node_modules/pi-lens/dist/clients/lens-map.js +1 -1
  184. package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -38
  185. package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +3 -1
  186. package/node_modules/pi-lens/dist/clients/lsp/client.js +172 -33
  187. package/node_modules/pi-lens/dist/clients/lsp/config.js +484 -158
  188. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +1 -1
  189. package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +1 -1
  190. package/node_modules/pi-lens/dist/clients/lsp/edits.js +18 -5
  191. package/node_modules/pi-lens/dist/clients/lsp/index.js +892 -96
  192. package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +1 -1
  193. package/node_modules/pi-lens/dist/clients/lsp/language.js +18 -177
  194. package/node_modules/pi-lens/dist/clients/lsp/launch.js +2 -1
  195. package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +1 -1
  196. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +5 -18
  197. package/node_modules/pi-lens/dist/clients/lsp/server.js +284 -147
  198. package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +116 -23
  199. package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +2 -7
  200. package/node_modules/pi-lens/dist/clients/lsp/sync-kind.js +0 -1
  201. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +14 -7
  202. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/classification.js +6 -0
  203. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/strategies.js +2 -1
  204. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +1 -1
  205. package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +1 -1
  206. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +163 -21
  207. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +36 -0
  208. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +33 -4
  209. package/node_modules/pi-lens/dist/clients/mcp/session.js +5 -16
  210. package/node_modules/pi-lens/dist/clients/memory-sampler.js +8 -3
  211. package/node_modules/pi-lens/dist/clients/metrics-history.js +28 -107
  212. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +3 -5
  213. package/node_modules/pi-lens/dist/clients/module-report.js +21 -46
  214. package/node_modules/pi-lens/dist/clients/mutating-tool.js +651 -0
  215. package/node_modules/pi-lens/dist/clients/mutation-attribution.js +368 -0
  216. package/node_modules/pi-lens/dist/clients/mutation-bridge.js +240 -0
  217. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +247 -24
  218. package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +101 -0
  219. package/node_modules/pi-lens/dist/clients/observed-mutation.js +1215 -0
  220. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +70 -28
  221. package/node_modules/pi-lens/dist/clients/opengrep-config.js +5 -1
  222. package/node_modules/pi-lens/dist/clients/package-manager.js +195 -26
  223. package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +359 -80
  224. package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +23 -7
  225. package/node_modules/pi-lens/dist/clients/path-keyed-map.js +21 -2
  226. package/node_modules/pi-lens/dist/clients/path-utils.js +451 -15
  227. package/node_modules/pi-lens/dist/clients/performance-report.js +2 -2
  228. package/node_modules/pi-lens/dist/clients/persist-debounce.js +8 -1
  229. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +114 -0
  230. package/node_modules/pi-lens/dist/clients/pipeline.js +79 -18
  231. package/node_modules/pi-lens/dist/clients/probe-home-state.js +228 -0
  232. package/node_modules/pi-lens/dist/clients/process-bridge.js +66 -0
  233. package/node_modules/pi-lens/dist/clients/process-snapshot.js +68 -0
  234. package/node_modules/pi-lens/dist/clients/project-changes.js +1 -1
  235. package/node_modules/pi-lens/dist/clients/project-diagnostics/extractors.js +1 -1
  236. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +4 -3
  237. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +1 -1
  238. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +1 -1
  239. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +1 -1
  240. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +1 -1
  241. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +28 -4
  242. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +51 -20
  243. package/node_modules/pi-lens/dist/clients/project-lens-config.js +438 -122
  244. package/node_modules/pi-lens/dist/clients/project-scan-policy.js +3 -51
  245. package/node_modules/pi-lens/dist/clients/project-snapshot.js +52 -24
  246. package/node_modules/pi-lens/dist/clients/python-environment.js +217 -0
  247. package/node_modules/pi-lens/dist/clients/python-provenance.js +639 -0
  248. package/node_modules/pi-lens/dist/clients/quiet-window.js +6 -1
  249. package/node_modules/pi-lens/dist/clients/read-bridge.js +13 -21
  250. package/node_modules/pi-lens/dist/clients/read-expansion.js +9 -46
  251. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +16 -5
  252. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +364 -212
  253. package/node_modules/pi-lens/dist/clients/read-guard.js +26 -2
  254. package/node_modules/pi-lens/dist/clients/recent-touches.js +2 -2
  255. package/node_modules/pi-lens/dist/clients/resource-sampler.js +195 -96
  256. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +155 -114
  257. package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +1 -1
  258. package/node_modules/pi-lens/dist/clients/review-graph/service.js +55 -3
  259. package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +7 -15
  260. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +10 -74
  261. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +9 -3
  262. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +19 -3
  263. package/node_modules/pi-lens/dist/clients/runtime-context.js +49 -16
  264. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +25 -6
  265. package/node_modules/pi-lens/dist/clients/runtime-session.js +184 -32
  266. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +179 -36
  267. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +797 -243
  268. package/node_modules/pi-lens/dist/clients/runtime-turn.js +1028 -53
  269. package/node_modules/pi-lens/dist/clients/rust-client.js +31 -0
  270. package/node_modules/pi-lens/dist/clients/safe-spawn.js +33 -10
  271. package/node_modules/pi-lens/dist/clients/sanitize.js +7 -12
  272. package/node_modules/pi-lens/dist/clients/scan-utils.js +1 -56
  273. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +1 -3
  274. package/node_modules/pi-lens/dist/clients/security-scan-client.js +3 -0
  275. package/node_modules/pi-lens/dist/clients/session-lifecycle.js +1 -1
  276. package/node_modules/pi-lens/dist/clients/session-start-observability.js +79 -0
  277. package/node_modules/pi-lens/dist/clients/session-summary.js +0 -24
  278. package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +12 -3
  279. package/node_modules/pi-lens/dist/clients/sgconfig.js +7 -6
  280. package/node_modules/pi-lens/dist/clients/shared-checkout-guard.js +1 -1
  281. package/node_modules/pi-lens/dist/clients/skills-resolver.js +105 -0
  282. package/node_modules/pi-lens/dist/clients/smells-rollup.js +4 -4
  283. package/node_modules/pi-lens/dist/clients/startup-scan.js +2 -10
  284. package/node_modules/pi-lens/dist/clients/string-utils.js +13 -0
  285. package/node_modules/pi-lens/dist/clients/subagent-mode.js +17 -4
  286. package/node_modules/pi-lens/dist/clients/test-runner-client.js +176 -39
  287. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +244 -0
  288. package/node_modules/pi-lens/dist/clients/tool-definition.js +41 -1
  289. package/node_modules/pi-lens/dist/clients/tool-policy.js +92 -22
  290. package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +40 -40
  291. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +87 -100
  292. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
  293. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +81 -1
  294. package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +51 -46
  295. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +28 -0
  296. package/node_modules/pi-lens/dist/clients/tui-fit.js +0 -4
  297. package/node_modules/pi-lens/dist/clients/typos-config.js +5 -0
  298. package/node_modules/pi-lens/dist/clients/user-notify.js +6 -6
  299. package/node_modules/pi-lens/dist/clients/widget-state.js +191 -26
  300. package/node_modules/pi-lens/dist/clients/word-index-logger.js +2 -9
  301. package/node_modules/pi-lens/dist/clients/word-index-store.js +23 -12
  302. package/node_modules/pi-lens/dist/clients/word-index.js +252 -47
  303. package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -1
  304. package/node_modules/pi-lens/dist/clients/zizmor-config.js +4 -1
  305. package/node_modules/pi-lens/dist/index.js +65899 -55340
  306. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -1
  307. package/node_modules/pi-lens/dist/mcp/build-staleness.js +1 -1
  308. package/node_modules/pi-lens/dist/mcp/server.js +127 -5
  309. package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +583 -0
  310. package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +129 -0
  311. package/node_modules/pi-lens/dist/tools/effective-config.js +89 -0
  312. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +96 -25
  313. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +104 -86
  314. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +37 -16
  315. package/node_modules/pi-lens/dist/tools/lsp-structured-output.js +3 -3
  316. package/node_modules/pi-lens/dist/tools/render-compact.js +1 -1
  317. package/node_modules/pi-lens/dist/tools/shared.js +0 -1
  318. package/node_modules/pi-lens/dist/tools/symbol-search.js +1 -2
  319. package/node_modules/pi-lens/docs/agent-guide.md +64 -1
  320. package/node_modules/pi-lens/docs/configuration.md +222 -0
  321. package/node_modules/pi-lens/docs/dependencies.md +3 -3
  322. package/node_modules/pi-lens/docs/features.md +44 -5
  323. package/node_modules/pi-lens/docs/globalconfig.md +20 -0
  324. package/node_modules/pi-lens/docs/language-coverage.md +2 -2
  325. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +9 -1
  326. package/node_modules/pi-lens/docs/pi-lens-fixer.md +25 -0
  327. package/node_modules/pi-lens/docs/pi-lens-investigator.md +25 -0
  328. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +33 -0
  329. package/node_modules/pi-lens/docs/pi-lens-subagent.md +49 -0
  330. package/node_modules/pi-lens/docs/pi-lens-warden.md +55 -0
  331. package/node_modules/pi-lens/docs/public-api-stability.md +359 -0
  332. package/node_modules/pi-lens/docs/release-qa-baseline.md +190 -0
  333. package/node_modules/pi-lens/docs/servercapabilities.md +7 -3
  334. package/node_modules/pi-lens/docs/subagent-compat.md +110 -30
  335. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +2 -2
  336. package/node_modules/pi-lens/docs/word-index.md +1 -1
  337. package/node_modules/pi-lens/package.json +18 -35
  338. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-cross-language-method.yml +3 -3
  339. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-hallucinated-import.yml +2 -2
  340. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-sql-injection.yml +12 -2
  341. package/node_modules/pi-lens/rules/typos/_typos.toml +4 -2
  342. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +192 -1
  343. package/node_modules/pi-lens/scripts/install-selftest.mjs +58 -2
  344. package/node_modules/pi-lens/scripts/lib/skills-predicate.mjs +129 -0
  345. package/node_modules/pi-lens/scripts/lib/warm-loader-cache.mjs +1 -1
  346. package/node_modules/pi-lens/scripts/rpc-load-check.mjs +3 -1
  347. package/node_modules/pi-lens/scripts/warm-loader-cache.mjs +4 -2
  348. package/node_modules/pi-web-access/CHANGELOG.md +28 -0
  349. package/node_modules/pi-web-access/README.md +62 -15
  350. package/node_modules/pi-web-access/curator-page.ts +3 -1
  351. package/node_modules/pi-web-access/curator-server.ts +5 -1
  352. package/node_modules/pi-web-access/gemini-search.ts +8 -4
  353. package/node_modules/pi-web-access/github-extract.ts +242 -1
  354. package/node_modules/pi-web-access/index.ts +118 -64
  355. package/node_modules/pi-web-access/mistral-search.ts +281 -0
  356. package/node_modules/pi-web-access/package.json +2 -2
  357. package/node_modules/pi-web-access/perplexity.ts +14 -1
  358. package/node_modules/pi-web-access/utils.ts +23 -6
  359. package/node_modules/pi-web-access/xai-search.ts +96 -33
  360. package/package.json +6 -6
@@ -17,7 +17,7 @@ every run.
17
17
 
18
18
  | # | Contract | Depended on by | Third-party file (as of the versions below) | Verified against |
19
19
  |---|----------|-----------------|-------------------------------------------------|-------------------|
20
- | 1 | `PI_SUBAGENT_CHILD` is set to the literal string `"1"` in every spawned child's env; `PI_SUBAGENT_RUN_ID` / `PI_SUBAGENT_CHILD_AGENT` are set alongside it for best-effort identity. | `clients/subagent-mode.ts` (`isSubagentSession()`, `getSubagentIdentity()`) | `pi-subagents@0.34.0` — `src/runs/shared/pi-args.ts` (`SUBAGENT_CHILD_ENV`/`SUBAGENT_RUN_ID_ENV`/`SUBAGENT_CHILD_AGENT_ENV` consts + the `env[SUBAGENT_CHILD_ENV] = "1"` assignment) | `checkNicobailonChildEnv` |
20
+ | 1 | `PI_SUBAGENT_CHILD` is set to the literal string `"1"` on every process that hosts a child session. | `clients/subagent-mode.ts` (`isSubagentSession()`, `getSubagentIdentity()`) | `pi-subagents@0.34.0` — co-located in `src/runs/shared/pi-args.ts` (`SUBAGENT_CHILD_ENV` const + the `env[SUBAGENT_CHILD_ENV] = "1"` assignment); as of `pi-subagents@0.66.0` the const moved to `src/runs/shared/child-runtime-config.ts` and the assignment to `src/runs/background/subagent-runner.ts` (#2581) — `compat-contract-locator.mjs`'s `locateContractSources` tries both layouts and concatenates whichever resolves. | `checkNicobailonChildEnv` |
21
21
  | 1b | avtc-pi-subagent sets `PI_SUBAGENT_CHILD_AGENT` + `PI_SUBAGENT_PARENT_PID` (never `PI_SUBAGENT_CHILD`) on the per-spawn subagent env; `isSubagentSession()` treats the PAIR (both non-empty) as an additional subagent signal (#507). | `clients/subagent-mode.ts` (`isSubagentSession()`, `getSubagentIdentity()`) | `avtc-pi-subagent@1.0.3` — `src/process-runner.ts` (`subagentEnv.PI_SUBAGENT_CHILD_AGENT = agent.name` + `subagentEnv.PI_SUBAGENT_PARENT_PID = String(process.pid)`) | `checkAvtcChildEnv` |
22
22
  | 2a | The pi SDK's extension loader keeps a **process-global** cache (`extensionCache = new Map()`). This is what makes an in-process `bindExtensions()` reuse pi-lens's own module-scope singletons instead of a fresh isolated instance. | `clients/session-lifecycle.ts` (the whole premise of the concurrent-session guard) | `@earendil-works/pi-coding-agent@0.80.6` — `dist/core/extensions/loader.js` | `checkSdkExtensionCache` |
23
23
  | 2b | `AgentSession.bindExtensions()` **unconditionally** emits a `session_start`-typed event (`this._extensionRunner.emit(this._sessionStartEvent)`). | Same as 2a — this is why an in-process subagent bind re-triggers pi-lens's `session_start` handler at all. | `@earendil-works/pi-coding-agent@0.80.6` — `dist/core/agent-session.js` (`bindExtensions()`, ~line 1717) | `checkSdkBindExtensionsEmitsSessionStart` |
@@ -30,7 +30,24 @@ unit-tested regex matchers against RESILIENT semantic shapes (never a line
30
30
  number — those drift on every third-party release). `scripts/compat-contracts.mjs`
31
31
  is the orchestration script: it `npm install`s the four packages (SDK,
32
32
  `pi-subagents`, `avtc-pi-subagent`, `@tintinweb/pi-subagents`) into a scratch
33
- directory, reads the specific files above, and runs every check.
33
+ directory, resolves each contract's source file(s) independently (see
34
+ "Layer A" below) and runs every check.
35
+
36
+ **Contract 1's identity vars were removed upstream, not relocated (#2581).**
37
+ The doc used to also pin `PI_SUBAGENT_RUN_ID` / `PI_SUBAGENT_CHILD_AGENT` as
38
+ part of contract 1 — nicobailon/pi-subagents set them alongside
39
+ `PI_SUBAGENT_CHILD=1` for best-effort child identity. `pi-subagents@0.65.0`'s
40
+ rewrite to run subagents as native, in-process `AgentSession`s (instead of
41
+ spawning a separate `pi` CLI process per child) deleted both vars from the
42
+ package entirely — grep-verified absent from the whole 0.66.0 source tree;
43
+ child identity now travels through an in-process `ChildRuntimeConfig` object
44
+ that never touches `process.env`. This is real, permanent upstream drift, but
45
+ it needed no pi-lens code change: `getSubagentIdentity()` was already
46
+ documented and tested as best-effort, returning `runId`/`agentName: undefined`
47
+ when the vars are absent (`tests/clients/subagent-mode.test.ts`) — exactly the
48
+ degraded state this vocabulary is now always in. `checkNicobailonChildEnv`
49
+ no longer requires them; only the `PI_SUBAGENT_CHILD='1'` flag pi-lens's
50
+ light-mode detection actually depends on behaviorally still gates the check.
34
51
 
35
52
  ## The three env levers
36
53
 
@@ -45,10 +62,46 @@ directory, reads the specific files above, and runs every check.
45
62
  ### Layer A — pinned-contract verification (`scripts/compat-contracts.mjs`)
46
63
 
47
64
  No `pi` process, no LLM turn. Installs the real packages (table above) and
48
- mechanically re-checks all six contracts against the installed source. Exit
49
- 0 = all pass; exit 1 = at least one contract check failed (real drift); exit
50
- 2 = infrastructure failure (npm install of the third-party packages itself
51
- failed — usually a registry/network issue, not a contract regression).
65
+ mechanically re-checks all seven contracts against the installed source.
66
+
67
+ Each contract resolves independently to one of **three outcomes**, printed
68
+ per-contract and rolled up into a run-level `outcome` (also exposed as a
69
+ GITHUB_OUTPUT for the workflow's alert step, distinct from the GH step's own
70
+ success/failure) and exit code:
71
+
72
+ - **verified** (exit 0 when every contract is this) — the contract's source
73
+ file(s) were found and their content matches the pinned shape.
74
+ - **drift** (exit 1) — the source file(s) were found, but the content no
75
+ longer matches. This is an actual upstream behavioral change worth
76
+ investigating (see "What to do when the nightly alerts" below).
77
+ - **infra** (exit 2, when nothing drifted but at least one contract hit
78
+ this) — the contract's source file could not be located at ANY of its
79
+ known candidate paths (each `CONTRACTS` entry's `parts` field in
80
+ `scripts/lib/compat-contracts.mjs`, resolved via
81
+ `compat-contract-locator.mjs` and `compat-contract-resolution.mjs`), or
82
+ the `npm install` of the four packages itself failed. This means Layer A
83
+ has NOT actually re-checked that contract's content at all — it is
84
+ distinct from drift and must never be reported as one. #2581: before this
85
+ three-way split, a single relocated file (`pi-subagents@0.65.0` moving
86
+ `src/runs/shared/pi-args.ts`) threw inside one shared try/catch, aborted
87
+ the whole run, and got reported — both in the run log and the tracking
88
+ issue's body — as generic "failure" alongside the other six contracts that
89
+ were never actually re-checked that run either. A contract's own outcome
90
+ only becomes "infra" when ITS candidate paths are all missing; every other
91
+ contract is still resolved and checked independently in the same run.
92
+
93
+ Candidate paths are walked NEWEST-observed-layout first, not oldest (#2680
94
+ F1) — a stale leftover file at an old path (left behind by a partial
95
+ publish, or an npm install that added files without pruning ones the
96
+ package's current `files` list no longer references) must never outrank the
97
+ package's actual current layout. When a candidate path list needs a NEW
98
+ entry (the package relocated the file again), APPEND it to that contract's
99
+ `parts` in the `CONTRACTS` list (`scripts/lib/compat-contracts.mjs`) —
100
+ oldest-observed-layout first in how the list reads, rather than replacing
101
+ the old entry — the locator resolves the newest EXISTING one regardless of
102
+ authored order, so older installs stay covered too. `parts` and `package`
103
+ live directly on each `CONTRACTS` entry, not a second table keyed by a
104
+ string id (#2680 F2) — there is nowhere else to update.
52
105
 
53
106
  ### Layer B — real-pi behavioral smoke (`scripts/compat-smoke-behavioral.mjs`)
54
107
 
@@ -71,7 +124,7 @@ first session.
71
124
  Assertions:
72
125
 
73
126
  1. **Subagent light mode engages** — with `PI_SUBAGENT_CHILD=1` set,
74
- `subagent_light_mode` is logged to `~/.pi-lens/latency.log` (a `type:
127
+ `subagent_light_mode` is logged to `$PI_LENS_HOME/latency.log` (a `type:
75
128
  "phase"` entry) and none of the seven heavyweight-scan phases
76
129
  (`knip`/`jscpd`/`madge`/`dead-code`/`govulncheck`/`gitleaks`/`trivy`) are
77
130
  logged for that run.
@@ -99,22 +152,32 @@ Assertions:
99
152
  `PI_SUBAGENT_PARENT_PID`), no `subagent_light_mode` phase is logged.
100
153
  `subagent-mode.ts`'s doc comment requires the PAIR — a lone var set by
101
154
  some unrelated tool must not trigger light mode.
102
- 6. **`concurrent_session_bind` (#473) — NOT asserted, documented TODO.**
155
+ 6. **`concurrent_session_bind` (#473) and its `concurrent_session_bind_rollup`
156
+ session-end summary (#2249) — NOT asserted, documented TODO.**
103
157
  The guard is fully wired on master (PR #477): `index.ts`'s `session_start`
104
158
  handler calls `decideSessionStart()` and logs a `concurrent_session_bind`
105
159
  latency phase for a concurrent-secondary bind — so the phase exists to
106
- observe. The blocker is DRIVING it keylessly: reproducing tintinweb's
107
- in-process model for real (mirroring `agent-runner.ts`'s
108
- `createAgentSession()` + `DefaultResourceLoader` + `bindExtensions()`
109
- sequence) requires full session construction, which in turn needs
110
- model/provider config — not cheaply stubbable without a real model key,
111
- and #476 explicitly asks not to ship something flaky here. The unit +
112
- behavioral coverage in `tests/clients/session-lifecycle.test.ts` guards
113
- the classifier and the no-reset contract in-repo; what Layer B cannot yet
114
- add is the end-to-end SDK-driven variant. **Revisit if the pi SDK grows a
115
- model-free session constructor or stub provider** — at that point add a
116
- Layer B assertion analogous to 1-3 checking the `concurrent_session_bind`
117
- phase and the absence of a second LSP fleet teardown.
160
+ observe. `clients/session-start-observability.ts` also keeps a bounded,
161
+ process-singleton-backed tally of declined binds by classification
162
+ (`concurrent-secondary` / `secondary-root`), which `index.ts`'s
163
+ `session_shutdown` handler logs as one `concurrent_session_bind_rollup`
164
+ row (primary sessions only) and clears — same primary-only placement as
165
+ `session_end_bus_rollup`/`path_attribution_verified_rollup`. The blocker is
166
+ DRIVING either keylessly: reproducing tintinweb's in-process model for real
167
+ (mirroring `agent-runner.ts`'s `createAgentSession()` +
168
+ `DefaultResourceLoader` + `bindExtensions()` sequence) requires full
169
+ session construction, which in turn needs model/provider config — not
170
+ cheaply stubbable without a real model key, and #476 explicitly asks not
171
+ to ship something flaky here. The unit + behavioral coverage in
172
+ `tests/clients/session-lifecycle.test.ts` guards the classifier and the
173
+ no-reset contract, and `tests/clients/session-start-observability.test.ts`
174
+ plus `tests/index-integration.test.ts` guard the rollup's counting,
175
+ process-singleton survival, and primary-only reset/emit wiring, all
176
+ in-repo; what Layer B cannot yet add is the end-to-end SDK-driven variant.
177
+ **Revisit if the pi SDK grows a model-free session constructor or stub
178
+ provider** — at that point add a Layer B assertion analogous to 1-3
179
+ checking the `concurrent_session_bind`/`concurrent_session_bind_rollup`
180
+ phases and the absence of a second LSP fleet teardown.
118
181
 
119
182
  ## What to do when the nightly alerts
120
183
 
@@ -125,18 +188,35 @@ third-party contract drift detected"** — search for it by title before
125
188
  assuming a NEW investigation is needed; the workflow already
126
189
  create-or-updates it, never duplicates.
127
190
 
128
- 1. Read the linked run log — both layers print a `[PASS]`/`[FAIL]` line per
129
- check with a one-line detail on exactly what didn't match.
130
- 2. Find the failed check's row in the pinned-contracts table above and go
131
- read the current third-party source at the referenced file — a Layer A
132
- failure means the semantic shape genuinely changed upstream (a renamed
133
- env var, a moved `emit()` call, a reworded error message, ...).
134
- 3. Update the corresponding matcher in `scripts/lib/compat-contracts.mjs`
191
+ 1. Read the linked run log — the alert issue body now says which of Layer
192
+ A's three outcomes fired (**verified** / **drift** / **infra**, #2581 —
193
+ never just a generic "failure"); Layer A/B each print a `[PASS]`/`[FAIL]`
194
+ or `[INFRA]` line per check with a one-line detail on exactly what didn't
195
+ match or couldn't be found.
196
+ 2. **If Layer A says infra**: the run log's `INFRA` line names every
197
+ candidate path tried for that contract. Read the installed package at the
198
+ printed version and find where the file actually lives now, then append
199
+ it to that contract's `parts` in the `CONTRACTS` list
200
+ (`scripts/lib/compat-contracts.mjs`) — don't replace the old candidate,
201
+ the locator resolves whichever existing one is newest regardless of
202
+ authored order (#2680 F1), so older installs stay covered too. This is a
203
+ relocation, not a confirmed content change; only move to step 3 once the
204
+ check actually runs against the relocated file.
205
+ 3. **If Layer A says drift**: find the failed check's row in the
206
+ pinned-contracts table above and read the current third-party source at
207
+ the referenced file — the semantic shape genuinely changed upstream (a
208
+ renamed env var, a moved `emit()` call, a reworded error message, ...).
209
+ Update the corresponding matcher in `scripts/lib/compat-contracts.mjs`
135
210
  (and its test in `tests/scripts/compat-contracts.test.ts`) to match the
136
- new shape, update the pinned-contracts table's version/line reference
137
- above, and fix whichever pi-lens module (`subagent-mode.ts` /
211
+ new shape, update the pinned-contracts table's version/reference above,
212
+ and fix whichever pi-lens module (`subagent-mode.ts` /
138
213
  `session-lifecycle.ts` / `instance-reaper.ts`) actually depended on the
139
- old shape if the drift broke real behavior — not just the check.
214
+ old shape if the drift broke real behavior — not just the check. If
215
+ pi-lens's own dependent code already tolerates the drift gracefully (as
216
+ with contract 1's now-removed identity vars, #2581), relaxing the check
217
+ to stop requiring what upstream removed IS the fix — don't keep a check
218
+ that can only ever report drift forever for something pi-lens never
219
+ needed to work.
140
220
  4. A Layer B failure (an assertion, not an infra error) means real pi-lens
141
221
  behavior regressed under a real `pi` — treat it like any other bug: write
142
222
  a fixture-level test if the gap wasn't otherwise covered, then fix.
@@ -135,10 +135,10 @@ Rule source: `rules/tree-sitter-queries/<language>/`.
135
135
  | `open-invalid-mode` | error | reliability | open() called with invalid mode '{{MODE}}' |
136
136
  | `python-assert-production` | warning | correctness | assert statement stripped by Python -O flag — use explicit checks with exceptions in production code |
137
137
  | `python-command-injection` | error | security | Potential command injection sink — avoid shell execution with dynamic input |
138
- | `python-cross-language-method` | warning | correctness | '{METHOD}' is not a Python method — likely a {LANG} idiom leaking in |
138
+ | `python-cross-language-method` | warning | correctness | '{{METHOD}}' is not a Python method — likely a cross-language idiom leaking in |
139
139
  | `python-debugger` | warning | debugging | Debugger call '{{FUNC}}' — remove before committing |
140
140
  | `python-empty-except` | warning | reliability | Except block only contains 'pass' — handle or re-raise the exception |
141
- | `python-hallucinated-import` | warning | correctness | Hallucinated import — '{NAME}' does not exist in '{MODULE}' |
141
+ | `python-hallucinated-import` | warning | correctness | Hallucinated import — '{{NAME}}' does not exist in '{{MODULE}}' |
142
142
  | `python-hardcoded-secrets` | warning | security | Hardcoded {{VARNAME}} — use environment variables or a secrets manager |
143
143
  | `python-insecure-deserialization` | error | security | Potential insecure deserialization sink — avoid unsafe loaders |
144
144
  | `python-insecure-random` | warning | security | Insecure randomness source detected — use secrets or os.urandom for security-sensitive values |
@@ -156,7 +156,7 @@ the cwd, falling back to the stateless snapshot read otherwise.
156
156
 
157
157
  ## Caps and boundaries
158
158
 
159
- - **≤6000 files, ≤512KB per file** (`WORD_INDEX_MAX_FILES`,
159
+ - **≤6000 files, ≤512KB per file** (the file cap is passed into the walk;
160
160
  `WORD_INDEX_MAX_BYTES` in `clients/word-index.ts`) — shared by every
161
161
  build path and the per-edit update path alike.
162
162
  - **Deletions aren't plumbed at the per-edit seam** — the cascade only ever
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
4
4
  "type": "module",
5
5
  "description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
6
6
  "repository": {
@@ -15,21 +15,29 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "tsc --project tsconfig.build.json",
18
- "build:dist": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npx --yes -p typescript@7.0.2 tsc --project tsconfig.dist.json --noCheck && npm run bundle:dist",
18
+ "build:dist": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && node scripts/build-dist-tsc.mjs tsconfig.dist.json && npm run bundle:dist",
19
19
  "bundle:dist": "node scripts/bundle-dist.mjs",
20
20
  "prepare": "npm run build:dist && node scripts/download-grammars.js --core --dest grammars && node scripts/setup-git-hooks.mjs && node scripts/warm-loader-cache.mjs",
21
- "lint": "tsc --project tsconfig.json",
21
+ "prepack": "node scripts/strip-dev-deps-for-pack.mjs --strip",
22
+ "postpack": "node scripts/strip-dev-deps-for-pack.mjs --restore",
23
+ "lint": "tsc --project tsconfig.json && npm run lint:js",
24
+ "lint:js": "oxlint --deny-warnings --import-plugin --promise-plugin -D block-scoped-var -D import/default -D import/namespace -D import/no-absolute-path -D import/no-empty-named-blocks -D import/no-named-as-default -D import/no-self-import -D no-extend-native -D no-extra-bind -D no-implied-eval -D no-new -D no-unexpected-multiline -D no-useless-constructor -D oxc/approx-constant -D oxc/misrefactored-assign-op -D oxc/no-accumulating-spread -D oxc/no-async-endpoint-handlers -D oxc/no-this-in-exported-function -D promise/no-callback-in-promise -D promise/no-multiple-resolved -D promise/no-new-statics -D promise/valid-params -D typescript/no-confusing-non-null-assertion -D typescript/no-extraneous-class -D typescript/no-unnecessary-type-constraint -D typescript/no-unsafe-enum-comparison -D unicorn/no-accessor-recursion -D unicorn/no-array-fill-with-reference-type -D unicorn/no-confusing-array-with -D unicorn/no-instanceof-builtins -D unicorn/prefer-array-flat-map -D unicorn/require-module-specifiers --ignore-pattern \"tests/**/*.ts\" --ignore-pattern \"tests/**/*.tsx\" --ignore-pattern \"**/*.d.mts\" --ignore-pattern \"tests/fixtures/autofix-smoke/**\" --ignore-pattern \"tests/fixtures/format-smoke/**\" --ignore-pattern \"tests/fixtures/tool-smoke/**\" --ignore-pattern \"tests/fixtures/call-graph/javascript/**\" --ignore-pattern \"tests/fixtures/function-facts/javascript-parameter.js\" .",
25
+ "lint:js:advisory": "node scripts/lint-js-advisory.mjs --deny-warnings --format default -D correctness -D suspicious -D perf --import-plugin --promise-plugin --type-aware -A no-underscore-dangle -A no-await-in-loop -A unicorn/no-array-sort -A unicorn/consistent-function-scoping -A promise/no-promise-in-callback -A no-useless-call -A import/no-unassigned-import -A no-unmodified-loop-condition --ignore-pattern \"**/*.d.mts\" --ignore-pattern \"tests/fixtures/autofix-smoke/**\" --ignore-pattern \"tests/fixtures/format-smoke/**\" --ignore-pattern \"tests/fixtures/tool-smoke/**\" --ignore-pattern \"tests/fixtures/call-graph/javascript/**\" --ignore-pattern \"tests/fixtures/function-facts/javascript-parameter.js\" .",
22
26
  "depcruise:check": "depcruise --validate --config .dependency-cruiser.cjs --ignore-known .dependency-cruiser-known-violations.json --output-type err index.ts \"clients/**/*.ts\"",
23
27
  "fmt": "oxfmt",
24
28
  "fmt:check": "oxfmt --check",
29
+ "taplo": "taplo check $(git ls-files '*.toml' ':!tests/fixtures/**') && taplo fmt --check $(git ls-files '*.toml' ':!tests/fixtures/**' ':!config/ruff/core.toml') # taplo 0.7.0 panics on this file's comments; lint it above",
25
30
  "watch": "tsc --watch",
26
31
  "test": "node scripts/with-test-lock.mjs -- vitest run",
27
32
  "test:unit": "node scripts/with-test-lock.mjs -- vitest run",
28
33
  "test:integration": "node scripts/with-test-lock.mjs -- vitest run tests/index-integration.test.ts tests/clients/lsp/integration.test.ts",
34
+ "test:targeted": "node scripts/with-test-lock.mjs --shared -- vitest run",
29
35
  "test:watch": "vitest",
36
+ "hygiene": "node scripts/prune-agent-worktrees.mjs",
30
37
  "check": "node scripts/check-extensions.mjs",
31
38
  "selftest:install": "node scripts/install-selftest.mjs",
32
39
  "check:lockfile": "node scripts/check-lockfile-sync.mjs",
40
+ "knip": "node scripts/run-knip.mjs",
33
41
  "check:grammars": "node scripts/check-grammar-provenance.mjs",
34
42
  "check:grammar-load": "node scripts/check-grammar-load.mjs",
35
43
  "audit:tree-sitter": "node scripts/audit-tree-sitter-rules.mjs",
@@ -72,6 +80,9 @@
72
80
  ],
73
81
  "author": "Apostolos Mantzaris",
74
82
  "license": "MIT",
83
+ "engines": {
84
+ "node": ">=22.19.0"
85
+ },
75
86
  "files": [
76
87
  "dist/",
77
88
  "docs/",
@@ -85,6 +96,7 @@
85
96
  "scripts/analyze-pi-lens-logs.mjs",
86
97
  "scripts/install-selftest.mjs",
87
98
  "scripts/lib/host-provided-deps.mjs",
99
+ "scripts/lib/skills-predicate.mjs",
88
100
  "scripts/lib/warm-loader-cache.mjs",
89
101
  "scripts/warm-loader-cache.mjs",
90
102
  "scripts/rpc-load-check.mjs",
@@ -103,7 +115,7 @@
103
115
  },
104
116
  "peerDependencies": {
105
117
  "@earendil-works/pi-coding-agent": "*",
106
- "@earendil-works/pi-tui": "^0.84.1",
118
+ "@earendil-works/pi-tui": "^0.84.1 || ^0.85.0",
107
119
  "typebox": "^1.0.0"
108
120
  },
109
121
  "peerDependenciesMeta": {
@@ -121,45 +133,16 @@
121
133
  "jiti": "^2.7.0",
122
134
  "web-tree-sitter": "0.25.10"
123
135
  },
124
- "devDependencies": {
125
- "@biomejs/biome": "^2.4.10",
126
- "@earendil-works/pi-coding-agent": "^0.84.1",
127
- "@earendil-works/pi-tui": "^0.84.1",
128
- "@types/node": "^26.0.0",
129
- "@types/pidusage": "^2.0.5",
130
- "@vitest/coverage-v8": "^4.1.5",
131
- "dependency-cruiser": "^18.2.0",
132
- "husky": "^9.1.7",
133
- "json5": "^2.2.3",
134
- "oxfmt": "0.64.0",
135
- "oxlint": "1.79.0",
136
- "typebox": "^1.0.0",
137
- "typescript": "^7.0.2",
138
- "typescript-language-server": "^6.0.0",
139
- "vitest": "^4.1.1"
140
- },
141
136
  "pi": {
142
137
  "extensions": [
143
138
  "./dist/index.js"
144
139
  ],
145
140
  "skills": [
146
- "../../skills"
147
- ]
148
- },
149
- "knip": {
150
- "entry": [
151
- "index.ts"
152
- ],
153
- "project": [
154
- "**/*.ts",
155
- "!**/*.test.ts"
156
- ],
157
- "ignore": [
158
- "**/*.test.ts"
141
+ "./skills"
159
142
  ]
160
143
  },
161
144
  "allowScripts": {
162
- "@ast-grep/cli@0.45.1": true,
145
+ "@ast-grep/cli@0.45.3": true,
163
146
  "@google/genai@1.52.0": true,
164
147
  "protobufjs@7.6.5": true
165
148
  }
@@ -9,7 +9,7 @@ defect_class: hallucination
9
9
  inline_tier: warning
10
10
  language: python
11
11
 
12
- message: "'{METHOD}' is not a Python method — likely a {LANG} idiom leaking in"
12
+ message: "'{{METHOD}}' is not a Python method — likely a cross-language idiom leaking in"
13
13
 
14
14
  description: |
15
15
  A method name from another language is being called on a Python object.
@@ -27,7 +27,7 @@ query: |
27
27
  function: (attribute
28
28
  object: (_) @OBJ
29
29
  attribute: (identifier) @METHOD)
30
- (#match? @METHOD "^(push|forEach|indexOf|charAt|substring|hasOwnProperty|unshift|flatMap|padStart|padEnd|trimStart|trimEnd|equals|isEmpty|println|printf|getClass|hashCode|toCharArray|getBytes|compareTo|equalsIgnoreCase|startsWith|endsWith|each|collect|select|reject|detect|inject|chomp|chop|gsub|upcase|downcase|present|blank|Add|Contains|ToLower|ToUpper|Trim|Substring|WriteLine|ReadLine|TryParse|forEach|includes|assign|freeze|splice|unshift|shift|flatMap)$"))
30
+ (#match? @METHOD "^(push|forEach|indexOf|charAt|substring|hasOwnProperty|unshift|flatMap|padStart|padEnd|trimStart|trimEnd|equals|isEmpty|println|printf|getClass|hashCode|toCharArray|getBytes|compareTo|equalsIgnoreCase|startsWith|endsWith|each|collect|reject|detect|inject|chomp|chop|gsub|upcase|downcase|present|blank|Add|Contains|ToLower|ToUpper|Trim|Substring|WriteLine|ReadLine|TryParse|forEach|includes|assign|freeze|splice|unshift|shift|flatMap)$"))
31
31
 
32
32
  metavars:
33
33
  - OBJ
@@ -35,7 +35,7 @@ metavars:
35
35
 
36
36
  post_filter: match_captures
37
37
  post_filter_params:
38
- METHOD: "^(push|forEach|indexOf|charAt|substring|hasOwnProperty|unshift|flatMap|padStart|padEnd|trimStart|trimEnd|equals|isEmpty|println|printf|getClass|hashCode|toCharArray|getBytes|compareTo|equalsIgnoreCase|startsWith|endsWith|each|collect|select|reject|detect|inject|chomp|chop|gsub|upcase|downcase|present|blank|Add|Contains|ToLower|ToUpper|Trim|Substring|WriteLine|ReadLine|TryParse|forEach|includes|assign|freeze|splice|unshift|shift|flatMap)$"
38
+ METHOD: "^(push|forEach|indexOf|charAt|substring|hasOwnProperty|unshift|flatMap|padStart|padEnd|trimStart|trimEnd|equals|isEmpty|println|printf|getClass|hashCode|toCharArray|getBytes|compareTo|equalsIgnoreCase|startsWith|endsWith|each|collect|reject|detect|inject|chomp|chop|gsub|upcase|downcase|present|blank|Add|Contains|ToLower|ToUpper|Trim|Substring|WriteLine|ReadLine|TryParse|forEach|includes|assign|freeze|splice|unshift|shift|flatMap)$"
39
39
 
40
40
  has_fix: false
41
41
 
@@ -9,7 +9,7 @@ defect_class: hallucination
9
9
  inline_tier: blocking
10
10
  language: python
11
11
 
12
- message: "Hallucinated import — '{NAME}' does not exist in '{MODULE}'"
12
+ message: "Hallucinated import — '{{NAME}}' does not exist in '{{MODULE}}'"
13
13
 
14
14
  description: |
15
15
  This import is from the wrong package. A name from one framework is being
@@ -32,7 +32,7 @@ metavars:
32
32
 
33
33
  post_filter: match_captures
34
34
  post_filter_params:
35
- MODULE: "^(requests|flask|django|typing|collections|asyncio|json|unittest|pytest|urllib|sqlalchemy)$"
35
+ MODULE: "^(requests|flask|django|typing|collections|asyncio|json|unittest|pytest|urllib)$"
36
36
  NAME: "^(JSONResponse|HTMLResponse|RedirectResponse|StreamingResponse|Depends|Query|Path|Body|Header|Cookie|Form|File|UploadFile|FastAPI|APIRouter|HTTPException|BackgroundTasks|dataclass|fields|BaseModel|Field|validator|aiohttp|parse|stringify|fixture|TestCase|get|post|put|delete|Model|Session|Column|Integer|String)$"
37
37
 
38
38
  has_fix: false
@@ -18,8 +18,18 @@ description: |
18
18
 
19
19
  Suppressed:
20
20
  - cursor.execute(query, params) — parameterized query (safe)
21
- - session.execute(select(...)) — SQLAlchemy ORM (safe by construction)
22
- - cursor.execute(f"...") — f-string with literal-only interpolation (rare false positive)
21
+ - session.execute(...) — receiver conventionally named for a SQLAlchemy session
22
+ - x.execute(select(...)) — statement builder in argument position (safe by
23
+ construction)
24
+ - db.query(...) / db.execute(stmt) where `db: Session` and `Session` is proven
25
+ from a same-file `sqlalchemy.orm` / `sqlalchemy.ext.asyncio` import, and
26
+ `stmt` is bound exactly once to a builder call
27
+ - cursor.execute(sql.SQL("...").format(sql.Identifier(...))) where `sql` is
28
+ an unshadowed same-file psycopg or psycopg2 import and every format argument
29
+ is an Identifier
30
+
31
+ Other raw, dynamic, or ambiguous SQL remains diagnostic so this rule fails
32
+ closed when it cannot prove the safe API provenance.
23
33
 
24
34
  ✅ FIX: use placeholders and parameter binding instead of string composition.
25
35
 
@@ -13,5 +13,7 @@
13
13
  # dictionary here; every entry must have a provenance comment.
14
14
 
15
15
  [default.extend-identifiers]
16
- dito = "dito" # #967 — real model/vendor namespace (provider-failover normalization prefix), not a misspelling of "ditto"
17
- unparseable = "unparseable" # #967 — valid English spelling ("un-parseable"), not a typo of "unparsable"
16
+ # #967 — real model/vendor namespace (provider-failover normalization prefix), not a misspelling of "ditto"
17
+ dito = "dito"
18
+ # #967 — valid English spelling ("un-parseable"), not a typo of "unparsable"
19
+ unparseable = "unparseable"