pi-lens 4.4.7 → 4.4.9
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-USER.md +31 -0
- package/CHANGELOG.md +327 -0
- package/README.md +13 -2
- package/config/dependency-cruiser-eager-allowlist.json +1 -1
- package/config/markdownlint/run-no-fix.mjs +36 -0
- package/dist/{chunk-4LM3VAZH.js → chunk-2VZ3VN3N.js} +2 -2
- package/dist/{chunk-PUZ3E2J4.js → chunk-3HTZDY3C.js} +8 -6
- package/dist/{chunk-RORGS5II.js → chunk-3NPWO5UO.js} +7 -13
- package/dist/{chunk-MNJIXFX4.js → chunk-47UCC4MM.js} +1 -1
- package/dist/chunk-4ENEJHF4.js +198 -0
- package/dist/chunk-5GEYJJHG.js +22 -0
- package/dist/{chunk-U6VN4NVL.js → chunk-5YSEQHJN.js} +3 -3
- package/dist/{chunk-6IR3ZYIB.js → chunk-6GPB3JLL.js} +3 -3
- package/dist/{chunk-MB6PXBUA.js → chunk-7R5GZIA6.js} +7 -15
- package/dist/{chunk-DH5JPM3K.js → chunk-7UTSNTWM.js} +10 -9
- package/dist/{chunk-24BILSZW.js → chunk-7YTRG6YW.js} +2 -2
- package/dist/{chunk-KW5JQPO5.js → chunk-AACN5GNE.js} +2 -2
- package/dist/{chunk-PKES3ISE.js → chunk-ACRJ2GZ5.js} +2 -2
- package/dist/{chunk-4ZYJHQMB.js → chunk-C3YRO3EU.js} +10 -12
- package/dist/{chunk-PQJFG24Z.js → chunk-CB7PEVOJ.js} +1300 -946
- package/dist/{chunk-ABPKUVA4.js → chunk-CDFJF5YD.js} +1 -1
- package/dist/{chunk-T7A2HK2B.js → chunk-CJS6WE66.js} +17 -18
- package/dist/{chunk-3YY7IXIL.js → chunk-CM6BDY4E.js} +14 -60
- package/dist/{chunk-RZOXUSPC.js → chunk-CZCAZVTD.js} +16 -2
- package/dist/chunk-DGKFWQK4.js +23 -0
- package/dist/{chunk-NA7SEXHE.js → chunk-E65WJVI5.js} +7 -9
- package/dist/{chunk-2TF6RXWB.js → chunk-EKNYSXFB.js} +8 -10
- package/dist/{chunk-RRV3FNNM.js → chunk-EY6LY2HO.js} +27 -30
- package/dist/{chunk-LBLBAFG3.js → chunk-F6BEQWAK.js} +17 -5
- package/dist/{chunk-4L36HG27.js → chunk-FGNSESAC.js} +12 -14
- package/dist/{chunk-3FRLWYBG.js → chunk-FRUBVFXV.js} +39 -42
- package/dist/{chunk-FB5SCCPT.js → chunk-G22UNQID.js} +14 -15
- package/dist/{chunk-LV4UMYVH.js → chunk-GQTQUNCG.js} +26 -27
- package/dist/{chunk-E7HJ56Y7.js → chunk-H3BVMK47.js} +64 -73
- package/dist/chunk-H6FLQ5NW.js +28 -0
- package/dist/{chunk-QHSNL7B2.js → chunk-HEA3EM23.js} +15 -19
- package/dist/{chunk-AWDSEDER.js → chunk-HSOBIN22.js} +2 -2
- package/dist/{chunk-EAOK7MIZ.js → chunk-HYSKJMZK.js} +17 -4
- package/dist/{chunk-VUZWQ7UG.js → chunk-IICERRFF.js} +46 -72
- package/dist/{chunk-OXOI55RU.js → chunk-IILEH3ZC.js} +8 -10
- package/dist/{chunk-ZKXQKGWZ.js → chunk-J3Q2NYJR.js} +4 -3
- package/dist/{chunk-YHC2O2WO.js → chunk-JUZ67QZQ.js} +20 -9
- package/dist/chunk-KR5VGMVT.js +25 -0
- package/dist/{chunk-F7K5IBZG.js → chunk-KV6GQOGN.js} +41 -44
- package/dist/{chunk-SNDXCFRS.js → chunk-KXMJLOZF.js} +25 -23
- package/dist/{chunk-CB4WHS4H.js → chunk-L4Y3ROKQ.js} +3 -3
- package/dist/{chunk-3F6BMY53.js → chunk-L6WBJGQS.js} +1 -1
- package/dist/{chunk-MPKRJBPK.js → chunk-L7O774U7.js} +30 -32
- package/dist/{chunk-URCQWAQ4.js → chunk-LAHHGNAY.js} +21 -21
- package/dist/{chunk-V63BC55Q.js → chunk-LT62P654.js} +1 -1
- package/dist/{chunk-ZMAUPOMG.js → chunk-LWOM6LVS.js} +34 -34
- package/dist/{chunk-HO6LWE2E.js → chunk-MKPDIAZH.js} +21 -1
- package/dist/{chunk-2PHMIAKO.js → chunk-MN635QYA.js} +3 -4
- package/dist/{chunk-KDX35VXP.js → chunk-MQ4PPCJB.js} +166 -149
- package/dist/{chunk-QOE342SU.js → chunk-MRLH4MYU.js} +2 -2
- package/dist/{chunk-CE6VMBCB.js → chunk-N56BNAA6.js} +20 -21
- package/dist/{chunk-L3CMBQMH.js → chunk-N5CEGQPG.js} +14 -17
- package/dist/{chunk-7E2563GA.js → chunk-NCLO6E6N.js} +13 -33
- package/dist/{chunk-J6JP25XU.js → chunk-NL5LSKVD.js} +4 -3
- package/dist/{chunk-U7BD2QL7.js → chunk-NMUSOZ2D.js} +10 -12
- package/dist/{chunk-BZARLRJW.js → chunk-NOWH2VA2.js} +8 -33
- package/dist/{chunk-U2SDMG7C.js → chunk-NUSXS6YB.js} +6 -5
- package/dist/{chunk-ZJTT47IG.js → chunk-OSEKJEUU.js} +2 -2
- package/dist/{chunk-FZKFVUEC.js → chunk-OUYAUXAT.js} +647 -355
- package/dist/{chunk-ZE3KXHS7.js → chunk-PBZNYHMM.js} +84 -4
- package/dist/{chunk-U5HPROLA.js → chunk-PIIUNJIT.js} +2 -4
- package/dist/chunk-PKLB2XJL.js +8 -0
- package/dist/{chunk-RC2Z6K47.js → chunk-PRHYIA6X.js} +15 -6
- package/dist/{chunk-RQS4QQSD.js → chunk-PXQ45SGD.js} +2 -2
- package/dist/chunk-Q6JQKWPK.js +25 -0
- package/dist/{chunk-F6X3YJWD.js → chunk-QB7T2PHK.js} +2 -2
- package/dist/{chunk-TIQJPRDD.js → chunk-QGITU23N.js} +3 -2
- package/dist/chunk-QJJKOHLH.js +57 -0
- package/dist/{chunk-4LOE5R5P.js → chunk-QP33NKYC.js} +18 -15
- package/dist/{chunk-N5WSK2K7.js → chunk-QVBOXT3L.js} +12 -17
- package/dist/{chunk-DPGEAHZT.js → chunk-RNJFRXEN.js} +10 -18
- package/dist/{chunk-EKWX4WD3.js → chunk-RNXOWDM6.js} +10 -10
- package/dist/{chunk-O4BJFESU.js → chunk-RTFMDIKV.js} +1 -1
- package/dist/{chunk-LS3QJRUB.js → chunk-SIQHOB6P.js} +11 -13
- package/dist/{chunk-3K2F6UDZ.js → chunk-SLSMJPEF.js} +43 -42
- package/dist/chunk-T5QSLSMM.js +50 -0
- package/dist/chunk-TGQDAG4B.js +88 -0
- package/dist/{chunk-4YHYPW2G.js → chunk-THYHUIDR.js} +44 -13
- package/dist/{chunk-YVHBNSME.js → chunk-TMNUTMT5.js} +1099 -1100
- package/dist/{chunk-WDBICWH3.js → chunk-TOE2RRCS.js} +1 -1
- package/dist/chunk-TYHPVE5H.js +25 -0
- package/dist/chunk-UAKO2M6B.js +73 -0
- package/dist/chunk-UC5AXW5Z.js +20 -0
- package/dist/chunk-UTJP6WOS.js +28 -0
- package/dist/{chunk-DQZFQSR5.js → chunk-UXTQ3QPD.js} +4 -4
- package/dist/chunk-UYXV5NIS.js +20 -0
- package/dist/{chunk-KKCK636N.js → chunk-V2WDBOLZ.js} +10 -12
- package/dist/{chunk-PR6PO3ES.js → chunk-V67D6TMU.js} +22 -20
- package/dist/{chunk-VSFLRN5Y.js → chunk-VCRVNLE7.js} +135 -2
- package/dist/{chunk-CPSR3AVL.js → chunk-VO4JFPTV.js} +2 -2
- package/dist/{chunk-XT2HTCJ5.js → chunk-VWLSU3XV.js} +6 -5
- package/dist/{chunk-WME2OQST.js → chunk-W5E72HJA.js} +66 -24
- package/dist/{chunk-LLS45EWB.js → chunk-W7TY6HYX.js} +6 -8
- package/dist/{chunk-CCV2EU7T.js → chunk-WSSLVMDA.js} +12 -13
- package/dist/{chunk-YISME6ON.js → chunk-WTB4GKMH.js} +10 -1
- package/dist/{chunk-KPPJTH44.js → chunk-X5BJ3G2P.js} +64 -35
- package/dist/{chunk-JMEKXFOL.js → chunk-XKFO2SZV.js} +39 -34
- package/dist/{chunk-HR3OJ3TH.js → chunk-XLAI7UYY.js} +84 -31
- package/dist/{chunk-H7OR7DFZ.js → chunk-XO756WE5.js} +53 -37
- package/dist/{chunk-F5Z6URKM.js → chunk-XVB3Q2PG.js} +2 -4
- package/dist/{chunk-R5MOQM2H.js → chunk-YOXCCJDF.js} +607 -366
- package/dist/{chunk-ZGSJDWQU.js → chunk-ZCQBNPRH.js} +2 -2
- package/dist/chunk-ZD4KVFXI.js +234 -0
- package/dist/{chunk-WGRJOXED.js → chunk-ZDMFGACN.js} +1295 -966
- package/dist/{chunk-OSTKYB55.js → chunk-ZMMHHXSW.js} +1 -1
- package/dist/{chunk-75GAYVNO.js → chunk-ZPM7ZIFL.js} +6 -6
- package/dist/{chunk-LUBPZN36.js → chunk-ZVCDHYWZ.js} +9 -11
- package/dist/{chunk-Y7F7IEE3.js → chunk-ZZN74OGD.js} +102 -7
- package/dist/{chunk-L5JYIU47.js → chunk-ZZSJAR76.js} +39 -20
- package/dist/index.js +10933 -8644
- package/dist/mcp/analyze-cli.js +12 -17
- package/dist/mcp/cli.js +43 -42
- package/dist/mcp/server.js +3073 -1147
- package/dist/mcp/worker.js +61 -61
- package/dist/probes/installer.js +18 -19
- package/docs/adr/0003-git-guard-latch-writer.md +11 -6
- package/docs/agent-tools.md +58 -16
- package/docs/alignment-families.md +29 -0
- package/docs/analysisall.md +1 -1
- package/docs/ast-grep_rules_catalog.md +6 -4
- package/docs/ci-bot-pr-checks.md +128 -0
- package/docs/configuration.md +150 -12
- package/docs/defect-shapes.md +107 -15
- package/docs/engineering-principles.md +27 -2
- package/docs/environment-variables.md +18 -1
- package/docs/features.md +14 -7
- package/docs/globalconfig.md +11 -3
- package/docs/invariants/git-guard-host.md +7 -3
- package/docs/invariants/language-config.md +15 -4
- package/docs/invariants/lsp-trust-exec.md +25 -4
- package/docs/invariants/paths-os.md +4 -2
- package/docs/invariants/session-telemetry.md +2 -2
- package/docs/language-coverage.md +1 -0
- package/docs/lsp-capability-matrix.md +167 -65
- package/docs/lsp-idle-eviction.md +4 -1
- package/docs/merge-queue-rollout.md +10 -8
- package/docs/module-report-read-symbol.md +34 -23
- package/docs/pi-lens-fixer.md +34 -17
- package/docs/pi-lens-investigator.md +3 -0
- package/docs/pi-lens-merge-policy.md +34 -17
- package/docs/pi-lens-monitor.md +9 -0
- package/docs/pi-lens-orchestration.md +4 -1
- package/docs/pi-lens-reviewer.md +6 -6
- package/docs/pi-lens-subagent.md +19 -3
- package/docs/public-api-stability.md +57 -7
- package/docs/release-qa-baseline.md +7 -4
- package/docs/schema/pi-lens-config-v1.json +21 -2
- package/docs/servercapabilities.md +3 -1
- package/docs/settings.md +11 -7
- package/docs/word-index.md +20 -7
- package/package.json +11 -4
- package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
- package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
- package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
- package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
- package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
- package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
- package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
- package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
- package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
- package/scripts/download-grammars.js +3 -2
- package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
- package/dist/chunk-46TNM7XZ.js +0 -88
- package/dist/chunk-72OKUXSD.js +0 -31
- package/dist/chunk-7GLOLOSH.js +0 -57
- package/dist/chunk-AKUUMGD5.js +0 -26
- package/dist/chunk-ASUXV767.js +0 -22
- package/dist/chunk-CTADOKYM.js +0 -25
- package/dist/chunk-GNSIWBAT.js +0 -106
- package/dist/chunk-HWDAVBFU.js +0 -49
- package/dist/chunk-JJ2RRESP.js +0 -58
- package/dist/chunk-KXF5R4UN.js +0 -48
- package/dist/chunk-LSC3VADM.js +0 -23
- package/dist/chunk-OE5ZBP7F.js +0 -443
- package/dist/chunk-SHLDT3OI.js +0 -27
- package/dist/chunk-UF7RTZSO.js +0 -27
- package/dist/chunk-W4WP2ERB.js +0 -30
- package/dist/chunk-YES5CACN.js +0 -73
- package/dist/chunk-Z2XAOKHK.js +0 -136
package/docs/settings.md
CHANGED
|
@@ -150,13 +150,14 @@ field docs.
|
|
|
150
150
|
| `ignore` | global + project | `[]` | Gitignore-style globs excluded from every scan |
|
|
151
151
|
| `widget.visible` | global | `true` | Whether the diagnostics widget shows at session start |
|
|
152
152
|
| `dispatch.runnerTimeoutFloorMs` | global | none (no floor) | Minimum wall-clock budget per dispatch runner |
|
|
153
|
+
| `dispatch.disabledRunners` | global + project | `[]` | Dispatch runner ids that never run (for example `["dotnet-build"]`). A denial: the union of every tier, so a project can add but never re-enable. Unknown ids are dropped with a warning. See [configuration](configuration.md#dispatchdisabledrunners--turning-a-dispatch-runner-off) |
|
|
153
154
|
| `format.mode` | global | `"deferred"` | `"deferred"` (at `agent_end`) or `"immediate"` |
|
|
154
155
|
| `actionableWarnings.autoFix.maxFixes` | global | `5` | Cap on quickfixes applied per turn (`0` = report only) |
|
|
155
156
|
| `rules.high-complexity.threshold` | project | `15` | Cyclomatic-complexity threshold |
|
|
156
157
|
| `rules.high-fan-out.threshold` | project | `20` | Distinct-function-call threshold |
|
|
157
|
-
| `rules.<id>.disable` | global + project | absent | Disable diagnostics for a rule (output-only filter, project-wide; same normalization as `pi-lens-ignore`) |
|
|
158
|
-
| `rules.<id>.select` | project | absent | Allowlist of rule ids (output-only filter, project-wide across every key; disable wins over select) |
|
|
159
|
-
| `rules.<id>.ignorePaths` | global + project | `[]` | Experimental rule-scoped
|
|
158
|
+
| `rules.<id>.disable` | global + project | absent | Disable diagnostics for a rule (output-only filter, project-wide; same normalization as `pi-lens-ignore`). Read per file from its nearest `.pi-lens.json`, so a nested file governs the files under it. A denial: the union of every tier (global, root and nested files), so a nearer file can add rules but never re-enable one. See [configuration](configuration.md#rulesid--read-from-each-files-own-config) |
|
|
159
|
+
| `rules.<id>.select` | global + project | absent | Allowlist of rule ids (output-only filter, project-wide across every key; disable wins over select). Not a denial: per grouping key, the nearest file that sets it supplies the whole list, and a global `select` applies to a key no nearer file sets. Lists under different keys are unioned |
|
|
160
|
+
| `rules.<id>.ignorePaths` | global + project | `[]` | Experimental rule-scoped path entries matched like the `ignore` field: gitignore rules, relative to the directory of the file that declares them (the project root for a global entry). A later entry beats an earlier one, `!` re-includes, a leading `/` roots the entry at that directory, a trailing `/` names a directory, and an entry with no slash matches at any depth below it. Matching files skip that rule's scan and output. Entries are monotonic across files: a `!` re-includes only against the entries of its own file, and a nearer file never lifts another file's carve-out. Changed from earlier releases, which matched each entry as a plain glob: a `!` entry used to hide every path its glob did not name, and a leading `/` or trailing `/` matched nothing; they now follow gitignore. An entry with a slash keeps its meaning, and a slashless entry such as `*.gen.ts` now also matches below the root. See the [configuration reference](./configuration.md#rulesid--read-from-each-files-own-config). |
|
|
160
161
|
| `maxProjectFiles` | project | `2000` | Base scale knob; derives five subsystem size budgets |
|
|
161
162
|
| `reviewGraph.maxFiles` | project | derived (clamped `100`–`20000`) | Explicit review-graph file budget |
|
|
162
163
|
| `trivy.enabled` / `trivy.minSeverity` | project | off | Opt-in Trivy vulnerability scanning |
|
|
@@ -169,7 +170,7 @@ field docs.
|
|
|
169
170
|
User-level. The file is selected by the [global-location table](configuration.md#global-config-location)
|
|
170
171
|
and applies to **every** project. It honors **all** flag keys from the
|
|
171
172
|
table above plus the non-flag global knobs (`ignore`, `widget.visible`,
|
|
172
|
-
`dispatch.runnerTimeoutFloorMs`, `format.mode`,
|
|
173
|
+
`dispatch.runnerTimeoutFloorMs`, `dispatch.disabledRunners`, `format.mode`,
|
|
173
174
|
`actionableWarnings.autoFix.maxFixes`). On Windows the path is
|
|
174
175
|
`%USERPROFILE%\.pi-lens\config.json`.
|
|
175
176
|
|
|
@@ -219,9 +220,12 @@ Most toggles are **global-only**. Putting a global-only key such as
|
|
|
219
220
|
`"lsp": { "enabled": false }` in a `.pi-lens.json` is **not** honored at project
|
|
220
221
|
scope — pi-lens logs a one-time warning saying so (rather than silently doing
|
|
221
222
|
nothing) and you should set it in `~/.pi-lens/config.json` or pass the CLI flag
|
|
222
|
-
instead.
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
instead. `dispatch` is mixed-scope: `dispatch.disabledRunners` is honored in a
|
|
224
|
+
project file, while `dispatch.runnerTimeoutFloorMs` stays global-only and is
|
|
225
|
+
reported as such. Foreign LSP-loader namespaces that a shared file legitimately
|
|
226
|
+
carries (`servers`, `serverOverrides`, `disabledServers`, `warmFiles`) and
|
|
227
|
+
`$schema` are tolerated without warning; anything else is logged once as a
|
|
228
|
+
likely typo.
|
|
225
229
|
|
|
226
230
|
```json
|
|
227
231
|
{
|
package/docs/word-index.md
CHANGED
|
@@ -53,8 +53,9 @@ parsed by `parseWordIndexQuery` (`clients/word-index.ts`) before tokenization:
|
|
|
53
53
|
- `file:<substr>` — path substring match against the index's own stored path,
|
|
54
54
|
normalized through `wordIndexKey` (case-folded on win32 only, matching how
|
|
55
55
|
the index's own path-keyed maps already fold win32 paths, #1025).
|
|
56
|
-
- `ext:<ext>` —
|
|
57
|
-
equivalent
|
|
56
|
+
- `ext:<ext>` — path-suffix match on the index's display path, case-insensitive,
|
|
57
|
+
leading dot optional (`ext:ts` and `ext:.ts` are equivalent; `ext:test.ts`
|
|
58
|
+
matches `foo.test.ts`; `ext:ts` does not match `foo.tsx`).
|
|
58
59
|
- Any filter may be negated with a leading `-` (`-file:test`).
|
|
59
60
|
|
|
60
61
|
Example: `lang:jsts file:clients/ -file:test rank`. Multiple positive filters
|
|
@@ -137,11 +138,23 @@ rebuild:
|
|
|
137
138
|
files by identifier → `module_report` explains one → `read_symbol` reads
|
|
138
139
|
the exact body. See [docs/module-report-read-symbol.md](module-report-read-symbol.md)
|
|
139
140
|
for the second half of that chain.
|
|
140
|
-
- **
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
`file
|
|
141
|
+
- **One rendered table (#5104)**: both surfaces print a header, one row per
|
|
142
|
+
hit, and a footer, rendered by `renderCompactSymbolSearch()` in
|
|
143
|
+
`clients/lens-engine.ts` — neither appends a JSON payload or a fenced
|
|
144
|
+
block. A row is
|
|
145
|
+
` 1. <file> <startLine> (score 0.82, 3 hit(s)[, fanIn 4][, complexity 7])`:
|
|
146
|
+
the path relative to the query's `cwd`, the hit's single best-matching line,
|
|
147
|
+
the BM25 score and hit count, then the graph annotations when the cached
|
|
148
|
+
review graph is warm (`fanIn 0` means no known importers, so it prints).
|
|
149
|
+
`startLine` and `endLine` are that one line — no synthesized whole-file
|
|
150
|
+
span — so read it with `offset=startLine, limit=1`, or call `module_report`
|
|
151
|
+
on `file` for the real outline. The footer carries index coverage
|
|
152
|
+
(`capped — results may be incomplete` on a truncated index), the MCP-only
|
|
153
|
+
staleness note below, and one next-step line naming the top-ranked hit
|
|
154
|
+
(`module_report <file>` on pi, `pilens_module_report <file>` on MCP). On pi, `details`
|
|
155
|
+
keeps `{ available, query, count, coverage }` (MCP has no `details`); the rows carry everything the
|
|
156
|
+
dropped JSON did (annotations, and the next step that replaces
|
|
157
|
+
`suggestedNext`).
|
|
145
158
|
- **Staleness hint (MCP only, #536)**: `symbolSearch()` returns
|
|
146
159
|
`snapshotGeneratedAt` (the backing project snapshot's `generatedAt`); the
|
|
147
160
|
MCP handler turns an old timestamp into a human staleness note
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-lens",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
"audit:tree-sitter": "node scripts/audit-tree-sitter-rules.mjs",
|
|
50
50
|
"audit:rule-catalog": "node scripts/validate-rule-catalog.mjs",
|
|
51
51
|
"audit:astgrep-rule-pairs": "node scripts/audit-astgrep-rule-pairs.mjs",
|
|
52
|
-
"astgrep:self-scan": "node scripts/run-astgrep-pi-lens.mjs",
|
|
52
|
+
"astgrep:self-scan": "node scripts/run-astgrep-pi-lens.mjs && node scripts/run-astgrep-pi-lens.mjs --suite governance",
|
|
53
|
+
"astgrep:governance": "node scripts/run-astgrep-pi-lens.mjs --suite governance",
|
|
54
|
+
"astgrep:governance:update-baseline": "node scripts/run-astgrep-pi-lens.mjs --suite governance --update-baseline",
|
|
53
55
|
"lane:check": "node scripts/lane-check.mjs",
|
|
54
56
|
"astgrep:self-scan:update-baseline": "node scripts/run-astgrep-pi-lens.mjs --update-baseline",
|
|
55
57
|
"audit:playground": "node scripts/playground-verify-rule.mjs",
|
|
@@ -124,6 +126,7 @@
|
|
|
124
126
|
"scripts/rpc-load-check.mjs",
|
|
125
127
|
"README.md",
|
|
126
128
|
"CHANGELOG.md",
|
|
129
|
+
"CHANGELOG-USER.md",
|
|
127
130
|
"banner.svg",
|
|
128
131
|
"banner.png"
|
|
129
132
|
],
|
|
@@ -131,9 +134,9 @@
|
|
|
131
134
|
"@ast-grep/cli": "0.51.0",
|
|
132
135
|
"@ast-grep/napi": "^0.51.0",
|
|
133
136
|
"js-yaml": "^5.2.2",
|
|
134
|
-
"minimatch": "^
|
|
137
|
+
"minimatch": "^11.0.4",
|
|
135
138
|
"pidusage": "^4.0.1",
|
|
136
|
-
"vscode-jsonrpc": "^
|
|
139
|
+
"vscode-jsonrpc": "^10.0.0"
|
|
137
140
|
},
|
|
138
141
|
"peerDependencies": {
|
|
139
142
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -156,6 +159,7 @@
|
|
|
156
159
|
"web-tree-sitter": "0.25.10"
|
|
157
160
|
},
|
|
158
161
|
"pi": {
|
|
162
|
+
"changelogPath": "CHANGELOG-USER.md",
|
|
159
163
|
"extensions": [
|
|
160
164
|
"./dist/index.js"
|
|
161
165
|
],
|
|
@@ -171,6 +175,9 @@
|
|
|
171
175
|
"protobufjs@7.6.6": true
|
|
172
176
|
},
|
|
173
177
|
"overrides": {
|
|
178
|
+
"@stryker-mutator/core": {
|
|
179
|
+
"minimatch": "$minimatch"
|
|
180
|
+
},
|
|
174
181
|
"qs": "^6.15.4",
|
|
175
182
|
"undici": "^8.12.2"
|
|
176
183
|
}
|
|
@@ -2,7 +2,44 @@ id: no-accumulating-spread-js
|
|
|
2
2
|
valid:
|
|
3
3
|
- 'arr.reduce((acc, item) => { acc.push(item); return acc }, [])'
|
|
4
4
|
- 'arr.flatMap(item => [item])'
|
|
5
|
+
# #5093: a copy made once, outside a reduce callback, is not a per-pass copy.
|
|
6
|
+
- 'const copy = Object.assign({}, acc)'
|
|
7
|
+
- 'const copy = Array.from(acc)'
|
|
8
|
+
- 'const copy = acc.slice()'
|
|
9
|
+
# #5093: mutating the accumulator is not a copy.
|
|
10
|
+
- 'arr.reduce((acc, item) => Object.assign(acc, item), {})'
|
|
11
|
+
- 'arr.reduce((acc, item) => { acc.concat(item); return acc }, [])'
|
|
12
|
+
# #5093 binding guard: the copied value must be the accumulator itself.
|
|
13
|
+
- 'arr.reduce((acc, item) => Array.from(item), [])'
|
|
14
|
+
- 'arr.reduce((acc, item) => [].concat(item), [])'
|
|
15
|
+
- 'arr.reduce((acc, item) => item.slice(), [])'
|
|
16
|
+
- 'arr.reduce((acc, item) => Object.assign({}, item, { k: 1 }), {})'
|
|
5
17
|
invalid:
|
|
6
18
|
- 'arr.reduce((acc, item) => [...acc, item], [])'
|
|
7
19
|
- 'arr.reduce((acc, item) => [...acc, ...item], [])'
|
|
8
20
|
- 'arr.reduce(function (acc, item) { return [...acc, item] }, [])'
|
|
21
|
+
# #5093: non-spread copies of the accumulator, expression bodies.
|
|
22
|
+
- 'arr.reduce((acc, item) => Object.assign({}, acc, { [item.k]: item.v }), {})'
|
|
23
|
+
- 'arr.reduce((acc, item) => Object.assign({}, acc), {})'
|
|
24
|
+
- 'arr.reduce((acc, item) => Array.from(acc), [])'
|
|
25
|
+
- 'arr.reduce((acc, item) => [].concat(acc, item), [])'
|
|
26
|
+
- 'arr.reduce((acc, item) => [].concat(acc), [])'
|
|
27
|
+
- 'arr.reduce((acc, item) => acc.concat(item), [])'
|
|
28
|
+
- 'arr.reduce((acc, item) => acc.concat(item.children), [])'
|
|
29
|
+
- 'arr.reduce((acc, item) => acc.slice(), [])'
|
|
30
|
+
# #5093: the same copies as the only statement of an arrow block body.
|
|
31
|
+
- 'arr.reduce((acc, item) => { return Object.assign({}, acc, { [item.k]: item.v }) }, {})'
|
|
32
|
+
- 'arr.reduce((acc, item) => { return Object.assign({}, acc) }, {})'
|
|
33
|
+
- 'arr.reduce((acc, item) => { return Array.from(acc) }, [])'
|
|
34
|
+
- 'arr.reduce((acc, item) => { return [].concat(acc, item) }, [])'
|
|
35
|
+
- 'arr.reduce((acc, item) => { return [].concat(acc) }, [])'
|
|
36
|
+
- 'arr.reduce((acc, item) => { return acc.concat(item) }, [])'
|
|
37
|
+
- 'arr.reduce((acc, item) => { return acc.slice() }, [])'
|
|
38
|
+
# #5093: the same copies as the only statement of a function body.
|
|
39
|
+
- 'arr.reduce(function (acc, item) { return Object.assign({}, acc, { k: item }) }, {})'
|
|
40
|
+
- 'arr.reduce(function (acc, item) { return Object.assign({}, acc) }, {})'
|
|
41
|
+
- 'arr.reduce(function (acc, item) { return Array.from(acc) }, [])'
|
|
42
|
+
- 'arr.reduce(function (acc, item) { return [].concat(acc, item) }, [])'
|
|
43
|
+
- 'arr.reduce(function (acc, item) { return [].concat(acc) }, [])'
|
|
44
|
+
- 'arr.reduce(function (acc, item) { return acc.concat(item) }, [])'
|
|
45
|
+
- 'arr.reduce(function (acc, item) { return acc.slice() }, [])'
|
|
@@ -3,6 +3,17 @@ valid:
|
|
|
3
3
|
- 'arr.filter(fn)'
|
|
4
4
|
- 'arr.map(fn)'
|
|
5
5
|
- 'arr.flatMap(fn)'
|
|
6
|
+
# #5094: this rule is the identity filter only. A generic filter().map()
|
|
7
|
+
# chain is the filter-then-map hint (warning here was over-matching).
|
|
8
|
+
- 'arr.filter(onlyPositive).map(double)'
|
|
9
|
+
- 'arr.filter(x => y).map(f)'
|
|
10
|
+
- 'arr.filter((x: Foo): x is Bar => x !== null).map(g)'
|
|
11
|
+
# #5093: a typed arrow that is not an identity (it reads a field) keeps the chain.
|
|
12
|
+
- 'arr.filter((x: Foo) => x.ok).map(g)'
|
|
6
13
|
invalid:
|
|
7
14
|
- 'arr.filter(x => x).map(fn)'
|
|
8
|
-
- 'arr.filter(
|
|
15
|
+
- 'arr.filter((x) => x).map(fn)'
|
|
16
|
+
- 'arr.filter(Boolean).map(fn)'
|
|
17
|
+
# #5093: a typed identity arrow is the same identity filter.
|
|
18
|
+
- 'arr.filter((x: string | undefined) => x).map(fn)'
|
|
19
|
+
- 'arr.filter((x: Array<string> | null) => x).map(fn)'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
id: filter-then-map-js
|
|
2
|
+
valid:
|
|
3
|
+
- 'arr.filter(fn)'
|
|
4
|
+
- 'arr.map(fn)'
|
|
5
|
+
- 'arr.flatMap(fn)'
|
|
6
|
+
# Not adjacent: the chain is not filter() directly followed by map().
|
|
7
|
+
- 'arr.filter(onlyPositive).slice(0).map(double)'
|
|
8
|
+
invalid:
|
|
9
|
+
- 'arr.filter(onlyPositive).map(double)'
|
|
10
|
+
# JavaScript has no identity-filter warning rule, so the hint covers it too.
|
|
11
|
+
- 'arr.filter(x => x).map(fn)'
|
|
12
|
+
- 'arr.filter((x) => x > 0).map(double)'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
id: filter-then-map
|
|
2
|
+
valid:
|
|
3
|
+
- 'arr.filter(fn)'
|
|
4
|
+
- 'arr.map(fn)'
|
|
5
|
+
- 'arr.flatMap(fn)'
|
|
6
|
+
# Not adjacent: the chain is not filter() directly followed by map().
|
|
7
|
+
- 'arr.filter(onlyPositive).slice(0).map(double)'
|
|
8
|
+
# Identity filters belong to ts-redundant-filter-map (warning), not this hint.
|
|
9
|
+
- 'arr.filter(x => x).map(fn)'
|
|
10
|
+
- 'arr.filter((x) => x).map(fn)'
|
|
11
|
+
- 'arr.filter(Boolean).map(fn)'
|
|
12
|
+
# Type-guard filters narrow the element type; a rewrite would lose that.
|
|
13
|
+
- 'arr.filter((x): x is Foo => x !== null).map(g)'
|
|
14
|
+
- 'arr.filter((x: Foo): x is Bar => x !== null).map(g)'
|
|
15
|
+
- 'arr.filter(async (x): x is Foo => true).map(g)'
|
|
16
|
+
- 'arr.filter(function (x): x is Foo { return x !== null }).map(g)'
|
|
17
|
+
invalid:
|
|
18
|
+
- 'arr.filter(onlyPositive).map(double)'
|
|
19
|
+
- 'arr.filter((x) => x > 0).map(double)'
|
|
20
|
+
# Binding guard: the filter's parameter is not the value it returns.
|
|
21
|
+
- 'arr.filter(x => y).map(f)'
|
|
22
|
+
- 'arr.filter(x => x !== null).map(f)'
|
|
23
|
+
# Binding guard: an annotation alone is not a type predicate.
|
|
24
|
+
- 'arr.filter((x): boolean => x > 0).map(f)'
|
|
25
|
+
- 'arr.filter((x: number) => x > 0).map(f)'
|
|
@@ -1,11 +1,59 @@
|
|
|
1
1
|
id: no-accumulating-spread-js
|
|
2
2
|
language: JavaScript
|
|
3
|
-
message: "
|
|
3
|
+
message: "Copying the reduce accumulator each pass can be O(n^2) when it grows (spread, concat, slice, Array.from, Object.assign); build the result with push/flatMap, or mutate only an accumulator the reduce owns"
|
|
4
4
|
severity: warning
|
|
5
5
|
metadata:
|
|
6
6
|
category: performance
|
|
7
|
+
note: |
|
|
8
|
+
A reduce callback that returns a fresh copy of its own accumulator does the
|
|
9
|
+
copy on every pass. Each copy costs as much as the accumulator is long, so the
|
|
10
|
+
loop is O(n^2) when the accumulator grows with the input. A fixed-size
|
|
11
|
+
accumulator, such as `items.reduce((acc, item) => acc.slice(), [0])`, costs
|
|
12
|
+
constant work per copy, so that loop is linear. The shape is still flagged,
|
|
13
|
+
because the copy is wasted work on every pass. Flags the spread copies, and
|
|
14
|
+
the non-spread copies `Object.assign({}, acc, ...)`, `Array.from(acc)`,
|
|
15
|
+
`[].concat(acc, ...)`, `acc.concat(...)` and `acc.slice()`.
|
|
16
|
+
|
|
17
|
+
Mutating the accumulator also changes the initial value passed to reduce and
|
|
18
|
+
any intermediate snapshot a caller holds. Mutate it only when it is a fresh
|
|
19
|
+
value the reduce owns. When the initial value or a snapshot comes from outside,
|
|
20
|
+
keep the copy, or preserve both when you choose an alternative such as flatMap.
|
|
21
|
+
|
|
22
|
+
Matched only where the callback's single result is the copy (an expression
|
|
23
|
+
body, or a block or function body whose only statement is that `return`), and
|
|
24
|
+
only when the copied value is the accumulator parameter itself. A copy made
|
|
25
|
+
once outside the callback, a mutation such as `acc.push`, and a copy of the
|
|
26
|
+
item are not flagged. A callback with more than one statement is a known miss.
|
|
27
|
+
|
|
28
|
+
The non-spread arms follow dmmulroy/anti-slop's `no-reduce-accumulator-copy`
|
|
29
|
+
(MIT). The text here is written for this catalog, not copied.
|
|
7
30
|
rule:
|
|
8
31
|
any:
|
|
9
32
|
- pattern: $ARR.reduce(($ACC, $ITEM) => [...$ACC, $ITEM], $$$INIT)
|
|
10
33
|
- pattern: $ARR.reduce(($ACC, $ITEM) => [...$ACC, ...$ITEM], $$$INIT)
|
|
11
34
|
- pattern: $ARR.reduce(function($ACC, $ITEM) { return [...$ACC, $ITEM] }, $$$INIT)
|
|
35
|
+
# #5093: non-spread copies of the accumulator, expression body. The comma
|
|
36
|
+
# arms need a zero-rest twin: `, $$$REST` does not match a bare `(acc)`.
|
|
37
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => Object.assign({}, $ACC, $$$REST), $$$INIT)
|
|
38
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => Object.assign({}, $ACC), $$$INIT)
|
|
39
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => Array.from($ACC), $$$INIT)
|
|
40
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => [].concat($ACC, $$$REST), $$$INIT)
|
|
41
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => [].concat($ACC), $$$INIT)
|
|
42
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => $ACC.concat($$$REST), $$$INIT)
|
|
43
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => $ACC.slice(), $$$INIT)
|
|
44
|
+
# #5093: the same copies as the only statement of an arrow block body.
|
|
45
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return Object.assign({}, $ACC, $$$REST) }, $$$INIT)
|
|
46
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return Object.assign({}, $ACC) }, $$$INIT)
|
|
47
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return Array.from($ACC) }, $$$INIT)
|
|
48
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return [].concat($ACC, $$$REST) }, $$$INIT)
|
|
49
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return [].concat($ACC) }, $$$INIT)
|
|
50
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return $ACC.concat($$$REST) }, $$$INIT)
|
|
51
|
+
- pattern: $ARR.reduce(($ACC, $ITEM) => { return $ACC.slice() }, $$$INIT)
|
|
52
|
+
# #5093: the same copies as the only statement of a function body.
|
|
53
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return Object.assign({}, $ACC, $$$REST) }, $$$INIT)
|
|
54
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return Object.assign({}, $ACC) }, $$$INIT)
|
|
55
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return Array.from($ACC) }, $$$INIT)
|
|
56
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return [].concat($ACC, $$$REST) }, $$$INIT)
|
|
57
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return [].concat($ACC) }, $$$INIT)
|
|
58
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return $ACC.concat($$$REST) }, $$$INIT)
|
|
59
|
+
- pattern: $ARR.reduce(function($ACC, $ITEM) { return $ACC.slice() }, $$$INIT)
|
|
@@ -59,8 +59,7 @@ note: |
|
|
|
59
59
|
`SELECT` and `WITH` arms carry no word boundary, so
|
|
60
60
|
`job.execute("selected from " + source)` still flags there, and its
|
|
61
61
|
skip accepts real whitespace only, so an escaped `"\nSELECT ..."` is a
|
|
62
|
-
miss there.
|
|
63
|
-
the rest of the alternation byte-identical to the sibling's copy.
|
|
62
|
+
miss there.
|
|
64
63
|
|
|
65
64
|
Cost (#4804 review, measured on this head for the shared statement
|
|
66
65
|
test): 2.2 to 23.7 ms per scanned file, 231 to 468 of 2,687 JS/TS files
|
|
@@ -59,8 +59,7 @@ note: |
|
|
|
59
59
|
`SELECT` and `WITH` arms carry no word boundary, so
|
|
60
60
|
`job.execute("selected from " + source)` still flags there, and its
|
|
61
61
|
skip accepts real whitespace only, so an escaped `"\nSELECT ..."` is a
|
|
62
|
-
miss there.
|
|
63
|
-
the rest of the alternation byte-identical to the sibling's copy.
|
|
62
|
+
miss there.
|
|
64
63
|
|
|
65
64
|
Cost (#4804 review, measured on this head for the shared statement
|
|
66
65
|
test): 2.2 to 23.7 ms per scanned file, 231 to 468 of 2,687 JS/TS files
|
|
@@ -2,9 +2,17 @@ id: ts-redundant-filter-map
|
|
|
2
2
|
language: typescript
|
|
3
3
|
severity: warning
|
|
4
4
|
message: arr.filter(x => x).map(...) - use flatMap or a single pass
|
|
5
|
+
note: |
|
|
6
|
+
Identity filter only: `arr.filter(x => x).map(f)` and `arr.filter(Boolean).map(f)`.
|
|
7
|
+
A generic `filter(f).map(g)` chain is not flagged: `filter-then-map` ships disabled (#5094).
|
|
5
8
|
metadata:
|
|
6
9
|
weight: 3
|
|
7
10
|
category: slop
|
|
8
11
|
rule:
|
|
9
12
|
kind: call_expression
|
|
10
|
-
|
|
13
|
+
any:
|
|
14
|
+
- pattern: "$ARR.filter(($X) => $X).map($G)"
|
|
15
|
+
# #5093: a typed identity arrow. $T matches any type node; $X must be the returned binding.
|
|
16
|
+
- pattern: "$ARR.filter(($X: $T) => $X).map($G)"
|
|
17
|
+
- pattern: "$ARR.filter($X => $X).map($G)"
|
|
18
|
+
- pattern: "$ARR.filter(Boolean).map($G)"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
id: filter-then-map-js
|
|
2
|
+
language: JavaScript
|
|
3
|
+
severity: hint
|
|
4
|
+
message: "use flatMap or one loop; keep callback order, indexes and filter semantics"
|
|
5
|
+
metadata:
|
|
6
|
+
category: performance
|
|
7
|
+
note: |
|
|
8
|
+
JavaScript twin of `filter-then-map`. Flags every adjacent `filter(f).map(g)`,
|
|
9
|
+
identity filters included, because no JavaScript identity-filter rule exists.
|
|
10
|
+
JavaScript has no type predicates, so the type-guard exclusion is not needed.
|
|
11
|
+
|
|
12
|
+
Shipped disabled (#5094). A reviewer sample of 58 hits (24 of all 524 TypeScript
|
|
13
|
+
hits, 20 of the 92 outside tests, 14 of 87 JavaScript) found 0 clearly worth a
|
|
14
|
+
rewrite and 6 marginal, below the 70% bar. Enable by moving back into `rules/`
|
|
15
|
+
with its fixture.
|
|
16
|
+
rule:
|
|
17
|
+
pattern: "$ARR.filter($F).map($G)"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
id: filter-then-map
|
|
2
|
+
language: TypeScript
|
|
3
|
+
severity: hint
|
|
4
|
+
message: "use flatMap or one loop; keep callback order, indexes and filter semantics"
|
|
5
|
+
metadata:
|
|
6
|
+
category: performance
|
|
7
|
+
note: |
|
|
8
|
+
`filter(f).map(g)` walks the array twice and builds a throwaway array in
|
|
9
|
+
between. `flatMap`, or one loop, does both in one pass. Eager versus lazy is
|
|
10
|
+
partly taste, so this is a hint and never blocks.
|
|
11
|
+
|
|
12
|
+
Shipped disabled (#5094). A reviewer sample of 58 hits (24 of all 524 TypeScript
|
|
13
|
+
hits, 20 of the 92 outside tests, 14 of 87 JavaScript) found 0 clearly worth a
|
|
14
|
+
rewrite and 6 marginal, below the 70% bar. Enable by moving back into `rules/`
|
|
15
|
+
with its fixture.
|
|
16
|
+
|
|
17
|
+
Known gaps: receiver-blind (lodash, jQuery and iterator-helper chains fire), and
|
|
18
|
+
two-parameter or generic type guards are not excluded.
|
|
19
|
+
|
|
20
|
+
Not flagged: an identity filter (`filter(x => x)`, `filter(Boolean)`), which
|
|
21
|
+
`ts-redundant-filter-map` owns at warning; and a type-guard filter (an
|
|
22
|
+
`x is T` predicate), which narrows the element type for the map.
|
|
23
|
+
|
|
24
|
+
The shape follows dmmulroy/anti-slop's `no-array-filter-map` (MIT). The text
|
|
25
|
+
here is written for this catalog, not copied.
|
|
26
|
+
rule:
|
|
27
|
+
pattern: "$ARR.filter($F).map($G)"
|
|
28
|
+
not:
|
|
29
|
+
any:
|
|
30
|
+
- pattern: "$ARR.filter(($X) => $X).map($G)"
|
|
31
|
+
- pattern: "$ARR.filter($X => $X).map($G)"
|
|
32
|
+
- pattern: "$ARR.filter(Boolean).map($G)"
|
|
33
|
+
- pattern: "$ARR.filter(($X): $X is $T => $$$BODY).map($G)"
|
|
34
|
+
- pattern: "$ARR.filter(($X: $TY): $X is $T => $$$BODY).map($G)"
|
|
35
|
+
- pattern: "$ARR.filter(function ($X): $X is $T { $$$BODY }).map($G)"
|
|
36
|
+
- pattern: "$ARR.filter(async ($X): $X is $T => $$$BODY).map($G)"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "Regenerate with `npm run astgrep:self-scan
|
|
2
|
+
"_comment": "Regenerate with `npm run astgrep:self-scan:update-baseline` (this suite only; the governance suite has `npm run astgrep:governance:update-baseline`) AFTER triaging every new entry (fix the underlying finding, or confirm it's a legitimate exception and document why in the same PR). Never regenerate to silently swallow an unreviewed hit.",
|
|
3
3
|
"generatedAt": "2026-08-19T20:44:05.206Z",
|
|
4
4
|
"allowed": []
|
|
5
5
|
}
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
import { createHash } from "node:crypto";
|
|
21
21
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
22
22
|
import { dirname, join } from "node:path";
|
|
23
|
-
import { fileURLToPath
|
|
23
|
+
import { fileURLToPath } from "node:url";
|
|
24
|
+
import { isMainModule } from "./lib/is-main-module.mjs";
|
|
24
25
|
// The pinned tree-sitter-wasms release. Bump this, run `--write-manifest`, and
|
|
25
26
|
// commit the regenerated grammars.lock.json to move to a new grammar set.
|
|
26
27
|
const TREE_SITTER_WASMS_VERSION = "0.1.13";
|
|
@@ -312,7 +313,7 @@ async function main() {
|
|
|
312
313
|
}
|
|
313
314
|
// Only run when invoked directly (not when imported by the provenance check or
|
|
314
315
|
// tests) — the import guard keeps the exported helpers side-effect-free.
|
|
315
|
-
if (import.meta.url
|
|
316
|
+
if (isMainModule(import.meta.url)) {
|
|
316
317
|
main().catch((err) => {
|
|
317
318
|
// Never fail the install — tree-sitter is optional.
|
|
318
319
|
console.warn("Warning: grammar download failed:", err.message);
|
|
@@ -58,12 +58,16 @@ The `operation` values are `definition`, `typeDefinition`, `declaration`, `refer
|
|
|
58
58
|
|
|
59
59
|
For `findSymbol`, pass `query`; optionally narrow with `kinds`, `exactMatch`, `topLevelOnly`, and `maxResults`. `rename_file` uses `newFilePath`. `symbol` resolves a character automatically; `character: -1` requests automatic resolution, and `symbol#N` selects a numbered symbol when the result lists one. `callHierarchyItem` is the object returned by `prepareCallHierarchy` and is required by the incoming/outgoing follow-up calls.
|
|
60
60
|
|
|
61
|
+
**Output is text by default**, the shape a Neovim LSP user sees: a `path:line:col` location list for `definition`, `references`, `implementation` and call hierarchy; `hover`'s markdown (a language-bearing snippet as a fenced code block); an indented `start-end kind name` symbol tree for `documentSymbol` and `findSymbol`; `path:line:col: severity: message` rows for `workspaceDiagnostics`, under a `path (scanned 5m ago)` header per file when the snapshot stamped its age; and the rename summary, or the completed edit list after applying (with a warning when the server dropped a conflicting edit). A call-hierarchy entry prints its call sites on indented `path:line:col` lines under the symbol, and `prepareCallHierarchy` adds a `callHierarchyItem: <json>` line carrying the item verbatim. Pass `view: "json"` only when you need the structured envelope (the pre-text default, byte-identical), for example to parse `locations` or `metadata.searchReads`.
|
|
62
|
+
|
|
63
|
+
An executed `executeCommand` value is the one exception: its payload is the server's arbitrary JSON, so it prints as compact single-line JSON with no line shape of its own. A command the client refused or timed out prints `Not executed: <reason>`, plus a warning that a timed-out command may still be changing files.
|
|
64
|
+
|
|
61
65
|
## Call Hierarchy Pattern
|
|
62
66
|
|
|
63
67
|
```
|
|
64
68
|
// Step 1
|
|
65
69
|
lsp_navigation(operation="prepareCallHierarchy", path="src/api.ts", line=42, character=10)
|
|
66
|
-
// →
|
|
70
|
+
// → symbol line, then `callHierarchyItem: <json>`: pass that JSON back verbatim
|
|
67
71
|
|
|
68
72
|
// Step 2
|
|
69
73
|
lsp_navigation(operation="incomingCalls", callHierarchyItem=<item from step 1>)
|
package/dist/chunk-46TNM7XZ.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
_getWarmWordIndexCacheStateForTests,
|
|
4
|
-
_resetWarmWordIndexCacheForTests,
|
|
5
|
-
acquireWarmWordIndex,
|
|
6
|
-
analyzeFile,
|
|
7
|
-
summarizeWarningTiers
|
|
8
|
-
} from "./chunk-WGRJOXED.js";
|
|
9
|
-
import "./chunk-LBLBAFG3.js";
|
|
10
|
-
import "./chunk-MNJIXFX4.js";
|
|
11
|
-
import "./chunk-Y7F7IEE3.js";
|
|
12
|
-
import "./chunk-JJ2RRESP.js";
|
|
13
|
-
import "./chunk-EAOK7MIZ.js";
|
|
14
|
-
import "./chunk-4LM3VAZH.js";
|
|
15
|
-
import "./chunk-E7HJ56Y7.js";
|
|
16
|
-
import "./chunk-V63BC55Q.js";
|
|
17
|
-
import "./chunk-CPSR3AVL.js";
|
|
18
|
-
import "./chunk-ZE3KXHS7.js";
|
|
19
|
-
import "./chunk-RQS4QQSD.js";
|
|
20
|
-
import "./chunk-CB4WHS4H.js";
|
|
21
|
-
import "./chunk-N5WSK2K7.js";
|
|
22
|
-
import "./chunk-7E2563GA.js";
|
|
23
|
-
import "./chunk-MB6PXBUA.js";
|
|
24
|
-
import "./chunk-DQZFQSR5.js";
|
|
25
|
-
import "./chunk-3YY7IXIL.js";
|
|
26
|
-
import "./chunk-WDBICWH3.js";
|
|
27
|
-
import "./chunk-H7OR7DFZ.js";
|
|
28
|
-
import "./chunk-3MED75HT.js";
|
|
29
|
-
import "./chunk-FZKFVUEC.js";
|
|
30
|
-
import "./chunk-XT2HTCJ5.js";
|
|
31
|
-
import "./chunk-XIMYZ3JA.js";
|
|
32
|
-
import "./chunk-R5MOQM2H.js";
|
|
33
|
-
import "./chunk-24BILSZW.js";
|
|
34
|
-
import "./chunk-PR6PO3ES.js";
|
|
35
|
-
import "./chunk-RC2Z6K47.js";
|
|
36
|
-
import "./chunk-F5Z6URKM.js";
|
|
37
|
-
import "./chunk-5W3R6LFT.js";
|
|
38
|
-
import "./chunk-MPKRJBPK.js";
|
|
39
|
-
import "./chunk-DH5JPM3K.js";
|
|
40
|
-
import "./chunk-PKES3ISE.js";
|
|
41
|
-
import "./chunk-ZKXQKGWZ.js";
|
|
42
|
-
import "./chunk-L5JYIU47.js";
|
|
43
|
-
import "./chunk-Z54ZSOBZ.js";
|
|
44
|
-
import "./chunk-U6VN4NVL.js";
|
|
45
|
-
import "./chunk-TIQJPRDD.js";
|
|
46
|
-
import "./chunk-YISME6ON.js";
|
|
47
|
-
import "./chunk-6HWVI6MI.js";
|
|
48
|
-
import "./chunk-O4BJFESU.js";
|
|
49
|
-
import "./chunk-CKEQFGLT.js";
|
|
50
|
-
import "./chunk-HO6LWE2E.js";
|
|
51
|
-
import "./chunk-SNDXCFRS.js";
|
|
52
|
-
import "./chunk-QOE342SU.js";
|
|
53
|
-
import "./chunk-AWDSEDER.js";
|
|
54
|
-
import "./chunk-LLS45EWB.js";
|
|
55
|
-
import "./chunk-2BEMIWEW.js";
|
|
56
|
-
import "./chunk-IJYGIDF4.js";
|
|
57
|
-
import "./chunk-KDX35VXP.js";
|
|
58
|
-
import "./chunk-DPGEAHZT.js";
|
|
59
|
-
import "./chunk-NA7SEXHE.js";
|
|
60
|
-
import "./chunk-3F6BMY53.js";
|
|
61
|
-
import "./chunk-KW5JQPO5.js";
|
|
62
|
-
import "./chunk-PUZ3E2J4.js";
|
|
63
|
-
import "./chunk-ABPKUVA4.js";
|
|
64
|
-
import "./chunk-EKWX4WD3.js";
|
|
65
|
-
import "./chunk-ZGSJDWQU.js";
|
|
66
|
-
import "./chunk-YVHBNSME.js";
|
|
67
|
-
import "./chunk-AWQWXSW4.js";
|
|
68
|
-
import "./chunk-QYF5S6P6.js";
|
|
69
|
-
import "./chunk-RZOXUSPC.js";
|
|
70
|
-
import "./chunk-KPPJTH44.js";
|
|
71
|
-
import "./chunk-J6JP25XU.js";
|
|
72
|
-
import "./chunk-U5HPROLA.js";
|
|
73
|
-
import "./chunk-WME2OQST.js";
|
|
74
|
-
import "./chunk-KXF5R4UN.js";
|
|
75
|
-
import "./chunk-S26LC76R.js";
|
|
76
|
-
import "./chunk-Z2XAOKHK.js";
|
|
77
|
-
import "./chunk-VSFLRN5Y.js";
|
|
78
|
-
import "./chunk-LJDODBBZ.js";
|
|
79
|
-
import "./chunk-OSTKYB55.js";
|
|
80
|
-
import "./chunk-PQJFG24Z.js";
|
|
81
|
-
import "./chunk-NXL4FFQQ.js";
|
|
82
|
-
export {
|
|
83
|
-
_getWarmWordIndexCacheStateForTests,
|
|
84
|
-
_resetWarmWordIndexCacheForTests,
|
|
85
|
-
acquireWarmWordIndex,
|
|
86
|
-
analyzeFile,
|
|
87
|
-
summarizeWarningTiers
|
|
88
|
-
};
|
package/dist/chunk-72OKUXSD.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
calcCyclomaticComplexity,
|
|
4
|
-
functionFactProvider
|
|
5
|
-
} from "./chunk-3YY7IXIL.js";
|
|
6
|
-
import "./chunk-WDBICWH3.js";
|
|
7
|
-
import "./chunk-5W3R6LFT.js";
|
|
8
|
-
import "./chunk-L5JYIU47.js";
|
|
9
|
-
import "./chunk-Z54ZSOBZ.js";
|
|
10
|
-
import "./chunk-U6VN4NVL.js";
|
|
11
|
-
import "./chunk-TIQJPRDD.js";
|
|
12
|
-
import "./chunk-YISME6ON.js";
|
|
13
|
-
import "./chunk-HO6LWE2E.js";
|
|
14
|
-
import "./chunk-KW5JQPO5.js";
|
|
15
|
-
import "./chunk-YVHBNSME.js";
|
|
16
|
-
import "./chunk-RZOXUSPC.js";
|
|
17
|
-
import "./chunk-KPPJTH44.js";
|
|
18
|
-
import "./chunk-J6JP25XU.js";
|
|
19
|
-
import "./chunk-U5HPROLA.js";
|
|
20
|
-
import "./chunk-WME2OQST.js";
|
|
21
|
-
import "./chunk-KXF5R4UN.js";
|
|
22
|
-
import "./chunk-S26LC76R.js";
|
|
23
|
-
import "./chunk-Z2XAOKHK.js";
|
|
24
|
-
import "./chunk-VSFLRN5Y.js";
|
|
25
|
-
import "./chunk-LJDODBBZ.js";
|
|
26
|
-
import "./chunk-PQJFG24Z.js";
|
|
27
|
-
import "./chunk-NXL4FFQQ.js";
|
|
28
|
-
export {
|
|
29
|
-
calcCyclomaticComplexity,
|
|
30
|
-
functionFactProvider
|
|
31
|
-
};
|
package/dist/chunk-7GLOLOSH.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
DependencyChecker,
|
|
4
|
-
buildMadgeArgs,
|
|
5
|
-
resetMadgeManagedPathMemo
|
|
6
|
-
} from "./chunk-N5WSK2K7.js";
|
|
7
|
-
import "./chunk-7E2563GA.js";
|
|
8
|
-
import "./chunk-MB6PXBUA.js";
|
|
9
|
-
import {
|
|
10
|
-
mapWithConcurrency
|
|
11
|
-
} from "./chunk-XIMYZ3JA.js";
|
|
12
|
-
import "./chunk-R5MOQM2H.js";
|
|
13
|
-
import "./chunk-24BILSZW.js";
|
|
14
|
-
import "./chunk-PR6PO3ES.js";
|
|
15
|
-
import "./chunk-RC2Z6K47.js";
|
|
16
|
-
import "./chunk-PKES3ISE.js";
|
|
17
|
-
import "./chunk-ZKXQKGWZ.js";
|
|
18
|
-
import "./chunk-U6VN4NVL.js";
|
|
19
|
-
import "./chunk-TIQJPRDD.js";
|
|
20
|
-
import "./chunk-YISME6ON.js";
|
|
21
|
-
import "./chunk-O4BJFESU.js";
|
|
22
|
-
import "./chunk-CKEQFGLT.js";
|
|
23
|
-
import "./chunk-HO6LWE2E.js";
|
|
24
|
-
import "./chunk-SNDXCFRS.js";
|
|
25
|
-
import "./chunk-QOE342SU.js";
|
|
26
|
-
import "./chunk-2BEMIWEW.js";
|
|
27
|
-
import "./chunk-IJYGIDF4.js";
|
|
28
|
-
import "./chunk-KDX35VXP.js";
|
|
29
|
-
import "./chunk-DPGEAHZT.js";
|
|
30
|
-
import "./chunk-NA7SEXHE.js";
|
|
31
|
-
import "./chunk-3F6BMY53.js";
|
|
32
|
-
import "./chunk-KW5JQPO5.js";
|
|
33
|
-
import "./chunk-PUZ3E2J4.js";
|
|
34
|
-
import "./chunk-ABPKUVA4.js";
|
|
35
|
-
import "./chunk-EKWX4WD3.js";
|
|
36
|
-
import "./chunk-ZGSJDWQU.js";
|
|
37
|
-
import "./chunk-YVHBNSME.js";
|
|
38
|
-
import "./chunk-AWQWXSW4.js";
|
|
39
|
-
import "./chunk-QYF5S6P6.js";
|
|
40
|
-
import "./chunk-RZOXUSPC.js";
|
|
41
|
-
import "./chunk-KPPJTH44.js";
|
|
42
|
-
import "./chunk-J6JP25XU.js";
|
|
43
|
-
import "./chunk-U5HPROLA.js";
|
|
44
|
-
import "./chunk-WME2OQST.js";
|
|
45
|
-
import "./chunk-KXF5R4UN.js";
|
|
46
|
-
import "./chunk-S26LC76R.js";
|
|
47
|
-
import "./chunk-Z2XAOKHK.js";
|
|
48
|
-
import "./chunk-VSFLRN5Y.js";
|
|
49
|
-
import "./chunk-LJDODBBZ.js";
|
|
50
|
-
import "./chunk-PQJFG24Z.js";
|
|
51
|
-
import "./chunk-NXL4FFQQ.js";
|
|
52
|
-
export {
|
|
53
|
-
DependencyChecker,
|
|
54
|
-
buildMadgeArgs,
|
|
55
|
-
mapWithConcurrency,
|
|
56
|
-
resetMadgeManagedPathMemo
|
|
57
|
-
};
|