pi-lens 4.4.6 → 4.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/README.md +17 -3
  3. package/config/markdownlint/run-no-fix.mjs +36 -0
  4. package/dist/{chunk-ZQ6NZZTB.js → chunk-2453RRJ2.js} +44 -6
  5. package/dist/{chunk-GZE7WOI4.js → chunk-2BKUFQKR.js} +696 -330
  6. package/dist/chunk-2TS4GLOJ.js +31 -0
  7. package/dist/{chunk-2DMLM3ZO.js → chunk-2ZE3AUJQ.js} +12 -14
  8. package/dist/{chunk-OJLTLYHB.js → chunk-35WKJWO5.js} +51 -33
  9. package/dist/chunk-3JAHQBSY.js +27 -0
  10. package/dist/{chunk-PO45POGF.js → chunk-3O5EII3W.js} +2 -2
  11. package/dist/chunk-447YZL4S.js +25 -0
  12. package/dist/{chunk-TIYGSODX.js → chunk-4B2YFN4U.js} +28 -22
  13. package/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
  14. package/dist/{chunk-XQCSWV2G.js → chunk-4LL2VRNY.js} +27 -28
  15. package/dist/{chunk-MA77RSFN.js → chunk-4NBWFYWW.js} +9 -9
  16. package/dist/{chunk-75SY4F24.js → chunk-4QG55RRC.js} +12 -12
  17. package/dist/{chunk-K2YGBXOA.js → chunk-4W52ZKZX.js} +2 -2
  18. package/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
  19. package/dist/{chunk-CFRQMBGP.js → chunk-57X2CDRX.js} +23 -23
  20. package/dist/{chunk-XAIT2YGS.js → chunk-5F3XF3SX.js} +7 -15
  21. package/dist/{chunk-UHGF5UT5.js → chunk-5RNB4HVK.js} +1 -1
  22. package/dist/{chunk-Q4EMRFNA.js → chunk-5T5A6YAJ.js} +35 -34
  23. package/dist/{chunk-W5LGKNET.js → chunk-6FIRFP6A.js} +12 -12
  24. package/dist/{chunk-KLQVC3XC.js → chunk-6GMGEKQN.js} +36 -9
  25. package/dist/{chunk-UN4TEBWN.js → chunk-6LJOJ6EO.js} +20 -15
  26. package/dist/{chunk-HK6JVFZC.js → chunk-6YUNI7B5.js} +3 -3
  27. package/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
  28. package/dist/{chunk-VQH24FIP.js → chunk-7CGIDRIK.js} +16 -15
  29. package/dist/{chunk-SCIUNBPF.js → chunk-7MAD5ZAY.js} +16 -17
  30. package/dist/{chunk-OOU2WZZE.js → chunk-7TNILKGY.js} +1 -1
  31. package/dist/{chunk-LEJOJDXL.js → chunk-A5GRLYPZ.js} +9 -9
  32. package/dist/{chunk-AE37FEGH.js → chunk-AGGUWKRK.js} +1 -1
  33. package/dist/{chunk-BWYQUPOS.js → chunk-BBET6HD6.js} +1 -1
  34. package/dist/{chunk-GAACZY6R.js → chunk-BHWW6FAX.js} +14 -13
  35. package/dist/{chunk-A3YNG5KP.js → chunk-BOPDQ7AZ.js} +23 -21
  36. package/dist/{chunk-MKVZQUEG.js → chunk-BQG2QFVO.js} +215 -134
  37. package/dist/{chunk-EVDGNG4F.js → chunk-BUZIQDFS.js} +3 -3
  38. package/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
  39. package/dist/{chunk-63RIVFQI.js → chunk-CUDD35TW.js} +10 -9
  40. package/dist/{chunk-BM5GS6ZH.js → chunk-CZL44WFN.js} +2 -2
  41. package/dist/{chunk-QGSTQH4D.js → chunk-DIWK3LBC.js} +12 -15
  42. package/dist/{chunk-JL6CXUMW.js → chunk-DYRZGUMA.js} +2 -2
  43. package/dist/{chunk-NDMCVUYK.js → chunk-FHEV6T4L.js} +22 -18
  44. package/dist/{chunk-4PCQCU47.js → chunk-FRLAUP2B.js} +4 -4
  45. package/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
  46. package/dist/{chunk-2RLWJO5K.js → chunk-G6JKM4O7.js} +7 -7
  47. package/dist/chunk-GGYOZWHW.js +27 -0
  48. package/dist/{chunk-DC4CFXM5.js → chunk-GIRBSBGL.js} +6 -5
  49. package/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
  50. package/dist/{chunk-ZUUI3ZSA.js → chunk-HHR7WGCI.js} +3 -3
  51. package/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
  52. package/dist/{chunk-VPBIMOAQ.js → chunk-HUAM7QG3.js} +15 -13
  53. package/dist/{chunk-ZYNI26MI.js → chunk-HXFUTMX2.js} +2 -2
  54. package/dist/{chunk-W5R5SABV.js → chunk-I22THIHI.js} +12 -12
  55. package/dist/chunk-IE5D3RA5.js +58 -0
  56. package/dist/{chunk-MT6BVNFW.js → chunk-IYVYZQRL.js} +10 -16
  57. package/dist/{chunk-ARD426WI.js → chunk-JBP7KESM.js} +1 -1
  58. package/dist/{chunk-MN7MHUXQ.js → chunk-JE6HKLC7.js} +2 -2
  59. package/dist/{chunk-3MYEA7QD.js → chunk-JPRDTY5S.js} +85 -3
  60. package/dist/{chunk-CJYKEW2L.js → chunk-JYLOYTZD.js} +17 -1
  61. package/dist/{chunk-5APMQ2IJ.js → chunk-JZRP4DGP.js} +2 -2
  62. package/dist/{chunk-AMXIUN2R.js → chunk-KZ4ALBCH.js} +2 -2
  63. package/dist/{chunk-W2V54OCL.js → chunk-L3CLUGDY.js} +3 -3
  64. package/dist/{chunk-DMSLNKF7.js → chunk-L4NEVZ4T.js} +28 -27
  65. package/dist/chunk-LPYTPNOJ.js +22 -0
  66. package/dist/{chunk-BI5LAQ3Y.js → chunk-LSFXZLPW.js} +2071 -1725
  67. package/dist/{chunk-2DDDCJDL.js → chunk-MC6VB2E5.js} +4 -4
  68. package/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
  69. package/dist/{chunk-Q4FCYCRE.js → chunk-NSPVR3FN.js} +19 -18
  70. package/dist/{chunk-VG5JS5SW.js → chunk-O2ARHQKF.js} +2 -2
  71. package/dist/{chunk-KSR7RGQY.js → chunk-O4N5BQ3T.js} +10 -10
  72. package/dist/{chunk-5ZR3APIM.js → chunk-OC7VWJBZ.js} +39 -40
  73. package/dist/chunk-OFNMHPBT.js +89 -0
  74. package/dist/{chunk-YSBHPOY6.js → chunk-OWTG6UMO.js} +21 -21
  75. package/dist/{chunk-7RQXA5GG.js → chunk-OY7WZI7Q.js} +13 -12
  76. package/dist/{chunk-5CV5ITZF.js → chunk-OZWXLJMX.js} +2 -2
  77. package/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
  78. package/dist/chunk-PKLB2XJL.js +8 -0
  79. package/dist/{chunk-DQXSPYRI.js → chunk-PKSUMEPT.js} +17 -4
  80. package/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
  81. package/dist/{chunk-4AVZ3TG7.js → chunk-R2QQC33W.js} +14 -14
  82. package/dist/{chunk-GMTFDAOK.js → chunk-R4QWJQ2H.js} +11 -11
  83. package/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
  84. package/dist/{chunk-SJJYRZB4.js → chunk-RZG472YW.js} +116 -26
  85. package/dist/{chunk-NIU2IPC5.js → chunk-SDFKOLSF.js} +6 -6
  86. package/dist/{chunk-H7HTEQUZ.js → chunk-SFLHSL5R.js} +9 -9
  87. package/dist/{chunk-FA5LDARD.js → chunk-SP4TFY5F.js} +14 -13
  88. package/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
  89. package/dist/{chunk-T7FTXGS3.js → chunk-T2S3FNNJ.js} +44 -42
  90. package/dist/{chunk-S67UJDGQ.js → chunk-TV6RXRYH.js} +10 -10
  91. package/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
  92. package/dist/{chunk-WIZWZR4C.js → chunk-UHHLR2VY.js} +43 -41
  93. package/dist/chunk-UYXV5NIS.js +20 -0
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
  95. package/dist/{chunk-FFL3A2VP.js → chunk-VN3L2JWZ.js} +46 -72
  96. package/dist/{chunk-Z7IGUAXL.js → chunk-VOP4PJKA.js} +12 -8
  97. package/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
  98. package/dist/{chunk-NNKXDXXS.js → chunk-VPLBLWFO.js} +14 -8
  99. package/dist/chunk-W3BGKBBK.js +27 -0
  100. package/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
  101. package/dist/{chunk-Q3UZHW6N.js → chunk-WMDUT4KH.js} +1150 -1138
  102. package/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
  103. package/dist/chunk-WXUDRAG6.js +24 -0
  104. package/dist/{chunk-OLAWH5UQ.js → chunk-X35S7HSB.js} +29 -10
  105. package/dist/{chunk-YBSONGSZ.js → chunk-X66YJ2SS.js} +40 -34
  106. package/dist/{chunk-U6OC3QEM.js → chunk-XOMGO63G.js} +22 -21
  107. package/dist/{chunk-WQOIR3QY.js → chunk-XWIME22V.js} +13 -13
  108. package/dist/{chunk-3WEPUD2V.js → chunk-XYLC35E4.js} +202 -103
  109. package/dist/{chunk-UCGQT677.js → chunk-YHGYAEFH.js} +18 -18
  110. package/dist/{chunk-V3APN3DY.js → chunk-ZFORSIED.js} +13 -13
  111. package/dist/{chunk-BHUWL2Y3.js → chunk-ZKLTNLAW.js} +64 -73
  112. package/dist/chunk-ZONZ6YY3.js +74 -0
  113. package/dist/chunk-ZSM35JF4.js +30 -0
  114. package/dist/{chunk-PPIBVH4R.js → chunk-ZZDIOAAJ.js} +15 -6
  115. package/dist/index.js +8817 -6239
  116. package/dist/mcp/analyze-cli.js +10 -10
  117. package/dist/mcp/cli.js +44 -42
  118. package/dist/mcp/server.js +2236 -861
  119. package/dist/mcp/worker.js +62 -61
  120. package/dist/probes/installer.js +20 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +29 -11
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/ast-grep_rules_catalog.md +6 -4
  125. package/docs/ci-bot-pr-checks.md +126 -0
  126. package/docs/configuration.md +99 -3
  127. package/docs/defect-shapes.md +68 -11
  128. package/docs/dependencies.md +1 -0
  129. package/docs/engineering-principles.md +27 -2
  130. package/docs/environment-variables.md +14 -0
  131. package/docs/features.md +13 -3
  132. package/docs/globalconfig.md +12 -1
  133. package/docs/invariants/git-guard-host.md +38 -0
  134. package/docs/invariants/language-config.md +15 -4
  135. package/docs/invariants/lsp-trust-exec.md +22 -2
  136. package/docs/invariants/paths-os.md +4 -2
  137. package/docs/invariants/session-telemetry.md +42 -2
  138. package/docs/lsp-capability-matrix.md +208 -84
  139. package/docs/lsp-idle-eviction.md +3 -5
  140. package/docs/merge-queue-rollout.md +1 -1
  141. package/docs/pi-lens-fixer.md +31 -17
  142. package/docs/pi-lens-merge-policy.md +27 -15
  143. package/docs/pi-lens-monitor.md +9 -0
  144. package/docs/pi-lens-orchestration.md +4 -1
  145. package/docs/pi-lens-reviewer.md +5 -5
  146. package/docs/pi-lens-subagent.md +13 -7
  147. package/docs/public-api-stability.md +18 -2
  148. package/docs/schema/pi-lens-config-v1.json +33 -0
  149. package/docs/servercapabilities.md +1 -1
  150. package/docs/settings.md +15 -6
  151. package/docs/usage.md +5 -0
  152. package/docs/word-index.md +17 -5
  153. package/package.json +5 -3
  154. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  155. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  156. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  157. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  158. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  159. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  160. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  161. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  162. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  163. package/dist/chunk-2F47TQOA.js +0 -73
  164. package/dist/chunk-2X4VLOCC.js +0 -55
  165. package/dist/chunk-4WX4CTUE.js +0 -57
  166. package/dist/chunk-FJIVKLPH.js +0 -31
  167. package/dist/chunk-G2B7F6ZU.js +0 -88
  168. package/dist/chunk-GTAI2J6U.js +0 -27
  169. package/dist/chunk-IPDG45G5.js +0 -26
  170. package/dist/chunk-P4QNXS6I.js +0 -27
  171. package/dist/chunk-Q6D6VMI4.js +0 -22
  172. package/dist/chunk-SXGD4ANG.js +0 -25
  173. package/dist/chunk-XCUHKYCQ.js +0 -23
  174. package/dist/chunk-YRD4ISED.js +0 -30
@@ -19,11 +19,14 @@ acceptance surface quoted from that run's log. Any self-bound inside the lane
19
19
  must sit below the job cap by a stated margin so the loud-failure path is
20
20
  reachable.
21
21
 
22
- Every PR body starts with `## Why`, `## Notes for the reviewer`, and
23
- `## Change outline`, followed by the existing `## Summary`, `## Tests`,
24
- `## Blast radius`, `## Class sweep`, `## Observability`, and `## Fold check`
25
- sections. The change outline is the changed symbol's caller/callee tree with
26
- `+`/`-` on moved lines; include only structural views that changed.
22
+ Every PR body has `## Summary` (at most three sentences),
23
+ `## Notes for the reviewer` (at most five bullets), `## Change outline`, and
24
+ `## Proof and checks`, which holds `### Tests`, `### Class sweep`,
25
+ `### Observability`, and `### Fold check`, plus the conditional sections the
26
+ template lists. The change outline is the changed symbol's caller/callee tree
27
+ with `+`/`-` on moved lines; include only structural views that changed.
28
+ `scripts/check-pr-body.mjs` caps visible text at 5000 characters and each code
29
+ fence at 20 lines (#5003).
27
30
 
28
31
  ## The loop, per PR
29
32
 
@@ -209,7 +212,7 @@ issue filed without one is a triage defect, not a shortcut.
209
212
  **Merge bar (user, 2026-10-18).** A PR merges when no HIGH finding is open and
210
213
  every gating check is green on the exact head. Each MEDIUM or LOW finding
211
214
  either folds into the same PR or becomes an accepted residual: the PR body
212
- lists it under `## Accepted residuals`, named `p3` with its severity and live
215
+ lists it under `### Accepted residuals`, named `p3` with its severity and live
213
216
  population (for example `p3 (MEDIUM, live 0): <the gap>`), so the gap keeps a
214
217
  priority without an issue.
215
218
  A residual never becomes a follow-up issue. File an issue only for p2 or
@@ -221,10 +224,16 @@ reopen the round.
221
224
  **Known gaps (user, 2026-10-19).** An open p3 issue is an accepted known gap,
222
225
  not backlog. The orchestrator closes it as not planned with the `known-gap`
223
226
  label and lists it under its seam on the pinned tracker #4626. When a PR
224
- merges, its `## Accepted residuals` lines join the same tracker under their
227
+ merges, its `### Accepted residuals` lines join the same tracker under their
225
228
  seam. A known gap reopens as p2 when it turns material: a live wrong result,
226
229
  data loss, a hang, or a leak with no bound.
227
230
 
231
+ **Ideas go on the tracker (user, 2026-10-31).** A rule candidate, research idea
232
+ or optional slice that no lane will start is never filed as a p3 issue. It goes
233
+ straight onto the pinned known-gaps tracker under its seam. On 2026-10-31 five
234
+ such issues were filed from research passes (#5083, #5091, #5093, #5094,
235
+ #5096); three were closed onto #4835.
236
+
228
237
  Every reviewer **follow-up issue** generalization verdict that meets that bar is
229
238
  filed and assigned to a seam group on the tracking queue in the same turn. At each regroup, scan
230
239
  merged PRs for subset-shaped changes that lack a generalization verdict.
@@ -312,7 +321,7 @@ operator's private notes, so a different orchestrator can run the same train.
312
321
  | a change that touches identifier uses of a glossary-retired synonym | run `tests/config/glossary-synonym-sweep.test.ts` on the head AND on the merge with `origin/master`, then re-pin in the PR from the sweep's own `UNPINNED`/`STALE` output — #3279, #3283, #3284, #3288 |
313
322
  | a new `vi.mock` in a test file | run `tests/config/vi-mock-export-sweep.test.ts`; whole-module mocks of a production module must spread `importOriginal` — PR #3268's CI red, fixed by trailing commit `621d61c5c` |
314
323
  | a changelog fragment | front matter `section: <Section>` plus `audience: user` or `audience: internal` and exactly one top-level entry; new user entries open with a bold lead of at most 100 characters (refs excluded), never `CHANGELOG.md`, validated by `node scripts/check-changelog-fragments.mjs` — PR #3268 r1 shipped `category:` and a paragraph |
315
- | a PR body | the header gate: exactly one-sentence `## Why`, `## Notes for the reviewer`, `## Change outline`, plus Summary / Tests with `### Test assessment` / Blast radius / Class sweep / Fold check / Observability; run `node scripts/check-pr-body.mjs --lint-local` before pushing — three PRs this week needed orchestrator body edits |
324
+ | a PR body | the header gate: `## Summary`, `## Notes for the reviewer`, `## Change outline`, plus Tests / Class sweep / Fold check / Observability, inside the caps; run `node scripts/check-pr-body.mjs --lint-local` before pushing — three PRs this week needed orchestrator body edits |
316
325
  | a whole-tree docs restructure of `AGENTS.md` | every governance test that reads `AGENTS.md`, with markers on their own lines — PR #3265 r1 |
317
326
  | a raw poll in a test | the flake-shape ratchet; the fix is the governed wait, never a header admission — #2781 r1 |
318
327
  | a new, renamed or deleted rule file under `rules/` | `npm run docs:rule-catalogs` and commit the generated catalog; `tests/scripts/rule-catalogs.test.ts` is a strict consumer of every rule file, not of rule ids — #3214 r1 |
@@ -554,11 +563,14 @@ operator's private notes, so a different orchestrator can run the same train.
554
563
  DETECTION lesson in one line: which verification layer caught it and which
555
564
  layer SHOULD have caught it earlier and at what cost. The accepted layer
556
565
  words are the `DETECTION_LAYERS` list exported by `scripts/check-pr-body.mjs`,
557
- which the `## Detection` body check reads; the prose does not restate them.
558
- `nightly` may carry its workflow as `nightly:<workflow>`, and a bug-closing
559
- PR is refused when `Caught by:`, `Should have been caught by:`, the reason
560
- after `Gap: none:`, the `Shape: new:` name or the `Enforcer: none:` reason is
561
- a placeholder (starts with `unknown`, or is exactly `n/a`, `tbd` or `?`)
566
+ which the `### Detection` body check reads; the prose does not restate them.
567
+ `nightly` may carry its workflow as `nightly:<workflow>`. A PR that only
568
+ references a `bug` or `nightly-drift` issue, in its body or its title, owes
569
+ the section too (#4968: the 2026-10-29 audit found 24 bug-linked PRs merged
570
+ in one week with `Refs #N` and no lesson). A PR that owes the section is refused when `Caught by:`,
571
+ `Should have been caught by:`, the reason after `Gap: none:`, the
572
+ `Shape: new:` name or the `Enforcer: none:` reason is a placeholder (starts
573
+ with `unknown`, or is exactly `n/a`, `tbd` or `?`)
562
574
  (#4519: 139 of 363 closed bugs read unknown in the 2026-10-16 retro).
563
575
  If that layer does not exist, file it as an issue with the bug as
564
576
  its named recurrence — the same standard shapes are held to. The lesson
@@ -720,7 +732,7 @@ Each row cost a lane at least once; the prose above carries the record.
720
732
  | Reviewing a branch head that no longer carries master | Reviewer merges origin/master into the scratch checkout first; CONFLICTING is not reviewable (#2808 vs #2795) |
721
733
  | Pushing docs, config or data straight to master without preflight | `npm run preflight` on the exact tree first; three master reds on 2026-09-09 |
722
734
  | Nudging a capped small-model lane more than once | One continuation, then reassign to the strongest model (GLM lanes, 2026-09-09) |
723
- | Waiting on CI for a bot-authored PR (github-actions nightly refresh) | A GITHUB_TOKEN push fires no `pull_request` run: required checks stay ABSENT forever; close/reopen the PR to fire them (#2801, 2026-09-09) |
735
+ | Waiting on CI for a bot-authored PR (github-actions nightly refresh) | A GITHUB_TOKEN push fires no `pull_request` run. Since #5062 the opening job dispatches `ci.yml` and `lint.yml` on the bot branch (`docs/ci-bot-pr-checks.md`); a bot PR still BLOCKED with every check absent means that dispatch step failed or did not run: read the nightly's `Open refresh PRs` job, then close/reopen to fire the checks (#2801, 2026-09-09) |
724
736
  | Leaving a design question to the fixer (where evidence comes from, which identity rule) | Decide it in the brief; #2900 oscillated three rounds (walker → findings → walker again) until round 4's brief fixed the evidence source (2026-09-10) |
725
737
  | Guessing a lane's branch name when writing a brief | Read `gh pr view N --json headRefName` in the same command that builds the brief; plegma refused two dispatches on invented refs (#2908, #2898; 2026-09-10) |
726
738
  | `git add -A -- . ':!<ignored file>'` in a chained command | The exclude pathspec on an IGNORED path makes `git add` exit 1 and the chain stops before the commit; use plain `git add -A` (ignored files never stage) and verify the index afterwards (2026-09-10, twice) |
@@ -846,7 +858,7 @@ Each row cost a lane at least once; the prose above carries the record.
846
858
  | Pushing to a PR branch while a fix round is queued against its old head | Merging master into #4594 staled the queued round's lease; the worker pushed a diverged copy to its handle branch (plegma #723). The orchestrator's push-verify refuses while a round still publishes to that branch. |
847
859
  | Resuming a reviewer without naming the deliverable | The resumed verifies of #4575 and #4593 inherited report names that did not match the brief, so the hand-back missed the report. Every resumed round names its `deliverables` explicitly. |
848
860
  | Calling an issue "blocked on a release" without reproducing it on master | #4554 waited on a release; 58 runs on master did not reproduce it, and it closed crediting #4563. Reproduce on master before naming a blocker. |
849
- | Bolding a residual bullet (`- **p3 (LOW, live 0):**`) under `## Accepted residuals` | The tracker parser read only a bare `p3`, so #4832's three residuals were recorded as "none" (2026-10-25). `known-gap-add.sh` now reads the bold form, pinned by its test case (g) |
861
+ | Bolding a residual bullet (`- **p3 (LOW, live 0):**`) under `### Accepted residuals` | The tracker parser read only a bare `p3`, so #4832's three residuals were recorded as "none" (2026-10-25). `known-gap-add.sh` now reads the bold form, pinned by its test case (g) |
850
862
  | Planning a tracker layout before measuring the platform's limits | An 11-issue pinned split was proposed and dispatched; GitHub pins 3 issues per repository, and the assumed 65k body cap was already exceeded by #4626 at 91k (2026-10-25). Measure the limit first, then plan |
851
863
  | Pasting the `claude-lane.sh` header into a brief | The header began `Worktree (created, ...):`, the brief guard wants `Worktree:`, and two dispatches were refused (2026-10-25). The header now starts with `Worktree:`, pinned by `test-claude-lane-header.sh` |
852
864
  | Linting a PR body in the main checkout | The main checkout sits on another branch, so citations resolved against the wrong tree; three edits needed a hand-built head tree (2026-10-25). `pr-body.sh edit` without `--tree` now builds a temp tree at the PR head |
@@ -135,6 +135,15 @@ the requested window.
135
135
  `filePath` even for a formatter that never settles or an Escape; a chained
136
136
  file with no later `*_format_late_resync` row on the same `filePath` is the
137
137
  anti-join to report.
138
+ `withheld_blocker_late_advisory` (#5108) is the same hand-off for a
139
+ tool_result handler the host bound abandoned while a run without authorship
140
+ withheld blockers: one row per abandoned call that queued its disclosure
141
+ for the calling session's next context call, with `metadata.notices` (the
142
+ withheld lines; the advisory shows five) and `metadata.budgetMs`, and the
143
+ tool name as `filePath`. The row is written even when the advisory never
144
+ reaches the agent: a full queue or a session that ended before its next
145
+ context call drops it as the `agent-advisory-dropped` degradation (`cap`
146
+ or `scope-retired`), so report the pair.
138
147
  **Session decisions** (#3873; each row is one lifecycle event, none is per
139
148
  occurrence in a loop): `session_handoff_slot` (`op`: `stashed`, `replaced`,
140
149
  `taken`, `key-mismatch-left` (once per stale slot), `forwarded`,
@@ -31,9 +31,12 @@ per-PR loop itself is `docs/pi-lens-merge-policy.md`.
31
31
  each candidate as folded into this PR (one `Closes #…` per folded issue) or
32
32
  not folded, with the reason (two hazards in one review, a maintainer decision,
33
33
  a blocked dependency, a different seam). The brief carries the candidate list
34
- and its decisions, and the PR body records them under `## Fold check`.
34
+ and its decisions, and the PR body records them under `### Fold check`.
35
35
  Planning precedes filing: a new issue is the answer for p2+ work no lane can
36
36
  carry, never for a p3 the lane could fold (history: `HISTORY.md`, 2026-10-20).
37
+ - A PR body's `### Class sweep` ends with one `Alignment:` line naming the
38
+ families of `docs/alignment-families.md` the change touches, or `none:
39
+ <reason>`; the body lint refuses a body without it.
37
40
  - The per-PR loop (review, verify, auto-merge on green), round routing, the
38
41
  merge gate and the Common mistakes table live in `docs/pi-lens-merge-policy.md`.
39
42
  - Read CI with `node scripts/ci-verdict.mjs <pr|sha>` (exact head, all pages).
@@ -145,21 +145,21 @@ real seam. Check that every gate the diff adds is exercised through that path.
145
145
  the exception to the one-spot-check cap above.
146
146
  - Repeat the pattern and population sweeps. Check blast radius, bounded
147
147
  observability, changelog, commit, and PR-body requirements.
148
- - Re-run the PR's `## Class sweep` search yourself and widen it when the
148
+ - Re-run the PR's `### Class sweep` search yourself and widen it when the
149
149
  named shape is broader than the touched seam (#4273, #4268).
150
- - Read the `## Fold check` against the open issues and pull requests the PR's
150
+ - Read the `### Fold check` against the open issues and pull requests the PR's
151
151
  mechanism has: the lint checks the form (candidate, decision, reason), not
152
152
  that every candidate was found, so decide whether the section's search was
153
153
  wide enough and whether each `not folded` reason holds (#4711). Open each
154
154
  candidate's diff (`gh pr diff <n>`) or the files its issue names: a
155
155
  `not folded` line is a finding when the candidate edits the same hunk or
156
156
  symbol, or owns a rule this PR re-derives, and a member your own search finds
157
- that the `## Class sweep` missed is a finding too. The gates check form only
157
+ that the `### Class sweep` missed is a finding too. The gates check form only
158
158
  and the author writes these lines, so this read is the only judgment they
159
159
  get. Recurrence: #4713 wrote "shares no clients/ file" beside #4712, and the
160
160
  review then re-derived a `clients/analysis-root.ts` rule #4712 edits, while
161
161
  the class sweep missed a single-scan-root member.
162
- - On a bug-closing PR, check the `## Detection` lesson: the layer named under
162
+ - On a bug-closing PR, check the `### Detection` lesson: the layer named under
163
163
  `Should have been caught by:` must be one that would actually have caught
164
164
  the bug, and `Gap:` must be a real issue, test, or reason (#4288). Judge
165
165
  `Shape:` and `Enforcer:` too: the lint checks the catalog number and that the
@@ -380,6 +380,6 @@ Use short, active, plain prose.
380
380
 
381
381
  Apply this standard to PR and issue bodies, review comments, commit messages, documentation, and changelog entries. Lead with the outcome. Remove words that do no work. Use active voice and present tense. Use second person for instructions, and use the imperative for steps. Keep one idea per sentence, with about 20–25 words and no more than 30 words. Use consistent terminology and sentence-case headings. Define acronyms on first use. Prefer plain words over jargon. Avoid `please`, filler, noun piles, nested parentheticals, and em-dash chains. Use the Oxford comma.
382
382
 
383
- The mechanical rules are checked by `scripts/check-prose.mjs`. The checker ignores fenced code, inline code, URLs, quoted log lines, blockquotes, and tables. It blocks long sentences, filler, and title-case headings. It warns on passive voice. The CLI accepts a body file or standard input and supports `--json`.
383
+ The mechanical rules are checked by `scripts/check-prose.mjs`. The checker ignores fenced code, inline code, URLs, quoted log lines, blockquotes, and tables. It warns on long sentences, filler, and passive voice, and it blocks title-case headings (#5110). The CLI accepts a body file or standard input and supports `--json`.
384
384
 
385
385
  Reviewers judge clarity, terminology, active voice, sentence structure, and whether each list uses parallel grammar. Treat a mechanically clean result as necessary, not sufficient. Report prose that obscures the outcome or makes a user infer the action.
@@ -81,8 +81,11 @@ the brief gives.
81
81
  checkout the shell happens to sit in, and agent shells reset their working
82
82
  directory between calls. Never edit the main checkout: other lanes and the
83
83
  orchestrator read it, and its branch must not move under them.
84
- - **Teardown.** `rm` a symlinked `node_modules` before `git worktree remove`
85
- (`ls -ld node_modules` first; unlink the link, never `rm -r` it). Removing the worktree over the link follows it
84
+ - **Teardown.** Run `node scripts/worktree-remove.mjs <path>`: it unlinks a
85
+ symlinked `node_modules`, refuses a real directory, then runs `git worktree
86
+ remove` (#5111). By hand: `rm` a symlinked `node_modules` before `git
87
+ worktree remove` (`ls -ld node_modules` first; unlink the link, never `rm -r`
88
+ it). Removing the worktree over the link follows it
86
89
  and deletes the main checkout's install (#3173; the hook denies the removal
87
90
  and `AGENTS.md` "Commands and gates" says how `pr-worktree.mjs close` does
88
91
  it). A real `node_modules` directory is removed only after confirming the
@@ -143,10 +146,13 @@ the brief gives.
143
146
  is that summary and nothing else: the full evidence (probe transcripts,
144
147
  tables, mutation logs) goes in the declared deliverable file or, when there
145
148
  is none, `~/.local/share/pi-lens-orchestrator/tmp/<lane>-tmp/REPORT.md`, and
146
- the summary names that path. The orchestrator reads the summary alone to
147
- route the lane and opens the file only when routing a fix round, so a claim
148
- made only in the file does not route. (Full reports pasted into the reply
149
- were the largest orchestrator token cost on 2026-10-07.)
149
+ the summary names that path. The hand-back file a brief names is a required
150
+ lane record, kept outside the repo; the harness default against report `.md`
151
+ files does not cover it. A lane that skips the file has not delivered. The
152
+ orchestrator reads the summary alone to route the lane and opens the file only
153
+ when routing a fix round, so a claim made only in the file does not route.
154
+ (Full reports pasted into the reply were the largest orchestrator token cost
155
+ on 2026-10-07.)
150
156
  - **Handbacks between rounds.** Every lane's returned summary for PR #N is
151
157
  kept at `~/.local/share/pi-lens-orchestrator/tmp/handbacks/pr-<N>.md` (the
152
158
  orchestrator's hooks write it; a fixer may also write it). A reviewer or
@@ -248,7 +254,7 @@ Fold a review follow-up into the same PR when it shares the seam or files, is
248
254
  about one commit, and needs no maintainer decision. Contract-only folds (body,
249
255
  comments, wording) are trailing commits; small code folds carry a red-first
250
256
  test and are routed per principles §3 "Round routing". A MEDIUM or LOW that
251
- does not fold is an accepted residual: list it under `## Accepted residuals`,
257
+ does not fold is an accepted residual: list it under `### Accepted residuals`,
252
258
  named `p3` with its severity and live population, and file nothing. File only p2 or
253
259
  higher work that cannot ride the PR (a HIGH outside its scope, or a MEDIUM
254
260
  with a live population), as one consolidated issue per PR. The merge bar is in
@@ -375,7 +375,7 @@ are part of the contract, so the predicate is named here** (`refusalMatches` in
375
375
 
376
376
  Everything else stays a warning and the tool runs, exactly as it did before: a
377
377
  misspelled mode name, an abbreviation (`max`), a substring or reverse containment
378
- (`files` for `maxLspFiles`, `file` for `path`), a leading or middle word
378
+ (`files` for `maxLspFiles`, `pth` for `path`), a leading or middle word
379
379
  (`sourcePath` is not `source`), a key whose qualifier retargets the head noun
380
380
  (`maxFiles`). Such keys still get the `did you mean` hint, except that a
381
381
  retargeted head noun is never the hint (`maxFiles` gets none, `cwdPath` gets
@@ -391,6 +391,22 @@ JSON-RPC `-32602` error; `arguments` absent, `null` or `[]` means no arguments.
391
391
  pass extra keys today would break, so it needs a major, through the removal
392
392
  checklist in section 4.
393
393
 
394
+ ### The single-file tool parameter is `path`
395
+
396
+ Every pi-lens tool that acts on one named file takes it as **`path`** (#5041).
397
+ That is the canonical spelling: new tools declare it, and the description a
398
+ model reads names it. It is also what keeps a call from being answered for the
399
+ wrong scope — a tool that only declares an older name refuses or ignores the
400
+ canonical one, and an ignored file parameter leaves the call running on its
401
+ default scope, whose answer then reads as if it were about the named file.
402
+
403
+ The MCP tools keep accepting **`file`**, and `lens_diagnostic_mark` keeps
404
+ accepting **`filePath`**, as declared aliases of `path`, so no caller written
405
+ against an older spelling breaks. A call may send any one of them; a call that
406
+ sends two spellings naming different files is refused rather than guessed at.
407
+ Adding a fourth spelling, or dropping one of these, changes this contract
408
+ through section 4.
409
+
394
410
  ## 6. File I/O Lifecycle Bridge (v2)
395
411
 
396
412
  `PiLensIOBridge` is public API from day one ([RFC 3654](rfcs/3654-unified-io-bridge-v2.md)).
@@ -406,7 +422,7 @@ The compatibility policy and migration path from legacy v1 symbols are documente
406
422
  | 2. Append-only `PILENS_CFG_*` codes | `CONFIG_DIAGNOSTIC_CODES` | `tests/clients/config-diagnostic-codes.test.ts` |
407
423
  | 3. Reserved `$schema` identity anchor | `CONFIG_SCHEMA_ID`, `CONFIG_SCHEMA_ANCHOR_KEY` | `assertSchemaIdentityAnchor` |
408
424
  | 4. Deprecation window + removal checklist | `DEPRECATED_CONFIG_SURFACES` | `tests/clients/config-deprecation-registry.test.ts` |
409
- | 5. Config core: tiers, deny precedence, ProcessSpec trust | `clients/config-core/` | `tests/clients/config-core/*.test.ts`, `tests/config/config-core-schema-stability.test.ts` |
425
+ | 5. Config core: tiers, deny precedence, ProcessSpec trust | `clients/config-core/` | `tests/clients/config-core/*.test.ts` |
410
426
 
411
427
  ## Related
412
428
 
@@ -139,6 +139,18 @@
139
139
  "guard": {
140
140
  "x-stability": "stable"
141
141
  },
142
+ "astGrep": {
143
+ "x-stability": "stable"
144
+ },
145
+ "zizmor": {
146
+ "x-stability": "stable"
147
+ },
148
+ "typos": {
149
+ "x-stability": "stable"
150
+ },
151
+ "spotbugs": {
152
+ "x-stability": "stable"
153
+ },
142
154
  "opengrep": {
143
155
  "x-stability": "stable"
144
156
  },
@@ -398,6 +410,17 @@
398
410
  "turnEnd": {
399
411
  "x-stability": "stable"
400
412
  },
413
+ "fallow": {
414
+ "type": "object",
415
+ "additionalProperties": true,
416
+ "properties": {
417
+ "enabled": {
418
+ "type": "boolean",
419
+ "x-stability": "experimental"
420
+ }
421
+ },
422
+ "x-stability": "stable"
423
+ },
401
424
  "knip": {
402
425
  "type": "object",
403
426
  "additionalProperties": true,
@@ -479,6 +502,16 @@
479
502
  "x-stability": "stable"
480
503
  },
481
504
  "dispatch": {
505
+ "type": "object",
506
+ "additionalProperties": true,
507
+ "properties": {
508
+ "disabledRunners": {
509
+ "type": "array",
510
+ "items": { "type": "string", "x-stability": "experimental" },
511
+ "x-deny": "array-union",
512
+ "x-stability": "experimental"
513
+ }
514
+ },
482
515
  "x-stability": "stable"
483
516
  },
484
517
  "widget": {
@@ -6,7 +6,7 @@ server's `initialize` handshake. Generated by `node scripts/server-capabilities.
6
6
  absent on the generating host are listed under *Unavailable* — run in a
7
7
  provisioned environment (the nightly) to capture those rows.
8
8
 
9
- _Last generated: 2026-10-25 on linux; 41 servers captured, 9 unavailable._
9
+ _Last generated: 2026-10-27 on linux; 41 servers captured, 9 unavailable._
10
10
 
11
11
  ## Diagnostic mode + navigation/edit operations
12
12
 
package/docs/settings.md CHANGED
@@ -77,6 +77,10 @@ column is the effective behavior when nothing is set.
77
77
  | `--lens-guard` | `guard.enabled` | global | **off** |
78
78
  | `--lens-checkout-guard` | `guard.sharedCheckout` | global | **off** |
79
79
  | `--no-opengrep` | `opengrep.enabled` | global | Opengrep scanner **on** |
80
+ | `--no-ast-grep` | `astGrep.enabled` | global | ast-grep auxiliary server **on** |
81
+ | `--no-zizmor` | `zizmor.enabled` | global | zizmor auxiliary server **on** |
82
+ | `--no-typos` | `typos.enabled` | global | typos auxiliary server **on** |
83
+ | `--lens-spotbugs` | `spotbugs.enabled` | global | SpotBugs **off** |
80
84
  | `--no-read-guard` | `readGuard.enabled` | global | read-before-edit monitor **on** |
81
85
  | `--no-lens-context` | `contextInjection.enabled` | global | context injection **on** |
82
86
  | `--lens-retain-injections` | `contextInjection.retain` | global | **off** |
@@ -92,6 +96,7 @@ column is the effective behavior when nothing is set.
92
96
  | `--no-lazy-tools` | `tools.lazy` | global | `true`: the five situational tools start inactive on every model (`"auto"` only on a model that keeps mid-conversation system messages, `false` never) |
93
97
  | `--no-tool=<name>` | `tools.<name>.enabled` | project | every lens tool **on** |
94
98
  | `--lens-turn-end-madge` | `turnEnd.madge.enabled` | global | **off** (madge runs at session start, not per turn) |
99
+ | `--lens-fallow` | `fallow.enabled` | global | **off** (fallow-lsp advisory auxiliary on JS/TS files; nothing installed or launched while off) |
95
100
  | `--no-knip` | `knip.enabled` | project | knip analyzer **on** |
96
101
  | `--no-jscpd` | `jscpd.enabled` | project | jscpd analyzer **on** |
97
102
  | `--no-madge` | `madge.enabled` | project | madge analyzer **on** |
@@ -145,13 +150,14 @@ field docs.
145
150
  | `ignore` | global + project | `[]` | Gitignore-style globs excluded from every scan |
146
151
  | `widget.visible` | global | `true` | Whether the diagnostics widget shows at session start |
147
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) |
148
154
  | `format.mode` | global | `"deferred"` | `"deferred"` (at `agent_end`) or `"immediate"` |
149
155
  | `actionableWarnings.autoFix.maxFixes` | global | `5` | Cap on quickfixes applied per turn (`0` = report only) |
150
156
  | `rules.high-complexity.threshold` | project | `15` | Cyclomatic-complexity threshold |
151
157
  | `rules.high-fan-out.threshold` | project | `20` | Distinct-function-call threshold |
152
- | `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>.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. See [configuration](configuration.md#rulesid--read-from-each-files-own-config) |
153
159
  | `rules.<id>.select` | project | absent | Allowlist of rule ids (output-only filter, project-wide across every key; disable wins over select) |
154
- | `rules.<id>.ignorePaths` | global + project | `[]` | Experimental rule-scoped globs relative to the project root; matching files skip that rule's scan and output. Entries are monotonic across tiers. |
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). |
155
161
  | `maxProjectFiles` | project | `2000` | Base scale knob; derives five subsystem size budgets |
156
162
  | `reviewGraph.maxFiles` | project | derived (clamped `100`–`20000`) | Explicit review-graph file budget |
157
163
  | `trivy.enabled` / `trivy.minSeverity` | project | off | Opt-in Trivy vulnerability scanning |
@@ -164,7 +170,7 @@ field docs.
164
170
  User-level. The file is selected by the [global-location table](configuration.md#global-config-location)
165
171
  and applies to **every** project. It honors **all** flag keys from the
166
172
  table above plus the non-flag global knobs (`ignore`, `widget.visible`,
167
- `dispatch.runnerTimeoutFloorMs`, `format.mode`,
173
+ `dispatch.runnerTimeoutFloorMs`, `dispatch.disabledRunners`, `format.mode`,
168
174
  `actionableWarnings.autoFix.maxFixes`). On Windows the path is
169
175
  `%USERPROFILE%\.pi-lens\config.json`.
170
176
 
@@ -214,9 +220,12 @@ Most toggles are **global-only**. Putting a global-only key such as
214
220
  `"lsp": { "enabled": false }` in a `.pi-lens.json` is **not** honored at project
215
221
  scope — pi-lens logs a one-time warning saying so (rather than silently doing
216
222
  nothing) and you should set it in `~/.pi-lens/config.json` or pass the CLI flag
217
- instead. Foreign LSP-loader namespaces that a shared file legitimately carries
218
- (`servers`, `serverOverrides`, `disabledServers`, `warmFiles`) and `$schema` are
219
- tolerated without warning; anything else is logged once as a likely typo.
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.
220
229
 
221
230
  ```json
222
231
  {
package/docs/usage.md CHANGED
@@ -109,6 +109,10 @@ pi --no-delta # Disable delta mode (show all diagnostics, not just ne
109
109
  pi --lens-guard # Block git commit/push when unresolved blockers exist (experimental)
110
110
  pi --lens-checkout-guard # Decline git commands that rewrite the working tree while another live pi-lens session shares this dirty checkout (experimental)
111
111
  pi --no-opengrep # Disable the Opengrep security scanner (default-on auxiliary LSP)
112
+ pi --no-ast-grep # Disable the ast-grep auxiliary LSP server (default-on)
113
+ pi --no-zizmor # Disable the zizmor auxiliary LSP server (default-on)
114
+ pi --no-typos # Disable the typos auxiliary LSP server (default-on)
115
+ pi --lens-spotbugs # Run SpotBugs on Java and Kotlin files (opt-in; needs a Java build descriptor and compiled classes)
112
116
  pi --no-read-guard # Disable the read-before-edit behavior monitor
113
117
  pi --lens-retain-injections # Re-send injected findings unchanged in later requests, for exact-prefix (local) prompt caches
114
118
  pi --lens-turn-summary # Persist a per-turn summary of diagnostics, autofixes, and autoformats
@@ -118,6 +122,7 @@ pi --lens-hide-lsp-status # Publish no pi-lens-lsp footer status at all, so
118
122
  pi --lens-compact-widget # Render the widget as one summary line (languages + totals, LSP↑ chip while servers spawn) with no file rows or blocker details (refs #3959)
119
123
  pi --no-lazy-tools # Keep every pi-lens tool active instead of activating the situational ones on demand
120
124
  pi --lens-turn-end-madge # Run the madge circular-dependency check at every turn end, not just at session start
125
+ pi --lens-fallow # Run fallow-lsp beside the TypeScript server on JS/TS files (advisory unused-code, duplication and cycle findings; opt-in)
121
126
  pi --no-knip # Disable the knip session-start analyzer
122
127
  pi --no-jscpd # Disable the jscpd session-start analyzer
123
128
  pi --no-madge # Disable the madge session-start analyzer
@@ -137,11 +137,23 @@ rebuild:
137
137
  files by identifier → `module_report` explains one → `read_symbol` reads
138
138
  the exact body. See [docs/module-report-read-symbol.md](module-report-read-symbol.md)
139
139
  for the second half of that chain.
140
- - **Hit shape** (#517-slimmed): `{ file, score, hits, startLine, endLine }`.
141
- `startLine`/`endLine` mark the file's single best-matching line (there's
142
- no synthesized whole-file span) — derive a one-line peek with
143
- `offset=startLine, limit=endLine-startLine+1`, or call `module_report` on
144
- `file` for the real outline.
140
+ - **One rendered table (#5104)**: both surfaces print a header, one row per
141
+ hit, and a footer, rendered by `renderCompactSymbolSearch()` in
142
+ `clients/lens-engine.ts` — neither appends a JSON payload or a fenced
143
+ block. A row is
144
+ ` 1. <file> <startLine> (score 0.82, 3 hit(s)[, fanIn 4][, complexity 7])`:
145
+ the path relative to the query's `cwd`, the hit's single best-matching line,
146
+ the BM25 score and hit count, then the graph annotations when the cached
147
+ review graph is warm (`fanIn 0` means no known importers, so it prints).
148
+ `startLine` and `endLine` are that one line — no synthesized whole-file
149
+ span — so read it with `offset=startLine, limit=1`, or call `module_report`
150
+ on `file` for the real outline. The footer carries index coverage
151
+ (`capped — results may be incomplete` on a truncated index), the MCP-only
152
+ staleness note below, and one next-step line naming the top-ranked hit
153
+ (`module_report <file>` on pi, `pilens_module_report <file>` on MCP). On pi, `details`
154
+ keeps `{ available, query, count, coverage }` (MCP has no `details`); the rows carry everything the
155
+ dropped JSON did (annotations, and the next step that replaces
156
+ `suggestedNext`).
145
157
  - **Staleness hint (MCP only, #536)**: `symbolSearch()` returns
146
158
  `snapshotGeneratedAt` (the backing project snapshot's `generatedAt`); the
147
159
  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.6",
3
+ "version": "4.4.8",
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",
@@ -131,7 +133,7 @@
131
133
  "@ast-grep/cli": "0.51.0",
132
134
  "@ast-grep/napi": "^0.51.0",
133
135
  "js-yaml": "^5.2.2",
134
- "minimatch": "^10.2.6",
136
+ "minimatch": "^11.0.1",
135
137
  "pidusage": "^4.0.1",
136
138
  "vscode-jsonrpc": "^9.0.0"
137
139
  },
@@ -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(onlyPositive).map(double)'
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)'