pi-lens 3.8.73 → 4.0.0
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.
- package/CHANGELOG.md +2614 -12
- package/README.md +50 -21
- package/dist/clients/actionable-warnings.js +73 -18
- package/dist/clients/agent-behavior-client.js +21 -4
- package/dist/clients/ast-grep-client.js +68 -16
- package/dist/clients/ast-grep-types.js +0 -1
- package/dist/clients/ast-grep-yaml-synth.js +37 -10
- package/dist/clients/atomic-write-staging.js +63 -0
- package/dist/clients/atomic-write.js +116 -16
- package/dist/clients/bash-file-access.js +193 -23
- package/dist/clients/biome-client.js +29 -25
- package/dist/clients/bootstrap.js +11 -2
- package/dist/clients/bounded-cache.js +34 -0
- package/dist/clients/bounded-pid-file-lock.js +192 -0
- package/dist/clients/bus-events-logger.js +5 -1
- package/dist/clients/bus-publish.js +10 -3
- package/dist/clients/cache/rule-cache.js +89 -6
- package/dist/clients/cache-manager.js +97 -9
- package/dist/clients/cache-observability.js +498 -0
- package/dist/clients/call-graph.js +460 -108
- package/dist/clients/cascade-logger.js +5 -1
- package/dist/clients/child-unref.js +85 -0
- package/dist/clients/codebase-model.js +52 -23
- package/dist/clients/collateral-test-role.js +40 -0
- package/dist/clients/complexity-client.js +6 -8
- package/dist/clients/console-guard-install.js +14 -0
- package/dist/clients/cooperative-budget.js +42 -0
- package/dist/clients/dead-code-client.js +2 -1
- package/dist/clients/debug-handles.js +206 -0
- package/dist/clients/debug-heap.js +167 -0
- package/dist/clients/degradation-ledger.js +153 -0
- package/dist/clients/dependency-checker.js +466 -63
- package/dist/clients/diagnostic-dispositions.js +83 -13
- package/dist/clients/diagnostics-publish.js +10 -3
- package/dist/clients/dispatch/auxiliary-lsp.js +34 -0
- package/dist/clients/dispatch/dispatcher.js +71 -13
- package/dist/clients/dispatch/fact-store.js +11 -0
- package/dist/clients/dispatch/facts/function-facts.js +37 -7
- package/dist/clients/dispatch/facts/import-facts.js +108 -119
- package/dist/clients/dispatch/facts/tree-sitter-facts.js +12 -12
- package/dist/clients/dispatch/facts/try-catch-facts.js +13 -0
- package/dist/clients/dispatch/indent-detect.js +35 -0
- package/dist/clients/dispatch/inline-suppressions.js +17 -8
- package/dist/clients/dispatch/integration.js +1094 -611
- package/dist/clients/dispatch/lazy.js +14 -0
- package/dist/clients/dispatch/plan.js +11 -1
- package/dist/clients/dispatch/rule-id-normalize.js +50 -0
- package/dist/clients/dispatch/rule-policy.js +135 -0
- package/dist/clients/dispatch/rules/async-noise.js +1 -0
- package/dist/clients/dispatch/rules/unsafe-boundary.js +7 -0
- package/dist/clients/dispatch/runners/ast-grep-napi.js +47 -6
- package/dist/clients/dispatch/runners/biome-check.js +5 -9
- package/dist/clients/dispatch/runners/detekt.js +3 -2
- package/dist/clients/dispatch/runners/hadolint.js +2 -1
- package/dist/clients/dispatch/runners/helm-lint.js +154 -0
- package/dist/clients/dispatch/runners/htmlhint.js +3 -2
- package/dist/clients/dispatch/runners/index.js +5 -1
- package/dist/clients/dispatch/runners/lsp.js +14 -6
- package/dist/clients/dispatch/runners/markdownlint.js +4 -9
- package/dist/clients/dispatch/runners/psscriptanalyzer.js +10 -1
- package/dist/clients/dispatch/runners/pyright.js +9 -5
- package/dist/clients/dispatch/runners/ruff.js +4 -8
- package/dist/clients/dispatch/runners/shellcheck.js +2 -3
- package/dist/clients/dispatch/runners/shfmt.js +2 -3
- package/dist/clients/dispatch/runners/spotbugs.js +2 -1
- package/dist/clients/dispatch/runners/taplo.js +2 -1
- package/dist/clients/dispatch/runners/terragrunt.js +163 -0
- package/dist/clients/dispatch/runners/tflint.js +37 -5
- package/dist/clients/dispatch/runners/tree-sitter.js +155 -166
- package/dist/clients/dispatch/runners/trivy-config.js +13 -7
- package/dist/clients/dispatch/runners/utils/lazy-installer.js +3 -0
- package/dist/clients/dispatch/runners/utils/runner-helpers.js +284 -34
- package/dist/clients/dispatch/runners/utils/spawn-outcome.js +22 -0
- package/dist/clients/dispatch/runners/yaml-rule-parser.js +5 -4
- package/dist/clients/disposition-publish.js +10 -3
- package/dist/clients/durable-store.js +97 -0
- package/dist/clients/event-loop-monitor.js +94 -3
- package/dist/clients/extension-log.js +139 -0
- package/dist/clients/extension-mode.js +73 -0
- package/dist/clients/feature-hints.js +53 -7
- package/dist/clients/file-kinds.js +143 -31
- package/dist/clients/file-role.js +18 -3
- package/dist/clients/file-utils.js +56 -34
- package/dist/clients/fix-worklog.js +14 -2
- package/dist/clients/format-events-publish.js +16 -3
- package/dist/clients/format-service.js +24 -8
- package/dist/clients/formatters-lazy.js +8 -0
- package/dist/clients/formatters.js +358 -61
- package/dist/clients/generated-artifacts.js +169 -15
- package/dist/clients/git-guard.js +681 -11
- package/dist/clients/git-tracked-ignore.js +4 -0
- package/dist/clients/go-client.js +2 -1
- package/dist/clients/govulncheck-client.js +8 -0
- package/dist/clients/grammar-source.js +12 -4
- package/dist/clients/gzip-stage-write.js +102 -0
- package/dist/clients/host-ports.js +31 -0
- package/dist/clients/installer/index.js +733 -213
- package/dist/clients/instance-reaper.js +142 -172
- package/dist/clients/jscpd-client.js +31 -54
- package/dist/clients/knip-client.js +78 -36
- package/dist/clients/language-policy.js +14 -2
- package/dist/clients/language-profile.js +72 -77
- package/dist/clients/latency-logger.js +28 -16
- package/dist/clients/lens-config.js +140 -166
- package/dist/clients/lens-engine.js +124 -21
- package/dist/clients/lens-events.js +27 -4
- package/dist/clients/lens-flag-registry.js +293 -0
- package/dist/clients/lens-map.js +96 -26
- package/dist/clients/live-bus-emitter.js +30 -0
- package/dist/clients/log-cleanup.js +8 -18
- package/dist/clients/lsp/cascade-tier.js +23 -3
- package/dist/clients/lsp/client.js +566 -57
- package/dist/clients/lsp/config.js +74 -10
- package/dist/clients/lsp/diagnostic-binding.js +86 -0
- package/dist/clients/lsp/edits.js +1012 -121
- package/dist/clients/lsp/index.js +1840 -803
- package/dist/clients/lsp/language.js +4 -1
- package/dist/clients/lsp/launch.js +40 -32
- package/dist/clients/lsp/path-utils.js +1 -1
- package/dist/clients/lsp/ruby-drive-dirs.js +83 -0
- package/dist/clients/lsp/server.js +279 -60
- package/dist/clients/lsp/workspace-diagnostics-cache.js +28 -4
- package/dist/clients/lsp-document-symbols.js +112 -0
- package/dist/clients/lsp-lazy.js +8 -0
- package/dist/clients/lsp-mutation.js +248 -0
- package/dist/clients/mcp/analyze.js +128 -36
- package/dist/clients/mcp/ipc.js +157 -24
- package/dist/clients/mcp/review.js +36 -3
- package/dist/clients/mcp/session.js +216 -8
- package/dist/clients/memory-sampler.js +115 -0
- package/dist/clients/metrics-client.js +2 -1
- package/dist/clients/metrics-history.js +2 -1
- package/dist/clients/module-report-lsp.js +5 -0
- package/dist/clients/module-report.js +267 -82
- package/dist/clients/ndjson-logger.js +334 -103
- package/dist/clients/opengrep-client.js +1 -1
- package/dist/clients/partial-edit-apply.js +120 -5
- package/dist/clients/path-keyed-map.js +76 -0
- package/dist/clients/path-utils.js +141 -5
- package/dist/clients/performance-report.js +327 -0
- package/dist/clients/pipeline.js +54 -13
- package/dist/clients/print-mode.js +21 -0
- package/dist/clients/project-changes.js +117 -4
- package/dist/clients/project-diagnostics/cache.js +3 -2
- package/dist/clients/project-diagnostics/extractors.js +26 -115
- package/dist/clients/project-diagnostics/fresh-fetch.js +149 -19
- package/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +117 -0
- package/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +37 -5
- package/dist/clients/project-diagnostics/scanner.js +268 -128
- package/dist/clients/project-lens-config.js +138 -34
- package/dist/clients/project-report.js +64 -25
- package/dist/clients/project-scale.js +8 -10
- package/dist/clients/project-snapshot-persist-worker.js +6 -0
- package/dist/clients/project-snapshot.js +767 -8
- package/dist/clients/project-trust.js +181 -0
- package/dist/clients/quiet-window.js +27 -5
- package/dist/clients/read-bridge.js +147 -0
- package/dist/clients/read-expansion.js +22 -12
- package/dist/clients/read-guard-logger.js +159 -1
- package/dist/clients/read-guard-tool-lines.js +150 -29
- package/dist/clients/read-guard.js +262 -3
- package/dist/clients/redact/secrets.js +449 -0
- package/dist/clients/resource-sampler.js +144 -39
- package/dist/clients/reverse-deps.js +48 -0
- package/dist/clients/review-graph/builder.js +2570 -326
- package/dist/clients/review-graph/git-identity.js +2 -1
- package/dist/clients/review-graph/import-resolvers.js +21 -10
- package/dist/clients/review-graph/persist-worker.js +10 -0
- package/dist/clients/review-graph/query.js +5 -0
- package/dist/clients/review-graph/shared-extraction-ir.js +90 -0
- package/dist/clients/review-graph/symbol-id.js +46 -0
- package/dist/clients/review-graph/tsconfig-paths.js +57 -6
- package/dist/clients/review-graph/workspace-modules.js +51 -3
- package/dist/clients/review-graph-logger.js +53 -0
- package/dist/clients/ruff-client.js +27 -44
- package/dist/clients/runtime-agent-end.js +111 -75
- package/dist/clients/runtime-context.js +36 -12
- package/dist/clients/runtime-coordinator.js +76 -8
- package/dist/clients/runtime-session.js +799 -137
- package/dist/clients/runtime-tool-call.js +117 -62
- package/dist/clients/runtime-tool-result.js +218 -23
- package/dist/clients/runtime-turn.js +284 -40
- package/dist/clients/rust-client.js +2 -1
- package/dist/clients/safe-spawn.js +873 -71
- package/dist/clients/security-scan-client.js +2 -1
- package/dist/clients/session-start-observability.js +15 -0
- package/dist/clients/session-state-store.js +5 -3
- package/dist/clients/sessionstart-logger.js +18 -0
- package/dist/clients/sg-runner.js +284 -159
- package/dist/clients/slow-fs.js +2 -1
- package/dist/clients/smells-rollup.js +224 -0
- package/dist/clients/source-filter.js +231 -43
- package/dist/clients/source-walker.js +66 -10
- package/dist/clients/startup-scan.js +15 -16
- package/dist/clients/startup-timing.js +9 -0
- package/dist/clients/test-runner-client.js +38 -8
- package/dist/clients/todo-scanner.js +30 -3
- package/dist/clients/tool-event.js +35 -0
- package/dist/clients/tool-policy.js +388 -39
- package/dist/clients/tool-render.js +155 -0
- package/dist/clients/tree-sitter-cache.js +153 -140
- package/dist/clients/tree-sitter-client.js +1722 -80
- package/dist/clients/tree-sitter-logger.js +64 -1
- package/dist/clients/tree-sitter-query-loader.js +117 -12
- package/dist/clients/tree-sitter-shared.js +48 -19
- package/dist/clients/tree-sitter-symbol-extractor.js +115 -11
- package/dist/clients/user-notify.js +51 -0
- package/dist/clients/vanished-instance-marker.js +57 -0
- package/dist/clients/warm-attach.js +33 -13
- package/dist/clients/widget-state.js +342 -49
- package/dist/clients/word-index-logger.js +44 -0
- package/dist/clients/word-index.js +612 -68
- package/dist/clients/workspace-topology.js +100 -7
- package/dist/index.js +65923 -47161
- package/dist/mcp/analyze-cli.js +185 -29
- package/dist/mcp/cli.js +110 -0
- package/dist/mcp/server.js +272 -50
- package/dist/tools/ast-grep-search.js +93 -27
- package/dist/tools/lens-diagnostics.js +247 -41
- package/dist/tools/lsp-diagnostics.js +153 -40
- package/dist/tools/lsp-navigation.js +51 -31
- package/dist/tools/module-report.js +9 -0
- package/dist/tools/symbol-search.js +21 -2
- package/docs/agent-guide.md +247 -0
- package/docs/agent-tools.md +21 -10
- package/docs/analysisall.md +192 -0
- package/docs/api-ports-inventory.md +165 -0
- package/docs/ast-grep_rules_catalog.md +5 -2
- package/docs/astplayground.md +3 -4
- package/docs/audit1.md +5 -5
- package/docs/durable-store-audit-1202.md +32 -0
- package/docs/environment-variables.md +197 -11
- package/docs/fable.md +27 -0
- package/docs/features.md +35 -5
- package/docs/globalconfig.md +101 -5
- package/docs/language-coverage.md +6 -5
- package/docs/lsp-capability-matrix.md +2 -2
- package/docs/mcp.md +54 -20
- package/docs/servercapabilities.md +7 -4
- package/docs/settings.md +192 -0
- package/docs/tools.md +18 -1
- package/docs/tree-sitter_rules_catalog.md +11 -31
- package/docs/usage.md +31 -0
- package/package.json +139 -138
- package/rules/ast-grep-rules/rule-tests/hardcoded-url-js-test.yml +1 -0
- package/rules/ast-grep-rules/rule-tests/hardcoded-url-test.yml +2 -0
- package/rules/ast-grep-rules/rule-tests/no-bare-except-test.yml +49 -0
- package/rules/ast-grep-rules/rule-tests/no-bare-host-path-in-win32-branch-test.yml +87 -0
- package/rules/ast-grep-rules/rule-tests/no-case-declarations-js-test.yml +10 -0
- package/rules/ast-grep-rules/rule-tests/no-case-declarations-test.yml +10 -0
- package/rules/ast-grep-rules/rule-tests/no-javascript-url-js-test.yml +10 -0
- package/rules/ast-grep-rules/rule-tests/no-javascript-url-test.yml +10 -0
- package/rules/ast-grep-rules/rule-tests/no-nested-links-test.yml +11 -1
- package/rules/ast-grep-rules/rule-tests/no-raw-json-store-write-test.yml +17 -0
- package/rules/ast-grep-rules/rule-tests/no-win32-isabsolute-for-qualification-test.yml +16 -0
- package/rules/ast-grep-rules/rule-tests/strict-equality-js-test.yml +3 -0
- package/rules/ast-grep-rules/rule-tests/strict-equality-test.yml +3 -0
- package/rules/ast-grep-rules/rule-tests/strict-inequality-js-test.yml +3 -0
- package/rules/ast-grep-rules/rule-tests/strict-inequality-test.yml +4 -0
- package/rules/ast-grep-rules/rules/hardcoded-url-js.yml +22 -4
- package/rules/ast-grep-rules/rules/hardcoded-url.yml +22 -4
- package/rules/ast-grep-rules/rules/no-bare-except.yml +3 -15
- package/rules/ast-grep-rules/rules/no-bare-host-path-in-win32-branch.yml +25 -0
- package/rules/ast-grep-rules/rules/no-case-declarations-js.yml +4 -3
- package/rules/ast-grep-rules/rules/no-case-declarations.yml +4 -3
- package/rules/ast-grep-rules/rules/no-console-except-error-js.yml +10 -0
- package/rules/ast-grep-rules/rules/no-console-except-error.yml +10 -0
- package/rules/ast-grep-rules/rules/no-javascript-url-js.yml +42 -6
- package/rules/ast-grep-rules/rules/no-javascript-url.yml +42 -6
- package/rules/ast-grep-rules/rules/no-nested-links.yml +7 -0
- package/rules/ast-grep-rules/rules/no-raw-json-store-write.yml +30 -0
- package/rules/ast-grep-rules/rules/no-win32-isabsolute-for-qualification.yml +23 -0
- package/rules/ast-grep-rules/rules/strict-equality-js.yml +14 -1
- package/rules/ast-grep-rules/rules/strict-equality.yml +14 -1
- package/rules/ast-grep-rules/rules/strict-inequality-js.yml +14 -1
- package/rules/ast-grep-rules/rules/strict-inequality.yml +14 -1
- package/rules/tree-sitter-queries/cpp/no-memset-sensitive-data.yml +9 -3
- package/rules/tree-sitter-queries/cpp/no-scoped-lock-without-args.yml +6 -6
- package/rules/tree-sitter-queries/css/calc-spacing.yml +8 -6
- package/rules/tree-sitter-queries/go/go-mutex-copy.yml +21 -18
- package/rules/tree-sitter-queries/go/go-shared-map-write-goroutine.yml +3 -3
- package/rules/tree-sitter-queries/java/infinite-loop-java.yml +3 -3
- package/rules/tree-sitter-queries/java/junit-call-super.yml +6 -4
- package/rules/tree-sitter-queries/java/no-double-checked-locking.yml +10 -8
- package/rules/tree-sitter-queries/java/no-field-shadowing.yml +1 -1
- package/rules/tree-sitter-queries/java/prepared-statement-valid-indices.yml +2 -3
- package/rules/tree-sitter-queries/java/resources-closed.yml +2 -2
- package/rules/tree-sitter-queries/java/springboot-default-package.yml +6 -3
- package/rules/tree-sitter-queries/java/switch-fall-through.yml +6 -4
- package/rules/tree-sitter-queries/java/switch-non-case-labels.yml +4 -3
- package/rules/tree-sitter-queries/java/tests-include-assertions.yml +6 -5
- package/rules/tree-sitter-queries/javascript/switch-case-termination-js.yml +5 -8
- package/rules/tree-sitter-queries/javascript/switch-non-case-labels.yml +3 -2
- package/rules/tree-sitter-queries/kotlin/prepared-statement-indices.yml +9 -5
- package/rules/tree-sitter-queries/php/this-in-static-context.yml +5 -5
- package/rules/tree-sitter-queries/python/exit-signature-check.yml +2 -9
- package/rules/tree-sitter-queries/python/in-operator-unsupported.yml +3 -4
- package/rules/tree-sitter-queries/python/no-super-torchscript.yml +4 -8
- package/rules/tree-sitter-queries/python/notimplemented-boolean-context.yml +1 -5
- package/rules/tree-sitter-queries/python/python-empty-except.yml +1 -1
- package/rules/tree-sitter-queries/python/return-in-init.yml +0 -2
- package/rules/tree-sitter-queries/python/yield-return-outside-function.yml +0 -3
- package/rules/tree-sitter-queries/ruby/ruby-command-injection.yml +1 -12
- package/rules/tree-sitter-queries/ruby/ruby-eval.yml +1 -1
- package/rules/tree-sitter-queries/ruby/ruby-insecure-deserialization.yml +4 -4
- package/rules/tree-sitter-queries/ruby/ruby-insecure-random.yml +4 -11
- package/rules/tree-sitter-queries/ruby/ruby-open-struct.yml +1 -1
- package/rules/tree-sitter-queries/ruby/ruby-string-eval.yml +2 -3
- package/rules/tree-sitter-queries/ruby/ruby-weak-hash.yml +4 -4
- package/rules/tree-sitter-queries/rust/rust-lock-held-across-await.yml +4 -3
- package/rules/tree-sitter-queries/tsx/no-nested-links.yml +4 -6
- package/rules/tree-sitter-queries/typescript/console-statement.yml +11 -0
- package/rules/tree-sitter-queries/typescript/duplicate-function-arg.yml +4 -9
- package/rules/tree-sitter-queries/typescript/empty-switch-case.yml +13 -9
- package/rules/tree-sitter-queries/typescript/infinite-loop.yml +2 -2
- package/rules/tree-sitter-queries/typescript/mixed-async-styles.yml +10 -1
- package/rules/tree-sitter-queries/typescript/switch-case-termination.yml +5 -8
- package/rules/tree-sitter-queries/typescript/ts-insecure-random.yml +7 -10
- package/rules/tree-sitter-queries/typescript/unsafe-regex.yml +4 -2
- package/rules/typos/_typos.toml +17 -0
- package/scripts/analyze-pi-lens-logs.mjs +55 -2
- package/skills/pi-lens-write-tree-sitter-rule/SKILL.md +5 -0
- package/dist/clients/ast-grep-parser.js +0 -86
- package/dist/clients/config-enabled-shape.js +0 -39
- package/dist/clients/lsp/interactive-install.js +0 -367
- package/dist/clients/lsp/lsp-index.js +0 -10
- package/dist/clients/lsp/server-strategies.js +0 -5
- package/dist/clients/project-metadata.js +0 -690
- package/dist/clients/source-groups.js +0 -96
- package/dist/clients/types.js +0 -11
- package/docs/env_variables.md +0 -10
- package/rules/tree-sitter-queries/abap-disabled/delete-where.yml +0 -46
- package/rules/tree-sitter-queries/cpp/no-confused-move-forward.yml +0 -59
- package/rules/tree-sitter-queries/cpp/noexcept-functions.yml +0 -58
- package/rules/tree-sitter-queries/java/mockito-initialized.yml +0 -66
- package/rules/tree-sitter-queries/java/no-wait-notify-on-thread.yml +0 -58
- package/rules/tree-sitter-queries/java/short-circuit-logic.yml +0 -57
- package/rules/tree-sitter-queries/java/spring-session-attributes-setcomplete.yml +0 -75
- package/rules/tree-sitter-queries/plsql-disabled/delete-update-where.yml +0 -56
- package/rules/tree-sitter-queries/plsql-disabled/end-loop-semicolon.yml +0 -51
- package/rules/tree-sitter-queries/plsql-disabled/fetch-bulk-collect-limit.yml +0 -47
- package/rules/tree-sitter-queries/plsql-disabled/forallsave-exceptions.yml +0 -51
- package/rules/tree-sitter-queries/plsql-disabled/nchar-nvarchar2-bytes.yml +0 -54
- package/rules/tree-sitter-queries/plsql-disabled/not-null-initialization.yml +0 -59
- package/rules/tree-sitter-queries/plsql-disabled/raise-application-error-codes.yml +0 -50
- package/rules/tree-sitter-queries/typescript-disabled/ts-path-traversal.yml +0 -71
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# API ports inventory — S1 of #1358
|
|
2
|
+
|
|
3
|
+
This is a read-only inventory of host state crossing into the engine. The scope is `clients/` and `tools/`; `index.ts` is listed separately as the current pi adapter. A `DispatchContext` is engine-owned, but its `cwd`, `pi.getFlag`, `hasTool`, and `log` members are projections of the host tool context and are therefore included. Engine fields such as `filePath`, facts, project configuration, and runtime state are not host ports.
|
|
4
|
+
|
|
5
|
+
The sweep used the requested `ctx.`, `pi.`, `ExtensionContext`, and `ExtensionAPI` searches, then followed the named seams and their consumers. There are **84 inventory rows** below. Line numbers refer to the S1 branch at commit time.
|
|
6
|
+
|
|
7
|
+
## Inventory
|
|
8
|
+
|
|
9
|
+
| file:line | capability | current mechanism | proposed port name |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| `tools/ast-grep-outline.ts:144` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
12
|
+
| `tools/ast-grep-replace.ts:181` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
13
|
+
| `tools/ast-grep-search.ts:437,652,661,687` | abort + workspace cwd | direct `ctx.signal`/`ctx.cwd` reads | `lifecycle.abortSignal`, `workspace.cwd` |
|
|
14
|
+
| `tools/lens-diagnostic-mark.ts:253` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
15
|
+
| `tools/lens-diagnostics.ts:376,398` | workspace cwd + abort | direct `ctx.cwd`/`ctx.signal` reads | `workspace.cwd`, `lifecycle.abortSignal` |
|
|
16
|
+
| `tools/lsp-diagnostics.ts:521,534` | abort + workspace cwd | direct `ctx.signal`/`ctx.cwd` reads | `lifecycle.abortSignal`, `workspace.cwd` |
|
|
17
|
+
| `tools/lsp-navigation.ts:992,1084,1128,1490,1496,1516,1521` | flags, workspace cwd, edit cwd | direct `ctx.cwd`; flag closure receives cwd | `flags.get`, `workspace.cwd` (path RESOLUTION is engine logic over `workspace.cwd` — review reclassification, #1360) |
|
|
18
|
+
| `tools/module-report.ts:130,131,282,283,438,439` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
19
|
+
| `tools/project-report.ts:76` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
20
|
+
| `tools/symbol-search.ts:73` | workspace cwd | direct `ctx.cwd` read | `workspace.cwd` |
|
|
21
|
+
| `tools/activate-tools.ts:87,89` | active-tool registry | direct `pi.getActiveTools`/`pi.setActiveTools` | `tools.active` |
|
|
22
|
+
| `clients/dispatch/dispatcher.ts:188,406` | feature flags | direct `pi.getFlag`/`ctx.pi.getFlag` | `flags.get` |
|
|
23
|
+
| `clients/dispatch/dispatcher.ts:607,979,1024` | diagnostic logging | direct `ctx.log` | `log.debug` |
|
|
24
|
+
| `clients/dispatch/dispatcher.ts:750,780,818,859,867,982,985` | cwd/project root | direct `ctx.cwd`/`ctx.projectRoot` | `workspace.cwd`, `workspace.projectRoot` |
|
|
25
|
+
| `clients/dispatch/integration.ts:337,359,394` | feature flags | direct `ctx.pi.getFlag`/`pi.getFlag` | `flags.get` |
|
|
26
|
+
| `clients/dispatch/auxiliary-lsp.ts:367` | cwd policy input | direct `ctx.cwd` | `workspace.cwd` |
|
|
27
|
+
| `clients/runtime-tool-call.ts:344,357,365,639` | workspace cwd | direct tool-context projection | `workspace.cwd` |
|
|
28
|
+
| `clients/runtime-tool-call.ts:452,453` | LSP status UI | direct `ctx.ui.setStatus`/`ctx.ui.theme` | `status.set` |
|
|
29
|
+
| `clients/dispatch/runners/actionlint.ts:92` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
30
|
+
| `clients/dispatch/runners/ast-grep-napi.ts:556,618,623` | tool availability, cwd, logging | direct `ctx.hasTool`, `ctx.cwd`, `ctx.log` | `tools.has`, `workspace.cwd`, `log.debug` |
|
|
31
|
+
| `clients/dispatch/runners/biome-check.ts:83` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
32
|
+
| `clients/dispatch/runners/cpp-check.ts:210` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
33
|
+
| `clients/dispatch/runners/credo.ts:81` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
34
|
+
| `clients/dispatch/runners/dart-analyze.ts:167` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
35
|
+
| `clients/dispatch/runners/detekt.ts:148` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
36
|
+
| `clients/dispatch/runners/dotnet-build.ts:147` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
37
|
+
| `clients/dispatch/runners/elixir-check.ts:166` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
38
|
+
| `clients/dispatch/runners/eslint.ts:110` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
39
|
+
| `clients/dispatch/runners/fish-indent.ts:22` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
40
|
+
| `clients/dispatch/runners/gleam-check.ts:57` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
41
|
+
| `clients/dispatch/runners/go-vet.ts:44` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
42
|
+
| `clients/dispatch/runners/golangci-lint.ts:129` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
43
|
+
| `clients/dispatch/runners/hadolint.ts:61` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
44
|
+
| `clients/dispatch/runners/helm-lint.ts:180,188` | project/cwd | direct `ctx.projectRoot`/`ctx.cwd` | `workspace.projectRoot`, `workspace.cwd` |
|
|
45
|
+
| `clients/dispatch/runners/htmlhint.ts:69` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
46
|
+
| `clients/dispatch/runners/javac.ts:55` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
47
|
+
| `clients/dispatch/runners/ktlint.ts:93` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
48
|
+
| `clients/dispatch/runners/lsp.ts:119,121,163` | cwd, flags | direct `ctx.cwd`, `ctx.pi.getFlag` | `workspace.cwd`, `flags.get` |
|
|
49
|
+
| `clients/dispatch/runners/markdownlint.ts:107` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
50
|
+
| `clients/dispatch/runners/mypy.ts:69` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
51
|
+
| `clients/dispatch/runners/oxlint.ts:64,82` | runner cwd, tool availability | direct `ctx.cwd`, `ctx.hasTool` | `workspace.cwd`, `tools.has` |
|
|
52
|
+
| `clients/dispatch/runners/php-lint.ts:47` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
53
|
+
| `clients/dispatch/runners/phpstan.ts:90` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
54
|
+
| `clients/dispatch/runners/prisma-validate.ts:56` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
55
|
+
| `clients/dispatch/runners/psscriptanalyzer.ts:148` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
56
|
+
| `clients/dispatch/runners/pyright.ts:39,44` | flags, runner cwd | direct `ctx.pi.getFlag`, `ctx.cwd` | `flags.get`, `workspace.cwd` |
|
|
57
|
+
| `clients/dispatch/runners/rubocop.ts:97` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
58
|
+
| `clients/dispatch/runners/ruff.ts:80` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
59
|
+
| `clients/dispatch/runners/rust-clippy.ts:66,67,70` | cwd for probe/install | direct `ctx.cwd` | `workspace.cwd` |
|
|
60
|
+
| `clients/dispatch/runners/shellcheck.ts:144,153,154,182` | cwd, tool availability | direct `ctx.cwd`, `ctx.hasTool` | `workspace.cwd`, `tools.has` |
|
|
61
|
+
| `clients/dispatch/runners/shfmt.ts:46` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
62
|
+
| `clients/dispatch/runners/spellcheck.ts:105,115` | cwd for probe/command | direct `ctx.cwd` | `workspace.cwd` |
|
|
63
|
+
| `clients/dispatch/runners/spotbugs.ts:218,222` | cwd, logging | direct `ctx.cwd`, `ctx.log` | `workspace.cwd`, `log.debug` |
|
|
64
|
+
| `clients/dispatch/runners/sqlfluff.ts:133,140` | cwd, logging | direct `ctx.cwd`, `ctx.log` | `workspace.cwd`, `log.debug` |
|
|
65
|
+
| `clients/dispatch/runners/stylelint.ts:112,120` | cwd, logging | direct `ctx.cwd`, `ctx.log` | `workspace.cwd`, `log.debug` |
|
|
66
|
+
| `clients/dispatch/runners/swiftlint.ts:161` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
67
|
+
| `clients/dispatch/runners/taplo.ts:60,70` | cwd, tool availability | direct `ctx.cwd`, `ctx.hasTool` | `workspace.cwd`, `tools.has` |
|
|
68
|
+
| `clients/dispatch/runners/terragrunt.ts:159` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
69
|
+
| `clients/dispatch/runners/tflint.ts:83` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
70
|
+
| `clients/dispatch/runners/tree-sitter.ts:429,435,458,522,713` | cwd/config/ignore root | direct dispatch-context `ctx.cwd`/`ctx.projectRoot` | `workspace.cwd`, `workspace.projectRoot` |
|
|
71
|
+
| `clients/dispatch/runners/trivy-config.ts:149` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
72
|
+
| `clients/dispatch/runners/vale.ts:135` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
73
|
+
| `clients/dispatch/runners/yamllint.ts:52,59` | cwd, logging | direct `ctx.cwd`, `ctx.log` | `workspace.cwd`, `log.debug` |
|
|
74
|
+
| `clients/dispatch/runners/zig-check.ts:61` | runner cwd | direct dispatch-context `ctx.cwd` | `workspace.cwd` |
|
|
75
|
+
| `clients/project-trust.ts:51,86` | project trust | host accessor read, then latched singleton | `trust.isProjectTrusted` |
|
|
76
|
+
| `clients/extension-mode.ts:50` | run mode | host accessor read at call site | `mode.current` |
|
|
77
|
+
| `clients/user-notify.ts:30,50` | human notification | live getter seam over `ctx.ui.notify` | `notify.user` |
|
|
78
|
+
| `clients/lens-events.ts:66,111` | event emission | live bus getter, resolved at deferred delivery | `emit.lens` |
|
|
79
|
+
| `clients/bus-publish.ts:83,196` | files-touched event | live emitter getter | `emit.bus` |
|
|
80
|
+
| `clients/diagnostics-publish.ts:130` | diagnostics event | live emitter getter | `emit.bus` |
|
|
81
|
+
| `clients/disposition-publish.ts:62` | disposition event | live emitter getter | `emit.bus` |
|
|
82
|
+
| `clients/format-events-publish.ts:130` | format/autofix events | live emitter getter | `emit.bus` |
|
|
83
|
+
| `clients/safe-spawn.ts:322,987` | turn cancellation for children | ambient abort signal set by adapter, read deep by spawn helper | `spawn.abortSignal` |
|
|
84
|
+
| `clients/widget-state.ts:142,205` | TUI invalidation | callback setter invoked by adapter; engine calls callback | `render.invalidate` |
|
|
85
|
+
| `clients/runtime-session.ts:104,970,1755` | session-start user output | notifier passed as callback parameter | `notify.user` |
|
|
86
|
+
| `clients/runtime-agent-end.ts:44,97,512` | agent-end user output | notifier passed as callback parameter | `notify.user` |
|
|
87
|
+
| `clients/lsp/config.ts:119` | invalid-config user output | `notifyUserDegradation` getter seam plus log sink | `notify.user`, `log.extension` |
|
|
88
|
+
| `clients/dispatch/runners/tree-sitter.ts:429,458` | tree-sitter config degradation | parameterized cwd plus notifier from config loader | `workspace.cwd`, `notify.user` |
|
|
89
|
+
| `clients/runtime-tool-call.ts:559,597,791,822,923,1038,1070,1112` | stable session identity in telemetry | parameter threaded from adapter/runtime identity | `session.id` |
|
|
90
|
+
| `clients/session-lifecycle.ts:298,333` | primary/secondary session identity | adapter extracts host session id and passes it in | `session.id` |
|
|
91
|
+
| `clients/session-state-store.ts:79,144` | persisted session state namespace | session id parameter threaded from adapter | `session.id` |
|
|
92
|
+
| `clients/extension-log.ts:35` | extension log sink | process/global-dir-derived static NDJSON sink | `log.extension` |
|
|
93
|
+
| `clients/actionable-warnings-logger.ts:16`, `ast-grep-tool-logger.ts:28`, `bus-events-logger.ts:43`, `cascade-logger.ts:10`, `dead-code-logger.ts:22`, `diagnostic-logger.ts:90`, `disposition-logger.ts:32`, `latency-logger.ts:10`, `read-guard-logger.ts:17`, `review-graph-logger.ts:16`, `sessionstart-logger.ts:12`, `tree-sitter-logger.ts:11`, `word-index-logger.ts:30` | subsystem log sinks | `createNdjsonLogger` consumers; no ExtensionAPI read, but host-owned process/filesystem policy is implicit | `log.sink` |
|
|
94
|
+
| `clients/debug-handles.ts:153`, `clients/debug-heap.ts:77` | optional diagnostic log sinks | `createNdjsonLogger` consumers gated by environment | `log.sink` |
|
|
95
|
+
|
|
96
|
+
## Draft `HostPorts` shape
|
|
97
|
+
|
|
98
|
+
This is intentionally an interface sketch for S2, not an implementation. It keeps host capabilities grouped by concern, makes live getters explicit where session replacement matters, and leaves engine data (`cwd`, file paths, and event payloads) as ordinary arguments rather than hiding them in a host object.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
export interface HostPorts {
|
|
102
|
+
readonly notify: {
|
|
103
|
+
user(message: string, level?: "info" | "warning" | "error"): void;
|
|
104
|
+
};
|
|
105
|
+
readonly trust: {
|
|
106
|
+
isProjectTrusted(): "trusted" | "untrusted" | "unknown";
|
|
107
|
+
};
|
|
108
|
+
readonly mode: {
|
|
109
|
+
current(): "tui" | "rpc" | "json" | "print" | "unknown";
|
|
110
|
+
supportsTuiWidget(): boolean;
|
|
111
|
+
suppressesUserNotify(): boolean;
|
|
112
|
+
};
|
|
113
|
+
readonly log: {
|
|
114
|
+
extension(entry: { subsystem: string; message: string; level?: string; metadata?: Record<string, unknown> }): void;
|
|
115
|
+
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
116
|
+
/** Subsystem NDJSON sink factory (the 13 subsystem-logger rows + debug
|
|
117
|
+
* sinks) — host owns the directory/retention policy. */
|
|
118
|
+
sink(subsystem: string): (entry: object) => void;
|
|
119
|
+
};
|
|
120
|
+
readonly emit: {
|
|
121
|
+
bus(channel: string, payload: unknown): void;
|
|
122
|
+
lens(channel: string, payload: unknown): void;
|
|
123
|
+
};
|
|
124
|
+
readonly status: {
|
|
125
|
+
set(name: string, value: string): void;
|
|
126
|
+
};
|
|
127
|
+
readonly spawn: {
|
|
128
|
+
abortSignal(): AbortSignal | undefined;
|
|
129
|
+
/** Trust-gated install/materialization policy (clients/project-trust.ts assertInstallAllowed; adapter-surface today -- callers in index.ts). */
|
|
130
|
+
isAllowed(context: string): boolean;
|
|
131
|
+
};
|
|
132
|
+
readonly render: {
|
|
133
|
+
invalidate(): void;
|
|
134
|
+
};
|
|
135
|
+
readonly session: {
|
|
136
|
+
id(): string | undefined;
|
|
137
|
+
};
|
|
138
|
+
readonly workspace: {
|
|
139
|
+
cwd(): string | undefined;
|
|
140
|
+
projectRoot(): string | undefined;
|
|
141
|
+
};
|
|
142
|
+
readonly flags: {
|
|
143
|
+
get(name: string, filePath?: string): string | boolean | undefined;
|
|
144
|
+
};
|
|
145
|
+
readonly tools: {
|
|
146
|
+
has(name: string): Promise<boolean>;
|
|
147
|
+
getActive(): string[];
|
|
148
|
+
setActive(names: string[]): void;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Four hardest migrations
|
|
154
|
+
|
|
155
|
+
1. **Dispatch runner context fan-out (`clients/dispatch/runners/*`, especially `tree-sitter.ts`, `lsp.ts`, and `ast-grep-napi.ts`).** Dozens of runners read `cwd`, availability, flags, and logging through `DispatchContext`; replacing these safely requires separating engine context from host projections without changing runner scheduling or fallback semantics. The existing `PiAgentAPI` is only a flag fragment, so this is the largest mechanical and typing migration.
|
|
156
|
+
|
|
157
|
+
2. **Turn-scoped abort propagation (`index.ts` → `setAmbientAbortSignal` → `clients/safe-spawn.ts`).** The ambient signal is intentionally available deep inside arbitrary child-spawn paths, and its correctness depends on lifecycle ordering and clearing every settle path. A port must preserve cancellation, session replacement, and print-mode handle behavior without reintroducing captured-context races.
|
|
158
|
+
|
|
159
|
+
3. **Session-bound UI/status and event delivery (`clients/runtime-tool-call.ts`, `clients/widget-state.ts`, and the bus/event publishers).** UI getters, status setters, render invalidation, and event emitters can all outlive the context that supplied them. The existing getter seams solve some cases, but consolidating them requires preserving delivery-time resolution, dropped-event observability, and no-throw behavior across TUI/RPC/MCP hosts.
|
|
160
|
+
|
|
161
|
+
4. **Read-guard tool-event seam** (`index.ts:1722-1734` → `clients/runtime-tool-call.ts`; `index.ts:1739-1745` → `clients/runtime-tool-result.ts`): the tool-call/tool-result coupling and strict ordering make this at least as hard as the UI/event migration — the port must preserve event order and the paired-call identity across session replacement (#1360 review addition).
|
|
162
|
+
|
|
163
|
+
## S2 recommendation
|
|
164
|
+
|
|
165
|
+
Implement `HostPorts` as a host-neutral capability object assembled by each adapter, but migrate one capability family at a time behind the existing seams: first notify/trust/mode, then emit/log/status/render, then workspace/flags/tools/session/spawn. Keep current getters as canonical adapter implementations during the transition, and add a contract test that the MCP and pi adapters provide the same defaults (no-op notify/emit/status/render, unknown trust/mode, and no ambient abort) before changing engine call signatures.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- GENERATED by scripts/gen-rule-catalogs.mjs — do not edit by hand. Run `npm run docs:rule-catalogs` after changing rules. -->
|
|
4
4
|
|
|
5
|
-
pi-lens bundles **
|
|
5
|
+
pi-lens bundles **438 enabled** ast-grep rules (254 pi-lens-authored + 184 vendored from CodeRabbit) across **16 languages**, plus 16 disabled.
|
|
6
6
|
|
|
7
7
|
See [`docs/custom-rules.md`](custom-rules.md) to add your own. Rule sources: `rules/ast-grep-rules/rules/` (pi-lens), `rules/ast-grep-rules/coderabbit/rules/` (vendored).
|
|
8
8
|
|
|
@@ -401,7 +401,7 @@ See [`docs/custom-rules.md`](custom-rules.md) to add your own. Rule sources: `ru
|
|
|
401
401
|
| `redundant-usestate-type` | info | pi-lens | `useState<TYPE>(...)` where TYPE is a primitive redundant — TS can infer it from the initial value |
|
|
402
402
|
| `unnecessary-react-hook` | warning | pi-lens | Function with a `use*` name does not call any other React hook — rename to a plain function |
|
|
403
403
|
|
|
404
|
-
### TypeScript (
|
|
404
|
+
### TypeScript (120)
|
|
405
405
|
|
|
406
406
|
| Rule | Severity | Source | Description |
|
|
407
407
|
|---|---|---|---|
|
|
@@ -429,6 +429,7 @@ See [`docs/custom-rules.md`](custom-rules.md) to add your own. Rule sources: `ru
|
|
|
429
429
|
| `no-await-expression-member` | hint | pi-lens | Unnecessary parentheses around await — write await expr.prop directly |
|
|
430
430
|
| `no-await-in-promise-all` | error | pi-lens | Avoid await inside Promise.all — use Promise.all with an array of promises instead |
|
|
431
431
|
| `no-await-in-promise-methods` | warning | pi-lens | Do not await inside Promise.all/allSettled — pass the promises directly |
|
|
432
|
+
| `no-bare-host-path-in-win32-branch` | warning | pi-lens | Use win32 path operations inside a branch committed to Windows path semantics |
|
|
432
433
|
| `no-case-declarations` | error | pi-lens | Unexpected lexical declaration in case block — wrap in braces to restrict scope |
|
|
433
434
|
| `no-compare-neg-zero` | error | pi-lens | Disallow comparing against -0 |
|
|
434
435
|
| `no-cond-assign` | error | pi-lens | Expected a conditional expression and instead saw an assignment. |
|
|
@@ -456,6 +457,7 @@ See [`docs/custom-rules.md`](custom-rules.md) to add your own. Rule sources: `ru
|
|
|
456
457
|
| `no-open-redirect` | error | pi-lens | Potential open redirect vulnerability — validate redirect URLs |
|
|
457
458
|
| `no-prototype-builtins` | error | pi-lens | Use Object.hasOwn() or Object.prototype.hasOwnProperty.call() instead of calling methods directly on the object |
|
|
458
459
|
| `no-prototype-builtins-native` | hint | pi-lens | Use Object.hasOwn() instead of hasOwnProperty() — ES2022 standard |
|
|
460
|
+
| `no-raw-json-store-write` | warning | pi-lens | Use the atomic write seam for JSON stores instead of writeFileSync |
|
|
459
461
|
| `no-relative-cross-package-import` | info | pi-lens | Avoid relative imports across package boundaries (../../). Use absolute imports (@app/..., @components/...) for better agent reasoning abou… |
|
|
460
462
|
| `no-return-await` | warning | pi-lens | Unnecessary 'await' in return statement — use direct return instead |
|
|
461
463
|
| `no-single-promise-in-promise-methods` | warning | pi-lens | Promise.all/race with a single promise is unnecessary — await it directly |
|
|
@@ -468,6 +470,7 @@ See [`docs/custom-rules.md`](custom-rules.md) to add your own. Rule sources: `ru
|
|
|
468
470
|
| `no-useless-length-check` | warning | pi-lens | Use .some() instead of .filter().length check — short-circuits at first match |
|
|
469
471
|
| `no-useless-promise-resolve-reject` | warning | pi-lens | Unnecessary Promise.resolve/reject wrapping — return the value directly |
|
|
470
472
|
| `no-useless-rest-spread` | warning | pi-lens | Redundant spread into same container type — remove the extra spread |
|
|
473
|
+
| `no-win32-isabsolute-for-qualification` | warning | pi-lens | Use isFullyQualified for path qualification instead of win32.isAbsolute |
|
|
471
474
|
| `node-rsa-weak-key-typescript` | warning | CodeRabbit | Use of RSA-$BITS, which is considered weak. Based on NIST standards, RSA keys should be at least 2048 bits. |
|
|
472
475
|
| `node-sequelize-empty-password-argument-typescript` | warning | CodeRabbit | The application creates a database connection with an empty password. This can lead to unauthorized access by either an internal or externa… |
|
|
473
476
|
| `node-sequelize-hardcoded-secret-argument-typescript` | warning | CodeRabbit | A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive da… |
|
package/docs/astplayground.md
CHANGED
|
@@ -60,8 +60,6 @@ node scripts/playground-verify-rule.mjs rules/ast-grep-rules/rules/jsx-boolean-s
|
|
|
60
60
|
node scripts/playground-verify-rule.mjs rules/ast-grep-rules/rules/no-console-except-error.yml \
|
|
61
61
|
--code "ignored" --keep-chrome
|
|
62
62
|
|
|
63
|
-
# Audit all our shipped rules (uses the default source — no per-rule expectations)
|
|
64
|
-
node scripts/playground-verify-rule.mjs --all
|
|
65
63
|
```
|
|
66
64
|
|
|
67
65
|
### Output
|
|
@@ -161,8 +159,9 @@ auto-skipped when Google Chrome is not on `PATH` and
|
|
|
161
159
|
reuses Chrome (~1.5s for the CDP attach + load + scrape). With
|
|
162
160
|
`--keep-chrome`, multiple `playground-verify-rule.mjs` invocations
|
|
163
161
|
share the same Chrome process.
|
|
164
|
-
- The verifier does **not** parallelize — it's a single-rule smoke test.
|
|
165
|
-
|
|
162
|
+
- The verifier does **not** parallelize — it's a single-rule smoke test. It has
|
|
163
|
+
no batch-audit flag; script a loop yourself if you need to check multiple
|
|
164
|
+
rules.
|
|
166
165
|
|
|
167
166
|
## Known limitations
|
|
168
167
|
|
package/docs/audit1.md
CHANGED
|
@@ -68,7 +68,7 @@ This document records structural inconsistencies and centralization gaps found w
|
|
|
68
68
|
|
|
69
69
|
**Files:**
|
|
70
70
|
- `clients/dispatch/runners/lsp.ts` — `appliesTo` array lists ~35 file kinds
|
|
71
|
-
- `clients/lsp/server.ts` — `LSP_SERVERS` currently has
|
|
71
|
+
- `clients/lsp/server.ts` — `LSP_SERVERS` currently has 42 entries
|
|
72
72
|
|
|
73
73
|
**Impact:** Adding a new language server for a new file kind requires updating both `LSP_SERVERS` and the lsp runner's `appliesTo`. If they drift, the runner may skip files that have a configured server, or vice versa.
|
|
74
74
|
|
|
@@ -100,15 +100,15 @@ This document records structural inconsistencies and centralization gaps found w
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
### 8. README server count
|
|
103
|
+
### 8. README server count was inconsistent with `LSP_SERVERS` (resolved)
|
|
104
104
|
|
|
105
105
|
**Files:**
|
|
106
|
-
- `README.md` —
|
|
107
|
-
- `clients/lsp/server.ts` — `LSP_SERVERS` has
|
|
106
|
+
- `README.md` — the original count was "37 language server definitions (including two cross-cutting auxiliary scanners)"
|
|
107
|
+
- `clients/lsp/server.ts` — `LSP_SERVERS` currently has 42 entries: 38 primary + 4 auxiliary (`opengrep`, `ast-grep`, `zizmor`, `typos`)
|
|
108
108
|
|
|
109
109
|
**Impact:** A contributor adding a server cannot tell what number to update, and users may be confused about which auxiliary scanners exist (the README names only Opengrep and ast-grep, omitting zizmor).
|
|
110
110
|
|
|
111
|
-
**
|
|
111
|
+
**Resolution:** The feature documentation now reports the current 42-entry registry and names all four auxiliary servers. Consider generating the count in a nightly doc script if this remains a recurring drift source.
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Durable-store cross-process audit (#1202)
|
|
2
|
+
|
|
3
|
+
Atomic rename prevents torn files; it does not serialize read-modify-write. This
|
|
4
|
+
audit classifies stores reachable by extension, MCP, CLI, and subagent processes.
|
|
5
|
+
`<project>` means `getProjectDataDir(cwd)` and `<global>` means
|
|
6
|
+
`getGlobalPiLensDir()`.
|
|
7
|
+
|
|
8
|
+
| Store and path | Racing writers | Semantics | Risk | Existing mitigation / decision |
|
|
9
|
+
|---|---|---|---|---|
|
|
10
|
+
| Turn state — `<project>/turn-state.json` | extension, MCP, CLI; subagents use distinct owners | read-modify-write worklist | (a) impossible | **fixed here:** deferred-format writes now carry the pi session owner, and `clearTurnState` / `incrementTurnCycle` reject a foreign live owner just like `addModifiedRange`; MCP turn-end operations are FIFO-serialized. |
|
|
11
|
+
| Scanner caches — `<project>/cache/{scanner}.json` + `{scanner}.meta.json` | extension, MCP, CLI, subagents | overwrite-only scan result + freshness metadata | (b) possible, benign | none; a losing cache publication is recoverable on the next scan. Data is written before metadata, so interruption cannot make old data newly fresh; concurrent last-finisher wins. |
|
|
12
|
+
| Rule cache — `<project>/cache/{language}-rules-3.json` | all analysis processes | overwrite-only, content-hash validated | (a) impossible | rule hash rejects a cache for different inputs. |
|
|
13
|
+
| Workspace diagnostics — `<project>/cache/lsp-workspace-diagnostics.json` | extension/MCP/CLI sweeps and subagents | read-merge-overwrite cache | (b) possible, benign | mtime/content/dependency freshness rejects stale entries; a lost entry causes a rescan. Accepted benign. |
|
|
14
|
+
| Call graph — `<project>/cache/call-graph.json` + `.meta.json` | extension/MCP/CLI graph builds, subagents | overwrite-only derived graph | (b) possible, benign | source freshness validation; a loss rebuilds from source. Accepted benign. |
|
|
15
|
+
| Codebase model — `<project>/cache/codebase-model.json` + `.meta.json` | extension/MCP/CLI builds, subagents | overwrite-only derived model | (b) possible, benign | source/file-set validation; a loss rebuilds. Accepted benign. |
|
|
16
|
+
| Actionable-warning state — `<project>/cache/actionable-warning-state.json` | dispatches in every process | read-merge-overwrite behavior gate | (c) possible, harmful | **fixed here:** bounded exclusive pid lock, in-lock disk re-read, and per-warning merge preserve concurrent suppression fields before atomic replacement. |
|
|
17
|
+
| Actionable-warning history — `<project>/actionable-warnings.jsonl` | every dispatcher | append-only telemetry | (b) possible, benign | one append call per batch; malformed/truncated telemetry lines are ignored. Accepted benign. |
|
|
18
|
+
| Metrics history — `<project>/metrics-history.json` | session scans and `/lens-metrics` in every process | read-modify-overwrite trend cache | (c) possible, harmful | **accepted loss:** telemetry only; a race can leave a user-visible gap in trend history, but gaps are self-healing after the next scan restores the latest snapshot. Locking every passive capture or restructuring the established bounded JSON format is disproportionate to advisory history. |
|
|
19
|
+
| Project diagnostics — `<project>/cache/project-diagnostics.json` and `project-diagnostics-delta.json` | extension/MCP/CLI scans, subagents | overwrite-only derived snapshots | (b) possible, benign | per-file mtime filtering; next scan replaces loss. Accepted benign. |
|
|
20
|
+
| Worklog — `<project>/worklog.jsonl` | all dispatchers | append-only best-effort telemetry | (b) possible, benign | OS append operation per batch; readers skip malformed lines. Accepted benign. |
|
|
21
|
+
| Widget/read-guard session state — `<project>/sessions/{sessionId}.json` | one extension host per stable session id | overwrite-only session snapshot | (a) impossible | session-id sharding; read guard and widget are co-snapshotted atomically. |
|
|
22
|
+
| Diagnostic dispositions — `<project>/cache/diagnostic-dispositions.json` | extension, MCP, CLI tools, subagents | read-modify-write behavior gate | (c) possible, harmful | **fixed here:** exclusive pid lock, in-lock disk re-read, and per-anchor merge refuse stale whole-file promotion. |
|
|
23
|
+
| Recent touches — `<project>/recent-touches.json` | every extension/subagent publisher | read-append-overwrite bounded attribution ring | (b) possible, benign | explicitly best-effort nudge attribution; lost entries do not gate edits/checks and later touches replenish it. Accepted benign. |
|
|
24
|
+
| Instance registry — `<global>/instances.json` | every host/MCP/subagent process and reaper | read-modify-overwrite observability registry | (b) possible, benign | explicitly best-effort. Backstop orphan reaping intentionally kills untracked managed processes on dead-parent confirmation; missing registry entries allow this (intentional, #1267-adjacent; no fix needed). |
|
|
25
|
+
| Project snapshot — `<project>/cache/project-snapshot.json.gz` + `.meta.json` | extension/MCP/CLI builders, subagents | monotonic derived snapshot | (a) impossible | durable project sequence/source identity and generation-gated staged promotion; body embeds its seq so mismatched metadata is rejected. |
|
|
26
|
+
| Review graph + checkpoint — `<project>/cache/review-graph.json.gz`, `review-graph.checkpoint.json.gz` | extension/MCP/CLI builders, subagents | overwrite-only derived graph | (a) impossible | source signature/project-seq validation plus staged, generation-gated promotion; stale content is rejected on load. |
|
|
27
|
+
| Probe cache — `<global>/probe-cache.json` | every installer/prober | read-modify-write tool availability | (a) impossible | existing bounded cross-process lock + in-lock re-read/change merge (#1263). |
|
|
28
|
+
| Stop-hook status — OS temp `pi-lens-turn-end-*.json` | concurrent CLI Stop hooks | read-modify-overwrite counters | (b) possible, benign | atomic publication; explicitly bounded best-effort telemetry. Accepted benign. |
|
|
29
|
+
|
|
30
|
+
The grammar/WASM destination files are immutable content assets, not shared
|
|
31
|
+
mutable stores. Atomic staging artifacts are covered separately by the bounded
|
|
32
|
+
session-start stage GC and are not authoritative stores.
|
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
# Environment Variables
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
shell that launches pi (`export …` in bash,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`
|
|
3
|
+
The complete pi-lens environment-variable reference. Every variable here is read
|
|
4
|
+
at process start; set it in the shell that launches pi (`export …` in bash,
|
|
5
|
+
`$env:VAR = "…"` / `setx …` in PowerShell), your process manager, or CI config.
|
|
6
|
+
|
|
7
|
+
Boolean-style variables are compared literally against `"1"` or `"0"` — only the
|
|
8
|
+
exact string flips the switch.
|
|
9
|
+
|
|
10
|
+
**Precedence** varies by variable and is noted in each section, because the env
|
|
11
|
+
tier sits in a different place depending on what the variable controls:
|
|
12
|
+
|
|
13
|
+
- **Path / directory overrides** (`PILENS_DATA_DIR`, `PI_LENS_HOME`,
|
|
14
|
+
`PI_LENS_CONFIG_PATH`) have no CLI or config-key equivalent, so the env var is
|
|
15
|
+
the only surface.
|
|
16
|
+
- **The registry-bound toggle** (`PI_LENS_NO_CONTEXT_INJECTION`) resolves through
|
|
17
|
+
the flag registry, where **env is the highest tier** — it outranks both the
|
|
18
|
+
`--no-lens-context` CLI flag and the `contextInjection.enabled` config key
|
|
19
|
+
(`clients/lens-config.ts` resolution order: `env → cli → project → global →
|
|
20
|
+
default`).
|
|
21
|
+
- **Scale / limit knobs** (`PI_LENS_MAX_PROJECT_FILES` and friends) sit *between*
|
|
22
|
+
the matching `config.json` value and the built-in default — the config value
|
|
23
|
+
wins when present, else the env var, else the default. A few are outright
|
|
24
|
+
overrides that win over everything; each says so below.
|
|
25
|
+
|
|
26
|
+
For the readable overview of all three configuration surfaces (env, CLI flags,
|
|
27
|
+
config JSON) and how they interact, see [Settings](settings.md).
|
|
28
|
+
|
|
29
|
+
## Config location
|
|
30
|
+
|
|
31
|
+
### `PI_LENS_CONFIG_PATH`
|
|
32
|
+
|
|
33
|
+
Override the path of the global config file. **Default:** `~/.pi-lens/config.json`
|
|
34
|
+
(`%USERPROFILE%\.pi-lens\config.json` on Windows). When set, the value is
|
|
35
|
+
resolved to an absolute path and used verbatim.
|
|
36
|
+
|
|
37
|
+
**When to set it:** keeping the config under version control or a dotfiles
|
|
38
|
+
manager at a non-default location, or pointing CI at a fixture config.
|
|
8
39
|
|
|
9
40
|
## Data directory
|
|
10
41
|
|
|
@@ -31,6 +62,15 @@ out of the workspace.
|
|
|
31
62
|
machine-global logs at `~/.pi-lens/{latency,cascade,tree-sitter,
|
|
32
63
|
read-guard,…}.log` likewise stay put.
|
|
33
64
|
|
|
65
|
+
## Machine-global directory
|
|
66
|
+
|
|
67
|
+
### `PI_LENS_HOME`
|
|
68
|
+
|
|
69
|
+
Override the machine-global pi-lens directory. This relocates global logs,
|
|
70
|
+
managed tools, install caches, and the cross-process instance registry from the
|
|
71
|
+
default `~/.pi-lens/` root to the supplied path. This is separate from
|
|
72
|
+
`PILENS_DATA_DIR`, which controls per-project state; the two are independent.
|
|
73
|
+
|
|
34
74
|
## Startup mode
|
|
35
75
|
|
|
36
76
|
### `PI_LENS_STARTUP_MODE`
|
|
@@ -48,12 +88,54 @@ repo skip the counting walk entirely; a repo that shrinks below the threshold
|
|
|
48
88
|
recovers when the TTL expires. Other verdicts use content-based freshness and
|
|
49
89
|
ignore this setting.
|
|
50
90
|
|
|
51
|
-
##
|
|
91
|
+
## Scale and limits
|
|
52
92
|
|
|
53
|
-
### `
|
|
93
|
+
### `PI_LENS_MAX_PROJECT_FILES`
|
|
54
94
|
|
|
55
|
-
|
|
56
|
-
|
|
95
|
+
Base project-size scale knob (default `2000`). It derives five subsystem size
|
|
96
|
+
budgets together. In precedence it sits **below** a project's `maxProjectFiles`
|
|
97
|
+
config value and **above** the built-in default: a `.pi-lens.json`
|
|
98
|
+
`maxProjectFiles` wins when present, otherwise this env var, otherwise `2000`.
|
|
99
|
+
|
|
100
|
+
### `PI_LENS_REVIEW_GRAPH_MAX_FILES`
|
|
101
|
+
|
|
102
|
+
Override the review graph's own file budget. This wins **outright** over both the
|
|
103
|
+
config `reviewGraph.maxFiles` value and the adaptive taper derived from
|
|
104
|
+
`maxProjectFiles` — it is checked at the call site before any derivation.
|
|
105
|
+
|
|
106
|
+
### `PI_LENS_STARTUP_SCAN_MAX_ENTRIES`
|
|
107
|
+
|
|
108
|
+
Directory-entry ceiling for the startup source-count walk (default `50000`). This
|
|
109
|
+
bounds directory entries *visited* — a raw tree-walk safety valve — and is
|
|
110
|
+
deliberately **not** derived from `maxProjectFiles`, since the healthy ratio of
|
|
111
|
+
entries-visited to source-files-kept varies wildly by project shape.
|
|
112
|
+
|
|
113
|
+
### `PI_LENS_GRAPH_PERSIST_MAX_ELEMENTS`
|
|
114
|
+
|
|
115
|
+
Element-count ceiling (default `500000`) above which the review graph persists
|
|
116
|
+
only a ranked partial snapshot instead of the whole graph.
|
|
117
|
+
|
|
118
|
+
### `PI_LENS_RUNNER_TIMEOUT_FLOOR_MS`
|
|
119
|
+
|
|
120
|
+
Minimum wall-clock budget (ms) for every dispatch runner; the effective timeout
|
|
121
|
+
is `max(runner budget, floor)`. **Default:** `0` (no floor). Also settable via
|
|
122
|
+
the `dispatch.runnerTimeoutFloorMs` config key, which wins when both are set.
|
|
123
|
+
|
|
124
|
+
## Install control
|
|
125
|
+
|
|
126
|
+
### `PI_LENS_AUTO_INSTALL`
|
|
127
|
+
|
|
128
|
+
Set to `1` to auto-approve tool installs non-interactively (same as
|
|
129
|
+
`--auto-install`). Off by default — installs prompt interactively.
|
|
130
|
+
|
|
131
|
+
### `PI_LENS_DISABLE_LSP_INSTALL`
|
|
132
|
+
|
|
133
|
+
Set to `1` to skip auto-installing language servers. Off by default.
|
|
134
|
+
|
|
135
|
+
### `PI_LENS_DISABLE_TOOL_INSTALL`
|
|
136
|
+
|
|
137
|
+
Set to `1` to skip auto-installing managed tools (formatters, linters,
|
|
138
|
+
scanners). Off by default.
|
|
57
139
|
|
|
58
140
|
## Context injection
|
|
59
141
|
|
|
@@ -66,6 +148,18 @@ active; findings are still cached for `lens_diagnostics` and
|
|
|
66
148
|
`/lens-health`. Useful when prompt-cache invalidation from injected
|
|
67
149
|
messages is hurting throughput in long, cache-sensitive sessions.
|
|
68
150
|
|
|
151
|
+
This variable is bound into the flag registry, where **the env tier is highest**:
|
|
152
|
+
`PI_LENS_NO_CONTEXT_INJECTION=1` outranks the `--no-lens-context` CLI flag and the
|
|
153
|
+
`contextInjection.enabled` config key when they disagree.
|
|
154
|
+
|
|
155
|
+
## Concurrent-session guard
|
|
156
|
+
|
|
157
|
+
### `PI_LENS_CONCURRENT_SESSION_GUARD`
|
|
158
|
+
|
|
159
|
+
Set to `0` to disable the concurrent-session guard. The guard is **on** by
|
|
160
|
+
default; it prevents a newly starting same-workspace session from resetting the
|
|
161
|
+
warm LSP of a live incumbent session.
|
|
162
|
+
|
|
69
163
|
## LSP warm attach
|
|
70
164
|
|
|
71
165
|
### `PI_LENS_WARM_ATTACH`
|
|
@@ -76,6 +170,58 @@ Unset or `0` preserves the prior local-LSP behavior exactly. Any transport,
|
|
|
76
170
|
schema, freshness, deadline, or incumbent-liveness failure permanently falls
|
|
77
171
|
back to a local LSP fleet for that session.
|
|
78
172
|
|
|
173
|
+
## Language-specific
|
|
174
|
+
|
|
175
|
+
### `PI_LENS_VULTURE_MIN_CONFIDENCE`
|
|
176
|
+
|
|
177
|
+
Minimum confidence for the Python dead-code (Vulture) scanner. **Default:** `60`.
|
|
178
|
+
Accepts `0`–`100`; out-of-range values are clamped into that range.
|
|
179
|
+
|
|
180
|
+
### `PI_LENS_JAVA_LOMBOK`
|
|
181
|
+
|
|
182
|
+
Set to `0` to disable auto-attaching the Lombok javaagent to the Java language
|
|
183
|
+
server. Lombok support is on by default when a Lombok jar is resolved.
|
|
184
|
+
|
|
185
|
+
### `PI_LENS_LOMBOK_JAR`
|
|
186
|
+
|
|
187
|
+
Explicit path to a Lombok jar for the Java language server, used when
|
|
188
|
+
auto-resolution does not find one. The legacy `LOMBOK_JAR` variable is also
|
|
189
|
+
honored.
|
|
190
|
+
|
|
191
|
+
## Project map
|
|
192
|
+
|
|
193
|
+
### `PI_LENS_MAP_MAX_NODES`
|
|
194
|
+
|
|
195
|
+
Node cap for `/lens-map` (default 500). Graphs with more files keep only the
|
|
196
|
+
highest-degree ones and render a visible truncation note.
|
|
197
|
+
|
|
198
|
+
## Memory / idle eviction
|
|
199
|
+
|
|
200
|
+
Several in-memory caches release their contents after a period of inactivity so a
|
|
201
|
+
long-running session does not retain hydrated state indefinitely. Each has an
|
|
202
|
+
env-tunable window; all default to 20 minutes (`1200000` ms).
|
|
203
|
+
|
|
204
|
+
### `PI_LENS_TS_IDLE_EVICT_MS`
|
|
205
|
+
|
|
206
|
+
Idle window (ms) after which TypeScript language-service clients release their
|
|
207
|
+
hydrated program and shut down, rebuilding transparently on the next request.
|
|
208
|
+
**Default:** 20 minutes (`1200000`).
|
|
209
|
+
|
|
210
|
+
### `PI_LENS_WORD_INDEX_IDLE_EVICT_MS`
|
|
211
|
+
|
|
212
|
+
Idle window (ms) after which the persisted word index (`symbol_search`'s BM25
|
|
213
|
+
index) is released from memory. **Default:** 20 minutes (`1200000`).
|
|
214
|
+
|
|
215
|
+
### `PI_LENS_PROJECT_SNAPSHOT_IDLE_EVICT_MS`
|
|
216
|
+
|
|
217
|
+
Idle window (ms) after which the cached project snapshot is released from
|
|
218
|
+
memory. **Default:** 20 minutes (`1200000`).
|
|
219
|
+
|
|
220
|
+
### `PI_LENS_REVIEW_GRAPH_IDLE_EVICT_MS`
|
|
221
|
+
|
|
222
|
+
Idle window (ms) after which the in-memory review graph (`file → symbol →
|
|
223
|
+
dependency`) is released. **Default:** 20 minutes (`1200000`).
|
|
224
|
+
|
|
79
225
|
## Bus events
|
|
80
226
|
|
|
81
227
|
### `PI_LENS_BUS_PUBLISH`
|
|
@@ -87,7 +233,47 @@ never affects the write path's own success or latency, so this switch exists
|
|
|
87
233
|
purely to opt out of the broadcast, e.g. if another extension's bus listener
|
|
88
234
|
misbehaves.
|
|
89
235
|
|
|
236
|
+
## Diagnostics and logging
|
|
237
|
+
|
|
238
|
+
### `PI_LENS_DEBUG`
|
|
239
|
+
|
|
240
|
+
Set to `1` for verbose installer/debug logging (same as `--debug`). Off by
|
|
241
|
+
default.
|
|
242
|
+
|
|
243
|
+
### `PI_LENS_DEBUG_HANDLES`
|
|
244
|
+
|
|
245
|
+
Set to `1` **before starting pi** to enable the handle-origin tracer
|
|
246
|
+
(institutionalized from the #1097 hand-rolled `async_hooks` investigation
|
|
247
|
+
that root-caused a leaked `setTimeout` keeping a `--print --no-session`
|
|
248
|
+
process alive). Read once at extension load — toggling it mid-session has no
|
|
249
|
+
effect. When set, pi-lens dumps `process.getActiveResourcesInfo()` counts by
|
|
250
|
+
resource type (plus per-type creation-site stack attribution, since the
|
|
251
|
+
`async_hooks` tracker only installs when the flag was already on at startup)
|
|
252
|
+
to `~/.pi-lens/debug-handles.log` at two points: `agent_settled` (after
|
|
253
|
+
quiet-window work is scheduled) and `session_shutdown` (after teardown —
|
|
254
|
+
whatever is still alive at that point is the leak). Off by default, and a
|
|
255
|
+
true no-op when unset — no writer, no `async_hooks` hook, zero overhead. Use
|
|
256
|
+
it to diagnose a pi process that won't exit: run once with the flag set,
|
|
257
|
+
reproduce the hang, then check `debug-handles.log`'s `session_shutdown`
|
|
258
|
+
entry for what's still holding the loop open.
|
|
259
|
+
|
|
260
|
+
### `PI_LENS_LOG_RETENTION_DAYS`
|
|
261
|
+
|
|
262
|
+
Days to keep rotated logs before cleanup. **Default:** `7`.
|
|
263
|
+
|
|
264
|
+
### `PI_LENS_MAX_LOG_SIZE_MB`
|
|
265
|
+
|
|
266
|
+
Maximum log size (MB) before rotation. **Default:** `10`.
|
|
267
|
+
|
|
268
|
+
## Advanced tuning knobs
|
|
269
|
+
|
|
270
|
+
pi-lens also has many advanced/internal tuning variables — LSP timeouts and
|
|
271
|
+
memory budgets, debounce intervals (`PI_LENS_LSP_*`, and others). These are for
|
|
272
|
+
edge-case tuning, are not part of the supported surface above, and are documented
|
|
273
|
+
in the source; enumerate them with `grep PI_LENS_ clients/`.
|
|
274
|
+
|
|
90
275
|
## Related
|
|
91
276
|
|
|
92
|
-
-
|
|
93
|
-
-
|
|
277
|
+
- [Settings](settings.md) — the configuration overview hub (env, CLI, config).
|
|
278
|
+
- `~/.pi-lens/config.json` schema — [Global and project config](globalconfig.md)
|
|
279
|
+
- CLI flags — [Runtime flags](usage.md#runtime-flags)
|
package/docs/fable.md
CHANGED
|
@@ -138,3 +138,30 @@ inventory earning nothing. Feeding transitive impact into cascade neighbor
|
|
|
138
138
|
selection is probably the highest-leverage *feature* work available — ideally
|
|
139
139
|
paired with the #202 structural-hash short-circuit so the expansion prunes
|
|
140
140
|
when a changed file's exported interface is unchanged.
|
|
141
|
+
|
|
142
|
+
## OS-agnostic paths: classification is centralized, transformation isn't (#1193)
|
|
143
|
+
|
|
144
|
+
The path-*shape* layer is genuinely unified — `isWindowsPath`, the
|
|
145
|
+
`win32`-vs-`posix` shape-conditional idiom (confined to 4 files), `realpathSync`
|
|
146
|
+
(confined to `path-utils.ts`), `PathKeyedMap`, the `walkUpDirs` family, and the
|
|
147
|
+
`uriToPath`/`uriToDiskPath` LSP ingest boundary are all single-source and
|
|
148
|
+
defensively documented. The path-*transformation* layer is not: slash-folding
|
|
149
|
+
(`.replace(/\\/g, "/")`) is hand-rolled **138× across 83 files** with no shared
|
|
150
|
+
helper, `\r\n`-folding re-implements `normalizeToLF` in five files, and ephemeral
|
|
151
|
+
case/slash key-normalizers are copy-pasted in four (one of which case-folds but
|
|
152
|
+
forgets to slash-fold). That gap is why the *same* shape-2 defect keeps re-filing
|
|
153
|
+
under new numbers — #1150 → #1152 → #1161 → #1163 → #1194. Per-site
|
|
154
|
+
`isWindowsPath ? win32 : posix` conditionals treat symptoms; every new interior
|
|
155
|
+
`dirname`/`relative`/`isAbsolute` on a potentially-cross-shaped value is a fresh
|
|
156
|
+
latent instance. The tell: LSP URIs are the one axis with a real *ingest*
|
|
157
|
+
primitive, and the one axis not generating monthly bugs.
|
|
158
|
+
|
|
159
|
+
Highest-leverage move (**P1**, tracked in #1193): ship a `toPosix()` slash-fold
|
|
160
|
+
primitive and make it the only sanctioned form — it funnels the 138 sites *and*
|
|
161
|
+
makes a shape-2 ast-grep rule **possible** for the first time (today the idiom and
|
|
162
|
+
the bug are byte-identical, so #1158 can't distinguish them; an *un-migrated*
|
|
163
|
+
`.replace` after the primitive exists is detectable). Then push normalization to
|
|
164
|
+
the four ingest boundaries — **persisted-key rehydrate** (snapshot / word-index /
|
|
165
|
+
call-graph / review-graph symbol keys written on Windows, read on Linux CI) is the
|
|
166
|
+
hot one — so interior code can once again trust host-default `path` fns. Full P1–P5
|
|
167
|
+
plan + enforcement in #1193; the latest missed member fixed in #1194.
|