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
@@ -34,25 +34,62 @@ memory growth:
34
34
  row in latency.log records the release and its trigger).
35
35
  - samplerDurationMs measures the sampler's own record-assembly wall time,
36
36
  excluding the surrounding turn.
37
+ - idle is false on the periodic sample. It is true on the one sample written
38
+ at a session's first turn start after its own turn end, when that gap is
39
+ longer than the TS idle-evict window (`getLspIdleEvictMs()`, 20 minutes by
40
+ default). That record also carries idleMs, the measured gap. The heap
41
+ reading is process-wide; the gap belongs to the session whose turn started.
37
42
 
38
43
  All fields are in the existing record and are O(1) reads or latest-value
39
44
  snapshots; no additional telemetry sink is created.
40
45
 
41
46
  ## Inputs
42
47
 
43
- - `~/.pi-lens/latency.log` and `~/.pi-lens/extension.log` (JSON lines; every
44
- row carries `pid` and `ts`). The session is the `pid` the brief names, or the
45
- newest pid with rows in the last hour when the brief says "live".
48
+ Read the monitored process's log directory, resolved by `getGlobalPiLensLogDir()`
49
+ in `clients/probe-home-state.ts`: a non-empty `PI_LENS_HOME` wins, otherwise
50
+ any applicable probe-home redirect, otherwise `~/.pi-lens`. Do not infer this
51
+ from the monitor's own environment. The brief names the root. When it does
52
+ not, a `PI_LENS_HOME` in the monitored pid's environment (`/proc/<pid>/environ`
53
+ on Linux, `ps eww -p <pid>` on macOS) settles it; otherwise a probe-home
54
+ redirect may have chosen the root from that process's working directory, so
55
+ ask the orchestrator for the root instead of reading `~/.pi-lens`. Pass that directory as `--root` to
56
+ `scripts/analyze-pi-lens-logs.mjs`, whose default is `~/.pi-lens`.
57
+
58
+ - `latency.log` and `extension.log` (JSON lines; every row carries `pid`
59
+ and `ts`). The session is the `pid` the brief names, or the newest pid with
60
+ rows in the last hour when the brief says "live".
61
+ - `cascade.log` (JSON lines with `ts`, `phase`, and `filePath`,
62
+ but no `pid` or `type`). Use the selected time window and `filePath` to
63
+ narrow by project. Label counts as project/time-window evidence, not
64
+ pid-attributed evidence; flag shared-project and non-path rows as
65
+ attribution-ambiguous.
46
66
  - The previous readout for the same project when one exists (an issue comment
47
67
  the brief links, or a file under the scratch directory). Every number is
48
68
  reported as a delta against it when available.
49
69
 
70
+ Read active files, retained numbered siblings (for example, `cascade.log.1`),
71
+ and date-only archives (for example, `cascade.log.2026-03-01`), plus timestamped
72
+ archives that overlap the selected window. The analyzer includes numbered and
73
+ date-only siblings by default; use `--archived` for timestamped archive names
74
+ containing `T` (for example, `cascade.2026-03-01T12-00-00Z.log`, the form session-start cleanup writes). Filter rows by
75
+ the selected window in every file. A missing active file does not make its
76
+ retained siblings empty; flag incomplete retention when the files do not cover
77
+ the requested window.
78
+
50
79
  ## The readout (fixed shape, one comment or file, never stdout to the session)
51
80
 
52
81
  1. **Session line**: pid, project root, first/last row timestamps, row count,
53
82
  pi-lens version if a session-start row carries it.
54
- 2. **Phase table**: for every `type:"phase"` value, `n | p50 | p95 | max |
55
- total_ms`, sorted by total, top 15. Durations in ms, from `durationMs`.
83
+ 2. **Phase table**: group `latency.log` rows with `type:"phase"` and
84
+ `cascade.log` rows from all selected files by `source | phase`, using the
85
+ log family as `source` across active and archived siblings. Report
86
+ `n | timed_n | p50 | p95 | max | total_ms`, sorted by total, top 15.
87
+ Count every row in `n`; compute
88
+ timing columns only from numeric `durationMs`, in ms, with `timed_n`
89
+ showing that sample count. Show `-` when no durations exist. List count-only
90
+ phases separately so the timing top 15 cannot hide `cascade_carry_rendered`;
91
+ include its `metadata.carriedRunsRendered` and `metadata.labeledAdvisories`
92
+ totals.
56
93
  3. **Bounds reached at p50** (shape 41): every phase whose p50 is within 10%
57
94
  of a declared budget or timeout in its metadata (`budgetMs`, `timeoutMs`,
58
95
  `elapsedMs` ≈ budget). Name the constant when it is known
@@ -76,7 +113,11 @@ snapshots; no additional telemetry sink is created.
76
113
  re-activates and uses them. MCP remains connection-scoped and owns the
77
114
  terminal latch.
78
115
  6. **Backlogs**: `lsp_document_drift` rows by disposition, files affected,
79
- `driftAgeMs` p50/p95/max; `agent_end_deferred_mutation_drain` durations and
116
+ `driftAgeMs` p50/p95/max; `lsp_document_drift_cap` rows (at most one per
117
+ session) with `tracked` and `cap` when the tracked-document set stands above
118
+ `DRIFT_TRACK_CAP` because every record belongs to a document a live server
119
+ still holds (#4503) — `tracked - cap` is the excess at the first crossing,
120
+ not the held-document count or later growth; `agent_end_deferred_mutation_drain` durations and
80
121
  coalesced path counts; `deferred_format_file` runs with `changed:true`
81
122
  versus total. A formatter that never settles is visible only as an
82
123
  anti-join (#3828): a `deferred_format_post_exit_resync` row with
@@ -109,7 +150,14 @@ snapshots; no additional telemetry sink is created.
109
150
  displaced is another; a subagent beside a live primary writes none)
110
151
  transitions,
111
152
  `session_end_fence_rollup` (one per primary shutdown: `sources[]` with
112
- `guarded` and `dropped`, plus totals). Read `read_guard_branch_retained` with
153
+ `guarded` and `dropped`, plus totals), `session_handoff_turn_state` (#4751:
154
+ one per primary that takes the turn-state worklist at its turn_start;
155
+ `arm` `predecessor` (from an in-process predecessor: `from`, its files kept
156
+ as `filesKept`), `evicted` (from a predecessor past the stale bound: `from`,
157
+ its files dropped as `filesDropped`) or `empty`, and `to`),
158
+ `lsp_created_import_scan_rollup`
159
+ (one per primary shutdown when the created-module producer ran: `calls`,
160
+ `importers`, `targets`, `capped`, `oversized`, `totalMs`, `maxMs`). Read `read_guard_branch_retained` with
113
161
  `payloadReads`: `kept 0, dropped 0` is a missing payload when `payloadReads`
114
162
  is `null`, an empty read set at `0`, and an ignored payload when it is above
115
163
  0 beside a `payloadVersion` that is not the current one.
@@ -147,8 +195,22 @@ snapshots; no additional telemetry sink is created.
147
195
  - File nothing yourself unless the brief grants `gh`; then one comment on the
148
196
  issue the brief names, never a new issue: the orchestrator decides what
149
197
  becomes a lane.
150
- - A worker that finds the logs empty or the pid absent reports exactly that
151
- with the `ls -la` of the two files and stops.
198
+ - The analyzer reads discovered sources independently and does not apply a
199
+ pid-evidence stop rule. It reports per-family file and row counts
200
+ (`filesScanned`, `rowsSeen`, `parseErrors`) but cannot classify each input
201
+ as absent, empty, unreadable, or out-of-window.
202
+ Missing files and unreadable directories can yield no discovered input;
203
+ empty files and out-of-window rows contribute no rows. A discovered file
204
+ read error fails the command instead of producing an empty report. Do not
205
+ infer absent or empty inputs from zero counts alone.
206
+ - Apply the evidence policy in the monitor's own readout: if the pid is absent
207
+ from the selected latency/extension rows, report that and stop only
208
+ pid-attributed analysis. Continue the project/time-window cascade readout,
209
+ including carry counters, without claiming pid ownership. Inspect the inputs
210
+ separately and report absent, empty, unreadable, or out-of-window states as
211
+ observed, with a bounded `ls -la` inventory of the resolved active files and
212
+ retained archives. After reporting those limits, stop the whole readout only
213
+ when neither kind of evidence is available.
152
214
 
153
215
  ## Deliverable
154
216
 
@@ -25,8 +25,8 @@ which is where mistake rows land.
25
25
  ## Inputs (primary sources, never memory)
26
26
 
27
27
  The lane ledger, the session transcripts, PR bodies and review verdicts, CI
28
- job logs on the exact head, `~/.pi-lens/latency.log` when runtime behaviour
29
- is involved. Every finding cites the source it came from.
28
+ job logs on the exact head, `latency.log` under the resolved log root (`docs/pi-lens-monitor.md`
29
+ "Inputs") when runtime behaviour is involved. Every finding cites the source it came from.
30
30
 
31
31
  ## Procedure
32
32
 
@@ -62,7 +62,10 @@ is involved. Every finding cites the source it came from.
62
62
  is filed as an issue naming the incident as its recurrence, not merged.
63
63
  4. **Judgement candidates become one line in the right place.** A defect shape
64
64
  goes into the `AGENTS.md` catalog as a lean screen, and its issues, PRs and
65
- examples go to `HISTORY.md`; a reviewer duty goes
65
+ examples go to `HISTORY.md`, under a heading that names the shape, such as
66
+ `## 2026-10-14 - title (shape N)`: a lean entry cites no issue, and
67
+ `tests/config/shape-history-governance.test.ts` finds the record by that
68
+ heading or by one of the entry's own issue numbers. A reviewer duty goes
66
69
  into `docs/pi-lens-reviewer.md`; a fixer duty goes into `docs/pi-lens-fixer.md`
67
70
  only when the fixer is the sole actor who can honour it. Standards are
68
71
  enforced by the reviewer, whose context pressure is lowest; fixers get
@@ -50,6 +50,53 @@ a brief supplies only `lane=<name>`, scope, and the grant.
50
50
  7. Clean up: revert mutations, delete probes, and leave
51
51
  `git status --porcelain` empty.
52
52
 
53
+ ## Compliance pass
54
+
55
+ Run this over the merge-base diff at step 2, before the adversarial probes in
56
+ step 4. Each row is a rule a bot can decide from what the diff touches; the
57
+ probes still prove behaviour. Quote the named evidence in the review, and name
58
+ the anchor in the finding so the fixer can route it. A row with no recurrence
59
+ does not ship.
60
+
61
+ | Diff touches | Check | Evidence to quote | Recurrence |
62
+ | --- | --- | --- | --- |
63
+ | A new `it(` or `test(` title, or a case added to a table test | Red first: the case fails on the pre-fix source, with the failure the defect names (principles §2 "Red first") | The pre-fix transcript, with its `Tests N failed` line naming the new titles | #4577 (Greptile, 2026-10-17: round-4 cases shipped with no red) |
64
+ | A new guard, branch, filter, cap or fallback | Mutation red on that predicate, both directions, in a compile-valid change (principles §2 "Mutation output is quoted") | The `scripts/mutate.mjs` transcript and its `RED` status line, with the one test it reds | #4575 (Greptile r4304045025: no mutation red for the saveOnly rule) |
65
+ | A file under `clients/lsp/`, `formal/`, or any path `formal/switch-pins.json` names | The model moves with the code: a `.tla`/`.cfg` hunk and its TLC verdict, or a `TLA+ unaffected:` line; a flipped constant flips its config and its pin (AGENTS shape 68) | The line, or the model diff plus the verdict, and the pin's test name for a flipped constant | #4575 (Greptile r4304045020: the model did not move with the code), #4387, #4393 |
66
+ | A spawn, shell or path seam: `clients/package-manager.ts`, `clients/lsp/launch.ts`, `clients/path-utils.ts`, `clients/safe-spawn.ts`, or any `trySpawn` caller | Read the Windows lane, and keep a shim cell that asserts the platform command (AGENTS "Test requirements"; "Dispatch, runners, formatters, and installers") | The `Unit tests Windows` row on the head, or the shim cell's platform assertion | #4566 (Greptile r4304149666: the `.cmd` cells), #4356, #4263 |
67
+ | A rung that can execute project code | Judge the rung by the resolved target under every trust state, never by the name it was called with (AGENTS "LSP, trust, and process execution") | The target table: each spelling, its resolved path, and the verdict under trusted, unknown and denied | #4566 (an empty `PATH` and a global link each ran project code), #4530 |
68
+ | A new shared helper | Net-count rule: delete a same-shape sibling in this change (principles §1 "Net-count rule for shared helpers") | The deleted sibling in `Change outline`, or the unsafe-to-fold reason with its follow-up link | #2585 r1, #2617 r1 (an existing override and scan set bypassed or recopied), #3064, #3065, #3066, #3068 (a fold's newly sole predicate left untested) |
69
+ | A second writer, reader or mirror of one shared record | Design shared state once, with a reason or kind discriminator per writer (principles §1 "Design shared state once"; AGENTS shape 24) | The writers-by-axis table, and the discriminator each writer carries | #1631/#1641 (the `stale` collision that was green alone), #1633, #1703 |
70
+ | A durable record whose shape changes, or a new version of one | Keep the fixture corpus: every version that produced the record still parses (principles §2 "Keep fixture corpora") | The fixture path and the parser test that replays it | #3594 R2-F1 (AGENTS shape 57) |
71
+ | A cache or memo key | Key every input the value depends on, trust scope and install state included (AGENTS shape 6) | The key's input list beside the value's dependencies, and the mutation that changes one input | #4562 (a large update left a cached answer), #4566 (a trust change left tools missing) |
72
+ | A test-side source scan, census, ratchet or detector | Detectors match code, not prose, and fail closed on an unlisted spelling (principles §2 "Detectors match code"; AGENTS shape 69) | The blanked-source read, and three plants the author did not design for: an alias, an indirect call, a value through another binding | #2693 (a ratchet counted four sites where six existed), #4439 |
73
+ | A workflow, action or job | The edited lane runs on a pull request, or a branch run is quoted with its run id (AGENTS "Commands and gates") | `gh workflow run <file> --ref <branch>` with its run id, or the PR-eligible cell's name | #3043, #3085 |
74
+ | A `continue-on-error` producer or a nightly floor | The producer reports to `scripts/assert-evaluated.mjs`, and its floor reds below the measured count (AGENTS "LSP, trust, and process execution") | The floor value beside the run's evaluated count | #4518 |
75
+ | A path a host tool was given (a `~`, an `@` prefix, a `file://` URL), or a path re-resolved after it left disk | Resolve by provenance, one seam per provenance; a generated or recovered path is never re-resolved (AGENTS shape 74) | The resolver the caller uses, and the path form it accepts, before and after | #4576, #4577 (a bash operand resolved on the host-argument ladder, then an absolute spelling rewritten) |
76
+ | A path recovered from disk, a synthetic write event, or a path pi-lens generates | The path carries its provenance, host argument, shell token, recovered or generated, and nothing re-derives it (AGENTS shape 58) | The provenance the caller states at the injection point, and the resolver it therefore skips | #4577 (a recovered name was re-folded), #4558 |
77
+ | A path-keyed map, normalizer or path comparison | Normalize on write, read, delete and rehydrate, and test Windows separators and casing (AGENTS shape 1) | The writer and reader table, with the normalizer each one calls | #3178 (four rounds, two inverted arms, one unmeasured swap) |
78
+ | A session, lifecycle, generation or turn-end seam | Capture the generation before the await, and key the state by the session that owns it (AGENTS shapes 21 and 22; "Session, telemetry, and delivery") | The captured scope or generation the write checks, and the test that races it | #4258 (a stale activation rebinding a held bridge), #4154 |
79
+ | A lifecycle, ownership or queue-ordering change | Name a cell and a mutation per axis: owner and identity, last leave, and queue ordering (principles §1 "Identity and lifecycle rules"; AGENTS shapes 21 and 22) | The state table with one row per axis, and the mutation transcript for each cell | #4563 (seven lifecycle findings), #4575 (a slow send overwrote a newer edit), #4562 |
80
+ | A lifecycle change | The TLA+ model moves with the code, and `docs/pi-lens-monitor.md` gains the row for a new store or hand-off branch (AGENTS shape 68; "Session, telemetry, and delivery") | The model diff or `TLA+ unaffected:` line, and the monitor-doc row | #4563, #4569 (held documents undercounted), #4575 |
81
+ | A delivery surface, or a bound on findings that reach the model | A bound discloses its truncation on the rendered surface, and a skipped or unavailable result is not clean (AGENTS shape 10) | The rendered truncation line, or the skip reason from `RUNNER_SKIP_REASONS` | #3166 r2 (an 80-finding input bound zeroed a neighbour's errors) |
82
+ | A relaxed or rewritten existing assertion | Mutate the behaviour the test is named for; a rewrite that stays green is a deleted test (AGENTS "Issue and PR design contract"; principles §2) | The red on the new assertion, with that behaviour broken | #4390 (the eviction smoke's rewrite passed with root re-registration broken) |
83
+ | A new decision branch on a session, lifecycle or delivery seam | Name its record, sink plus kind, and read it back through the real seam (AGENTS "Session, telemetry, and delivery"; shape 31) | The record literal, and the test that reads it back | #3873 (a fix that could not be shown to fire live), #3875 |
84
+ | A new failure path, catch or silent return | One bounded record per distinct event, in a stream a monitor reads without asking (principles §1 "Every new failure path gets bounded observability"; shape 31) | The record literal and its sink, or `none:` with its reason | #4562 (a failed log write stayed silent), #4575 (a failed save left no trace) |
85
+ | Every diff, every changed file, tests included | Read the whole diff file by file. Check each PR-body claim against the diff, and look in the body for proof before calling it missing (principles §3 "Reviewing and delegating") | The body line or transcript quoted beside a claim the diff cannot show, or the finding names the body line that lacks it | #4574 F2, #4582 F1; 3 of Greptile's 4 false positives were a transcript already in the body (#4572, #4573, #4577) |
86
+
87
+ Rows 1, 2 and 4 are mechanical from #4585: `scripts/check-pr-body.mjs`
88
+ (`lintDiffCompliance`, wired into both entry points) reds a body that omits
89
+ their evidence, and it keys each item to the diff: a red belongs to the title
90
+ its table names and to the file whose path it spells, and a Windows read
91
+ belongs to the seam file it names or to a diff with exactly one seam file.
92
+ Row 1 is file-level: a changed test file owes one fenced red-first transcript
93
+ that names it and shows a failure from it, or a Controls row naming it with a
94
+ reason. The lint does not read a title, a table row or a suite chain, so a red
95
+ from the file proves the file whatever the new case is called (#4605). Row 3
96
+ stays a reviewer judgement row; the lint never decides what a model means. Confirm the lint passed on the head, then spend
97
+ this pass on the rest — a quoted mutation-table red is not a red-first
98
+ transcript, and a body that names the right file is still yours to judge.
99
+
53
100
  ## Verification
54
101
 
55
102
  For each new or changed `vi.mock` or hand-built double of a `clients/` module,
@@ -61,12 +108,29 @@ real seam. Check that every gate the diff adds is exercised through that path.
61
108
  a lifecycle, dispatch, or ownership seam, run EVERY suite that exercises the
62
109
  behaviour the seam governs and name the list; a curated file set cannot
63
110
  clear what it omits (#3622).
111
+ - **Challenge the population query.** Re-run the fixer's sibling search with
112
+ a wider query of your own, by primitive or mechanism instead of the fixer's
113
+ call names. Report what the fixer's query missed; a population that a wider
114
+ query extends is a finding (#4536).
115
+ - **Severity and live population.** Every finding carries HIGH, MEDIUM or LOW
116
+ and its live population (how many sites in the tree hit it today). The
117
+ verdict follows the merge bar in `docs/pi-lens-merge-policy.md` "Filing
118
+ issues": no HIGH plus green gating checks is merge-ready, and a MEDIUM or
119
+ LOW names whether it folds or stays an accepted residual.
64
120
  - **Generalization verdict.** When a mechanism, policy, guard, or optimisation
65
121
  targets N of M members (registry entries, servers, tools, languages,
66
122
  stores), name M, why the others are excluded, and their default, and end
67
- with *widen in this PR*, *follow-up issue* (with its seam group), or *stay
123
+ with *widen in this PR*, *accepted residual* (named `p3`, with its live population),
124
+ *follow-up issue* (p2 or higher only, with its seam group), or *stay
68
125
  specific* (with the reason). A missing verdict is a finding (#3622; the
69
126
  optional ast-grep assist is #3684).
127
+ - **A new test's layer.** A registration question (flags, tools, commands,
128
+ declarations) belongs on tier 1 (`tests/support/pi-runner.ts`), a
129
+ session-flow case on tier 2 (`tests/support/pi-session.ts`), and a
130
+ JSON-lines sink on `readNdjsonRows` (`tests/support/ndjson-rows.ts`), with
131
+ `skipped === 0` asserted when the claim needs the complete output. A fake of
132
+ an in-process store or registry is a finding; other doubles only where
133
+ `AGENTS.md` admits them, which holds the detail.
70
134
  - Review the pre-push self-scan with `npm run astgrep:self-scan`; `pr-preflight`
71
135
  runs the same gate after its build.
72
136
  - Require the exact-pin rule in `docs/pi-lens-subagent.md` on the MERGE of
@@ -76,13 +140,32 @@ real seam. Check that every gate the diff adds is exercised through that path.
76
140
  fixer's hand mutations. There is no per-PR Stryker comment or `MUTATION`
77
141
  line to read; the nightly Stryker report on master is exploratory and is not
78
142
  a review input.
143
+ - For every relaxed or rewritten existing assertion, mutate the behaviour the
144
+ test is named for; a rewrite that stays green is a finding (#4390). This is
145
+ the exception to the one-spot-check cap above.
79
146
  - Repeat the pattern and population sweeps. Check blast radius, bounded
80
147
  observability, changelog, commit, and PR-body requirements.
81
148
  - Re-run the PR's `## Class sweep` search yourself and widen it when the
82
149
  named shape is broader than the touched seam (#4273, #4268).
150
+ - Read the `## Fold check` against the open issues and pull requests the PR's
151
+ mechanism has: the lint checks the form (candidate, decision, reason), not
152
+ that every candidate was found, so decide whether the section's search was
153
+ wide enough and whether each `not folded` reason holds (#4711). Open each
154
+ candidate's diff (`gh pr diff <n>`) or the files its issue names: a
155
+ `not folded` line is a finding when the candidate edits the same hunk or
156
+ symbol, or owns a rule this PR re-derives, and a member your own search finds
157
+ that the `## Class sweep` missed is a finding too. The gates check form only
158
+ and the author writes these lines, so this read is the only judgment they
159
+ get. Recurrence: #4713 wrote "shares no clients/ file" beside #4712, and the
160
+ review then re-derived a `clients/analysis-root.ts` rule #4712 edits, while
161
+ the class sweep missed a single-scan-root member.
83
162
  - On a bug-closing PR, check the `## Detection` lesson: the layer named under
84
163
  `Should have been caught by:` must be one that would actually have caught
85
- the bug, and `Gap:` must be a real issue, test, or reason (#4288).
164
+ the bug, and `Gap:` must be a real issue, test, or reason (#4288). Judge
165
+ `Shape:` and `Enforcer:` too: the lint checks the catalog number and that the
166
+ path is on the base and named by the entry, not that the test scans the
167
+ shape's whole population, so open the enforcer and decide whether it does
168
+ (#4439).
86
169
  - For LSP, dispatch, cache, runner, or tool changes, test one non-TypeScript
87
170
  registry entry through the same seam.
88
171
  - On a net-count fold, mutate every predicate the deleted sibling used to
@@ -95,6 +178,9 @@ real seam. Check that every gate the diff adds is exercised through that path.
95
178
  ## Standing probes
96
179
 
97
180
  Run every probe the diff can trip and say which ran and what each returned.
181
+ For LSP diagnostics, the formatter, the review graph and `rename_file`, start
182
+ from the `verify-pi-lens` skill (`.claude/skills/verify-pi-lens/SKILL.md`)
183
+ instead of rebuilding the probe.
98
184
 
99
185
  - **Ladder and deletion sweep.** Every ask names the ladder rung it serves. An
100
186
  ask that adds a guard names its recurrence; an ask that deletes a defensive
@@ -114,6 +200,12 @@ Run every probe the diff can trip and say which ran and what each returned.
114
200
  except `index.ts`, which gates on the lifecycle hook handler a hunk lands in.
115
201
  A green `TLA+ models` run over an unchanged model proves nothing about the
116
202
  new code.
203
+ For a `TLA+ unaffected` line, read the family's as-built config constants:
204
+ a diff that changes a behaviour one of them encodes refutes the line and is
205
+ a finding (#4387: #4235 changed read-guard authorship while the as-built
206
+ switches kept the old behaviour). `formal/switch-pins.json` names each
207
+ pinned constant's test (#4393); a changed behaviour with no flipped value
208
+ and pin is the same finding.
117
209
  - **Red-proof audit.** A claimed red without its quoted transcript is a finding
118
210
  of its own; reproduce it (step 3).
119
211
  - **Quoted-evidence audit.** Diff every CI line the body quotes against the job
@@ -151,6 +243,26 @@ Run every probe the diff can trip and say which ran and what each returned.
151
243
  `// flake-shape: <detector> — <reason>` header and `wallClockBudgetInclude`
152
244
  membership (#2547). A pinned file whose count falls below its pin needs its
153
245
  baseline tightened; a stale ceiling re-admits regrowth.
246
+ - **Hot-path timing.** When the diff touches dispatch, `session_start`, LSP
247
+ diagnostics, a cache lookup or turn-end, re-run the body's before/after
248
+ timing on the real path, at a small and a large input (file size, file
249
+ count). A regression the body does not name and justify is a finding (#4344
250
+ r1: replay went from 6 ms to 321 ms; #4368 r1: import extraction took 190 ms
251
+ at 1.6k lines and 9.2 s at 12k). Read the `Hot-path latency (advisory)` job
252
+ summary on the head (#4363) first; it covers `session_start`, dispatch and
253
+ replay, and a red there is a finding unless the body justifies it. Green
254
+ means no regression of 1.25x and 5 ms; a "slower, below threshold" row is
255
+ still a number to read.
256
+ - **Shutdown-path parity.** When the diff moves or rewraps code that stops a
257
+ child (a server, a client, a spawned tool), compare the stop path before and
258
+ after: does the child still get its graceful signal (stdin end, shutdown
259
+ request) before any kill, and do its exit-time records and files still
260
+ appear? Count them over a few runs on both heads. A green suite proves
261
+ nothing here (#4366 r2: a shared-client fold swapped stdin end for SIGTERM;
262
+ the shutdown record went from 3/3 to 0/12 and 11 sockets leaked).
263
+ - **Windows path shapes.** A new test or runtime comparison of paths goes
264
+ through `toPosix` or `path.win32` (`AGENTS.md`). A host-default separator is
265
+ a finding even when Linux CI is green (#4356: Windows advisory red).
154
266
  - **Platform skips and session-start resets.** Apply the `AGENTS.md` test
155
267
  screens and the `SessionStartClassification` invariant.
156
268
 
@@ -198,14 +310,19 @@ the rate they remove them.
198
310
 
199
311
  ## Findings and verdict
200
312
 
201
- Classify every finding as **fold** or **file** with a one-word reason
202
- (`docs/pi-lens-subagent.md` "Follow-ups"). Order findings `CRITICAL`, `HIGH`,
313
+ Classify every finding as **fold**, **accepted residual** (named `p3`) or
314
+ **file** with a one-word reason and its live population (`docs/pi-lens-subagent.md`
315
+ "Follow-ups"; the merge bar is in `docs/pi-lens-merge-policy.md` "Filing
316
+ issues"). Order findings `CRITICAL`, `HIGH`,
203
317
  `MEDIUM`, `LOW`, `NITPICK`. Each carries a stable id, a file or symbol anchor,
204
318
  the reproduction command or probe output, expected and observed behaviour, the
205
319
  root cause, cost, and a concrete remedy, and whether it is an
206
320
  issue-acceptance or a repository-standard finding. Severity requires a
207
321
  reproduced failure; a high-severity hypothesis without a failure scenario is
208
- at most medium.
322
+ at most medium. A remedy that adds mechanism for an unreproduced race or edge
323
+ case is filed as a hypothesis with its trigger path and cost, for the
324
+ maintainer to decide, not prescribed to the fixer (principles §1, speculative
325
+ robustness).
209
326
 
210
327
  Start with one verdict: `merge-ready`, `needs changes`, `redesign`, or
211
328
  `conflicted`. Then give spec-compliance and standards-compliance findings under
@@ -218,6 +335,44 @@ merge-order interactions with other open PRs, plus:
218
335
  - `Disposition table`: each prior finding as `fixed`, `not fixed`,
219
336
  `new defect`, or `withdrawn (reason)`.
220
337
  - Cleared categories (one compact list) and exact-head identity.
338
+ - **Bot threads and code-scanning alerts.** When bot threads or code-scanning
339
+ alerts exist, read and dispose of each one: list every unresolved review
340
+ thread on the PR (`reviewThreads`, `isResolved == false`) and every open
341
+ code-scanning alert on the branch, both read at the exact head with the
342
+ commands in `docs/pi-lens-fixer.md` "Fix rounds". Rate each one as a
343
+ finding with its probe, or `refuted` with the probe that refutes it, so an
344
+ item nobody probed cannot read as cleared. A missing bot review is never
345
+ evidence of anything: never wait for one, never read its absence as a clear
346
+ signal, and let your own pass stand alone. No `merge-ready` verdict while
347
+ any thread or alert stays undisposed; the merge condition is
348
+ `docs/pi-lens-merge-policy.md` "The loop, per PR" step 1 and step 4
349
+ (`:34`, `:81`). Recurrence: #4566 and #4575 (2026-10-17), where the threads
350
+ outlived the rounds that should have read them.
351
+
352
+ Beside the prose report, write `FINDINGS_<pr>.json` at the worktree root, and
353
+ never commit it. The orchestrator's validator reads it before routing the
354
+ round. Shape:
355
+
356
+ ```json
357
+ {"pr": 4710, "head": "<40-hex sha reviewed>", "verdict": "merge-ready|needs changes|redesign|conflicted", "oneWayDoors": ["..."], "findings": [{"id": "F1", "severity": "<one of the five severity words>", "file": "path", "line": 1, "claim": "one sentence", "probe": "command or probe name whose output proves it", "remedy": "the prescribed change, or null", "addsMechanism": true, "class": "fold|accepted residual|file"}]}
358
+ ```
359
+
360
+ Write one entry per finding, with the same ids as the prose. `remedy: null`
361
+ means the fixer must design the change. `addsMechanism` is true when the
362
+ remedy adds a guard, branch, state, record, or lifecycle step, rather than a
363
+ fix to an existing line. The prose report stays the record a human reads;
364
+ the JSON is what routing reads, so the two must agree. This exists because
365
+ the orchestrator re-typed each finding into a fix brief by hand, and routed
366
+ rounds by judgment instead of by the review's own data.
367
+
368
+ State the change's rollback cost as a required summary line. Name every
369
+ one-way door it ships: something users or other code can come to depend on,
370
+ which a revert does not undo. Examples are a config key or flag users set, a
371
+ durable record shape already written to disk, a public tool, MCP or CLI
372
+ surface, or a migration. Each one-way door needs its proof in the PR: an
373
+ old-record parse fixture, a deprecation path, or a stated reason it is safe.
374
+ `none` is a valid answer, and state it. The JSON's `oneWayDoors` lists the
375
+ same items.
221
376
 
222
377
  Use short, active, plain prose.
223
378
 
@@ -58,9 +58,11 @@ explicit orchestrator authorization for
58
58
  `--force-with-lease=<branch>:<sha>`.
59
59
 
60
60
  Push forms are in "Orchestrator lane mechanics". Before `gh pr create` or `gh pr edit`, lint the body with
61
- `node scripts/check-pr-body.mjs --lint-local <body-file> "<title>"`. Multiline
62
- text (bodies, commit messages, comments) goes through a file (`--body-file`,
63
- `git commit -F`); re-read what GitHub stored and check the newlines survived.
61
+ `node scripts/check-pr-body.mjs --lint-local <body-file> "<title>"`. Read the
62
+ lint's exit code directly, never through a pipe, before `gh pr create` or
63
+ `gh pr edit`: a piped status is the last command's, and a failing lint opened a
64
+ PR (#4348). Multiline text (bodies, commit messages, comments) goes through a
65
+ file (`--body-file`, `git commit -F`); re-read what GitHub stored and check the newlines survived.
64
66
 
65
67
  ## Orchestrator lane mechanics
66
68
 
@@ -130,8 +132,11 @@ the brief gives.
130
132
  ("Worktree and Git"). A reviewer is always `none` and read-only.
131
133
  GitHub comments and issue edits are separate: only a brief that grants them
132
134
  allows them.
133
- - **Deliverable.** The report opens with an `ORCHESTRATOR SUMMARY` of at most
134
- 30 lines: the PR (or branch), the head SHA, the change or verdict in a few
135
+ - **Deliverable.** The report opens with an `ORCHESTRATOR SUMMARY`. Its cap
136
+ follows the lane kind: at most 6 lines for a mechanical lane (trailing fold,
137
+ pin or allowlist move, merge-and-resolve), 20 for a locate or investigation
138
+ pass, and 30 for a fix or review round. The summary carries the PR (or
139
+ branch), the head SHA, the change or verdict in a few
135
140
  lines, red and green evidence as counts with the quoted transcript below it,
136
141
  every skipped check or environment block, and what the orchestrator must
137
142
  decide. The RETURNED message (the agent's final reply, or the plegma answer)
@@ -169,8 +174,9 @@ sets the exit code and only `clean` exits 0:
169
174
  file is tracked.
170
175
  - `unproven` (3): a step failed or a red could not be attributed (the build, a
171
176
  run with no named failing file, an `INCONCLUSIVE` red-on-base verdict, a
172
- failed lint or format check, a selection over the 25-file cap where only
173
- governance suites ran). That is not evidence of unrelated: report it and
177
+ failed lint or format check, a selection over the 25-file cap, where the
178
+ change's own tests, the governance suites and the best 25 import matches ran
179
+ and the rest did not). That is not evidence of unrelated: report it and
174
180
  stop, or fix the cause. The summary prints `selection: selected S, matched
175
181
  M, capped C`.
176
182
  - `2`: usage error (`--body <path>` or `--body=<path>` missing, unknown, or the
@@ -193,9 +199,16 @@ change adds or removes a pinned use, run it on the head and on the merge of
193
199
 
194
200
  Each pre-push head has a durable result record at
195
201
  `$(git rev-parse --git-common-dir)/pi-lens-prepush/<sha>.json`. It contains the
196
- head/base, timestamp, selected test files and their `import`, `history`, or
197
- `governance` reason, plus passed/failed/skipped counts, the Vitest exit code,
198
- and wall time. Re-pushes overwrite that head's record; writes prune records
202
+ head/base, timestamp, selected test files and their `changed`, `mirror`,
203
+ `import`, `history`, or `governance` reason, plus passed/failed/skipped
204
+ counts, the Vitest exit code, and wall time. `base` is the ref the selection
205
+ diffed. A `tests-complete` record carries `treeBound` only when the tests ran
206
+ in a clean checkout of exactly that head (HEAD equal to it, no tracked
207
+ edits before or after the run); other heads keep their previous record
208
+ (`tests-not-started` after a pass, the run's own outcome after a failure). A re-push of a head
209
+ whose `treeBound` record passed the same selection skips the build and tests,
210
+ keeps the record and appends one `pre-push-skip` row to `pre-push.log` (#4724);
211
+ any other re-push overwrites it. Writes prune records
199
212
  older than fourteen days. The provisional record is written before build and
200
213
  self-scan work with outcome `tests-not-started`; preparation failures update it
201
214
  to `build-failed` or `self-scan-failed`. The write uses a same-directory
@@ -234,10 +247,12 @@ of fixture tests, and a real red hidden among them reaches CI (#4308).
234
247
  Fold a review follow-up into the same PR when it shares the seam or files, is
235
248
  about one commit, and needs no maintainer decision. Contract-only folds (body,
236
249
  comments, wording) are trailing commits; small code folds carry a red-first
237
- test and are routed per principles §3 "Round routing". File only
238
- different-seam, blocked, decision-dependent, untouched pre-existing, or
239
- risk-class-changing residuals (for example lifecycle work on a tooling PR), as
240
- one consolidated issue per PR.
250
+ test and are routed per principles §3 "Round routing". A MEDIUM or LOW that
251
+ does not fold is an accepted residual: list it under `## Accepted residuals`,
252
+ named `p3` with its severity and live population, and file nothing. File only p2 or
253
+ higher work that cannot ride the PR (a HIGH outside its scope, or a MEDIUM
254
+ with a live population), as one consolidated issue per PR. The merge bar is in
255
+ `docs/pi-lens-merge-policy.md` "Filing issues".
241
256
 
242
257
  ## Evidence and reporting
243
258
 
@@ -79,6 +79,7 @@ PR's packed tarball (#2700, the check #2587 was missing). `attw`
79
79
  | install-selftest | the runtime dependency graph and the `pi.skills` manifest resolve AS INSTALLED | npm-install | `node <installed>/scripts/install-selftest.mjs --allow-soft` | process exits 0 and no `[FAIL]` line | selftest stdout | `scripts/install-selftest.mjs` verbatim — install-smoke's `smoke` job | #1605 lane 5 (real-host install), narrower: this row asserts the packaged artifact resolves, not that a host classifier parses |
80
80
  | skills-registered | a real pi registers the four pi-lens skills from the installed package | pi-rpc | `pi install <installed pkg>` then `pi --mode rpc` plus `{"type":"get_commands"}` | at least 4 commands with `source` `skill`; every `sourceInfo.path` inside the installed package AND no `sourceInfo.source` is `extension:index` (pi's `pi.skills` manifest is the only registrar; the extension's `resources_discover` handler used to re-add the whole directory and undo settings package filters, #1416) | get_commands response JSON | new probe on the #2589 mechanism — the recurrence is #2587; #1416 widened it to the manifest-registrar direction | — |
81
81
  | commands-registered | the extension loads and registers its `lens-*` slash commands | pi-rpc | same RPC session as above | at least 1 command with `source` `extension` named `lens-*`, and zero `extension_error` events | same get_commands response plus the event stream | `scripts/rpc-load-check.mjs` assertion — install-smoke's `pi-load` job, which runs it against the PUBLISHED package only | #1605 lane 1 (real-host): the same real-host principle, applied to extension registration rather than stderr classification |
82
+ | lsp-warm-resolved | the extension's session-start LSP warm resolves in the installed candidate | pi-rpc | same RPC session as above | pinned `PI_LENS_HOME/extension.log`, observed for 10 s after `get_commands` (a `warm failed` record ends it early), has an `LSP warm resolved` record and no `warm failed` record of any warm; only records stamped at or after the session start count; the witness proves the LSP module loads, not that a language server spawned; a candidate older than the success record (4.4.3 and earlier) has no positive witness and FAILs | extension log NDJSON | new — the existing pi-rpc rows did not read the session-start warm log; recurrence #4314 | `scripts/rpc-load-check.mjs` (install-smoke `pi-load`) reds on any `warn` record of a published package; this row is the release gate's positive witness |
82
83
  | mcp-tools-registered | the MCP mirror advertises the `pilens_*` tool surface | mcp-stdio | `node <installed>/dist/mcp/server.js` then `initialize` plus `tools/list` | every advertised tool name starts `pilens_`, and the set contains analyze, diagnostics, turn_end, lsp_navigation, health | tools/list response JSON | new — no smoke drives the MCP mirror from an install | — |
83
84
  | mcp-diagnostics-full | `lens_diagnostics` full mode answers on a fixture repo | mcp-stdio | `tools/call` `pilens_diagnostics` with `mode` `full` and `refreshRunners` `cheap`, POLLED | text carries a `Summary (N files diagnosed this session)` line with N at least 1 | tool result text | new — `tests/clients` covers the handler, nothing covers it through a packaged install | — |
84
85
  | mcp-turn-end | the turn-end pipeline runs over the turn's files and returns an advisory | mcp-stdio | `tools/call` `pilens_turn_end` with the fixture file | text carries `Turn-end over N file(s).` with N at least 1 | tool result text | new — `scripts/smoke-availability-lifecycle.mjs` covers lifecycle availability, not the packaged turn-end path | #1605 lane 2 (availability-lifecycle): overlaps the turn-end half; #1605 asserts latch recovery, this row asserts the packaged turn-end path answers at all |
@@ -154,16 +155,26 @@ newest-in-range lane reads it, bounded above so `"*"` can never mean
154
155
  matrix has passed on. A newer host enters the window in ONE change: run this
155
156
  matrix on it, add it to that test's verified list, and move the workflow's
156
157
  ceiling together. P1 is one verified host per minor line from 0.86 onward;
157
- 0.81–0.83 are in-window without a dedicated host, while 0.80, 0.84, and
158
- 0.85 are represented by the existing host list and ratchet. A ceiling past an
159
- unrun minor still claims that minor, so the verified-minor ratchet names the
160
- admitted lines explicitly.
158
+ 0.86–1.4 are in-window, and every minor line below 0.86 falls outside the
159
+ window entirely, so none needs a dedicated host. A ceiling past an unrun
160
+ minor still claims that minor, so the verified-minor ratchet names the admitted
161
+ lines explicitly.
162
+
163
+ The floor is 0.86.1 (#4688, maintainer decision 2026-10-20). 0.80–0.85 are
164
+ out of the window: since #4644 pi-lens injects context only from a `context`
165
+ event that carries a system head, and those hosts keep the prompt in
166
+ `agent.state.systemPrompt` and never emit `context_with_system`, so they
167
+ receive no findings and no guidance. Raising the floor was chosen over reviving
168
+ the old hosts; a real 0.80.10 session delivered the staged guidance at
169
+ `91c939e10` and nothing at `e7a0a8aba` (`markerReachedProvider: false` on all
170
+ 3 requests).
161
171
 
162
172
  ### Verified hosts
163
173
 
164
- The certified policy is `>=0.80.10 <1.2.0`. Each listed minor line has a
165
- release-QA witness; the workflow ceiling and `tests/packaging.test.ts` list are
166
- updated together.
174
+ The certified policy is `>=0.86.1 <1.5.0`, and this table is the whole verified
175
+ set: `tests/packaging.test.ts` fails when it and `PI_HOST_SUPPORTED_RANGE`
176
+ disagree. Each listed minor line has a release-QA witness; the workflow ceiling
177
+ and `tests/packaging.test.ts` list are updated together.
167
178
 
168
179
  | host | date | pi-lens commit | result |
169
180
  | --- | --- | --- | --- |
@@ -172,6 +183,9 @@ updated together.
172
183
  | 0.99.2 | 2026-10-08 | 08abd60e193e5a17ea28dd4fbf3603cc9a0cdbe0 | 15 pass / 1 skipped (git-install-loads) |
173
184
  | 1.0.4 | 2026-10-08 | 08abd60e193e5a17ea28dd4fbf3603cc9a0cdbe0 | 15 pass / 1 skipped (git-install-loads) |
174
185
  | 1.1.0 | 2026-10-08 | 2fda17a53d62267cd9035fa04380bbf0e2de4318 | 15 pass / 1 skipped (git-install-loads) |
186
+ | 1.2.0 | 2026-10-16 | 9400454891d5a1beb0a4d2d9452dece276e22e71 | 15 pass / 1 skipped (git-install-loads) |
187
+ | 1.3.0 | 2026-10-16 | 9400454891d5a1beb0a4d2d9452dece276e22e71 | 15 pass / 1 skipped (git-install-loads) |
188
+ | 1.4.0 | 2026-10-22 | 75a1a3c893ed0ac44a3081dd3d475c1e72349099 | 15 pass / 1 skipped (git-install-loads) |
175
189
 
176
190
  Re-run any row with `node scripts/release-qa.mjs --pi <host>` at the listed commit.
177
191