pi-lens 4.4.3 → 4.4.5

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 (185) hide show
  1. package/CHANGELOG.md +721 -0
  2. package/README.md +25 -3
  3. package/config/dependency-cruiser-eager-allowlist.json +1 -0
  4. package/dist/chunk-22Y2BM7H.js +23 -0
  5. package/dist/{chunk-WU567RSC.js → chunk-27VWVB23.js} +16 -14
  6. package/dist/{chunk-FLKWCIZH.js → chunk-2FYKETQJ.js} +10 -6
  7. package/dist/{chunk-MQLUAEOC.js → chunk-2LDMXL2M.js} +2 -2
  8. package/dist/{chunk-YSZNHOBY.js → chunk-2SDHYHHO.js} +17 -17
  9. package/dist/chunk-2Y6OJRSI.js +38 -0
  10. package/dist/chunk-3SNDVPOR.js +507 -0
  11. package/dist/{chunk-EJIUXPBX.js → chunk-3WCEHYOI.js} +1 -1
  12. package/dist/chunk-44X7VIKR.js +73 -0
  13. package/dist/{chunk-Q7DUK4LX.js → chunk-4FHUGDKU.js} +16 -14
  14. package/dist/{chunk-H6MF6EVN.js → chunk-4ODSZ35Z.js} +1498 -534
  15. package/dist/{chunk-ZGDGW2V3.js → chunk-4U7GDSZQ.js} +2 -2
  16. package/dist/chunk-54NIOJJZ.js +25 -0
  17. package/dist/{chunk-ZWFS3OEF.js → chunk-5DKE4HGX.js} +38 -37
  18. package/dist/{chunk-VRZP76YM.js → chunk-5LRUKYFA.js} +34 -4
  19. package/dist/{chunk-QOBUHWHX.js → chunk-63NMUNYP.js} +12 -16
  20. package/dist/{chunk-VWCXW2E7.js → chunk-6XSESGWD.js} +13 -6
  21. package/dist/{chunk-QGQ5CCCG.js → chunk-72J27ICO.js} +2 -3
  22. package/dist/{chunk-CSHFH5IN.js → chunk-7FLRUH6B.js} +1 -1
  23. package/dist/chunk-7IYC4ENJ.js +297 -0
  24. package/dist/chunk-7WWQAW5P.js +30 -0
  25. package/dist/{chunk-EU63SDCG.js → chunk-7ZS7MC24.js} +885 -451
  26. package/dist/{chunk-KBG47GHP.js → chunk-AHWA4AKM.js} +18 -12
  27. package/dist/{chunk-FMSO6RDZ.js → chunk-AI3GP74G.js} +17 -19
  28. package/dist/chunk-APFJKOP6.js +67 -0
  29. package/dist/{chunk-RXCOMYPY.js → chunk-ASRAO7KG.js} +31 -33
  30. package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
  31. package/dist/{chunk-QILIYSJF.js → chunk-CG5V25HX.js} +1 -1
  32. package/dist/chunk-CKEQFGLT.js +32 -0
  33. package/dist/{chunk-RPLINGVB.js → chunk-COOUUC5W.js} +6 -6
  34. package/dist/{chunk-GBPP5P7X.js → chunk-CPZ5JJW6.js} +4 -4
  35. package/dist/{chunk-OCAGUNBC.js → chunk-DS2USX5G.js} +13 -15
  36. package/dist/chunk-EA2ZRG44.js +27 -0
  37. package/dist/{chunk-ZHFZWTZV.js → chunk-EDMLIW6W.js} +13 -14
  38. package/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
  39. package/dist/chunk-EKNWOL2I.js +27 -0
  40. package/dist/{chunk-CMMHNUZ2.js → chunk-ELZRSR5N.js} +65 -43
  41. package/dist/{chunk-BKE7E7TC.js → chunk-EN5AM7PX.js} +11 -12
  42. package/dist/{chunk-N2H3ZPZY.js → chunk-EWXXLS26.js} +227 -24
  43. package/dist/chunk-EX4EXBW7.js +37 -0
  44. package/dist/{chunk-YYOIQFRS.js → chunk-EXVXBSGN.js} +130 -52
  45. package/dist/{chunk-6GFRNVYR.js → chunk-F7BO6FWH.js} +12 -13
  46. package/dist/chunk-FEDWAYDS.js +2485 -0
  47. package/dist/{chunk-JAU72XNY.js → chunk-FWZRGGGY.js} +73 -9
  48. package/dist/{chunk-GXW6K4YJ.js → chunk-G224FADB.js} +1 -1
  49. package/dist/chunk-G5UCJFT7.js +26 -0
  50. package/dist/{chunk-67WMNWEE.js → chunk-GLW3YDZZ.js} +22 -13
  51. package/dist/{chunk-724UL2TJ.js → chunk-GTDSYEA2.js} +72 -39
  52. package/dist/{chunk-PHDMFAKM.js → chunk-GYRZ72R4.js} +10 -4
  53. package/dist/chunk-HYVXA3BB.js +49 -0
  54. package/dist/{chunk-SAEFPSB6.js → chunk-IEBJF3PN.js} +23 -15
  55. package/dist/chunk-IJYGIDF4.js +186 -0
  56. package/dist/{chunk-ACXEQZOU.js → chunk-IL7K66ZQ.js} +101 -109
  57. package/dist/{chunk-ZXYDQ3TZ.js → chunk-JWOVP5BL.js} +50 -19
  58. package/dist/{chunk-OXXKQCSV.js → chunk-K2GUZ4DN.js} +4 -4
  59. package/dist/{chunk-AW7R2GWG.js → chunk-K4SZB56V.js} +39 -39
  60. package/dist/{chunk-WOA4LN2R.js → chunk-KCBRHV5E.js} +3 -3
  61. package/dist/{chunk-3W7IEVVL.js → chunk-KFXCL4OV.js} +47 -45
  62. package/dist/{chunk-2BBLFX75.js → chunk-KJJAVH3X.js} +81 -15
  63. package/dist/{chunk-VCHXCQFG.js → chunk-KPVLQHCZ.js} +4 -6
  64. package/dist/{chunk-P7266HLM.js → chunk-KX56K73G.js} +10 -13
  65. package/dist/{chunk-VSSBEUFT.js → chunk-LMCTHJ2H.js} +19 -19
  66. package/dist/{chunk-IBGIOBEE.js → chunk-MEFLGBCS.js} +69 -8
  67. package/dist/{chunk-TYM6OUIT.js → chunk-MKPCELNI.js} +17 -17
  68. package/dist/{chunk-XTMJ7XDT.js → chunk-N3PLNNCW.js} +1 -1
  69. package/dist/chunk-N5FBM25N.js +22 -0
  70. package/dist/{chunk-CHOW74WE.js → chunk-NFNVDDGB.js} +7 -12
  71. package/dist/{chunk-52FUZI6K.js → chunk-NLIVE7L6.js} +2 -30
  72. package/dist/{chunk-SS36ZX4J.js → chunk-OMJ3OFBJ.js} +6 -6
  73. package/dist/{chunk-4W4VLAPJ.js → chunk-OZNCKLOX.js} +13 -14
  74. package/dist/chunk-P5XUGPIX.js +31 -0
  75. package/dist/{chunk-5UCAH366.js → chunk-PJXNTPB2.js} +253 -33
  76. package/dist/chunk-PKOXJIVT.js +88 -0
  77. package/dist/{chunk-6C7JWPCP.js → chunk-PP2A5V2T.js} +27 -26
  78. package/dist/{chunk-L3BLXZG7.js → chunk-Q42LJANT.js} +31 -70
  79. package/dist/{chunk-AB3YYG6N.js → chunk-Q4BKKOVC.js} +8 -8
  80. package/dist/{chunk-3EFKIGZN.js → chunk-QT66NEYN.js} +4 -4
  81. package/dist/{chunk-3VPVG5SU.js → chunk-RCHO5W7M.js} +19 -18
  82. package/dist/{chunk-77M37OKR.js → chunk-RG3MXTRI.js} +7 -7
  83. package/dist/chunk-RG7OODGM.js +57 -0
  84. package/dist/{chunk-T6CPIZNT.js → chunk-RU34BA4D.js} +44 -39
  85. package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
  86. package/dist/{chunk-5NGR67U5.js → chunk-S55TEC7I.js} +33 -5
  87. package/dist/{chunk-M6HSLBWY.js → chunk-SJHC3BCZ.js} +7956 -8047
  88. package/dist/{chunk-XCJN5IJU.js → chunk-SNEUMLM7.js} +4 -4
  89. package/dist/{chunk-UZ3TUTRV.js → chunk-T4NGVFYI.js} +2 -2
  90. package/dist/{chunk-2VUQMUMT.js → chunk-THEXI2QO.js} +49 -43
  91. package/dist/{chunk-R3PCY3YS.js → chunk-TL2TCJYL.js} +15 -16
  92. package/dist/{chunk-C34ZXZ7O.js → chunk-TPYYEDP5.js} +838 -352
  93. package/dist/{chunk-AOHZU2BM.js → chunk-TVZRLTG6.js} +8 -1
  94. package/dist/{chunk-XMSXXAHW.js → chunk-UCVMSOXF.js} +2 -2
  95. package/dist/chunk-UL5SXQVX.js +32 -0
  96. package/dist/{chunk-GAEGEPOC.js → chunk-UO66IMVP.js} +2 -2
  97. package/dist/{chunk-N3X6Q4YT.js → chunk-UVY4TOJH.js} +3 -3
  98. package/dist/{chunk-2CD5RS6M.js → chunk-VIDEKABZ.js} +23 -2
  99. package/dist/{chunk-JSQFTSC6.js → chunk-VITFDI3O.js} +13 -14
  100. package/dist/{chunk-YIUAVF7E.js → chunk-VUAVE3QC.js} +42 -42
  101. package/dist/{chunk-QOZXJ4NA.js → chunk-WUY4BZEP.js} +21 -20
  102. package/dist/{chunk-VCO24T4L.js → chunk-X3UTCXAA.js} +43 -53
  103. package/dist/chunk-XHDBJODR.js +45 -0
  104. package/dist/{chunk-MXGY6KPT.js → chunk-XHLK33VM.js} +28 -21
  105. package/dist/{chunk-RWWYJ623.js → chunk-XI34NWDI.js} +2 -2
  106. package/dist/{chunk-QQNQ7SJW.js → chunk-XWFIHYCH.js} +12 -4
  107. package/dist/{chunk-6SDEP3AJ.js → chunk-Y2TPADJR.js} +10 -11
  108. package/dist/{chunk-MRXKYPCS.js → chunk-Y5KTA2OB.js} +17 -17
  109. package/dist/{chunk-7DYBLXYA.js → chunk-YKVDBNPO.js} +11 -5
  110. package/dist/{chunk-2B73ZPOK.js → chunk-YSDPVDFC.js} +3 -3
  111. package/dist/chunk-YWNO5Q4R.js +44 -0
  112. package/dist/{chunk-QHJ6DQ2R.js → chunk-YWWG4AQA.js} +165 -32
  113. package/dist/{chunk-3JNKMP3B.js → chunk-YXDCRUKQ.js} +4 -4
  114. package/dist/{chunk-UXGETRP4.js → chunk-YXGRRORB.js} +16 -17
  115. package/dist/{chunk-SQ4TVJBR.js → chunk-ZAPSUBLU.js} +13 -7
  116. package/dist/{chunk-76MWC2K6.js → chunk-ZPJM7DID.js} +90 -97
  117. package/dist/{chunk-XVF2VVXP.js → chunk-ZSUX7KEM.js} +16 -15
  118. package/dist/index.js +31038 -20893
  119. package/dist/mcp/analyze-cli.js +11 -11
  120. package/dist/mcp/cli.js +47 -43
  121. package/dist/mcp/server.js +2188 -906
  122. package/dist/mcp/worker.js +66 -63
  123. package/dist/probes/installer.js +21 -23
  124. package/dist/workers/project-snapshot-persist-worker.js +28 -9
  125. package/dist/workers/review-graph-persist-worker.js +1 -1
  126. package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
  127. package/docs/adr/README.md +1 -0
  128. package/docs/ast-grep_rules_catalog.md +5 -3
  129. package/docs/configuration.md +20 -0
  130. package/docs/engineering-principles.md +44 -0
  131. package/docs/environment-variables.md +20 -0
  132. package/docs/features.md +16 -1
  133. package/docs/globalconfig.md +37 -8
  134. package/docs/lsp-capability-matrix.md +105 -12
  135. package/docs/lsp-idle-eviction.md +44 -36
  136. package/docs/pi-lens-fixer.md +139 -14
  137. package/docs/pi-lens-investigator.md +14 -0
  138. package/docs/pi-lens-merge-policy.md +120 -17
  139. package/docs/pi-lens-monitor.md +71 -9
  140. package/docs/pi-lens-retro.md +6 -3
  141. package/docs/pi-lens-reviewer.md +160 -5
  142. package/docs/pi-lens-subagent.md +29 -14
  143. package/docs/release-qa-baseline.md +21 -7
  144. package/docs/servercapabilities.md +53 -63
  145. package/docs/settings.md +9 -5
  146. package/docs/subagent-compat.md +1 -1
  147. package/docs/usage.md +1 -0
  148. package/package.json +9 -5
  149. package/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
  150. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
  151. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
  152. package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
  153. package/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
  154. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
  155. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
  156. package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
  157. package/rules/rule-catalog.json +25 -1
  158. package/scripts/analyze-pi-lens-logs.mjs +15 -5
  159. package/scripts/download-grammars.js +40 -7
  160. package/scripts/lib/is-main-module.mjs +27 -0
  161. package/scripts/lib/latency-log-phases.mjs +95 -0
  162. package/scripts/lib/scratch-home-env.mjs +21 -0
  163. package/scripts/rpc-load-check.mjs +568 -81
  164. package/scripts/warm-loader-cache.mjs +2 -5
  165. package/dist/chunk-23WOO7TX.js +0 -23
  166. package/dist/chunk-3YN6V5TV.js +0 -85
  167. package/dist/chunk-466Z26MG.js +0 -30
  168. package/dist/chunk-4UNXBNE2.js +0 -24
  169. package/dist/chunk-6STA6Z7I.js +0 -47
  170. package/dist/chunk-ABBOA7UD.js +0 -157
  171. package/dist/chunk-BRGDSBJE.js +0 -28
  172. package/dist/chunk-EC47DWFA.js +0 -56
  173. package/dist/chunk-FCSOVF55.js +0 -273
  174. package/dist/chunk-IZSHAIJ7.js +0 -26
  175. package/dist/chunk-KDERNTCQ.js +0 -28
  176. package/dist/chunk-KSX3TXSZ.js +0 -69
  177. package/dist/chunk-LOP6GRPH.js +0 -31
  178. package/dist/chunk-PNQDPDRC.js +0 -184
  179. package/dist/chunk-UOPVJQ4N.js +0 -103
  180. package/dist/chunk-XAGLWMJ4.js +0 -51
  181. package/dist/chunk-XIJZVPD5.js +0 -39
  182. package/dist/chunk-Z3CCVDUB.js +0 -76
  183. package/dist/chunk-Z527N6YQ.js +0 -28
  184. package/dist/chunk-ZANLILYD.js +0 -79
  185. /package/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -16,6 +16,727 @@ All notable changes to pi-lens will be documented in this file.
16
16
 
17
17
  ### Security
18
18
 
19
+ ## [4.4.5] - 2026-10-25
20
+
21
+ ### Added
22
+
23
+ - **Tag a post-idle `memory_sample` in latency.log.** The first turn that starts after the session sat idle past the LSP idle-evict window now writes one extra `memory_sample` with `idle: true` and `idleMs`, so the main heap can be read after idle. Regular samples carry `idle: false` (#1332).
24
+
25
+ - **Opt-in: repeat injected findings in later requests so exact-prefix prompt caches keep hitting.** With `--lens-retain-injections` (or `contextInjection.retain: true`), pi-lens re-sends each injection unchanged, at the same place, in every later request of the session, labelled as a snapshot; findings are still delivered once. `cache_context` now records where each request stops repeating the previous one, and a cache miss that follows a request dropping an earlier injection is named `injection-dropped` (#4743).
26
+
27
+ - **`no-sql-in-code-execute` reports `.execute()` SQL as advisory (closes #1828)** — a `db.execute(...)` or `db?.execute(...)` call whose first argument is built by string concatenation or `${...}` substitution and starts with a SQL statement now flags under the new rules `no-sql-in-code-execute` and `no-sql-in-code-execute-js`, at `severity: warning`. The `.query` arms stay in `no-sql-in-code` / `no-sql-in-code-js` at `severity: error`, with the matching unchanged. The `.execute` arms use the statement-prefix test the TypeScript `sql-injection` rule gained for #2909, with three changes: `SELECT` and `WITH` must be whole words, the escapes `\n`, `\r` and `\t` (exactly those, case-sensitive) before the statement are skipped like real whitespace, and a `--` comment before it may end at an escaped `\n` or `\r`. Statement-shaped English such as `acl.execute("grant " + role)` still flags, which is why the tier is advisory; `runner.execute("delete " + id)`, literal SQL, parameterized `execute(sql, [id])` calls and tagged templates such as Drizzle's `sql` stay quiet. All three rules exceed the per-edit rule-complexity cap, so these findings arrive from the full analysis (`pilens_analyze`), not the per-edit pass.
28
+
29
+ ### Changed
30
+
31
+ - **A document sync no longer measures bytes the edit path just measured.** The `didOpen`/`didChange` send reused neither the sync bound's newline count (`clients/lsp/content-limits.ts`, run by the post-write pipeline and the dispatch LSP runner on the same string) nor the `#1095` fingerprint the LSP service computes before it notifies (`clients/lsp/index.ts` `touchFile`), so every send walked the document twice more for answers it already had. Both are now handed to the send (`clients/lsp/content-scan.ts` `countLfNewlines` -> `scanDocumentContent`, `recordSentContent`'s `contentHash`): one full LF walk and one full sha256 removed per edit, 0.0716 -> 0.0575 ms of per-edit document work over 200 real files (x0.80), and x0.77/x0.84 on a 100 KB / 1.96 MB document. The digest is unchanged for the same bytes, and the send still walks and hashes for itself whenever no measurement of those exact bytes is on hand (`#2066`).
32
+
33
+ - **Idle eviction enabled for measured servers (refs #3989)** — `docker-official`, `zizmor` after consecutive safe measurements.
34
+
35
+ - **TypeScript files confirm clean on their first touch.** typescript-language-server's first publish for a file that has a finding already carries it (measured 2026-10-20), so the client no longer holds that first publish: a clean TypeScript file's single empty publish now resolves `lsp_diagnostics` instead of leaving the first touch of each session unconfirmed and spending its full wait budget (#4615).
36
+
37
+ - **New opt-in `tools.lazy: "auto"` keeps every tool active on folding models; four tool schemas shrink.** The default stays `true` (situational tools start inactive on every model). The new opt-in `"auto"` keeps every pi-lens tool active on a model that folds system messages into one prompt head, where each tool-list change rewrites the cached prompt, and stays lazy on models with `compat.supportsMidConvoSystemMessages`; `false` keeps its meaning. The `ast_grep_*` and `lsp_navigation` schemas are about 1.8 KB smaller: `lang` is a plain string checked at run time (an unknown id or a non-string is refused with the valid list), `operation` is an enum, and `callHierarchyItem` is validated when used (#4687).
38
+
39
+ - **pi 1.4 is supported (refs #4741)** — the tested host range now runs from pi 0.86.1 up to, but not including, 1.5.0. pi 1.4 passes the release-QA matrix against a real pi, a resumed or forked session sends the same lazy-tool list as on pi 1.3, and the development host moves to pi 1.4.
40
+
41
+ ### Removed
42
+
43
+ - **pi 0.86.1 is the oldest supported pi host; older hosts receive no findings (#4688).**
44
+ pi 0.80–0.85 keep the prompt outside the request an extension can write to and
45
+ never emit `context_with_system`, so since #4644 pi-lens delivered no session
46
+ guidance, turn-end findings, test findings or nudges there, and recorded
47
+ nothing about it. Rather than revive those hosts, the certified window moves
48
+ from `>=0.80.10 <1.4.0` to `>=0.86.1 <1.4.0`. `package.json` keeps its open
49
+ `*` peer (pi's own rule for host-provided packages); the window is
50
+ `PI_HOST_SUPPORTED_RANGE` in `install-smoke.yml`, the "Verified hosts" list in
51
+ `docs/release-qa-baseline.md`, and the release-QA host ratchet in
52
+ `tests/packaging.test.ts`, which now fails when any two of the three disagree.
53
+ On an older pi, stay on the previous pi-lens release or upgrade pi.
54
+
55
+ ### Fixed
56
+
57
+ - **Normalize every test-run duration through the shared measurement contract.** Pytest, ExUnit, PHPUnit, JSON results, and sub-millisecond vstest readings now use the same normalizer; malformed ExUnit readings remain unmeasured instead of carrying `NaN` (#1484).
58
+
59
+ - **Bash writes in a linked worktree of the session repo are analysed again.** An interpreter or `cd`-relative write there is recovered from that checkout's own `git status`, published, and dispatched with LSP, instead of the session root's clean tree reading as "nothing changed"; relative operands now resolve against the command's own `cd`, and a worktree nested under an ignored directory or reached through a symlink is judged by its own checkout (#2050).
60
+
61
+ - **An edit in a sibling git worktree of your repository is no longer analysed silently (#2050).** Such an edit already ran the full pipeline — format, autofix, LSP touch and sync, every dispatch runner — but every delivery branch treated it as foreign, so a run that found nothing reached the agent as nothing at all. It now records `tool-result-linked-worktree` once per worktree root per session and, when the language server checked the file and found nothing, says so in one advisory (`tool-result-linked-worktree-clean`) and stays quiet once the root is known. A format-only change, or a run no language server answered, gets no such advisory. LSP registration follows the file's class instead of the edited file's directory (#2657): a session file registers the nearest directory holding a pi-lens config file, the legacy `pi-lsp.json` and `.pi-lens/lsp.json` included (else the session root), a linked-worktree file registers the same below the worktree root, and an adopted project or an unanalysable path registers nothing — so an adopted project is no longer laundered into a session root, and its cap, idle eviction and project-local-binary refusal apply again. The class and the registration now compare real paths on both sides (#4689 item 7): a session started in a symlinked directory no longer treats its own files as an adopted project, and a file reached through a different spelling of its root registers that spelling, so the LSP serves it and the root's `lsp.disabledServers` denial still applies.
62
+
63
+ - **Record bundled query-root checks:** Tree-sitter now records the bundled root's health and entry count once per ledger generation, so a healthy check is distinguishable from a check that never ran. Repeated file dispatches do not add duplicate check records. (#2678)
64
+
65
+ - **`rename_file` no longer overwrites a file written while the rename was computed.** A file the `workspace/willRenameFiles` edit rewrites text in must still hold the bytes every language server that edited it computed from; otherwise the whole edit is refused, nothing is written or moved, and the result names the stale file.
66
+
67
+ - **Restore the registry identity the idle-eviction probe arms, so measured servers can be promoted.** The compiled LSP registry hands back the catalog entry itself for every built-in without a command override instead of a shallow copy, so a policy set on the object `LSP_SERVERS`/`getServerById` exposes is the policy the client registry reads (refs #3952). Since 2026-10-10 the copy swallowed the nightly probe's `idleEviction` arm, so every measurement row read `not-evicted` and no server could earn a promotion night. An overridden server keeps its own copy, so its `spawn` and trust admission never reach the shared catalog. `scheduleIdleEviction` also records `lsp-idle-eviction-declined` once per server per session when it declines to arm a timer, so "no timer scheduled" no longer reads as "slow eviction". `/lens-perf` and `pilens_health` print both idle-eviction rows as plain counts rather than `⚠` warnings: a release and a declaration are the policy answering.
68
+
69
+ - **Run shipped checks through symlinked script paths.** The loader-cache warm and RPC load check now resolve entry paths through one shared helper instead of silently exiting without running; log analysis prints help once through either path spelling (refs #4096).
70
+
71
+ - **A grammar load that never settles no longer strands its language (closes #4224).** `Language.load` is now bounded at 30 s. A load that hangs counts as a failed load: the call returns null, one `grammar-blocked` record names the grammar, and the grammar's retry cooldown keeps later calls from waiting out the bound again. Callers that joined the same in-flight rule-batch build settle with it, so the rules for that language no longer stay stuck for the rest of the process. The abandoned load is still watched: an abort that arrives after the bound latches the wasm runtime as it would have on time, and any other late failure adds to the grammar's `grammar-blocked` record. The log line and notice for a timeout now describe a local hang and no longer name a truncated download or a network fix.
72
+
73
+ - **Keep an adopted project's files out of the session word index.** An edit in a project pi-lens serves read-only no longer adds a document to the session's symbol index, and the MCP analyze route refuses the same write for the warm index of the workspace it belongs to. Both refusals record one bounded `adopted_root_writer_skipped` decision naming `word-index`. (#4242)
74
+
75
+ - **Restore ast-grep warning history.** The debounced warning scan now selects the registered runner instead of silently selecting none. This enables the existing background scan after JavaScript/TypeScript writes; findings remain history-only. (closes #4312)
76
+
77
+ - **detekt exit 1 no longer reads as a clean file.** detekt exits 1 when its configuration is invalid, and that run prints no findings. It now records a skipped runner result instead of a clean one. Findings that detekt printed before it exits 1 are kept (#4522).
78
+
79
+ - **Environment gaps stop blocking, worktree installs restart servers, adopted shims stay refused.** Environment-gap codes (TS2307 on a Node built-in or a package a `package.json` above the file declares, TS2503 for `NodeJS`, TS2304 and TS2580/TS2591 for `node`'s globals) are demoted to warnings with a label when the file resolves no `node_modules`, on every route (the per-edit check, `lsp_diagnostics` and its cache replays, `lens_diagnostics mode=full`, and the cascade both in its output and in the footer it updates), while a path alias or an undeclared import keeps blocking; the out-of-band install look runs at the roots of the live primary clients with each client's spawn epoch, so a `node_modules` symlinked in after the server started restarts it, while an adopted root receives the look and no session bookkeeping; and `launchLSP` resolves a bare server command from PATH **in process** against the cwd the child is spawned with, so a relative `node_modules/.bin` entry (husky's generated `.husky/_/h` exports one for every git hook) can no longer make an adopted root's own shim exec unclassified, and no project-supplied `which` runs (refs #4532).
80
+
81
+ - **A HEAD move, a bash rewrite or a swept change now refuses cached diagnostics that depend on it.** The diagnostics cache heard only the dependency-install and declaration-file look, so an unchanged importer of a file rewritten by a checkout kept serving its pre-change findings. It now hears every detector, and the settled sweep also tells the language servers about a file nothing explains (#4535).
82
+
83
+ - **Open documents resync after `git stash`, `git checkout .` or `git restore`.** A bash command that discards working-tree changes without moving HEAD now resyncs the files it reverted before the tool result returns, so diagnostics no longer describe the discarded edits (#4502). A code-mod or HEAD move over many files now resyncs exactly the files it changed instead of every open document, and a failed resync is reported as a failure instead of a clean zero (slice 2 of #4535).
84
+
85
+ - **Keep confirmed-clean turn-end resolutions current on no-write turns.** Provenance now includes files whose blockers were resolved by a read-only check, avoiding a misleading historical-finding label. (refs #4617)
86
+
87
+ - **A Python error is listed once, not twice, when Pyright finds it (closes #4629)** — the `pyright` CLI and the Pyright language server (or basedpyright's) both check a `.py` file and name each finding under a different spelling of its rule, so one error showed up twice in the STOP block and counted twice in its header. The two spellings are now one identity, and a bare Pyright code in `rules.<id>.disable`, `select` or a `pi-lens-ignore` comment reaches both copies where it used to hide only the CLI's. The same identity also stops an unchanged error from showing up as new after a write when the language server goes silent and only the CLI's copy is left.
88
+
89
+ - **Prompt-cache reuse survives injected findings on pi 0.87+**: pi-lens now injects through the host's `context_with_system` hook, whose returned list pi uses verbatim, so the system head stays byte-identical and the cached prefix is not rebuilt. On an older host the `context` hook still injects. Before this, a session holding a mid-list system message (pi adds one whenever prompt sections or tools change, for example after `pi_lens_activate_tools`) lost the whole cached prefix on every injecting turn (#4631).
90
+
91
+ - **JSONC-by-convention config files stop reporting comments as blocking errors (closes #4636)** — `tsconfig.json`, `tsconfig.*.json`, `tsconfig-*.json`, `jsconfig.json`, `jsconfig.*.json`, `jsconfig-*.json`, and the `jsonc` basenames VS Code routes the same way (`babel.config.json`, `.babelrc.json`, `.eslintrc.json`, `typedoc.json`) are announced to the JSON language server as `jsonc`, so the comments their format allows are no longer findings. Undeclared `.json` files still announce `json`, and `effective_config` reports `language: "jsonc"` for the declared names while the file kind stays `json`.
92
+
93
+ - **Name project-only settings in global config warnings.** Valid project settings such as `rules` and `reviewGraph` now point to `<project>/.pi-lens.json` instead of being described as typos. Unknown keys still receive the typo warning. (closes #4637)
94
+
95
+ - **Python 3.14 projects no longer see spurious syntax errors, and ruff fixes agree (closes #4638)** — jedi compiles with the interpreter it launched, so a PEP 758 unparenthesized `except` in a project declaring Python 3.14 surfaced a `compile` `SyntaxError` that the rest of the toolchain accepted. pi-lens now reads the declared syntax level from the project — ruff `target-version`, pyright `pythonVersion`, `requires-python`, then `.python-version` — and drops jedi's `compile` findings once that level is 3.14 or newer, recording the drop once per session with the declared level and the file that declared it, and naming the withheld rows in the text every surface returns (post-write, probe, `mode=full`, `lsp_navigation`). jedi and pyright also launch from the project's own interpreter (a uv workspace `.venv`, the project's `.venv`/`venv`, or an ambient `VIRTUAL_ENV`/`CONDA_PREFIX`/`UV_PROJECT_ENVIRONMENT`) before the managed install and `PATH`. ruff's fix pre-check no longer pins `py310`, so it parses exactly like `--fix` and the lint run under the project's own `target-version`.
96
+
97
+ - **A dead-code scan that finishes late no longer crashes pi-lens or stalls on a disk error (closes #4661).** When a Python dead-code scan outlived the turn_end budget and the disk then refused its baseline write (full, read-only, or the cache path taken by a file), the error escaped as an unhandled rejection and the scan stayed parked, so every later turn reported it as in flight and never started another. A failed baseline write is counted as `dead-code-baseline-write-failed` and the scan's findings are still delivered on the next turn.
98
+
99
+ - **Name the prompt-cache misses pi-lens causes, and stop losing real expiry to a long tool result.** `cache_usage` now reports `tool-set-changed` and `system-prompt-changed` from the unbounded ordered system-message set, measures a miss against the last healthy read, names a turn whose whole prompt shrank `prefix-shrunk` and re-baselines on it on every provider, whether or not it reports cache writes (so a compaction or a model switch stops reading as a miss, and a second rewrite on Gemini, Mistral or OpenAI still does), reads `ttl-expired` across an ordinary 20,000-character message, reads `partial-eviction` on Anthropic and Bedrock, where the re-sent tokens are cache writes, and records one `prompt-cache-miss-unexplained` degradation row on a session's second unexplained miss — the first stays silent and later misses only raise the count (#4687).
100
+
101
+ - **A symlinked file is one file to the read guard and to bash write attribution.** On Linux and macOS, a file read through a symlink and edited through its target (or through a directory link) is no longer refused as never read, and a bash write through a link now reports the blockers the real path reports instead of "clean". Path keys now resolve links the way Windows keys already did. In a project opened through a link, pi-lens now keeps one project data directory, named from the real path: a disposition mark silences its finding on the next write, and the marks, caches and session data an earlier version stored under the link's path are copied over once when the session starts, with the old directory left in place (#4689).
102
+
103
+ - **A directory link no longer selects a sibling package's Cargo workspace, git repo or package root** (refs #4689) — eight hand-rolled upward walks now climb the path identity through the shared `walkUpDirs` (#4689): the Cargo inherited-edition climb and its `$HOME` ceiling (a home that is itself a link no longer lets a workspace manifest above it through), the runner path resolver, the `.shellcheckrc` and `.vale.ini` finders, the metrics history's git check (a file in a linked directory recorded its commit as `unknown`), the package root and the ast-grep `node_modules` search. The project-root walk of the startup scan keeps its spelling by design and moves onto the same helper unchanged.
104
+
105
+ - **Config and package lookups follow a symlink to the real directory.** pi-lens looks upward for tool configs, `.pi-lens.json`, the Python target version, a uv workspace, and the Cargo or Dart package of a fixer. Each lookup now starts at the real path, so a file reached through a directory or file link reads the config of the package it really lives in. An active virtual environment named through a link to the project counts as the project's own. A link-spelled home directory stops the search on both spellings. The project-local bin trust check and the git and analysis-root walks still use the path as written (#4689).
106
+
107
+ - **`--lens-guard` now opens for a blocker you marked false-positive on a turn that wrote no file**: the commit gate re-judges its latch on a turn whose only action is `lens_diagnostic_mark`. The same marks probe now answers per project and resets with the session, so one project's `defer` neither turns the check on in another project nor outlives the session that made it.
108
+
109
+ - **An in-process subagent keeps its project root and language servers when its parent ends first** (#4704): the shared teardown now waits for the last live session in the process, not the last one of the parent's extension activation, and a subagent its runner disposed without a shutdown no longer holds it. A session started or resumed while a subagent runs keeps the language servers that subagent uses instead of restarting them.
110
+
111
+ - **Share fallback LSP roots across project directories.** When language-specific markers are absent, use the nearest generic project marker instead of starting a separate workspace for each directory; keep loose-file and extensions-boundary behavior (closes #4728).
112
+
113
+ - **A module changed on disk that no language server had open now reaches the live servers.** After a `git checkout`, merge, pull or an edit from another terminal, a server (pyright showed it) kept the old bytes of an imported module and reported every attribute of it as unknown on each later edit of the importer, until the server restarted. The HEAD-move, bash-write and settled-sweep looks now send those paths to the servers as watched-files events, and a module a checkout adds is announced as created, so an importer's unknown-import finding clears too (#4742, #4535).
114
+
115
+ - **pyright's interpreter now reaches the server; rust-analyzer's settings pull is answered truthfully** — pi-lens answered every `workspace/configuration` request from one flat options blob. pyright reads neither `pythonPath` nor `openFilesOnly` from `initializationOptions`; it pulls the `python`, `python.analysis` and `pyright` sections, got `{}` for each, and ran on its defaults, so the detected project interpreter and any `lsp.serverOverrides` options for pyright never reached it. They now sit under `python.pythonPath` and `python.analysis.diagnosticMode`, and a real pyright resolves a package that only the project interpreter carries. rust-analyzer already received its options at startup through `initializationOptions`, and it skips an empty client config, so the `{}` it pulled was a no-op; that pull is now answered with the same blob (user overrides included) so the two paths agree, and its applied effect stays unmeasured. Overrides for pyright and basedpyright are written under their section names (for example `python.analysis.typeCheckingMode`); see `docs/configuration.md`.
116
+
117
+ - **A loose file now roots the auxiliary scanners at its own directory, not at the session `$HOME`.** Opengrep, ast-grep, zizmor, and typos no longer spend five 15-second initialize timeouts (and latch the scanner broken for the session) when pi's cwd is `$HOME`. A file whose scanner root would be `$HOME` or above it (a file directly in `$HOME`, one in an excluded directory such as `~/testdata`, or a dotfiles checkout at `$HOME`, under any symlinked spelling of `$HOME`) is declined once, by policy, before any process starts (#4760).
118
+
119
+ - **An offline opengrep no longer reads as a clean scan.** An auxiliary scanner that reports over `window/showMessage` that its config or rules failed to load now records one bounded degradation, and its empty publications stop counting as evidence, so the touch reports the scanner as unconfirmed instead of clean, and the coverage-gap record carries the server's own failure text (#4764).
120
+
121
+ - **Opengrep stops downloading its rules at every start once it has them.** A weekly background refresh now fetches the registry rule pack to `~/.pi-lens/rules/`, checks it with `opengrep --validate`, and swaps it in. Sessions use your repo's own rule file if it has one, else that cached pack; until a non-empty pack is cached they fall back to the `auto` download. pi-lens ships no rules (#4765).
122
+
123
+ - **A bash rewrite of a module and its importer no longer STOPs on the importer's stale error.** Pyright and typescript-language-server checked the importer against the module's old bytes and re-checked it only after pi-lens had read the answer. pi-lens now sends each document of the command to them again after the last one, and reads the answer to that send. A server run through an `lsp.serverOverrides` command gets no second send, because pi-lens has not measured that binary (#4782).
124
+
125
+ - **A bash edit's dependent is no longer checked against its dependency's old bytes (refs #4782)** — When one command rewrote a module and a file that imports a name it added, the dispatch could read the importer's previous push answer, computed against the module's old bytes, while the server's newer answer was still in its 150 ms quiet window, and report a STOP on code that compiles. A diagnostics wait now never settles on a stored answer while a later one for the same file is pending.
126
+
127
+ - **An opengrep finding is no longer erased by a late empty publication (#4786)** — right after its rules load, opengrep could publish a file's finding and then an empty set for the same file: its open-documents scan clears every file it did not scan that time. pi-lens kept the last one, so the file read clean. An auxiliary scanner's unversioned empty publication now never replaces a finding from the same rules generation and the same send; a new send (an edit) or a rules refresh still clears it, and language servers keep last write wins. Each refusal is recorded as `lsp-auxiliary-empty-after-finding`.
128
+
129
+ - **Opengrep now reports findings on a file's first edit after the file is created.**
130
+
131
+ - **Two Python ast-grep false positives.** `no-return-value-in-generator` no longer treats a function as a generator because a nested generator lambda (`lambda: (yield)`) yields, and `unchecked-numeric-parse-python` no longer flags `int()`/`float()` over `round()` or `len()`, which always return numbers (#4840).
132
+
133
+ - **csharp-ls no longer crashes with SIGABRT in C# folders that have no solution or project** — for a C# file with no `.sln`/`.slnx`/`.csproj` above it (a Unity `Assets/**` tree is the common case), the root fallback handed csharp-ls the file's own directory. csharp-ls then threw "no .csproj/.fsproj or sln files found" on a thread-pool thread and the .NET runtime aborted the process, leaving a core dump per attempt. pi-lens now declines to start csharp-ls when no solution or project file exists at the file's root or in a bounded search below it (at most 128 directories, nearest first). `lsp_diagnostics` then reports the file as unconfirmed and names the missing project root and the search bound instead of a start problem. The OmniSharp fallback server is unchanged. The dotnet test runner and the `dotnet build` runner now read the same project-file rule, so a directory or backup file named like a project (`Foo.csproj/`, `Foo.csproj.bak`) no longer counts as one.
134
+
135
+ - **Bound deferred restore waits (refs #3915)** — The settled drain stops waiting when its restore budget ends or the run is cancelled. The host was already released at the hook wall, so this bound frees the drain's remaining work. Restoration continues, and any lost-edit notice is delivered once when it finishes.
136
+
137
+ - **A stray `.git` directory no longer becomes the checkout root (closes #4508)** — The file walk behind checkout, linked-worktree and HEAD lookups now skips a `.git` directory with no `HEAD`, as git does, and keeps looking upward. An empty `/tmp/.git` no longer turns every cwd under `/tmp` into a checkout, and a stray `.git` inside a real repository no longer hides the repository's HEAD and linked worktrees.
138
+
139
+ - **Keep inferred-project diagnostics non-blocking under warm attach (closes #4645).** An attached session now labels and demotes TypeScript errors for files outside every tsconfig project, as a local session does. The longest-lived process sends the server's own diagnostics together with its answer about project membership. The attached session then runs the usual demotion on both and keeps the quick fixes. When the membership answer is late, the reply still arrives in time but carries no answer, and the error stays blocking. The change applies once both the attached session and the longest-lived process run this version. With an older process on either side, the error still blocks as before.
140
+
141
+ - **Agent-facing guidance names the tools the agent's host can call.** The session-start situational bullet listed three of the five lazy tools (`ast_grep_outline` and `lens_diagnostic_mark` were missing); it now derives its list from the tool registry, skips a tool disabled by `tools.<name>.enabled`, and under MCP names only the tools MCP can call. The ast-grep no-match hint likewise told every caller to use `symbol_search`, `module_report`, `lsp_navigation` and `ast_grep_search`, none of which an MCP client can call by that name, and now renders through the same host translation (#4682, #4809).
142
+
143
+ - **The session-start orientation no longer tells the model to activate tools that are already active.** With `tools.lazy: false`, and under `"auto"` on a model that gets every tool up front, the situational bullet now says to activate through `pi_lens_activate_tools` only for an unlisted tool, so the same text is true under every `tools.lazy` posture (#4682).
144
+
145
+ - **A gitignored file is skipped whichever way its path is spelled** — the project ignore matcher was rooted at the spelling it was handed, so a file reached through a symlink to the project (or through a link into it) read as outside the project and was never ignored: it was linted, formatted and read-tracked despite `.gitignore` or `.pi-lens.json` `ignore`. A pi-authored write to a nested `.gitignore` named through such a link also missed the instant cache eviction it owes, so the stale verdict lived until the next freshness window. Verdicts and the eviction now key by the project's real path (refs #4689).
146
+
147
+ - **`lens_diagnostics` mode=full no longer keeps a stale blocker beside a clean sweep through a symlink** — the sweep names a file by its real path while the widget store holds the writer's spelling, so the fresh result did not retire the stored row, did not mark an unreconciled one stale, and rendered one file twice. The merge now keys both sides by the file's path identity.
148
+
149
+ - **A file reached through a symlink now gets its own project's language server** — a write through `pkg-a/src/blink.ts` (a link to `pkg-b/b.ts`) started or reused `pkg-a`'s TypeScript server, and a file reached through a linked directory could leave that wrong root cached for the real path too. The language-server root search now starts from the file's real location, and the directories it refuses or stops at (the home directory, the temp directory's `.git`, the `.pi/agent/extensions` boundary, the session directory) are compared on the same footing, so a session opened through a linked directory keeps one server per package instead of one for the whole session. One exception keeps the old search: an extension folder linked into `~/.pi/agent/extensions` from elsewhere still searches along its linked path, so it never picks up a project above its real folder. An extension linked the other way, from `~/.pi/agent/extensions` into a project, never roots at pi's own `~/.pi/agent` folder. It uses its own project when it has a `package.json`, and the project it is linked into when `~/.pi/agent/package.json` exists. With neither, it is served from its own directory, like any loose extension file.
150
+
151
+ - **A whole-package autofix of a file reached through a link is now recognised as pi-lens's own change** — when the agent wrote `crate-alias/src/main.rs` (a link to `crate/`) and `cargo clippy --fix` or `dart fix` rewrote it, the pipeline compared the agent's spelling with the fixer's real path, concluded the target was unchanged, and drew no post-write state hash for it. The changed-file set is now keyed by the file's real path, so both spellings are one file. Refs #4689.
152
+
153
+ - **A file reached through a symlink now runs its tools in its own project and keeps one footer row** — a write through `pkg-a/src/blink.ts` (a link to `pkg-b/b.ts`) ran biome and the other root-marker tools in `pkg-a`, with `pkg-a`'s config, while the same file written as `pkg-b/b.ts` ran them in `pkg-b`. The tool's working directory and the project-marker search now start from the file's real location, and the `$HOME` ceiling they stop at is compared on the same footing, so a home directory that is itself a link still stops the climb. Formatting a linked file (`AGENTS.md` linked to `CLAUDE.md`) no longer opens a second footer row under the link's name, and a `lens_diagnostic_mark` call typed with the link's name now retires the real file's row.
154
+
155
+ - **`--lens-guard` no longer refuses every commit over a record an earlier session left (#4725)** —
156
+ a `turn-end-findings` record past the cache's freshness window, or written by
157
+ another session, refused every later commit as "blocker state is unknown",
158
+ and the refusal's "start a fresh session" did not help. A record that claims
159
+ no blocker no longer gates at any age, and a clean write or a settled turn end
160
+ retires it; so does a turn end for the record a session without
161
+ `--lens-guard` left. A record that still carries a blocker keeps gating, and
162
+ the refusal now names its files: a write that pi-lens checks in full and
163
+ finds clean clears that file's part, and the last one clears the record. A
164
+ passing test run no longer takes over another session's record, so its
165
+ blockers stay until their files are checked. A file whose check crashed
166
+ keeps the gate closed, and names the file, until pi-lens checks that file
167
+ again or the file is gone; other files' clean writes no longer clear it. A
168
+ blocker fixed while a language server was unavailable no longer keeps every
169
+ commit refused.
170
+
171
+ - **Files written by tools other than bash now get diagnostics (#4732)** — A file another extension's tool, an MCP tool routed through pi, or a codemode script writes without naming it is found by the same git diff an opaque bash command gets, published to the language servers and dispatched. pi's read-only and structured built-ins and pi-lens's own tools are not diffed and cost nothing; a captured call costs two `git status` children. A call pi-lens cannot diff (no tool-call id, or git could not answer) is named once per session as `opaque-capture-refused`. With `--lens-guard`, a blocker found in a file such a tool edited now stops `git commit` straight away, not only from the end of the turn.
172
+
173
+ - **A second session's blocker no longer erases another session's commit-gate blocker.** Under `--lens-guard`, the turn-end record now keeps each session's blocker sections with their owner. A session's write, turn end or fix replaces only its own sections. Another session's section leaves only when a clean check of the whole file re-checks it, or when its file is deleted. Before, once a second session fixed its own blocker, `git commit` ran while the first session's blocker was never re-checked (#4738).
174
+
175
+ - **The commit gate guards `$'git' push` and every other quoting of git commit and git push (#4739)** — `--lens-guard` read the shell's raw token text, so `$'git' push`, `$"git" push`, `g$'i't push`, `git $'push'`, `g\it push` and `(git push)` ran unguarded while `git push` was guarded. It now reads the word bash decodes. ANSI-C words are decoded as bash decodes them (`$'\x67it'` is `git`), so an escape in an ordinary command (`cut -d $'\t'`, `python3 -c $'…'`) no longer trips the gate. A word the shell model cannot read (an expansion such as `$g`) guards the command when it can be git or its verb. Commands inside a subshell or a group are read too, and so is a literal string handed to `eval` (also behind `builtin` or `command`) or to `nix-shell --command`. An escaped launcher switch (`bash $'\x2dc' 'git push'`) is read as the switch it may be. An ANSI-C `\'` no longer hides the rest of the command from the gate, and a trailing line continuation no longer drops the last word.
176
+
177
+ - **Terraform diagnostics no longer wait out a hold on the first publish (#4746)** — terraform-ls's first publish carries the file's findings, so the first-publish hold that treated it as an index artifact could only delay them. The probe that measured that hold counted the workspace directory's empty set as the file's own first publish; scoped to the document it reads `direct`, and the hold is removed.
178
+
179
+ - **A second session no longer erases another session's CVE or secret blocker.** Under `--lens-guard`, a project-wide blocker that names no file (a CRITICAL dependency CVE, a leaked secret, an unlisted dependency) stays with the session that reported it. That session's next turn end replaces it. Any session's turn end drops it once 30 minutes pass without that session rewriting it. Before, the next turn end of any other session dropped it unchecked, and `git commit` then ran (#4750).
180
+
181
+ - **A session started with `/new`, `/fork` or a resume now gets its own turn-end findings (#4751)** — after pi replaced a session in the same process, pi-lens still read the turn-state worklist as the first session's, filed the new session's edits where its turn end never looked, and reported "no modified files": no turn-end findings reached the model and no turn-end blocker section reached the `--lens-guard` record. The new session now takes the worklist over at its turn start, keeping any work its predecessor left, and one `session_handoff_turn_state` row in `latency.log` records each hand-off.
182
+
183
+ - **Managed tool installs refuse a bin directory that links out of a pinned `PI_LENS_HOME`** — with `PI_LENS_HOME` set, an install whose `bin` directory resolves outside that home (a symlink to another directory) no longer writes the downloaded binary through the link: it records one `managed-tool-install` row and fails the install, instead of replacing the file the link points at (a probe overwrote a real `~/.pi-lens/bin/opengrep` that way). With no `PI_LENS_HOME`, a linked default `~/.pi-lens/bin` is still honored.
184
+
185
+ - **A reload during session start no longer raises an unhandled rejection from the startup scans** — the background scans wait for the analyzer clients to load before reading the host's flags. A reload that landed in that wait made the read throw the host's stale-context error from a task nothing caught, which can end a Node host's process. The replaced session now skips its scans and records one `extension-ctx-stale` entry (subject `session-start-scans`); the session that replaced it runs its own scans. (#4815)
186
+
187
+ - **A `serverOverrides.<id>.command` no longer runs under measurements of the catalog binary** — the override kept every measured trait of the built-in server row it replaced: idle eviction, notify reply ordering, dependent-file propagation, and the wait strategy keyed by server id. The override now keeps the row's routing identity, its protective guards, its wait budgets and the protocol workarounds that make a scan wait longer (opengrep's re-open on edit and its hold on the pre-rules empty publish, for example), and resets every optimistic claim (idle eviction, reply ordering, `silentOnClean`, `seedFirstPush`, shorter budgets) to its fail-safe default (#4833).
188
+
189
+ - **Swift roots at buildServer.json for Xcode projects (closes #4854)** — An Xcode project with no `Package.swift`, set up for sourcekit-lsp by xcode-build-server, now roots SourceKit-LSP at the `buildServer.json` directory. Before, the server started in each file's own directory, never read the build settings, and reported `Cannot find 'X' in scope` for every type from a sibling file.
190
+
191
+ - **detekt findings reach the agent again: its text report has no severity token (#4522)** —
192
+ detekt's console report is `file:line:col: message [Rule]`, but the parser required a
193
+ `warning:`/`error:` level, so a project with a `detekt.yml` read as clean
194
+ instead of reporting its findings. The level is now optional, and detekt 1.23.8's
195
+ real bytes are replayed from a captured fixture.
196
+
197
+ - **Session diagnostics disclose incomplete evidence (closes #4620)** — `lens_diagnostics` session results and compact summaries no longer show a ✓ or "clean" for a pending, stale or never-diagnosed file. Only a final snapshot with no matching findings reads clean; every other zero-finding result says `inconclusive` or `unverified`, and names a next check scoped to the requested paths with the pi or MCP tool name. A file that changed on disk stays `inconclusive` on every later read, and the footer withholds `✓ clean` for it, until a fresh analysis replaces its evidence. Session reads still run no validation. The footer's five file rows go to the highest tiers first, so a retained warning never pushes a blocking row out of the frame.
198
+
199
+ - **A symlinked file is formatted through its real path instead of failing every turn** — Prettier refuses an explicitly named symlink (its exit 2), so a repo with `AGENTS.md -> CLAUDE.md` reported `deferred format: 0 changed, 1 failed` at the end of every agent turn. `formatFile` and the format service now hand the formatter the file's identity (the real path of its nearest existing ancestor plus the missing tail), so `CLAUDE.md` is formatted and nothing fails. A file whose real path sits outside the session's writable roots is refused and writes nothing, whether it was named through a link or directly. The pipeline already skipped files in another project's root; the new refusal also covers files with no project root, such as vendor paths under `node_modules`, which the pipeline used to hand to a formatter (#4689).
200
+
201
+ - **A timed-out read-only LSP probe no longer keeps its server busy** — a tsserver `projectInfo` probe (the warm-attach membership check and the first-open project-identity sample) that the server never answered stayed pending forever: no `$/cancelRequest` was sent, the connection counted as busy, and the client could never be evicted or make room for another server (#4801). The probe is now cancelled on the wire and released as soon as its 2.5 s ceiling passes.
202
+
203
+ - **LSP root follows a marker added or removed right after a lookup (#4756)** — the per-directory root memo trusted an unchanged directory mtime, but a directory last changed a few milliseconds before the lookup takes its next change in the same file-system timestamp tick (10-16 ms on Windows), so a deleted `Package.swift` stayed the root and a new nearer `.git` did not move it. A lookup whose directories were stamped that close to it is no longer memoized.
204
+
205
+ - **Opengrep findings now reach the first check of a session (#4763)** — with its default `--config auto`, Opengrep scans a just-opened file before its rules load and publishes an empty result, then sends `semgrep/rulesRefreshed` and the real findings about a second later. pi-lens counted the empty result as Opengrep's answer, so the touch ended with "No auxiliary findings." and the findings arrived after the wait. The empty result is now held until Opengrep says its rules are loaded; the touch waits for the findings within the existing Opengrep budget, and an Opengrep whose rules never load is reported as not having answered instead of as clean. Each `lsp_aux_wait_outcome` row also records `publishedCount`, how many diagnostics the auxiliary published for the touch.
206
+
207
+ - **`.tfvars` no longer reported as "Unexpected attribute" under terraform-ls** — pi-lens opened every `.tf` and `.tfvars` file in terraform-ls with the language id `terraform`, so a variables file was decoded as module code and, with terraform-ls's enhanced validation (its default since 0.32), every assignment in a `.tfvars` was reported as an error even though `terraform validate` accepts the file. `.tfvars` is now announced as `terraform-vars` — the file association VS Code's extension uses (hashicorp/vscode-terraform#1672) — while keeping the same `terraform` server, runners, and formatter. The false report is gone for every variables-file basename. terraform-ls (0.39.0) publishes a variables file's real diagnostics only for autoloaded names (`terraform.tfvars`, `*.auto.tfvars`); other basenames (`variables.tfvars`, `dev.tfvars`, …) now get no terraform-ls diagnostics at all.
208
+
209
+ ### Security
210
+
211
+ - **A command lookup no longer starts the project's own files before you trust the project in pi.** Until pi reports the project as trusted, pi-lens leaves out of every child's search path the directories that belong to the session's repository: the session folder, the `node_modules/.bin`, `vendor/bin` and virtualenv bin folders of its parent folders below your home folder, and every checkout of the same git repository, including linked worktrees. pi-lens's own data folder never counts. A command name that would still resolve into the project, for example through a global folder holding a link into it, is refused. The same rule covers `which`/`where` answers, the npm, pnpm and yarn global bin folders (queried from your home folder, so project `.npmrc`-style files cannot redirect them), the installer's PATH check and the LSP launcher. Each refused folder or file is reported once per session as a `trust-refusal` row in `/lens-perf`, with one warning in the extension log. A trusted project, and every MCP host, behaves as before. A session started in your home folder or above it owns nothing (refs #4530).
212
+
213
+ ### Internal
214
+
215
+ <details>
216
+ <summary>58 internal changes: tests, CI, tooling, and refactors</summary>
217
+
218
+ - Document line addressing has one owner. `clients/lsp/content-scan.ts` counts the document's LF newlines (`countLfNewlines`) with a native walk on every document and serves the last LSP-addressable line, and the LSP sync bound (`exceedsLspSyncLimits`) plus `lineTextAt` now read that owner instead of running `content.split("\n")` themselves — one substring per line, ~40 800 of them on a 1.92 MB document. On a 1.92 MB document (best of 40, interleaved) the bound check drops from 0.61 ms to 0.44 ms on LF content and from 0.62 ms to 0.47 ms on CRLF content, so it no longer pays a per-character walk on any document holding `\r` (#2066); `lineTextAt` drops from 0.43 ms to under 0.01 ms for a line near the top. The #1095 content hash still makes its own native sha256 pass: folding it onto the walk costs 1.16x more on LF content (1.278 ms against 1.104 ms at 1.92 MB), and the walk's `lastLine` answers UTF-16 offsets a byte buffer cannot.
219
+
220
+ - **Summarize skills resolution in offline log reports.** The analyzer now counts `skills_resolved` phases by status in JSON and text, alongside its existing degradation-ledger census. (refs #2639)
221
+
222
+ - **Trace validation pilot for the session-lifecycle model.** A real lifecycle run's `session_scope_transition` rows are checked against `formal/session-lifecycle` with TLC (`scripts/trace-validate-session-lifecycle.mjs`); the design note, the measured cost and the planted-drift reds are in `docs/adr/0010-trace-validation-session-lifecycle.md` (#3533).
223
+
224
+ - **Keep the nightly's staged `.changelog/` fragment in the promotion artifact.** `tool-smoke`'s PR-input upload now sets `include-hidden-files: true`, because `actions/upload-artifact` v4.4+ drops every name that starts with `.` and the promotion PR then failed on `pathspec '.changelog/…' did not match any files`; a new workflow pin derives the staged set of every upload step and reds when one of them drops a dot path (#3952).
225
+
226
+ - Repoints dangling AGENTS.md section citations to their live homes and adds a sweep that fails on any quoted AGENTS.md section that is not a heading (#4361).
227
+
228
+ - Test files no longer leak module, bridge, ledger, client or fixture state into the next case, so eight shuffle-census rows are retired (refs #4561).
229
+
230
+ - **Shuffle-order isolation for five census members.** The wasm-trap containment file resets the review-graph extractor cache and the shared tree-sitter client per case. The console-channel, LSP real-runner and session-decision-records files restore their shared state per case, and the census ratchet is now empty (refs #4561).
231
+
232
+ - **Contributor docs name the five `pi-mock` classes with measured counts and the reuse rule a new test starts from (#4632, slice 10).** AGENTS.md "Test requirements" replaces "three classes" with the admit list's real vocabulary (`process-boundary` 4, `internal-seam` 38, `unproducible-payload` 5, `double-subject` 1, `real-ui-harness` 1, plus four `pending slice 10` markers) and its counting command, names `tests/support/ndjson-rows.ts` as the
233
+ JSON-lines reader whose `skipped` a complete-output claim asserts is zero, and
234
+ states that no host-spread script exists. The fixer and reviewer contracts gain
235
+ one pointer: tier 1 for a registration question, tier 2 for a session-flow case,
236
+ that reader, and doubles only where `AGENTS.md` admits them.
237
+
238
+ - Move the #4631 cache-head witness, and the image-attachment injection case, onto the real pi session tier, and record the tier-2 red/green evidence the #4644 merge never carried (#4632).
239
+
240
+ - The commit gate's `tool_call` verdict cases now run through a real `AgentSession` with a scripted provider: each asserts the tool result the model actually received and that a blocked tool never ran.
241
+
242
+ - **Session-identity tests moved from the pi double onto the real host (#4632 slice 5)** —
243
+ `tests/index-4632-s5-session-identity.test.ts` now runs the shared-teardown, per-root
244
+ `session_start` and config-resolution-at-the-boundary cases as real pi `AgentSession`s
245
+ (`tests/support/pi-session.ts`), asserting pi's own session ids, the process registry and the
246
+ loaded copy's own log rows. The old `tests/index-config-resolved-session-wiring.test.ts` is
247
+ deleted with its `pi-mock` row; the two other files keep the cases whose verdict needs the
248
+ double (an activation with several live members, a replacement ordering pi never produces, and
249
+ `vi.mock` interposition) and their rows now name that class. The tier-2 helper also pins
250
+ `minimal` as a startup mode and a second live session as a concurrent secondary. No product
251
+ behaviour changes.
252
+
253
+ - **The session tier of the real-host test seam (#4632): a real pi `AgentSession` over the built `index.js`, with a scripted provider at the boundary.** `tests/support/pi-session.ts` runs pi's own loader over the compiled extension, so a case asserts what the host and the scripted model actually received instead of what a handler was handed; three files moved their session-flow cases onto it (injection placement on a real turn, the `session_start_total` classification row, and the primary release at shutdown), and the helper's own contract test pins the tool-call round trip, resume from the persisted session file, and the effects of the loaded copy's own `session_shutdown` handler (its primary release and its settled sinks).
254
+
255
+ - CI: one shard-verdict seam for both sharded required aggregates. A shard whose own work step concluded `success` and was then `cancelled` at its own `timeout-minutes` (master run 39380875926, `TLA+ models (shard 4/4)`, 735 s against 720 s) is now a pass with a recorded `::warning::` instead of a red `TLA+ models` / `Unit tests` check; a shard cancelled before that step finished stays red, and unreadable evidence fails closed. `scripts/check-shard-verdict.mjs` is the one implementation, driven from the run's own job list with `actions: read` (#4672). The `ci-infra-kill-rerun` classifier also judges a `cancelled` `CI` run on `master` whose cancelled jobs all concluded every step `success`, and reruns it at most once under the existing two-rerun bound; a cancelled pull-request run is still left alone (#4672). `ci-verdict` now prints a non-gating runtime-vs-cap line for any job at 70% of its `timeout-minutes`, read from the workflow YAML and the check-runs it already has (#3920 item 3). A shard's teardown-cancel warning is reachable only for a `cancelled` aggregate result, and every gating step named with `--check-step` (now repeatable, so `Unit tests` names `Tmp-fixture hygiene owner` as well as `Run tests`) must have concluded, so an unfinished gate in the same job stays red. A blank `--check-step` value is a usage error, and the warning needs every shard of the matrix in the job list, so a teardown cancel beside a missing shard row stays red. `ci-verdict` reads the same judgement: a cancelled shard row whose own aggregate concluded `success` after that shard completed no longer holds the verdict pending (a green aggregate that started earlier judged nothing), its runtime-vs-cap marker agrees with the verdict for schedule-only jobs, and it loads in a checkout that was never built. The balance line's stale-table verdict compares the table's ordering with the run's own (rank agreement) instead of one shard's summed seconds, and `scripts/gen-tla-model-costs.mjs` refuses an empty, all-zero or under-populated table instead of writing one, and `loadModelCosts` refuses any table whose max is 0. The TLA+ shards are packed by measured per-config cost (`scripts/tla-model-costs.json`, `scripts/gen-tla-model-costs.mjs`) instead of round-robin by count, which took the per-shard measured work from a 2.9x spread to 1.00x, and the shard cap moves 12 -> 20 minutes from that measurement (#4672).
256
+
257
+ - **`actions/setup-python` interpreter pins are parsed, not text-scanned, so no workflow shape can slip a floating version past the gate (#4683)** —
258
+ `scripts/check-action-pins.mjs` now loads each workflow and composite action
259
+ with `js-yaml` and walks `jobs.*.steps[]` and `runs.steps[]`, requiring a
260
+ `python-version` that is a concrete `x.y` or `x.y.z` string, or a
261
+ `${{ matrix.<key> }}` reference whose every matrix leg is one. Flow
262
+ collections, anchors, aliases, tags and block scalars resolve through the
263
+ parser instead of a scanner, and a file the parser cannot read, a step it
264
+ cannot classify, and every other expression refuse rather than pass. A matrix
265
+ the rule cannot read refuses too — a non-list `include:`, an `include:` row
266
+ that is not a mapping, a non-mapping `strategy` or `strategy.matrix` — instead
267
+ of reading as absent. The
268
+ withdrawn text scan in #4671 found a new silent pass in each of six review
269
+ rounds; this one has no shape to enumerate. `Action pin comments` installs
270
+ its dependencies because the rule parses with a runtime dependency, and
271
+ `STATE_TABLE.md`'s population lands as `tests/config/action-pin-split.test.ts`.
272
+
273
+ - The test runner's failed-target and project-root keys, and the actionable-warning fix's one-file guard, now derive path identity through `clients/path-utils.ts` instead of a raw `realpathSync`: a project root that does not exist yet is keyed by its identity through either spelling, and a quick fix whose edit names a second file that is not on disk is skipped as `multi_file_edit` instead of `apply_failed` (#4689).
274
+
275
+ - Key every inline-blocker and deferred-format accessor of the runtime coordinator by the raw spelling through `normalizeMapKey`, and absolutize a deferred mutation with `realpathOrResolve`. A spelling that goes through a directory link with `..` (`link/../file.ts`) now reaches the same record through every accessor; common spellings are unchanged (#4689).
276
+
277
+ - Add a nightly warning when a required CI job's p90 runtime over the last 20 master runs reaches 70% of its `timeout-minutes` cap. It shares the rule with ci-verdict's per-head "Runtime vs cap" report, reads the required set from branch protection, emits one annotation per job, names every required context it could not measure, and never gates a PR (#4691).
278
+
279
+ - The daily `untriaged-issues.yml` workflow is now named `Daily repo health`, since it also runs the required-job p90 check (#4691). The file name and job name are unchanged.
280
+
281
+ - **Drop five redundant LSP server arms (#4709).** Seven test files were reviewed. Five no longer need the injected server list, because the real registry answers what the fake did. Two keep it, because without it a real server would spawn.
282
+
283
+ - **Twenty test files drop the `clients/latency-logger` mock they never read (#4709).** Test mode skips the latency writer (`logLatency` only updates its in-memory phase ring), so a file that never reads the stub or its sinks runs against the real module; the in-process-mock baseline falls from 816 to 796 rows. The 134 files that still read or drive the stub stay mocked.
284
+
285
+ - **Drive the LSP service double through the real singleton lifecycle seam in 16 test files.** `tests/support/lsp-service-seam.ts` installs a `makeLspServiceDouble` surface through `configureLspServiceLifecycle`, replacing the in-process `vi.mock` of `clients/lsp/capabilities` (AGENTS.md shape 66, #4709), and the three hand-rolled installs fold onto it.
286
+
287
+ - Move 26 more LSP test files off `vi.mock` of `clients/lsp/capabilities` and onto `tests/support/lsp-service-seam.ts`, deleting their `in-process-mock` and `vi-mock-export` baseline rows (#4709).
288
+
289
+ - Move 43 of the last 46 `clients/lsp/capabilities` test files off `vi.mock`/`vi.doMock` and onto `tests/support/lsp-service-seam.ts` (a no-service install and a `beforeReset` hook added to the seam), deleting their `in-process-mock` and `vi-mock-export` baseline rows; three files stay with their reason (#4709).
290
+
291
+ - Move 30 test files (31 `in-process-mock` rows) off `vi.mock` of `clients/user-notify`, `degradation-ledger`, `warm-attach`, `widget-state` and `file-utils` and onto the real modules with their reset or env knob, deleting the rows (#4709).
292
+
293
+ - Add a PATH-probe stub (`tests/support/path-probe-stub.ts`) that puts executable stand-in package managers first on a hermetic PATH, and a router that lets a `safeSpawnAsync` double pass only the package-manager lookup's own probes to the real spawn. Two test files (`review-rebuild`, the `resolveExec` argv matrix) move off `vi.mock` of `clients/package-manager` and onto the real lookup, deleting 2 `in-process-mock` rows; two hand-rolled stand-in writers fold onto the stub's `writeStandIn` (#4709).
294
+
295
+ - Add a test-only server-selection setter on `clients/lsp/config.ts` (`_setServersForFileForTests`, dropped by `resetLSPConfigStateForTests`, ignored outside a Vitest process) so suites that faked `getServersForFileWithConfig` with a whole-module `vi.mock` inject a per-test server list through the real module instead. The LSP service, diagnostics and runtime-session suites that mocked `clients/lsp/config` move onto it (and onto a pinned HOME for the config loader), deleting their `in-process-mock` baseline rows (#4709).
296
+
297
+ - **Contributor docs gain a per-case admit class, a census per countable shape, and three role-contract rules (#4709).** A spawn, pipeline-runner, or LSP-service double is `process-boundary`, not `internal-seam`. A `PI_MOCK_IMPORTERS` row's class holds for a whole file only while every case needs it. Each countable defect shape names its census, and shape 66 names the `in-process-mock` key of `tests/support/flake-shape-baseline.json` at 1009 rows. The reviewer writes `FINDINGS_<pr>.json` for round routing and names the change's one-way doors with their proof. The investigator and the fixer's premise-first step reproduce on the reporter's host and pi-lens version, and report one of four outcomes.
298
+
299
+ - **`scripts/check-pr-body.mjs` now reads the `## Fold check` section AGENTS.md requires (#4711).** A PR opened with a raw `gh pr create` skipped the fold-check rule because the CI body lint never looked for the section, while the maintainer's local gate refused the same body; two fixer bodies on 2026-10-21 were refused only locally. The lint refuses a body with no section; a section holding neither a decision line (`#N` first, one of `folded` / `not folded` / `sequenced`, then the reason) nor `none: <reason>`; a decision spelling outside the three; a line naming a candidate without deciding it; `none:` beside a candidate line, whatever its reason's length; and a `folded` candidate the body never closes (a `Closes #N` in any fenced or indented code closes nothing). Both heading scans read the body through one CommonMark lexer, `marked` 18.0.11 (`scripts/lib/markdown-lexer.mjs`): a section is a top-level heading token, so a heading inside an HTML comment, a raw-HTML block, a list item or a block quote is refused, a setext, indented or closed ATX heading counts, a heading is named by its rendered text (an inline comment or emphasis around the name is fine), a comment a list item leaves open hides everything after it as GitHub renders it, and section text drops every raw-HTML block. The prose rules take their headings and section boundaries from the same lexer. A required section's content check asks that reader whether a line is a heading by the line it sits on, not by its text, so a nested heading carrying an inline comment is structure and an answer that repeats a setext heading's title is content. The diff-keyed rows take their section boundaries from it too: a mutation or Controls table row under a setext or an indented ATX heading belongs to the section below that heading, so it cannot prove the section above it. `marked` is an exact devDependency loaded on first use, so the close-keyword jobs still run with no install; the PR body job installs that one package and checks it against the lockfile's sha512. The hand-written comment and code-span scanner in `scripts/lib/defect-shapes.mjs` and its copy in `scripts/check-prose.mjs` are deleted, so every gate that blanks markdown through that module reads it through the same lexer. The section's verdict parser stays the one `## Class sweep` uses, and only the admitted vocabulary differs; the candidate list stays the local script's to compute. The template, the flattened-body repair's heading list, the reviewer doc, and the commit/PR prose contract carry the section.
300
+
301
+ - Record TLC distinct-state counts per TLA+ config in `scripts/tla-model-costs.json` and fail a config whose count grows past 2x the recorded one (#4714).
302
+
303
+ - **Turn the event loop between files in three AST sweeps.** The silent-catch, env-path-key and lsp-service-double sweeps held every parsed native tree at once (1,902, 1,703 and 1,715 MB peak RSS of a 2,048 MB budget); the peaks are now 250, 272 and 452 MB with identical findings, so source growth no longer reds Unit shard 2/5 (#4736).
304
+
305
+ - **Manual Windows repeat probe for the server-policy flake.** A `workflow_dispatch`-only job runs one Vitest file up to 30 times on `windows-latest` and reports the pass/fail count and the per-run logs, so the Windows rate of the #4756 root-marker memo flake can be measured without a PR gate. The PR-body workflow-run lint now also accepts a push-run URL naming an added workflow, which cannot be dispatched from its branch, and an unreadable merge base no longer reads as an added file (refs #4756).
306
+
307
+ - TLA+: `formal/lsp-diagnostics-freshness/DependencyAnswer.tla` gains a `Clear` action (`clearDiagnosticsForPath` mid-wait) and the invariants `SettleNeedsAnswer`, `NoDroppedAnswer` and `NoCanceledStored`, so the `answerStored` guard of #4785 F4 and the slot cancel are checked instead of vacuous; hand-mutant configs violate each invariant, and blindness configs show the older checks pass those mutants (refs #4782).
308
+
309
+ - **Pin HOME and the XDG dirs in every operator script child (#4789).** `scripts/lib/scratch-home-env.mjs` builds the one home pin (HOME, USERPROFILE, the XDG base dirs, PI_LENS_HOME); release-qa and the eight non-vitest scripts that pinned only PI_LENS_HOME now use it, so no child they spawn reads the real home (#4789).
310
+
311
+ - **Give the project-trust seam ratchet an explicit, lane-scaled budget.** The whole-tree mock-population case timed out at vitest's 5000 ms default on the Windows unit lane (#4799).
312
+
313
+ - Tests: the `tool-cwd` language-roots fixture and the bounded-container guard's probe roots no longer build under the repository root, so a repo-walking governance scan on a sibling worker cannot list them and then `ENOENT` when the cell removes them mid-walk; the shared harness records a directory a test names at that root, and the tmp-fixture hygiene owner fails the creation even after the cell removed it.
314
+
315
+ - Include `cascade.log` in the monitor inputs and phase readout, with duration and process-attribution limits (closes #3204).
316
+
317
+ - `guard-bash.mjs` expands the path words of `mktemp` and `node` (a `$TMPDIR` or `~` template, a `-p`/`--tmpdir=` value, a script path) from the shell's own variables, before an inline `VAR=val` prefix applies, as it has done for `git` since #3997. GNU mktemp's own default directory (no template, `-t`, bare `--tmpdir`), which the rule models, and node's `PI_LENS_HOME` still read the prefix. A typed mktemp word or node file word that still holds a reference the hook cannot resolve (any `$NAME`, `${ … }` form, `$( … )`, positional parameter, backtick span or `~user`) is judged as written and with those references removed, and denies when either reading does; an empty `-p`/`--tmpdir=` value reads as mktemp's default directory, and that default is `/tmp` when TMPDIR is empty, as it is for GNU mktemp, not only when it is unset (#4057).
318
+
319
+ - Smoke checks reject every failed runner except completed checks with `blocking_diagnostics`, so parser failures and unconfirmed output no longer count as passes (refs #4130).
320
+
321
+ - The PR-body check no longer reads a bot's appended block as the author's text. A block (Greptile's, CodeRabbit's, any other) opens with an HTML comment after the last template section, and the body now ends there, so a `(refs #N)` in Greptile's "Last reviewed commit" link no longer reds `## Fold check` (#4774).
322
+
323
+ - **Declaration walk states its sort order with the shared code-unit comparator** —
324
+ `walkDeclarations` now passes `compareOrdinal` to `found.sort()` instead of a
325
+ bare `.sort()`, and `carryUnreadable`'s inline three-way comparator moved onto
326
+ the same export. Both bodies were already code units, so no output moves; the
327
+ change states the intent the bare call left implicit and closes SonarCloud
328
+ `typescript:S2871` on the changed code.
329
+
330
+ - **install-smoke mise-repro runs the real pi, not the mise shim.** The RPC smoke pins HOME to a scratch dir, so a `pi` shim could not resolve its tool and the advisory leg failed on every master run after #4821 (#4789, #4821).
331
+
332
+ - Release-QA witnesses the session-start LSP warm in the installed pi RPC session, and the extension logs one `LSP warm resolved` record per session start (#4316).
333
+
334
+ - **Live cross-file rename and deletion twins for the classic TypeScript server (#1712)** — `tests/clients/lsp/crossfile-classic-ts-live.test.ts` drives the real
335
+ `typescript-language-server` wrapper and a classic compiler through
336
+ `LSPService.renameFile` and `LSPService.notifyExternalFileChange`, and lands
337
+ in the `lsp-spawn-heavy` lane beside the cascade twin. Two cases prove a file
338
+ rename applies the server's own `workspace/willRenameFiles` edits to the
339
+ importer, and that no `workspace/didRenameFiles` reaches a server that never
340
+ registered it. The deletion case is written and admitted but skips on a
341
+ condition derived from the client capability, because a classic wrapper asks
342
+ for no client-side file watching while pi-lens advertises no relative-pattern
343
+ support and drops every `workspace/didChangeWatchedFiles` event it is sent.
344
+ Opt-in like the sibling live suites: `PI_LENS_INTEGRATION=1` plus
345
+ `PI_LENS_CLASSIC_TSC`, so CI skips it with a printed reason. No product
346
+ behaviour changes.
347
+
348
+ - The nightly LSP clean-gate now gates the Expert (Elixir) row. Its seeded compile error moved under `lib/`, where Mix compiles it (the old root-level file was never compiled, which is why the row read as a server limit), and a readiness rung polls `lsp_diagnostics` while Expert activates its project (#3405).
349
+
350
+ - The tests-tree walker (`testSourceFiles`), the atomic-write scan's `clientSourceFiles` and the win32 gate population now walk through one shared walker, `scripts/lib/walk-files.mjs`, which `listSourceFiles` also uses. A directory that a sibling process removes mid-walk is skipped and recorded instead of failing the sweep, and `.git`, `.probe-home`, `.claude` and `node_modules` are never entered (#4104, sibling of #4097). The tree-scanner census and the sweep-floor enumeration now recognise `walkFiles`, so a test-support module walking through it is still counted.
351
+
352
+ - `waitFor` and `suspendAt` in `tests/clients/interleaving-kit.ts` multiply their wall budget, the default and a caller's `timeoutMs` alike, by `PI_LENS_TEST_TIMEOUT_SCALE` (read through the shared `tests/support/test-timeout-scale.ts`), and an exhausted wait names its caller, the elapsed time and both budgets (#4437). The `Run targeted tests` step of `Targeted tests (advisory)` now sets the knob to 3, which it lacked when run 38618401454 failed a 3000 ms wait.
353
+
354
+ - **A certified-host tier spread exists, and the `pending slice` class is retired (#4632)** —
355
+ `scripts/probe-pi-host-tiers.mjs` runs tier 1 and tier 2 against every certified
356
+ pi host installed on the machine, reading the certified set from the baseline
357
+ doc's verified-host table (the same reader the packaging ratchet now uses), and
358
+ prints one line per host naming the host and the version it ran on. Each tier
359
+ loads the probed host's own code, so a host directory that cannot supply it
360
+ fails the tier instead of being reported as probed. It installs nothing: an
361
+ absent host is reported `not installed`, and `--require-all` is what makes that
362
+ a failure. `tests/config/pi-mock-importer-sweep.test.ts` no longer admits the
363
+ `pending slice N` class, whose last row left with the roadmap, so a reopened
364
+ placeholder reds instead of reading as scheduled work.
365
+
366
+ - **Contributors are told which real pi tier a host-semantics test belongs on, and the hand-built pi double now refuses to load for a test file off an admit list (#4632, slice 10 pulled forward).** AGENTS.md "Test requirements" names tier 1 (`tests/support/pi-runner.ts`) and tier 2 (`tests/support/pi-session.ts`) and the rule that a case about a handler's return value, the model's request or session ordering uses one of them. `tests/support/pi-mock.ts` throws at load unless the running test file is one of the 58 on `PI_MOCK_IMPORTERS`; `tests/config/pi-mock-importer-sweep.test.ts` fails on a row whose file stopped using the double, so the list only shrinks.
367
+
368
+ - **Registration tests read pi's real extension runner (#4632).** `tests/support/pi-runner.ts` loads the built extension through pi's own loader into a real `ExtensionRunner`, pins `PI_LENS_HOME` and `PILENS_DATA_DIR` before the load, keeps the loader's `jiti` cache inside the fixture, and drains the test-side writers in `afterAll`; four tool-roster, registry, schema and contract-pin files now assert the registries the host holds instead of the arguments a stand-in recorded. The helper runs on all six certified hosts, and its own contract test pins the declared handler, flag and command sets beside the host metadata each registration comes from.
369
+
370
+ - **Dynamic-tooling tests moved from the pi double onto the real host (#4632 slice 6)** —
371
+ `tests/index-4632-s6-dynamic-tooling.test.ts` runs ten of the twelve `#dynamic-tooling` cases
372
+ from `tests/index-wiring.test.ts` as real pi `AgentSession`s (`tests/support/pi-session.ts`):
373
+ pi's own active tool set, the real `pi_lens_activate_tools` round trip, and pi's `new` /
374
+ `resume` / `fork` / `reload` replacements. `tests/support/pi-session.test.ts` gains the
375
+ contract case that pins how the host declares a request's tool loadout (`getActiveTools()`,
376
+ `toolsAdded`, `toolsRemoved`, and the `context_with_system` transcript) before any consumer
377
+ reads it. The feature-detection fallback and a `/new` whose successor names the current
378
+ session file stay on the double, each a payload this host cannot produce; the
379
+ `tools/diagnostics-route-switch-matrix.test.ts` admit row is classified `internal-seam`.
380
+ No product behaviour changes.
381
+
382
+ - **The turn-end cascade line and the smells cadence now run on a real pi `AgentSession` (#4632 slice 7)** — `tests/index-4632-s7-turn-end-ordering.test.ts` moves 7 of the 10 cases out of `tests/clients/cascade-unanswered-primary-4403.test.ts`, so the cause matrix and two of the three delivered-once scripts read the provider requests pi actually sent rather than the payload a double recorded. Each case attributes a delivery to the requests its own prompt made, never to a prompt's index: one prompt makes several requests, and sampling the prompts array read two of the three turns' write continuations instead of their reads. The three cases that stay keep the double with their probe: two script `RUNTIME_CONFIG.turnEnd.maxChars`, an `as const` the loaded copy owns, and one is environment-dependent (red in the plegma sandbox, green on the orchestrator's host on both master and this head). `tests/index-4632-s7-smells-cadence.test.ts` replaces `tests/index-smells-rollup-wiring.test.ts` whole: it seeds the copy's own `bus-events.log` with rows typed as the writer's `BusEventLogEntry` and reads the notification the copy asked pi's UI to show, so the interval, the threshold, the session boundary and the once-per-session gate are observed end to end. The admit list's last three `pending slice 10` rows are classified, so no `pending slice` marker remains. Tier 2 gains `captureUi` (a recording `ExtensionUIContext` at the host boundary), and `flags` now turns a default OFF: pi reads a boolean flag's PRESENCE as `true`, so `false` deletes the key. No product behaviour changes. Tier 2 also owns the scanner report root (`PI_LENS_TEST_SCANNER_TMPDIR` plus the scanner-only harness marker, inside the fixture root): a `session_start` scan is fire-and-forget and the loaded copy's clients cannot be drained from the test side, so a report directory could otherwise outlive the file in the shared tmp root. No product behaviour changes.
383
+
384
+ - **Two host-wiring test files moved off the hand-built pi double onto the real tiers (#4632 slice 8)** —
385
+ `tests/index-process-bridge-registration.test.ts` now loads the built extension through pi's own
386
+ `ExtensionRunner` (`tests/support/pi-runner.ts`) and reads the process-global bridge slots the loaded
387
+ copy mounted; `tests/index-memory-sample-wiring.test.ts` runs real prompts through a real
388
+ `AgentSession` (`tests/support/pi-session.ts`) and reads the `memory_sample` record the loaded copy's
389
+ writer queued, through a new `PiSession.latencyRows()` accessor. Both files' `pi-mock` rows and the
390
+ memory-sample file's three `in-process-mock` baseline rows are deleted. The reader files slice 8 could
391
+ not move keep their rows with a stated class and reason. The ten hand-rolled JSON-lines readers those
392
+ tests carried now come from one shared reader (`tests/support/ndjson-rows.ts`), which reports the
393
+ lines it cannot parse instead of dropping them silently. No product behaviour changes.
394
+
395
+ - **Four session-flow test files lost or narrowed their hand-built pi double (#4632 slice 9)** —
396
+ `tests/index-2992-integration.test.ts` moved all three host cases onto tier 2: pi's own
397
+ `ExtensionRunner.invalidate()` supplies the stale ctx, a real `edit` round trip proves the bridge
398
+ read booked, and the loaded copy's `extension-ctx-stale` and `io-bridge-read-dropped` records are
399
+ read back from the `latency.log` the copy wrote, so its `pi-mock` row is deleted.
400
+ `tests/index-session-start-classification-wiring.test.ts` now runs a same-root start after a dead
401
+ prior ctx and a refused different-root start through real sessions, replacing the double's
402
+ mutated-ctx replay, and its `pi-mock` row's class is `unproducible-payload`. The
403
+ `lens-toggle-command` registration case runs on tier 1 against the host's own command registry,
404
+ and its four UI cases file under the new `real-ui-harness` class, because no slice builds a UI
405
+ harness. `tests/index-lsp-config-root-eviction.test.ts` keeps its row with the class
406
+ `internal-seam`. No product behaviour changes.
407
+
408
+ - **Wall-clock budgets scale with the host's load (#4634)** — Every case in
409
+ `tests/tools/diagnostics-route-switch-matrix.test.ts` now carries an explicit
410
+ `scaledTestTimeout` budget instead of vitest's 5 s default, the matrix's
411
+ write-time cell judges only the latency reports its own writes produced, and
412
+ the mkdtemp whole-tree scan in `tests/config/tmp-fixture-hygiene.test.ts` takes
413
+ 60 s. The `default` Vitest project declares the 60 s `hookTimeout` its six
414
+ sibling projects already use, which ends the 10 s `beforeAll` ceiling a
415
+ whole-`clients/` scan red on. Round 2 gives the same treatment to the tree-walk
416
+ census in `tests/clients/pi-lens-home-hermeticity.test.ts` and
417
+ `tests/config/vacuous-skip-coverage.test.ts`, to the wedged-notify rename case
418
+ in `tests/clients/lsp/rename-notify-wedged.test.ts`, and to the five unbudgeted
419
+ real-pi cases in `tests/real-harness/tools-enabled.test.ts` (whose four
420
+ budgeted siblings take the same scaled spelling, so the file has one budget),
421
+ and the
422
+ `expect.poll` waits on a real pi child in `tests/real-harness/lifecycle.test.ts`
423
+ now take a scaled 10 s poll budget instead of Vitest's 1 s poll default. No
424
+ product behaviour changes.
425
+
426
+ - **A by-path extension load no longer leaves a `jiti` directory at the tmp root (#4673)** —
427
+ pi's loader mkdirs `path.join(os.tmpdir(), "jiti")` in the test process on the
428
+ first by-path extension load, and the shared tmp-root census judged it as a
429
+ fixture sibling of `tests/clients/skills-package-filter.test.ts`, so any run
430
+ that selected that file beside the hygiene sweep red on a name neither file
431
+ spells. The test environment now pins `JITI_FS_CACHE=0` and `JITI_CACHE=0` in
432
+ `tests/support/vitest-setup.ts` and `vitest.config.ts`; the census's two
433
+ comments now say that a CHILD process's write is the case with no creator on
434
+ record, not an in-process loader cache; and a mechanism case in
435
+ `tests/config/tmp-fixture-hygiene.test.ts` drives pi's real
436
+ `DefaultResourceLoader` by path and asserts the tmp root gained nothing. No
437
+ product behaviour changes.
438
+
439
+ - **The pre-push hook selects tests for the branch's own change (#4724)** — Each
440
+ pushed ref now diffs against the base branch instead of the remote tip, so a
441
+ master merge onto a pull-request branch no longer counts master's files as the
442
+ branch's own (#4557's merge selected 366 test files for an 11-file change). The
443
+ base is `upstream/master` when it has commits `origin/master` lacks, as on a
444
+ fork with a lagging master, and `origin/master` otherwise. A re-push of a head
445
+ whose record shows the tests passed in a clean checkout of exactly that head
446
+ skips the build and tests, and an unresolvable base falls back to the remote-tip
447
+ range instead of selecting nothing. The
448
+ 12 armed real-harness suites and `diagnostics-route-switch-matrix` move to the
449
+ CI-only tier: each runs one file at a time, and together they took the whole
450
+ 120 s budget on any push. They still run in `Unit tests` and in
451
+ `Targeted tests (advisory)`.
452
+
453
+ - **Tree-walking governance censuses carry a timeout budget (#4828).** Tests in `tests/config` that walk the repo tree had vitest's 5 s default and reded on the Windows unit leg; they now pass the shared `TREE_WALK_TIMEOUT_MS` (30 s, scaled by the lane), and `tests/config/tree-census-timeout.test.ts` refuses a new census without it (a raw number or a file-local constant is refused too; `scaledTestTimeout(...)` is the only other budget), whether it is declared with `it.skipIf`, `it.each` over a walked table, an aliased import or an unrecognised wrapper.
454
+
455
+ - Two test waits that counted event-loop turns on real I/O now use the kit's `waitFor` with a real-clock deadline: the #3915 loss-notice test in `tests/clients/fix-run-restore.test.ts` (100 turns for the drain's bound, #4850) and `sidecarSettled` in `tests/index-3521-fork-tree-witness.test.ts` (5000 turns for the sidecar write, #4830), which also keeps its test timeout above that deadline. Both ended before the I/O did on a loaded CI host.
456
+
457
+ </details>
458
+
459
+ ## [4.4.4] - 2026-10-19
460
+
461
+ ### Changed
462
+
463
+ - **Preserve unchanged findings across file touches.** Share bounded content stamps while retaining strict report timestamps and existing pipeline byte limits (#4541).
464
+
465
+ - **pi 1.2 and 1.3 are supported (refs #4513)** — the tested host range now runs from pi 0.80.10 up to, but not including, 1.4.0. Both new minor lines pass the release-QA matrix against a real pi, a resumed session keeps the lazy tools pi-lens remembers, and the development host moves to pi 1.3.
466
+
467
+ - **Read-guard accounting reads a file once per tool call hook (#1649)** — a `read` used to re-read and re-split the whole file three times when it was called and three more when it returned. Now one bounded pass per hook counts its lines and hashes only the lines the read covers, in 64 KiB chunks, behind a size gate. Five search hits in one file now cost one pass instead of five. A bash `tail`/`head`/`cat` of a vendor or ignored file is dropped before its lines are counted. Read-guard verdicts are unchanged, except that a clipped bash view of a file over 512 MB now records one line instead of throwing.
468
+
469
+ - **Review-graph builds read each function body once (#1740)**. Function facts walked every function body seven times, once per summary field. One pass now computes all of them, with identical summaries. On a 719-file repository a full graph build dropped from 6.76 s to 5.65 s (median, fresh process), and a warm full rebuild from 5.39 s to 4.37 s.
470
+
471
+ - **The source walk answers compiled-twin lookups from the directory listing it already read (#1979)**. A `.js`, `.mjs`, `.cjs` or `.jsx` file no longer costs up to seven filesystem existence checks for a `.ts` or `.vue` twin; a twin-less file costs none, and a file that has one is still checked once against the real filesystem. Which files the walk keeps does not change. The review-graph size-skip record now also reports `entriesVisited` and `walkMs`, so a slow over-cap first build can be told apart as a slow collection or a large tree. `walkMs` covers the whole source collection, including the tracked-file index prime. The verdicts match the old walk on a tree that does not change during the walk. Refs #1979 (the cold-IO cost of the first walk is reduced, not removed).
472
+
473
+ - **Sending a document to a language server counts its lines natively (#2066)** — each `didOpen`/`didChange` walked the whole document one character at a time to count lines and find the last one, about 70% of a send. A document with no carriage return is now counted with the native `indexOf`, about 10x faster (3.0 to 0.3 ms scan on a 1.96 MB document). Line counts and ranges sent to the server are unchanged, and a document with a carriage return takes the same loop as before.
474
+
475
+ - **Per-file complexity baselines no longer stay in memory for the whole session** (#4125). The tool_call memo kept every file's full complexity result and only ever asked whether a path was present. It now keeps the path alone, which measured 28.0 MB down to 2.4 MB retained at 900 files.
476
+
477
+ - **Project scans skip ast-grep rules that cannot match a file (#4496)**. A rule whose required literal text is absent from the file no longer pays a native match call. A 300-file scan of this repository went from 16.3 s to 10.5 s warm, with identical diagnostics. The per-edit ast-grep runner uses the same check.
478
+
479
+ ### Fixed
480
+
481
+ - **Stop re-pushing byte-identical LSP content, and stop losing a save or a revert to the same gate.** The touch debounce now decides by the bytes the client sent and by whether that document's notify queue is still sending them, so a touch whose own work outlived the window no longer sends a redundant `didChange` that clears the server's diagnostics (#4532). A still-running save does not count as sending them either: it cannot change the document, so the cached diagnostics survive it. A skipped save still reaches the server, and its mark names the content the `didSave` landed for, so a retry that saves other bytes cannot suppress the save the next saved touch owes. That mark outlives the payload bound: Incremental's eviction strips the text it keeps, never the save evidence. A standalone save whose notification fails is retried once; a failed save carried by a content push remains owed by the next saved touch. Every failed send records it (`lsp-did-save-send-failed`, `lsp-did-save-recovery-exhausted`). A client that cannot report what it holds is re-sent rather than skipped.
482
+
483
+ - **`~/` paths now resolve where the shell, the disk, and the tool argument really point (closes #4576)** — a `tool_result` shares the `tool_call` resolver, so writes through `~/…` no longer dispatch runners against a `<projectRoot>/~/…` path that never existed; a bash operand follows shell rules again (each operand retains its own quoting, so a quoted `'~/x'` stays literal, and `@x`, a `file://` spelling or a no-break space are the file names a shell opens); a write recovered from disk keeps its byte-exact name; and `module_report`, `lens_diagnostic_mark`, `lsp_diagnostics` and `lsp_navigation` expand a `~` path argument instead of looking for it under the session cwd.
484
+
485
+ - **`symbol_search` answers as soon as a cold word-index build finishes (closes #4583)** — a query that arrived during the build cached "index is building" for that root, and nothing refreshed it, so every later call in the same process replayed the building hint and re-triggered a build over the index already on disk. A completed build (cold, or the session-start rebuild and reuse paths) now hands its index to that warm entry, so the next query searches it.
486
+
487
+ - **Count a multi-file bash command once in agent-behavior tracking.** Per-file diagnostic replays no longer cause false BLIND WRITE warnings or displace the real command from recent history. Each file still runs its diagnostics.
488
+
489
+ - **Marked findings stay hidden on every diagnostics route, and hidden ones are counted (#1634)** — a finding marked false-positive or won't-fix with `lens_diagnostic_mark` still came back from `lsp_navigation workspaceDiagnostics` (with or without a path) and from `pilens_project_scan` over MCP. Both now apply the same finding policy as `lens_diagnostics` and say how many findings it hid, and `lsp_navigation`'s no-path snapshot gives each file's age (`scanned 5m ago`), since it replays what each language server last reported. `lens_diagnostics` mode=full and mode=all now state how many findings marks hide in their scope, and a second `mode=full` no longer erases a mark from mode=all's count and the footer's `suppressed: N` chip, so neither mode reads "No issues ✓" with no reason right after a sweep listed those findings.
490
+
491
+ - **Keep the host responsive between files during project scans.** Diagnostic scans now let pending requests and cancellation callbacks run after each completed file. Individual file analysis can still block, and full graph builds still run without a break. (Refs #1740)
492
+
493
+ - **A language-server leader dropped from the held-pid set is now recorded (#3096)** — When 256 language-server groups are all still alive, the next launch drops the oldest held pid, and a group kill after that leader dies is refused. `holdOwnChildPid` now counts that drop as `held-own-pid-evicted` in the degradation ledger, once per launch that evicts, with the launch site as the subject and the dropped pid in the reason. A launch that evicts nothing records nothing. `tests/clients/lsp/kill-process-tree-real-child.test.ts` fills the set through the real `launchLSP` path and reads the record back from `latency.log`.
494
+
495
+ - **Save-triggered language servers now hear a save from MCP hosts and from cold queries (refs #3405)** — an MCP host's edit (the PostToolUse hooks and `pilens_analyze`) re-synced the file without `textDocument/didSave`, and a first `lsp_diagnostics` query on a cold server lost its save to the touch debounce after its own warm-up pushed the same bytes. A server that compiles on save, such as Expert for Elixir, answered neither. Both now send the save to servers that declared `textDocumentSync.save`; servers that declared none see no change. With auxiliary scanners on (the default), the diagnostics step after an edit also re-sent the bytes the post-write sync had just sent, clearing the server's diagnostics for every edit; it now reuses that push.
496
+
497
+ - **A dead export an edit introduced is no longer missed when turn end joins an older knip scan (closes #4166)**. A knip scan can already be running when the turn's edits land: the previous turn's slow scan, or a `lens_diagnostics` fetch. Turn end took that scan's answer as covering the edits and stored it as the baseline, so an export the edit left unused was never reported. Turn end still delivers that scan's findings. It now also carries the turn's files to the root's next successful scan, which reports what the edits added. The knip row in `latency.log` gains `joined` and `carried` for that turn.
498
+
499
+ - **A module created mid-session now clears the importer's missing-import (closes #4320)** — Language servers that cache a failed module lookup (Pyrefly) kept reporting `missing-import` and a definition at the import line after the module appeared, until the server restarted. pi-lens now announces a file created after the server started as Created, once, before any cached answer in the same call, whatever the path order; `rename_file` announces the moved-in path as Created too, and so do sibling packages served by the same server. pi-lens's own edits stay announced as edits, and only cached findings of a server that heard of a new file are re-checked.
500
+
501
+ - **Tab-indented files keep the formatter's own width (closes #4321)** — With no formatter config, pi-lens pinned tab style but also forced a tab width of 1 on Biome, Prettier and Ruff, so deferred formatting re-wrapped lines near the 80-column limit in files the formatter's defaults had already formatted. Tab evidence now pins the style only; the width is the formatter's default or your explicit config.
502
+
503
+ - **A file whose language server cannot start is no longer reported clean (closes #4322)** — When a file's language server could not be started, or was still starting, and only an auxiliary scanner such as typos-lsp answered, `lens_diagnostics source=lsp` and pi's write-time LSP check reported the file as confirmed clean, so invalid JSON passed. `lens_diagnostics` did the same when nothing answered at all. The check now names the language server as not available and reports the file as unconfirmed, for a single file, a batch, a directory and a primary-only check; the auxiliary's own findings are still shown, and a batch says which files have only auxiliary findings, and a file nothing answered for is counted as unavailable rather than cached as clean. Such an answer no longer clears a language-server blocker or the footer's language-server rows. The LSP workspace diagnostics cache moves to version 4, so a clean result cached by an earlier version is checked again once.
504
+
505
+ - **An explicit LSP check no longer starts Opengrep when it is switched off (closes #4323)** — `lens_diagnostics source=lsp` in pi, `pilens_diagnostics` over MCP and `lsp_navigation workspaceDiagnostics` started the Opengrep security scanner for an all-server check even with `--no-opengrep` or `opengrep.enabled=false` in `~/.pi-lens/config.json`. They now leave every auxiliary scanner the configuration switches off unstarted, as the write-time check and `pilens_analyze` already did, for a single file, a batch, a directory and the primary-only fallback. A primary-only check no longer shows a switched-off scanner's earlier findings, a batch cached before the switch is not served to the narrower check, and `lsp_navigation workspaceDiagnostics` without a path leaves out the rows of a switched-off scanner that is still running. The turn-end actionable-warnings report (`lens-actionable-warnings`) no longer starts a switched-off scanner either, and an explicit single-file check names the scanner it skipped: `No auxiliary findings. Switched off, not run: opengrep.`
506
+
507
+ - **A module created outside pi-lens now clears its importer's missing import (refs #4346)** — A module written by a shell, `cp` or codegen reached no language server, so pyright and Pyrefly kept the importer's missing import for the server's life when only the importer was diagnosed. Before `lsp_diagnostics` answers, pi-lens now announces the files an importer resolves to as Created to any server that has not heard of them. This covers every file that is not answered from a fresh clean cache entry, including one pi's write hook just touched, and a module moved into place with `mv`. Workspace edits that create, rename or delete files now send their watched-file events too. The review graph adds the importer's edge for a newly created module, so a cached clean answer is refused when that module later changes. Extracting a large file's symbols no longer grows with the square of its size: a 12,000-line Python file now takes 0.4 s in a review-graph build (was 9.6 s) and 0.09 s for its imports (was 9 s).
508
+
509
+ - **A new file now refuses only the cached diagnostics that depend on it (refs #4346)** — Before, any file created under a language server's root made `lsp_diagnostics` and `lens_diagnostics mode=full` re-check every cached file with findings from that server, and never a cached clean file. Now a cached answer is refused when the new file is in its dependency scope: a file its imports resolve to or name, a TypeScript or JavaScript ambient file (a `.d.ts`, `declare global`, `declare module`, or a script) for a JS/TS file, or a file of the same package for a Go file. That includes clean answers, so a new global or package file that breaks a clean file is checked again. Other cached answers keep serving. A cached Go answer is also refused when a file of its package is edited or removed. Before a check answers, pi-lens now announces a Go file's new package files to its servers, as it already did for import targets. Languages whose implicit scope is not modelled (Python, Java and others) keep the old rule for answers with findings, and so does a file with a dependency pi-lens cannot follow (a dynamic `import()`, `require`, or an imported file that re-exports).
510
+
511
+ - **The ast-grep export scan waits out its startup defer again** (refs #4352) — Its defer entry was keyed under a name no task used, so the scan started on the next tick and could freeze the TUI right after startup or `/new`. The entry now matches the task, and a misspelled task name fails the build.
512
+
513
+ - **MCP warm socket restarts after a kill on a long TMPDIR; a second pi session keeps its own endpoint.** The server and the warm-attach host now unlink only the socket file Node bound, never an unrelated file, and the pid-scoped endpoint is `pi-lens-mcp-<pid>-diagnostics-<hash>.sock` so the pid survives the path cut. The tmp-fixture hygiene owner also stops excusing creator-run leaks (#4353, #4354).
514
+
515
+ - **The read guard no longer refuses edits of a file the agent wrote itself (#4387)** — when the agent's own `edit` (oldText/newText) touched a file it had written whole, the read guard ended that file's authorship. It logged `authorship_retired` with `writer: "bridge"`, and after a bash write the next edit was refused with "File modified since your write" although no other process had touched the file. The authorship now advances to the edit's bytes. Separately, after a bash write and one own positional edit, an edit of another line was refused with "File modified since read". The guard again records the whole file as read when it allows that first edit, and that record survives `/tree`, `/fork` and resume exactly when the authorship does. A change by another writer still ends the authorship, also across a branch move. An own oldText edit inside a range-scoped authorship now asks for a read instead of blaming another writer.
516
+
517
+ - **pi no longer exits when a persist worker reports a result without a staged-file path (closes #4400)** — the project-snapshot and review-graph persist workers hand their result back with the path of the file they staged. A reporter on 4.4.3 hit a result without that path in an RPC chat, and the host removed it unchecked, so the resulting `ERR_INVALID_ARG_TYPE` ended pi. Why that result had no path is not yet known. The host now cleans up and promotes the stage path it sent itself and only trusts the path in a result when no request is left to look it up. A stage file the host cannot remove (a directory in its place, a Windows handle held by antivirus) no longer ends pi either: the snapshot persist continues and a `project-snapshot-stage-reap-failed` degradation count records it. Reported by timges.
518
+
519
+ - **A file no language server answered for no longer reads as clean on any diagnostics route (#4403)** — a language server turned off in `lsp.disabledServers` now leaves its files unconfirmed on write-time checks, `lsp_diagnostics`, MCP `pilens_diagnostics`, `lsp_navigation workspaceDiagnostics` and `mode=full`, and each says it is disabled in config. Write-time checks give one such note per server per session, and a later write of an unchecked file prints a one-line "unconfirmed" status naming the cause instead of "clean". `lsp_navigation workspaceDiagnostics` no longer returns a clean-looking empty result when no server answered, and a `mode=full` sweep says the server did not answer instead of blaming a timeout. The same holds when a disabled server's fallback (deno for `typescript`, for example) cannot start. Cross-file checks name such a server once per session instead of listing each importing file as inconclusive, counted from when the note reaches the agent. `lsp_navigation` file operations such as hover and documentSymbol say no server answered, and why, instead of "No results" or an install hint.
520
+
521
+ - **TypeScript language server starts for a compiler found only on PATH.** A trusted project whose `tsc` resolves through PATH to a normal TypeScript package (nvm, Homebrew, npm-global) now gets the TypeScript server, where it was reported as "mark the project trusted" (#4414). When the PATH `tsc` is TypeScript 7 or a shim with no package beside it (volta, asdf, mise, pnpm-global), pi-lens installs its own pinned classic compiler if installs are allowed. A missing compiler now warns that no compiler could be resolved, and a genuine trust refusal still prints only the trust notice. The first line of multi-match Windows `where` output is read without its carriage return.
522
+
523
+ - **A stalled grammar download now fails after 15 s, not 300 s** (#4425). The runtime fetch of a missing tree-sitter grammar and the install-time `download-grammars.js` both give up once no bytes arrive for 15 s. A slow connection that keeps delivering still completes. A black-holed CDN used to hold the first parse of a language such as Kotlin for undici's 300 s headers timeout.
524
+
525
+ - **Blockers and the cascade now see Go peers, ambient files and dynamic imports (#4438)** — The inline-blocker sweep demotes an LSP blocker to `[stale — re-run to confirm]` when the target of an `import("x")` or `require("x")` changes, or when pi-lens records a write, under the session root and after the verdict, to a same-package Go file known to be in the host build (test files excluded; a build constraint it cannot evaluate is no evidence) or to a file that feeds the TS/JS global scope (a `.d.ts`, `declare global`, a script). A file whose role cannot be read (deleted, over the LSP sync limits, unparsable) never demotes. The cascade checks a Go file's package peers and, for a changed ambient file, the 10 most central JS/TS files, and says when it stopped there. The diagnostics cache announces a dynamic-import target created outside pi-lens. All three read the one implicit-scope test in `clients/lsp/implicit-scope.ts`.
526
+
527
+ - **A Go type error or a Dart compile error is no longer reported as clean (#4451, #1937)** — `go vet` prefixes a type-check error with `vet: `, and the runner read that prefix as part of the file path, matched no target and returned `succeeded` with no findings. The prefix is now stripped before the path is compared. `dart analyze` exits 3 when it reports an error, but the runner's exit table stopped at 2, so the finding was dropped as a rejected run; the table now accepts 3. `tests/clients/dispatch/smoke-fixture-coverage.test.ts` now requires every dispatch runner to have captured real-binary output or a reasoned exemption, and `tests/clients/dispatch/runners/captured-real-output.test.ts` replays 14 more captured runners (Go 1.27.2, Dart 3.13.5 and others).
528
+
529
+ - **helm-lint, fish-indent and golangci-lint now read their tools' real output (#4453, #4454, #4455, #1937)** — helm 4 prints a template parse error as `templates/: parse error at (<chart>/templates/bad.yaml:5)`; the parser built the finding's path from the prose around the file and recorded no line, and now reports the template and line with the chart name stripped. `fish_indent --check` prints the file's own name on stderr and exits 1 for a file that only needs formatting; the runner reported that as a blocking `fish-indent-parse-error` and now reports the non-blocking `fish-indent-unformatted` finding. golangci-lint v2, which the installer downloads, rejects `--out-format=json` (exit 3, unknown flag); the runner now asks for `--output.json.path=stdout --show-stats=false`, so the JSON document is not followed by run statistics. golangci-lint v1 binaries do not understand these flags. helm 4 has no `--version` flag, so helm-lint and helm-render reported helm as unavailable and never ran against a real helm 4; they now probe with `helm version --short`. The installer's helm and SpotBugs rows had the same wrong probe (SpotBugs takes `-version`) and now use the argv each tool accepts. A golangci-lint config that also writes text, tab, sarif or another format to stdout no longer corrupts the JSON the runner parses: the runner now switches every other output format off. A helm template whose name holds a space, such as `templates/my file.yaml`, is reported on that file, not on a file named `file.yaml`. A fish file with a syntax error and an indent change is now a non-blocking `fish-indent-unformatted` warning; it used to be a blocking `fish-indent-parse-error` by accident. A well-formatted fish file with a syntax error passes `fish_indent --check` silently, before and after; fish-lsp reports it as an error through `lsp_diagnostics`.
530
+
531
+ - **A fish syntax error now reaches the agent as a blocking finding (#4454)** — `fish_indent --check` never reports a syntax error: it exits 0, silently, on a missing `end`, an unterminated quote and a stray `end` in a formatted file. The fish-indent runner now also runs `fish --no-config --no-execute <file>`, which parses without executing anything, and reports each error as a blocking `fish-syntax-error` on the real file and line. A file that is merely unformatted still gets only the non-blocking `fish-indent-unformatted` warning, and a valid formatted file gets no finding. When `fish` is not found next to `fish_indent`, the format check still runs and one `fish-syntax-check-unavailable` degradation row says syntax errors are not being checked. This supersedes the note in the #4453 entry that a well-formatted fish file with a syntax error passes silently. Checked on fish 3.3.1 (Ubuntu 22.04) and 4.9.3 by captured output, and on 3.7.0 and 4.2.1 by review probes. fish 3.1 rejects `--no-config`, so there the syntax check is skipped and leaves a `runner-empty-result` row.
532
+
533
+ - **Language servers see installs, codegen and outside edits before the next check (closes #4476, closes #4507)** — after a bash command rewrote several files the language server already held, pi-lens checked them one at a time, so a dependent could be checked against the old copy of a dependency the same command had rewritten and report a phantom error. The new bytes of every held file a command wrote now reach the language servers first, and a server with measured in-order replies answers one request before the first check to prove it has read them; threaded or unmeasured replies are recorded as undrained; the wait has the edit hook's time budget, and a server that does not answer in time is recorded. A branch switch or reset that rewrites held files gets the same budget, so a slow server no longer misses the move's new bytes. TypeScript 7's native server hands file watching to pi-lens and re-reads a closed file only when told about it by exact path. pi-lens now looks for disk changes at each bash result and each tool call. A dependency install (a lockfile or a package manager's install marker changed) restarts that project's language servers and refuses every diagnostics-cache entry scanned before it. A `.d.ts` file created, edited or deleted by codegen or outside pi, in gitignored directories too, is reported to the live servers by path and refuses the cache entries that could see it. Tool-call looks walk the declaration files at most once every `PI_LENS_DECLARATION_LOOK_MS` milliseconds (default 2000, 0 to walk at every look); a walk over 4096 directories or 2048 declaration files records a degradation instead of passing as clean.
534
+
535
+ - **Refresh diagnostics across JSDoc imports and module augmentations.** Capture their dependency specifiers and conservatively invalidate cached findings for alias and package dependencies.
536
+
537
+ - **ast-grep no longer stops on old findings away from an edit (refs #4481)** — on a file's first edit in a session, every existing `severity: error` ast-grep finding became a `🔴 STOP` blocker. Code the edit never touched blocked too. The in-process ast-grep runner and the ast-grep language server now block only on a finding whose lines overlap the edited lines. The tree-sitter rules use the same overlap test instead of the finding's first line. An edit inside a multi-line finding still blocks. A rule that reports a neighbouring node can still be missed on that write, such as the first of two duplicate object keys when the edit adds the second. A whole-file `write` still blocks on every finding. Type errors and linter findings still block on any line, because an edit can cause them at lines it did not touch. Thanks @kwisser for the report.
538
+
539
+ - **Linters no longer stop the first edit on errors the file already had (refs #4483)** — on a file's first write or edit in a session, every existing linter error became a `🔴 STOP` blocker, because the delta baseline only existed after that first check. Before the host writes, pi-lens now runs the file's linters over its current bytes once, and the first check reports their old errors as `ℹ Pre-existing: … not blocking` instead. An error the edit caused still blocks, even at a line it did not change, and so does an old error on a line the edit changed or a second copy of one. A whole-file `write` follows the same rules. The capture waits at most 500 ms on the first edit of each file; at most four captures run concurrently and abandoned captures are cancelled. If it runs out or capacity is full, that write blocks on every error as before. Language-server and type-checker errors still block on the first write, and linters that run off the edit path (collect-later) are not covered. Pre-existing linter errors no longer close the `--lens-guard` commit gate.
540
+
541
+ - **A second write no longer clears an unfixed blocker (closes #4484)** — When a write left an earlier error in place (it edited another line, or the next turn edited the file again), pi-lens treated "nothing new" as fixed: the write said `✓ clean`, the `--lens-guard` commit gate opened, `lens_diagnostics source=session` and the widget showed no issues, and turn end reported the error as cleared. The error now stays blocking until a check of the file no longer finds it: the write says `🔴 Still unfixed: N blocker(s) reported earlier (L…)` instead of clean, the commit gate stays shut, turn end lists it as unresolved, and the session store and widget keep it. This also holds for linters whose ids are positions (helm-lint), where fixing one error renumbers the next, and for a script run without authorship that leaves the error in place. The error also stays blocking when the write did not touch its lines (tree-sitter and ast-grep check only the edited lines for new blockers), when the language server or linter failed, timed out or did not answer on that write, when a slow checker's re-check was still running, and for an unused declaration that blocked when it was new. A write that removes the error still reports it resolved. A slow checker's re-check that finds the error gone clears it, at the commit gate or at turn end; one that failed clears nothing. A check that skipped the file without reading it no longer reads as clean: a file over a size or line limit, a crashed parser, an unavailable grammar or server. Fixing an error now clears it even when the same rule still matches an untouched line elsewhere. An error that moves with an edit above it keeps its new line number. Once a checker that could not run answers again, it reports an error first written meanwhile. A new error that takes a fixed error's place shows as a new STOP, not as "still unfixed". An error stays blocking after an edit too large to line up with the file's earlier version, after writes to hundreds of other files, and in a file over 2 MiB. After such an edit, a fixed error no longer blocks on an untouched line elsewhere with other text, and an error its checker skipped stays blocking once the file lines up again. A checker that skipped a file with no errors now re-checks only the lines it skipped, so an untouched old finding no longer becomes a new STOP. Turn end lists an error once after a slow checker's re-check settles. An ast-grep error found before the ast-grep language server started stays blocking after an edit elsewhere, when that server does not answer, and when a slow re-check settles, and still clears when fixed. A shellcheck or taplo error stays blocking when the language server that stands in for that linter does not answer.
542
+
543
+ - **Cascade checks report broken importers on every turn, not once or never (refs #4485, #4486, #4487)** — After an edit, the impact cascade often said nothing about the files that import the edited one. Classic TypeScript neighbours were sent to a background check that usually never finished, so the run read as clean. A snapshot published before the edit could stand in for the neighbour after it. An error shown once was hidden on later runs. Now classic TypeScript neighbours are answered in the same turn. Other servers that only publish when something changes get a 1 s wait. A neighbour that gets no answer is listed as unconfirmed instead of clean. Only diagnostics published after the edit are used. A persistent neighbour error is listed every turn and marked "still present since turn N". An error shown in an earlier turn and not checked since stays on a short "still unresolved" line until a check or an edit shows it gone. If that file was changed outside pi after the check, the line says so once and stops. If the file was deleted, the line is dropped. Neighbour errors stay advisory and never block a commit.
544
+
545
+ - **Language servers see a branch switch made with git (refs #4493)** — a clean-tree `git checkout`, `reset --hard`, or completed rebase or cherry-pick left the language server holding the old bytes of every open file, so edits were blocked on errors from the previous branch. pi-lens now notices each move of HEAD, at the bash call that made it or at the next tool call for a move made outside pi. Before that tool returns, it sends the new bytes of the open files the move rewrote to the primary language server, which is the one the next edit is checked against. Auxiliary scanners catch up after the tool returns. A tool call that starts while that send is running waits for it, up to 500 ms. One `opaque_mutation_head_moved` row records each move.
546
+
547
+ - **A subagent session in a linked worktree now recovers its own opaque bash writes** instead of reporting `no-pending-snapshot` for a command that did write (fixes #4504). The opaque prescan keyed its `tool_call` record on the host's session cwd and its `tool_result` take on the coordinator's project root, which are the same thing only for the primary session; a concurrent secondary session (a subagent in a worktree) wrote its baseline under one root and looked it up under another. Both hooks now resolve one root through `opaquePrescanRoot` (`clients/opaque-mutation-scan.ts`), and a witness through the real `index.ts` handlers over a real linked worktree pins it red-first. The same owner now keys the head-move resync and the held-primary send, so a subagent's recovered files reach the servers that hold them; a write it names in the main checkout is no longer cleared by a scan of its own worktree.
548
+
549
+ - **A fixed ast-grep error no longer stays blocking after the ast-grep server starts (closes #4509)** — An error the built-in ast-grep check found before the ast-grep language server started could block for the rest of the session once fixed: after an edit on its line that the server missed, or after an edit too large to line up with the file's earlier version, the fix still read `🔴 Still unfixed`, and the `--lens-guard` commit gate stayed shut. The built-in check now re-checks the file while it holds such an error, so the fix clears it; where the server reports the same rule on the same line, its copy is listed once, also when a slow re-check settles later. Another rule the server reports on that line, or a weaker copy of the same rule, no longer hides the error or opens the commit gate. An error kept through an edit too large to line up no longer cites a line number from the old file, is no longer cleared because its old line now holds the same text in a comment, and is no longer dropped at turn end or when a slow re-check settles. A lone closing brace or other line with no letters or digits no longer turns an older, untouched finding into a new STOP.
550
+
551
+ - **Language servers start from the managed install when project trust is unknown (closes #4515)** — on a host that does not report project trust (an older pi, a third-party embedder), the refusal of the project-local `node_modules/.bin` server ended the launch before the managed install was tried, so npm-installed servers (yaml, bash, Docker, Prisma) never started and no diagnostics appeared. The refusal now falls through to the managed install. A refused project binary is never run, not even for a `--version` check. When `PATH` reaches into the project (`npm run`, an activated venv, direnv), only pi-lens's own tool store is read and nothing is installed. Untrusted projects are unchanged: installs stay off there.
552
+
553
+ - **Tool crashes and timeouts no longer read as clean files; ktlint findings are preserved (refs #4522)** — shellcheck, shfmt and fish_indent now report no verdict when they fail to answer, and ktlint 1.8.0 output is parsed correctly. A tool-state matrix over captured runner output holds the line: only a clean run may read clean.
554
+
555
+ - **Opaque bash rewrites remain analyzed with `--no-read-guard`** — Dispatch and LSP resync continue while read evidence stays disabled (#4534).
556
+
557
+ - **Nested Python projects keep their own language server (closes #4547)** — For Python language servers, a directory marked only by `requirements.txt`, `setup.py` or `setup.cfg` is now a project boundary, so its Python files are no longer served by an ancestor's pyright client without the project's own config or virtualenv. Before, such files could report unresolved imports, depending on which Python file was opened first.
558
+
559
+ - **A process serving several live sessions releases its registry entry and stale primary registration** — One pi-lens activation can serve more than one live session: pi re-runs the extension factory per session, but a host can also deliver several `session_start` events to a single activation, where the first session is `primary` and each later one is a declined `concurrent-secondary`. The activation recorded only the LAST classification it saw, so a secondary's start overwrote the primary's role and every later shutdown, the primary's included, took the local-only branch. `cancelLSPIdleReset`, `resetLSPService`, `deregisterInstance` and the primary registration release therefore never ran for the process, which kept its `instances.json` entry and its stale primary registration until it exited. The shared teardown now belongs to the last live session of the activation that still owns the primary registration. Replacement removes superseded primary membership, reload hands off the departing primary's own scope, and every leave ends its own turn and cache bookkeeping. A superseded primary's delayed shutdown is not the activation's last leave, so it can no longer stop a live replacement, and a departing primary's saved state is written under its own session id rather than the identity a later session registered (#4554).
560
+
561
+ - **`rename_file` sends a `~/…` destination to your home directory, not a `~` folder in the project (#4578)** — the destination now resolves through the same host-path seam pi's own write tools use, so `~`, a leading `@` mention prefix, pi's unicode space class and a `file://` URL all resolve as they do on a read, and a destination outside the workspace is refused by the existing rename confinement instead of being created.
562
+
563
+ - **A held document keeps its drift record at the record cap, so an untracked edit still heals**: the capped record set evicted by insertion order alone, so a workspace sweep (one touch per project file, every document still open) unbound the earliest files — the server kept answering from their pre-edit bytes with nothing left to compare disk against (closes #4503). Eviction now skips every record whose document a live server still holds, and the held-document count bounds the set instead of the cap alone; one `lsp_document_drift_cap` row per session names the first crossing.
564
+
565
+ - **A malformed persist worker message no longer ends pi (#4402)** — The project-snapshot and review-graph persist hosts read a worker result only through `readGzipStageWorkerResult`. A message they cannot route, or whose handling threw, is counted as `persist-worker-message-contained` in the degradation ledger, and a result with a wrongly typed field takes the main-thread write. The persist worker answers a malformed request with an error result instead of dying. `tests/clients/worker-message-boundary-ratchet.test.ts` reds on any `message` handler in `clients/`, `mcp/`, `tools/` or `index.ts` whose parameter is not `unknown` or whose body is not one non-rethrowing `try`. `tests/clients/persist-worker-message-fault-injection.test.ts` sends malformed, error-shaped and foreign messages through the real `Worker`.
566
+
567
+ - **LSP status shows the whole project root (refs #4449)** — `/lens-health` and the engine status cut a client's root at its second colon, so a Windows root such as `c:/work/proj` read as `c` and a POSIX root such as `/srv/a:b/proj` as `/srv/a`. The root is now read the same way as in the breaker status, and evicting an adopted (foreign) project root no longer shuts down the language server of a different root whose path ends in `:` followed by the evicted root's path.
568
+
569
+ ### Internal
570
+
571
+ <details>
572
+ <summary>66 internal changes: tests, CI, tooling, and refactors</summary>
573
+
574
+ - The `Finalize CI rerun classification` job now gives `gh` a repository source (`GH_REPO`) instead of relying on a checkout it does not have, so the terminal `ci:real` / `ci:infra` label swap runs. Every job that reached that write had failed with `failed to run git: fatal: not a git repository` since 2026-10-10, and the census in `tests/config/github-token-write-gates.test.ts` reds a workflow job that calls `gh` with no `GH_REPO`, checkout, or `-R` (refs #4382). The census now shares command-position and quote-aware stdin parsing with the Bash guard, admits only data-only stdin consumers, refuses cyclic repository expressions and invalidates exported sources across `eval`, judges the last explicit repository operand, and reports inline scripts it cannot read instead of skipping them.
575
+
576
+ - The out-of-band disk look now publishes one `DiskChange` (`clients/disk-changes.ts`) instead of calling the LSP service and the diagnostics-cache clock itself, and the project sequence gains a bulk writer (`recordProjectMutations`) that allocates N paths in one locked change-log append with the single writer's lock-failure semantics. This is slice 1 of #4535 (publisher foundation): the migrated wires are the out-of-band look's two consumers, and the remaining detectors follow in later slices.
577
+
578
+ - Share the session-scoped reset block with fresh-module test seams to prevent prior-cell availability and timeout state leaking into later cells.
579
+
580
+ - Plant the shared project-root marker on every test fixture, widen the tmp-hygiene census to writes at the tmp root (#4560).
581
+
582
+ - The bounded-eviction idiom sweep (`tests/config/bounded-eviction-idiom-sweep.test.ts`) now matches the iterator-result spelling (`const oldest = m.keys().next()` with `.value` read on a later line), the one the pre-#4503 drift cap used and all four earlier spellings missed, and it matches it on the semantic rather than on an accessor name. The five production sites the wider matcher found (`clients/cascade-format.ts`, `clients/lsp/cascade-tier.ts`, `clients/mcp/session.ts`, `clients/read-guard.ts`, `clients/test-runner-delivery.ts`) move their cap into `BoundedFifoMap` instead of hand-rolling the evict-oldest loop; their eviction order and degradation records are unchanged. The second round widens the same sweep to an accessor chain a formatter wraps across lines, `$`-initial names, iterator destructuring, a re-assignment, a binding wrapped after `=`, and an eviction whose victim is picked by a comparator over a spread accessor: the session-fact tombstone trim moves its cap into `BoundedSet`, and six live sites whose policy no bounded class expresses are admitted with reasons. Rounds three and four separate balanced initializers, cap evidence and ordered element consumption, following transformed sequences, local aliases and multi-victim removal; newly visible policy-specific evictions and diagnostic-only rankings have explicit admissions. Round five stops widening the matcher and states what it cannot see: the census is the detector's population, and the count-bounded array truncations it does not follow (`ranked.slice(0, over)` deleted one victim at a time, `slice(-n)`, `length = cap`, `slice(...).forEach(delete)`) are named as residuals with five live sites, each re-read and re-probed by the suite so a row cannot go stale. Round six closes the read that made that promise hollow: each residual anchor is matched in comment- and string-blanked source, so a comment that quotes a removed block no longer keeps its row alive, a control pins that a quoted anchor matches nothing, and the accounting test now asserts how many plants and live sites it actually checked, so an emptied loop cannot read as a clean census. Refs #4570.
583
+
584
+ - Add a `test-server-teardown` ratchet sweep for #4589: a test that starts a real listener reds unless the close promise is proven settled where the hook actually runs it — in a teardown hook, a `finally`, the start's own function, or a local helper that returns it and whose every call site settles it. `await xs.forEach(...)`, `await xs.map(...)`, `Promise.race`, a helper that drops the promise, and an `await` in a function, callback, or branch the hook never runs all report instead of passing. A `bind`/`serve` start on a socket or runtime handle is in the population, including the computed `socket["bind"](0)` spelling and a runtime global's own `serve`; a verb, receiver, or construction the scan cannot read is reported as `unresolvable`, never counted clean. The sink drain sweep attributes a sink path at every parameter position of a same-file helper and judges the read where it runs against the call site that supplied the sink, so a helper that suspends on its own path before the read voids the caller's drain, and one that never runs that await does not.
585
+
586
+ - Add a `test-env-restore` ratchet sweep: an env write in test source with no restore in the same file reds, the AST enumerator follows TypeScript wrappers and local env bindings, cleanup copies cannot claim to delete new keys, and every admitted row carries a reason that the sweep re-checks (#4589).
587
+
588
+ - Pin a fixture `HOME` outside every root the harness deletes (`pinFixtureHome`), so a child a test never awaits can no longer re-create a `pi-lens-*` temp root after its file's teardown sweep, publish the fixture-home root each worker derives instead of the value it inherited so a nested Vitest child cannot remove its parent's root, and record a leaked entry's birth time and first-level children so the next such leak is attributable (refs #4591).
589
+
590
+ - The declaration-file walk under a root now records `lsp-declaration-walk-unreadable` when it cannot list a subtree or stat a file for a reason other than absence, and keeps that entry's previous fingerprint instead of reporting its files deleted or created; an unresolved implicit-scope question records `lsp-implicit-scope-unknown` with the file and cause, and a rejected root deregistration records `instance-registry-deregister-root-failed` with the error in its durable metadata. A new `tests/config/silent-catch-sweep.test.ts` ratchets every `catch` handler in the shipped trees to call a record seam on every path or carry a `none: <reason>` line, pinning each file's admitted set by content identity (#4596, #4603).
591
+
592
+ - `scripts/check-pr-body.mjs` now refuses a body that names a record literal under `## Observability` unless a test vitest collects and runs reads it back: the record's full name in an assertion, a comparison, a `case` label or a record-keyed row — never a test title, a `console.log` argument, a skipped test or an excluded tree — over blanked test source, with the collected set read from `vitest.config.ts` (#4597). A record is named whatever the spelling (a backticked span, a bare word, a link label), the declaration that holds the read-back may be spelled with a bracket link or an alias, and a declaration form the rule cannot classify contributes nothing: a skipped or unparsable declaration never counts as a read. The rule is the mechanical half of `docs/pi-lens-fixer.md`'s record rule; `none: <reason>` stays valid, and a probe that cannot run says so instead of passing.
593
+
594
+ - **The eviction sweep asks the question structurally instead of matching spellings (#4606).** `tests/config/bounded-eviction-idiom-sweep.test.ts` recognised five lexical spellings of a hand-rolled evict-oldest block, and every review round found a neighbouring shape the previous spelling could not see: a wrapped accessor chain, an alias, an indirect accessor, a binding split across statements, destructured iterator results, an ordering that finishes in its own statement. The question now lives in `tests/support/eviction-programs.ts`, a recognizer over the TypeScript AST built on the S0 census seam, which tests the four stages an eviction program passes through: a cap bound, an order, a victim selection, and an effect on state. It admits four forms (`iterator-head`, `ordered-victim`, `ordered-scan`, `count-truncation`) and refuses everything else; the state table is the module header's and the worktree's `STATE_TABLE.md`. Selection is structural, not a spelling: an iterator's `.next()` head, an array-destructured head, and a `for…of` head that breaks are the same eviction, and a victim reached through a second binding or an alias is resolved before the removal test. The population is 24 flagged programs over 790 census files (`iterator-head 3, ordered-victim 11, ordered-scan 4, count-truncation 6`); eight of them the lexical detector could not see (`clients/sgconfig.ts`, `clients/cache-manager.ts`, `clients/mutation-attribution.ts`, `clients/widget-state.ts`'s retention cap, `clients/lens-map.ts`, `clients/observed-mutation.ts`, `clients/resource-sampler.ts`, `scripts/analyze-pi-lens-logs.mjs`) with retained policy reasons. Three rows that recorded lexical NON-members are deleted rather than re-pinned, because the structural recognizer does not flag a median, a percentile, or a lockfile diagnostic. Six live retention programs the recognizer still refuses are tabled with their own statement anchors and asserted unflagged: insertion-order `push`-then-`slice(-N)` retention in two shapes, an ordered array of edits, a runtime line budget, a minimum reduction under a tracked-count cap, and a runtime-bound suffix retention.
595
+
596
+ - **A pull request that touches RPC, install, LSP launch or trust paths runs the deep install smoke (#4291)** — `install-smoke.yml` runs all four pi-load cells (npm-global, pnpm-global, bun-global, curl) on ubuntu and an advisory LSP handshake job on such a PR. Other PRs that reach the workflow keep the one pnpm-global cell. One path list (`PR_SMOKE_PATHS` in `scripts/ci-changed-files.mjs`) drives both, pinned by `tests/config/pr-smoke-paths.test.ts`.
597
+
598
+ - **Cache the nightly smokes' tool installs and prune the Actions cache (#4358)** — tool-smoke and parser-smoke restore their managed tool tree from a cache keyed on the installer registry's pins and the ISO week and saved once their install steps ran, a nightly `cache-prune.yml` removes caches of closed pull requests and superseded copies, and a config test fails a `pull_request_target` or `workflow_run` workflow that restores or saves a cache, whether through `actions/cache` or a `setup-*` action's own caching.
599
+
600
+ - Hot-path latency lane (#4363). `.github/workflows/hot-path-latency.yml` times `session_start`, `dispatchLint` and the diagnostics-cache replay 15 times on the checked-out commit and on its first parent (`HEAD^1`: master's tip on a pull request's merge ref, the previous commit on a push), and reports a bootstrapped interval per metric. It fails only when a metric is significantly slower and at least 1.25x and 5 ms above the base. It is advisory until 10 consecutive master push runs are green.
601
+
602
+ - The close-keyword lint (`--lint-pr`) also scans every PR commit message, merge commits included, because GitHub closes an issue for a keyword in a commit that reaches master (#4371). It flags any issue a commit would close that the PR title or a clean body keyword does not close, so a commit trailer alone is not intent, and it fails closed when the commit list cannot be read in full. The PR-metadata scripts now share one GitHub REST read, `scripts/lib/github-rest.mjs`.
603
+
604
+ - A PR's added or changed test files run alone and under two fixed shuffle seeds in `Targeted tests (advisory)` (#4397). `scripts/ci-shuffle-changed-tests.mjs` reds a file whose cases share state, within a 6-minute budget and a 20-file cap. A start that ran no test is unproven, not clean. Ten order-dependent cases on master are fixed, in `lens-diagnostics`, `flake-shape-ratchet`, `lsp-diagnostics` and three `lsp-diagnostics-*` test files.
605
+
606
+ - **The registry-package install-smoke legs run in a project that carries its own `typescript` (#4401)** — `pi-load` and `mise-repro` run the published pi-lens, which cannot start the TypeScript server when the only compiler is a bare `tsc` on PATH (#4414, fixed on master, unreleased). The RPC smoke now waits for the TypeScript server to start or fail, instead of a fixed second after the turn, and fails when it did not start.
607
+
608
+ - The PR-body check accepts `Gap: exists: <path>` only when the path is a file on the PR's base commit (#4404). A test the PR itself adds is not an existing layer; the check refuses it and points at an issue ref or `none: <reason>`. When the base cannot be resolved, the check fails closed with a fetch hint. The class-sweep composition test also stops scanning the whole test tree (#4385).
609
+
610
+ - **Pin the tool-tree cache action to actions/cache v6.1.0 (#4417)** — the composite action's restore and save steps moved from the v4.3.0 SHA to the v6.1.0 SHA that `ci.yml` already pins, so one action repository has one SHA across the workflow tree, as `tests/config/action-pin-split.test.ts` requires.
611
+
612
+ - Four review-found shapes now red instead of waiting for a reviewer (#4427). `tests/config/lsp-index-config-import-pin.test.ts` pins the exact symbols `clients/lsp/index.ts` takes from `./config.js`. A rise in the `vi.mock` sweep's missing-export count fails `tests/config/vi-mock-export-sweep.test.ts` (the baseline admits the 68 rises the old warning hid; the detector now accepts a `vi.importActual` spread of the mocked module, which drops 13 false-positive rows). `tests/config/live-pin-literal-sweep.test.ts` reds on a literal in `tests/config` that spells a live workflow action pin, and the heavy-gate and writer-governance tests derive their pins with `siblingPin`. `tests/config/github-bearer-ratchet.test.ts` reds on a `Bearer` or `Authorization:` header in `scripts/` outside `scripts/lib/github-rest.mjs` (no exceptions are admitted), and every script that sends a GitHub request builds its headers with `githubHeaders` or `githubFetcher`. `lint:js:promises` also denies `typescript/await-thenable` (#4428).
613
+
614
+ - The PR body `## Detection` lint requires `Shape:` and `Enforcer:` lines on a bug-closing PR (#4439), and `tests/config/shape-history-governance.test.ts` requires each `AGENTS.md` catalog shape to have a `HISTORY.md` entry, with a shrink-only baseline of the shapes that lack one.
615
+
616
+ - `Changed test files, alone and shuffled` runs the files a PR adds alone first, before the shuffled starts, so a new witness test no longer sorts past a cap (#4456). The 20-file cap is gone and the time budget is the only bound. The budget is 7 minutes, measured over two real plans that needed about 361 s, and every unproven line names the files it skipped.
617
+
618
+ - **Markdown table cells escape the backslash before the pipe (#4490)** — `escapeMarkdownCell` in `scripts/lib/markdown-cell.mjs` escapes the backslash, then the pipe, in the census issue body, the per-test candidate table and the mutation-table row written by `scripts/mutate.mjs`. A test title or error holding `a\|b` no longer splits its row. The rule-catalog generator now imports the helper with its output unchanged. The mutation report keeps its code-span escaping. The identifier-only `$` escapes in `tests/clients/finding-delivery-gate.test.ts` use the shared `escapeRegExp`. Pinned by `tests/scripts/markdown-cell.test.ts`, the census and stryker row cases, and the mutate title case.
619
+
620
+ - **`scripts/mutate.mjs` prints REFUSED for a refused edit and BROKEN for a failed build (#4510)** — the mutation transcript and table row used to print `RED` for any thrown error, so a mutation that never ran read as a test that catches it. `RED` now means a test run failed, `REFUSED` a no-op or comment-only edit, `BROKEN` a failed build, and `ERROR` any other failure without a verdict, including a vitest killed from outside and a `--tests` path with no test file. A signal to the run now kills vitest's whole process group, so its worker fork no longer keeps spinning. Exit codes are unchanged. Pinned by the REFUSED, BROKEN, ERROR and signal cases in `tests/scripts/mutate.test.ts`.
621
+
622
+ - **`Unit tests Windows` gates instead of advising (#4518)** — the lane drops its `(advisory)` suffix, its `needs: heavy-gate` deferral and its `continue-on-error` step, so it starts on every event like the Unit shards and a failing row gates in `ci-verdict` (an absent or job-skipped row still reads green until branch protection lists the name); the two tests that kept it red on master (a 60 s budget on a 10,000-path pipeline population, and the tmp-fixture census on win32) are fixed or quarantined, and branch protection still needs `Unit tests Windows` added by hand.
623
+
624
+ - The `## Detection` PR-body check accepts `TLA+`, `mutation`, `pre-push`, `lint/type check` and `nightly:<workflow>` as layer words and refuses `unknown` on a bug-closing PR (#4519).
625
+
626
+ - Tie PR-body evidence to changed test files, changed production guards, and Windows-sensitive launch and path seams (#4585). Row 1 is file-level: one fenced red-first transcript naming the file, or a Controls row naming it with a reason. A whole-file deletion owes no row, a move owes nothing while a copy does, a `mutation:` fence needs an explicit RED/FAIL result, and a Windows row that names a bare basename is not a generic read (#4605).
627
+
628
+ - **Role contracts read bot threads and code-scanning alerts when they exist** — the fixer contract disposes of each thread before the hand-back, the reviewer contract rates each one and refuses `merge-ready` while any stays undisposed, and the merge-policy mistakes table gains the seven 2026-10-17 retro rows. A missing bot review is never evidence of anything.
629
+
630
+ - **Record the 2026-10-17 retro rules and a principles digest.** AGENTS.md gains shapes 72 and 73, a digest linking `docs/engineering-principles.md` by heading, and the plegma publish rule; the merge policy gains a bot-thread disposition rule (#4565).
631
+
632
+ - `AGENTS.md` gains shape 74, split host-path resolution: a path resolves by its provenance (host argument, shell operand, recovered from disk, generated by pi-lens), each at one seam. `docs/pi-lens-fixer.md` now says a new shape is a PR-body proposal, never an `AGENTS.md` edit (#4576, #4577).
633
+
634
+ - **LSP client registry extracted (refs #2372)** — `LSPService`'s client identity and lifecycle (the client map and its key, single-flight spawn, the circuit breaker, leases, capacity and idle eviction, adopted roots, and the client half of shutdown) moved into `clients/lsp/client-registry.ts`. The service composes it, and the `LspCapabilities` lifecycle group's read members route to it. Keys, timings, records and log phases are unchanged.
635
+
636
+ - **Session start ensures madge once (refs #3753)** — The deferred availability probes skip tools a startup scan already covers, but madge was probed exactly when the startup scans run, so every such session ensured madge twice. The probe is gone; the startup madge scan still ensures it, and `tests/clients/runtime-session.test.ts` pins one ensure past the exports defer.
637
+
638
+ - The local PR-body preflight (`check-pr-body.mjs --lint-local`) now reads the closed issue's labels through `gh api` and validates any present `## Detection` section, so it agrees with CI's "PR body (advisory)" check (refs #4288).
639
+
640
+ - CI: the LSP census and ast-grep version steps call the installed binaries (`node_modules/.bin/vitest`, `node_modules/.bin/ast-grep`) instead of an on-demand `npx`, which reds the nightly SonarCloud master gate on S6505/S8543 (refs #4339).
641
+
642
+ - Test grammars are prefetched once, in parallel, before any worker starts (#4342). The globalSetup fetches every grammar in the download list that no runtime grammar directory already holds. Each fetch stops after 15 s with no bytes and retries once on a retryable failure. A grammar still missing fails the run under CI and warns once locally, naming every grammar. The LSP symbol fallback test uses a python fixture instead of dart, which is not a core grammar.
643
+
644
+ - The real-factory bridge-rebind test no longer strands a `pi-lens-jscpd-*` directory in the shared tmpdir: its unawaited session_start scans now write their report roots under a root the test harness owns. The ast-grep temp-rule scan joins the same scanner temp-root seam. The tmp-fixture hygiene exemption scan now reads code, so a comment or string that mentions `os.tmpdir()` or `REPO_ROOT` no longer exempts a mkdtemp site (#4347).
645
+
646
+ - `guard-bash.mjs` denies agent writes under `/tmp` (redirects, `tee`, `cp`/`mv`/`install` targets, `mkdir`, `touch`), exempting the harness's `/tmp/claude-<uid>/` and reads (#4348).
647
+
648
+ - Make the `removeTempDirSync` give-up test deterministic by failing the directory's removal in the test instead of racing a live writer that a starved CI runner could not keep ahead of the first removal pass (closes #4349).
649
+
650
+ - CodeQL init steps run the same v4.38.3 codeql-action commit as analyze and upload-sarif again, and a config test reds when one action repository carries two SHAs anywhere in the workflow tree (#4350).
651
+
652
+ - The close-keyword lint rejects a closing keyword inside a markdown table row or after a negation or hedge ("not fixed: #N", "Whether this closes #N"), and `--verify-merged` reports an issue GitHub closed only through such a line (#4371).
653
+
654
+ - The infra-kill rerun workflow takes a PR number only from a `pull_request` run's entry of this repository at the run's own head, so a master push run no longer targets another repository's namesake PR (issue 23, HTTP 403), and a refused PR comment write logs one warning without stopping the classify-and-rerun step (#4382).
655
+
656
+ - **The tool-smoke handshake lane reports an alternate row whose server is missing as unavailable again (#4465)** — since #4411, a touch that no language server answered returns the `primary-unavailable` verdict, not nothing, when a primary is off in `lsp.disabledServers`. Every alternate row disables its default, so the official Docker row failed with "got no warm client" on a runner without the binary instead of skipping. The LSP scripts now share one reader of a touch result: that verdict means "no client ready", and a requested auxiliary counts only while it runs. `bench-lsp` stops reporting every installed server unavailable, and stops timing auxiliaries that never started; the clean-signal probe counts its dirty diagnostics again. The PR install smoke drops its copied official-Docker install step.
657
+
658
+ - The pre-push test selection keeps the change's own tests when it caps (#4489). A changed test file and the mirrored test of each changed source file now survive the 25-file cap and do not count against it. The cap keeps the best 25 import matches instead of none, ranked by fewest importers of the changed file first (specific files outrank hubs), ties by path. The capped warning and the header describe the rule. Replaying the 20 newest merged PRs recalls 113 of 113 own test files, up from 31.
659
+
660
+ - **Test drain waits for the jscpd scan (#4505)** — `drainBackgroundWritesForTests` now waits for a resident jscpd scan, and `JscpdClient.shutdown()` also waits for a pending availability probe and the scan behind it, so a test file that ends right after `session_start` no longer strands a `pi-lens-jscpd-*` report directory in the pre-push batch. Pinned by `tests/clients/test-utils-drain-jscpd-4505.test.ts` and the probe cases in `tests/clients/jscpd-client.test.ts`.
661
+
662
+ - Allow the nightly matrix cell floor to accept expiry justified by HEAD's first-missed date while retaining the hold on unexplained losses (#4537, #4538).
663
+
664
+ - One predicate now answers whether a mutation event is a bash-derived
665
+ replay, and both readers (`mutating-tool` and `runtime-tool-result`) call
666
+ it instead of spelling the marker check inline (closes #4623). Behaviour
667
+ is unchanged. Contributed by @Don-Yin.
668
+
669
+ - A `verify-pi-lens` skill gives reviewers and fixers reusable real-path probes (MCP launch, doctor, wire and diagnostics evidence, cleanup) for LSP diagnostics with Pyrefly, the formatter, the review graph and `rename_file`, seeded with the #4344 probe shapes (#4359).
670
+
671
+ - The flake-shape ratchet gains two detectors: `in-process-mock` pins which non-boundary modules each test file mocks with `vi.mock`/`vi.doMock`, and `service-double` pins how many hand-rolled LSP client and service doubles it holds. Process and host boundaries (child processes, the filesystem, the network, the pi SDK) stay free, and a new in-process mock or double needs a `// flake-shape:` admission header. For every detector, a baseline row past the digest-pinned frozen mint now needs its `ADMITTED_AFTER_BASELINE` entry and header; before, a baseline row alone admitted anything (#4362).
672
+
673
+ - A manual `stryker-pertest` workflow mutates one `clients/` module with the vitest runner and per-test coverage, and `scripts/stryker-pertest.mjs candidates` lists the tests that cover mutated code but kill no mutant; four no-throw-only tests it flagged and a stronger sibling subsumes are removed (#4365).
674
+
675
+ - Tests drain a log sink before reading its offset, line count or rows (#4381). `config-resolved-phase` and its session-wiring sibling read a `sessionstart.log` offset while their own lines were still queued. The new `tests/config/sink-read-drain-sweep.test.ts` fails any test read of an in-process sink that no awaited drain of that sink precedes.
676
+
677
+ - The 37 code-choice constants of `formal/dispatch-pipeline` and `formal/format-drain` are now pinned in `formal/switch-pins.json`, each to a live test that drives the real code, and both families join `FULLY_PINNED` (#4393). A new test pins the target hold of a whole-package fixer, which no test asserted. `tests/config/tla-switch-pins.test.ts` now compares a constant only with the pass configs of modules that name it, so a family with two modules can be pinned. `narrowedBy` now names the configs it admits, so a flipped value in one config is no longer hidden by a sibling's narrowing, and the `SiblingRestoreQueued.cfg` model now matches the code's three report-history switches.
678
+
679
+ - Every TLA+ config constant is now classified in `formal/switch-pins.json`, and each read-guard switch that mirrors a code choice names a test that drives the real code (#4393). `tests/config/tla-switch-pins.test.ts` fails when a constant is unclassified, a pin's test title is gone, or an `expect: pass` config disagrees with the pinned value, so a model can no longer keep proving a design the code dropped (#4387). Test-existence detectors now share `testDeclarations` (tests/support/sweep-kit.ts), so a skipped, conditional or uncalled test no longer counts as a pin.
680
+
681
+ - The install smoke's RPC check now runs a session the way an RPC child does and reds on any host exit, `extension_error`, warning or error notice, or pi-lens failure log line from start through the first turn (#4401). `scripts/rpc-load-check.mjs` drives `pi --mode rpc` against a local fake provider, waits for the warm-up and sends a prompt. `host-range-smoke` also runs it on the packed tarball with the snapshot persist worker forced to fail (`PI_LENS_TEST_SNAPSHOT_WORKER_FAIL`, a test-only seam in the worker), the #4400 shape. The old check passed #4314 because a failed warm is only a log line. The smoke project is pinned trusted through pi's own `defaultProjectTrust` setting, so the language-server spawn and warm are exercised; every warning fails, and a failed run prints the offending records and the log tails. `release-qa` and the compat smoke now share the one driver.
682
+
683
+ - Repo-wide shuffle census for order-dependent test files (#4405). `scripts/ci-shuffle-census.mjs` runs every test file under seeds 202 and 424 (and alone, weekly) through the changed-files job's planner and runner, re-runs each failing member alone under its seed, reruns a chunk whose member passed alone, and diffs the member files against `scripts/shuffle-census-ratchet.json`, keyed by file: a new member reds, an entry clean two nights running must leave the list, and a planned start with no record is unproven, never clean. The census test also checks that the census plans exactly the files the `vitest.config.ts` projects collect, so a config change that hides a file from every seed reds its own PR. `shuffle-census-nightly.yml` runs it as six parallel parts and keeps one tracking issue. The first pass found 33 order-dependent files of 1449 (seeds 202, 424 and 606); the leaked `vi.doMock` registrations in `index-integration` and `tree-sitter-runner`, the heartbeat case in `tmp-fixture-hygiene` (found by the CI rehearsal) and the leaked degradation ledger in `bounded-pid-file-lock` are fixed; the other 30 are listed by seam.
684
+
685
+ - **Population-deriving ratchets fail closed on an unclassified spelling (refs #4429)** — the single-flight, run-outcome, project-trust seam, delivery-surface and strictness scanners now classify every needle hit or report it with its file and line: single-flight and run-outcome read the TypeScript AST (a constructor parameter property is a field; a primitive counts only where the runner references the value at runtime), the project-trust seam scan keys on the mocked specifier (a seam string in argument position counts unless the callee is proven non-vitest, and any other position reds), delivery-surface reads markers by decoded value with comments blanked and bracket keys read like dots, and the strictness parser reports unlocated tsc diagnostics and ratchets every repo-root file the baseline does not exclude with a reason.
686
+
687
+ - The backstop grace-retry cases own their follow-up sweep instead of racing its wall-clock timer (#4488, recurrence of #2669). A `graceRetryScheduler` seam hands a case the retry options production composed, so a loaded runner can no longer fail "grace retry did not complete" and leak a 5 ms sweep into the next case. The `onComplete` seam now fires after the sweep's `finally` released the backstop lock, so a case that awaits it no longer ends with the release still in flight (#4581 review, thread 4303835287).
688
+
689
+ - **Nightly LSP scripts adopt project trust and report how much they evaluated (refs #4514)** — `characterize-lsp`, `probe-clean-signal`, `server-capabilities`, `measure-lsp-idle-eviction` and `bench-lsp` now adopt trust through `adoptFixtureProjectTrust`, so the launch gate stops refusing their servers (30 of 54 rows had read `unknown` since 2026-10-10); a census over `scripts/*.mjs` fails a script that reaches `dist/clients/lsp/` without it. A refused row reads `refused: <reason>`. A dedicated `assert-evaluated` step fails the nightly when a producer evaluates less than its measured floor, the handshake layer carries `--min-pass=40`, and the refresh PR does not open when a regenerated doc's count drops more than 20% against HEAD.
690
+
691
+ - **The continue-on-error census now covers the whole producer tree (refs #4518)** — every `continue-on-error` site in `.github/workflows/*.{yml,yaml}` and in a composite `.github/actions/**/action.yml|action.yaml` is registered in `tests/fixtures/nightly-floors/continue-on-error-sites.json` as floored (naming the gating step, whose floor must sit in the argument list of a named measuring invocation on a top-level line of its `run:`), no-floor (the reader that makes an empty result visible), or governed-by (the issue and the live `it`/`test` declarations of the tests that own it). The test derives the population from the parsed files, and both of its predicates are allowlists, so a shape neither lists refuses: an unregistered site, a producer file it cannot classify, a key outside a job or step, floor evidence that is not a measuring invocation's argument (a comment, a quoted command, a heredoc body, a printed command, a function or block body, a subshell, a chained command, or a line after an `exit`), and a floor step whose `if:` is anything but absent or a conjunction of `always()`, `success()`, `!cancelled()` and one `github.event_name` or `matrix.<name>` comparison the workflow's own `on:` block or that job's `strategy.matrix` lists, of a job whose `if:` the document cannot prove never true. A `\`-continued or `&&`-continued line is one command, so a floor must start the joined command, and an `exit` ends the script only in command position. The Swift crash-watch step also prints `evaluated=<0|1>` to its log, so a night read from the job log alone states whether swift was evaluated.
692
+
693
+ - **Every continue-on-error producer outside the LSP nightly proves it evaluated something (refs #4518)** — the APFS anchors leg, the Swift crash-watch, the PR-time LSP handshake and the complexity report now fail on a measured floor through `assertEvaluated`, which gained a `--count <producer>=<n> --floor <m>` door; the `--min-pass` pass floor, the shuffle census's missing-start check and the complexity file count fold onto it. The strictness, jscpd, yamllint, typos, taplo and mise-repro jobs carry a header naming why they need no floor. The helper no longer imports `dist/` (through `clean-signal.mjs`), so the refresh-PR job's `assert-evaluated --docs` runs on its fresh checkout instead of failing every night.
694
+
695
+ - The nightly LSP witness's born-after-start phase now waits for the server to report the importer's missing import, creates the module only then, and polls to a deadline for the verdict to change instead of reading one call (refs #4521). The one-call row red-flaked on pyright (2 of 5 local runs) while a server that never picks the file up still reds at the deadline; a vitest case drives the phase over a real stdio language-server wire.
696
+
697
+ - **Runner captures now record the availability probe and a real clean run, and one gate decides whether a record is evidence.** Fixtures under `tests/fixtures/runner-output/` carry the argv, binary, and exit status their runner's availability checker receives, plus the bytes of a clean run of the fixture's own invocation in `tests/fixtures/runner-output-clean/`; the replay stops mocking the checker, so a tool that rejects its own probe reaches it, and the tool-state matrix's clean cell replays captured bytes instead of `""`. `recordProblems` (`scripts/capture-runner-output.mjs`) refuses a probe whose recorded version its own answer never printed, and a clean run whose argv is not this fixture's invocation: the capture calls it before writing, and the fixture census calls it over every committed fixture. `scripts/capture-runner-fixtures.mjs --records-only` retrofits the records onto an existing fixture without re-recording its work bytes, keyed on the fixture's own case, and there is no prose escape for a missing clean run.
698
+
699
+ - The shared Git fixture helpers point `GIT_CONFIG_GLOBAL` at one checked-in
700
+ policy file, `tests/fixtures/git-fixture-global.gitconfig`, which disables
701
+ background maintenance (`maintenance.auto=false`, `gc.auto=0`) for every
702
+ fixture Git process. A fixture `git commit` therefore no longer forks the
703
+ detached `git maintenance run --auto --quiet --detach` child that outlived
704
+ the cell and wrote inside the fixture's `.git` while `afterEach` teardown
705
+ removed it, so the gating Unit shard stops failing
706
+ `tests/scripts/check-pr-body.test.ts` in teardown with `ENOTEMPTY` instead of
707
+ in an assertion (closes #4552).
708
+
709
+ - **Nine order-dependent test files now reset the process state their siblings left behind (#4561)** — the shuffle census ratchet drops from 29 files to 19: the ast-grep, dispatch-reset and managed-bin cases restore the mocks or stubs they install, the sgconfig, batch-cache, index-2992, cwd-probe, word-index and cooldown cases reset the shared ledger, latch or telemetry ring through its own seam, and the read-bridge row is deleted now that #4549 keeps its file clean under every seed.
710
+
711
+ - **Six more shuffle-census ratchet rows are gone: three declaration-order files isolate their own cases, three opt out per `describe` (#4561)** — the io-bridge and process-bridge-registration files capture their "no bridge yet" observation in a file-level hook, the packaging manifest suite shares one real `npm pack` through a memo so either order pays it, and the two `onTestFinished` backstop suites plus the fake-timer drain suite register in the ratchet's `byDesign` rows with `{ shuffle: false }` because the order of their cases is the mechanism under test. The pinned ratchet count drops from 19 files to 13, and `tests/scripts/ci-shuffle-census.test.ts` now checks the by-design registry in both directions: an unregistered opt-out, or a registry row with no `{ shuffle: false }` describe, reds. The reader behind that check admits only the minimal marker over the parsed syntax tree: an options object is read as a sequence (a spread or an unnameable computed key refuses even beside a readable `shuffle`, and the last key wins), and a callee resolves through any number of aliases.
712
+
713
+ - A `tests/config` sweep now censuses how the tree composes the `PATH`
714
+ environment variable, because Windows' environment block is
715
+ case-insensitive while a `ProcessEnv` object is not: a composition that
716
+ writes both `PATH` and `Path`, or writes `PATH` over a spread that supplied
717
+ `Path`, or `Object.assign`/`Object.fromEntries` builds one over a base,
718
+ hands a child two names for one variable and one shadows the other
719
+ (closes #4590). The rule is decided from the syntax tree — which literal
720
+ holds the key, which object the key is written into, how a binding
721
+ resolves — not from key spellings, so a formatted multi-line literal or an
722
+ indirect write cannot slip past it. The 68 current sites (13 shipped, 55 in
723
+ test fixtures) are seeded as debt with their reason; a new site, a stale row
724
+ or a changed reason reds. Commented env members and later constants keep
725
+ their evidence, and a spread of a parenthesised, asserted, satisfied or
726
+ non-null `process.env` is still the ambient block. A computed key is either
727
+ proved — a quoted string, a substitution-free template, or a `const` chain
728
+ of those literals — or reported: a cast, a substituted template, a
729
+ concatenation, a call, a non-null or comma key, a mutable
730
+ binding, a cycle or a wrapper is `unclassified-spelling`, never a silent
731
+ pass. A key is read by its cooked value, so `"Pa\x74h"` is `Path` and
732
+ `\u0050ATH` is `PATH` whatever the source spells; a string the reader cannot
733
+ decode (a legacy octal escape) reports rather than passing, and a comment
734
+ never decides that a name is about the variable.
735
+
736
+ - **The AST governance sweeps share one census seam (#4606).** `tests/support/ast-census.ts` owns the pre-order walk, the single parse behind it, and the census file list with its `.js`-twin rule; each sweep keeps its own roots and admission tables, so no detector rule and no admission row moves. `tests/support/silent-catch-scan.ts`, `tests/support/worker-message-scan.ts` and `tests/clients/socket-error-listener-sweep.test.ts` load the same seam instead of a copy of the walk. A new guard derives both of its populations from code rather than from lists: the consumer set is every file whose parsed import or re-export resolves to the seam, and the site set is the child-accessor family, so a second traversal — a `namedChildren().forEach` recursion, a `child(i)`/`childCount()` loop, a destructured or reflective accessor, a call through a computed subscript key — reds by file and line. Admission is per live site with a declared count, so a verbatim copy of an admitted line reds, and a second module instance, or a list that stops matching the tree, reds too.
737
+
738
+ </details>
739
+
19
740
  ## [4.4.3] - 2026-10-11
20
741
 
21
742
  ### Added