pi-lens 4.4.2 → 4.4.3

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 (44) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/{chunk-2ZGIZPDG.js → chunk-2VUQMUMT.js} +6 -6
  3. package/dist/{chunk-ARJ6PLFH.js → chunk-3W7IEVVL.js} +1 -1
  4. package/dist/{chunk-5JM2524W.js → chunk-3YN6V5TV.js} +16 -15
  5. package/dist/{chunk-CF24OIYI.js → chunk-5UCAH366.js} +1 -1
  6. package/dist/{chunk-NW7BOILN.js → chunk-6STA6Z7I.js} +2 -2
  7. package/dist/{chunk-66SXUJCA.js → chunk-77M37OKR.js} +5 -3
  8. package/dist/{chunk-EETY4LF7.js → chunk-AB3YYG6N.js} +1 -1
  9. package/dist/{chunk-66VMUL7Q.js → chunk-ACXEQZOU.js} +3 -3
  10. package/dist/{chunk-3UUPUE3O.js → chunk-CMMHNUZ2.js} +31 -29
  11. package/dist/chunk-CSHFH5IN.js +17 -0
  12. package/dist/{chunk-3WA4HP4I.js → chunk-EC47DWFA.js} +6 -5
  13. package/dist/{chunk-ESBQHFMJ.js → chunk-EU63SDCG.js} +187 -79
  14. package/dist/{chunk-34WSVGEM.js → chunk-FCSOVF55.js} +78 -0
  15. package/dist/{chunk-IBRALRBR.js → chunk-FMSO6RDZ.js} +3 -2
  16. package/dist/{chunk-ODBNXWT4.js → chunk-H6MF6EVN.js} +81 -42
  17. package/dist/{chunk-XPZPXCBV.js → chunk-KDERNTCQ.js} +2 -2
  18. package/dist/chunk-KSX3TXSZ.js +69 -0
  19. package/dist/{chunk-PV6LR5P5.js → chunk-M6HSLBWY.js} +198 -4362
  20. package/dist/{chunk-XKIZ2HNN.js → chunk-MXGY6KPT.js} +6 -4
  21. package/dist/{chunk-GHB6AYCP.js → chunk-RXCOMYPY.js} +2 -2
  22. package/dist/{chunk-GZYBXISR.js → chunk-SQ4TVJBR.js} +3 -3
  23. package/dist/{chunk-VITUCP5A.js → chunk-SS36ZX4J.js} +5 -3
  24. package/dist/{chunk-PFNSLWU5.js → chunk-T6CPIZNT.js} +5 -4
  25. package/dist/{chunk-JWA5I3SR.js → chunk-VCO24T4L.js} +3 -5
  26. package/dist/{chunk-Q6ZWTCLY.js → chunk-XAGLWMJ4.js} +2 -3
  27. package/dist/{chunk-WOKKRCJ5.js → chunk-XIJZVPD5.js} +3 -2
  28. package/dist/{chunk-7ULNCDCO.js → chunk-YIUAVF7E.js} +5 -5
  29. package/dist/{chunk-GOYRYZ2R.js → chunk-YSZNHOBY.js} +63 -11
  30. package/dist/chunk-YYOIQFRS.js +4139 -0
  31. package/dist/{chunk-QZVW3AAK.js → chunk-ZWFS3OEF.js} +5 -4
  32. package/dist/index.js +1628 -1482
  33. package/dist/mcp/analyze-cli.js +1 -1
  34. package/dist/mcp/cli.js +6 -6
  35. package/dist/mcp/server.js +62 -61
  36. package/dist/mcp/worker.js +16 -15
  37. package/dist/probes/installer.js +1 -1
  38. package/docs/pi-lens-merge-policy.md +12 -4
  39. package/docs/pi-lens-reviewer.md +3 -0
  40. package/docs/pi-lens-subagent.md +5 -0
  41. package/package.json +1 -1
  42. package/dist/chunk-CO2G5PHH.js +0 -84
  43. package/dist/{chunk-IXXDFY73.js → chunk-3EFKIGZN.js} +0 -0
  44. package/dist/{chunk-OG5UUPN7.js → chunk-OCAGUNBC.js} +3 -3
@@ -199,7 +199,7 @@ async function main() {
199
199
  process.exit(0);
200
200
  let result = await requestWarmAnalyze(cwd, file);
201
201
  if (!result) {
202
- const { analyzeFile } = await import("../chunk-5JM2524W.js");
202
+ const { analyzeFile } = await import("../chunk-3YN6V5TV.js");
203
203
  result = await analyzeFile(file, cwd, {
204
204
  flags: withLsp ? {} : { "no-lsp": true },
205
205
  record: false,
package/dist/mcp/cli.js CHANGED
@@ -8,15 +8,15 @@ import {
8
8
  getLastReviewGraphBuildAttempt,
9
9
  graphWasmTrapDetail,
10
10
  reviewGraphCachePath
11
- } from "../chunk-PV6LR5P5.js";
11
+ } from "../chunk-YYOIQFRS.js";
12
12
  import "../chunk-3MED75HT.js";
13
- import "../chunk-CO2G5PHH.js";
13
+ import "../chunk-M6HSLBWY.js";
14
14
  import "../chunk-IBGIOBEE.js";
15
- import "../chunk-PNQDPDRC.js";
16
15
  import "../chunk-XIMYZ3JA.js";
17
- import "../chunk-ESBQHFMJ.js";
18
- import "../chunk-34WSVGEM.js";
16
+ import "../chunk-EU63SDCG.js";
19
17
  import "../chunk-VWCXW2E7.js";
18
+ import "../chunk-FCSOVF55.js";
19
+ import "../chunk-PNQDPDRC.js";
20
20
  import "../chunk-ZXYDQ3TZ.js";
21
21
  import "../chunk-5W3R6LFT.js";
22
22
  import {
@@ -34,7 +34,7 @@ import "../chunk-GAEGEPOC.js";
34
34
  import "../chunk-Z3CCVDUB.js";
35
35
  import "../chunk-L3BLXZG7.js";
36
36
  import "../chunk-2BEMIWEW.js";
37
- import "../chunk-66VMUL7Q.js";
37
+ import "../chunk-ACXEQZOU.js";
38
38
  import "../chunk-Q7DUK4LX.js";
39
39
  import "../chunk-AW7R2GWG.js";
40
40
  import "../chunk-RWWYJ623.js";
@@ -7,10 +7,10 @@ import {
7
7
  deadCodeIssues,
8
8
  formatDeadCodeDelta,
9
9
  stableFindingKey
10
- } from "../chunk-OG5UUPN7.js";
10
+ } from "../chunk-OCAGUNBC.js";
11
11
  import {
12
12
  clearFormatterCache
13
- } from "../chunk-ARJ6PLFH.js";
13
+ } from "../chunk-3W7IEVVL.js";
14
14
  import {
15
15
  findNearestProjectRoot,
16
16
  isStartupScanVerdictFresh,
@@ -19,23 +19,23 @@ import {
19
19
  import {
20
20
  loadCallGraph
21
21
  } from "../chunk-WOA4LN2R.js";
22
+ import {
23
+ isHardFailureSummary
24
+ } from "../chunk-7U2IDNXN.js";
22
25
  import {
23
26
  RUNNERS,
24
27
  formatRunDurationMs,
25
28
  isExcludedTestTarget,
26
29
  isRunnerErrorResult
27
- } from "../chunk-JWA5I3SR.js";
30
+ } from "../chunk-VCO24T4L.js";
28
31
  import {
29
32
  GovulncheckClient
30
- } from "../chunk-GZYBXISR.js";
33
+ } from "../chunk-SQ4TVJBR.js";
31
34
  import {
32
35
  GitleaksClient,
33
36
  classifyAndFilterFindings
34
- } from "../chunk-VITUCP5A.js";
37
+ } from "../chunk-SS36ZX4J.js";
35
38
  import "../chunk-ZGDGW2V3.js";
36
- import {
37
- isHardFailureSummary
38
- } from "../chunk-7U2IDNXN.js";
39
39
  import {
40
40
  resetManagedToolRefreshSession
41
41
  } from "../chunk-UXVNL3D7.js";
@@ -99,42 +99,53 @@ import {
99
99
  resetPendingRunnerFindings,
100
100
  resetPsScriptAnalyzerAvailability,
101
101
  runProviders
102
- } from "../chunk-ODBNXWT4.js";
102
+ } from "../chunk-H6MF6EVN.js";
103
103
  import {
104
104
  resetLazyInstallAttempts
105
105
  } from "../chunk-OXXKQCSV.js";
106
106
  import {
107
107
  isTestRoleCollateral
108
108
  } from "../chunk-EJIUXPBX.js";
109
+ import {
110
+ findingsResult,
111
+ hasUsableResult
112
+ } from "../chunk-2CD5RS6M.js";
109
113
  import "../chunk-FC4RP4I2.js";
114
+ import "../chunk-UZ3TUTRV.js";
115
+ import {
116
+ resetGoAvailability
117
+ } from "../chunk-XMSXXAHW.js";
110
118
  import {
111
119
  TrivyClient
112
- } from "../chunk-66SXUJCA.js";
120
+ } from "../chunk-77M37OKR.js";
121
+ import "../chunk-CSHFH5IN.js";
113
122
  import "../chunk-VCHXCQFG.js";
114
- import "../chunk-IXXDFY73.js";
123
+ import "../chunk-3EFKIGZN.js";
115
124
  import {
116
125
  resetRustAvailability
117
126
  } from "../chunk-MRXKYPCS.js";
118
- import {
119
- findingsResult,
120
- hasUsableResult
121
- } from "../chunk-2CD5RS6M.js";
122
- import "../chunk-UZ3TUTRV.js";
123
- import "../chunk-EETY4LF7.js";
127
+ import "../chunk-7DYBLXYA.js";
128
+ import "../chunk-AB3YYG6N.js";
124
129
  import {
125
130
  getSgCommand,
126
131
  resetDispatchAvailabilityState,
127
132
  resolveManagedToolClient
128
- } from "../chunk-GOYRYZ2R.js";
133
+ } from "../chunk-YSZNHOBY.js";
129
134
  import "../chunk-RPLINGVB.js";
130
135
  import "../chunk-XCJN5IJU.js";
131
136
  import "../chunk-76MWC2K6.js";
132
137
  import "../chunk-GXW6K4YJ.js";
133
138
  import "../chunk-2B73ZPOK.js";
134
139
  import {
135
- resetGoAvailability
136
- } from "../chunk-XMSXXAHW.js";
137
- import "../chunk-7DYBLXYA.js";
140
+ SYMBOL_KIND_NAMES,
141
+ captureReviewGraphStructuralIr,
142
+ formatReviewGraphRevisionDriftNote,
143
+ publishReviewGraphFileIr,
144
+ reviewGraphIrContentHash
145
+ } from "../chunk-YYOIQFRS.js";
146
+ import {
147
+ buildSymbolId
148
+ } from "../chunk-3MED75HT.js";
138
149
  import {
139
150
  DEPENDENCY_DRIFT_MAX_DELIVERIES,
140
151
  MAX_LATE_AUX_REARMS,
@@ -142,7 +153,6 @@ import {
142
153
  RUNTIME_CONFIG,
143
154
  ReadGuard,
144
155
  STALE_LINE_MARKER,
145
- SYMBOL_KIND_NAMES,
146
156
  Text,
147
157
  TreeSitterSymbolExtractor,
148
158
  WriteOrderingGuard,
@@ -157,8 +167,6 @@ import {
157
167
  beginScope,
158
168
  buildScopeKey,
159
169
  canRearmPendingAuxiliary,
160
- canWriteAnalysisRoot,
161
- captureReviewGraphStructuralIr,
162
170
  classifyDiagnosticTier,
163
171
  clearAllSessions,
164
172
  countRetainedSuppressedRows,
@@ -172,7 +180,6 @@ import {
172
180
  drainRenderedDependencyDriftFilePaths,
173
181
  exceedsLspSyncLimits,
174
182
  findAuxiliaryProfileForSource,
175
- formatReviewGraphRevisionDriftNote,
176
183
  getActiveSessionId,
177
184
  getDisposition,
178
185
  getFileDiagnosticSummaries,
@@ -195,7 +202,6 @@ import {
195
202
  newLspMutationCorrelationId,
196
203
  nextOrderTurn,
197
204
  pendingAuxiliaryCoverageSize,
198
- publishReviewGraphFileIr,
199
205
  rearmPendingAuxiliaryCoverage,
200
206
  reconcileCorrelatedScanDiagnostics,
201
207
  reconcileScanDiagnostics,
@@ -218,7 +224,6 @@ import {
218
224
  retagAuxiliaryDiagnostics,
219
225
  retireScope,
220
226
  retireWidgetDependencyDriftBlockers,
221
- reviewGraphIrContentHash,
222
227
  runPerServerGroups,
223
228
  scopeCell,
224
229
  setSessionLanguages,
@@ -232,14 +237,7 @@ import {
232
237
  widgetDiagnosticUri,
233
238
  workspaceEditTextPaths,
234
239
  writeOrderToken
235
- } from "../chunk-PV6LR5P5.js";
236
- import {
237
- buildSymbolId
238
- } from "../chunk-3MED75HT.js";
239
- import {
240
- emitBounded,
241
- resetBoundedTelemetry
242
- } from "../chunk-CO2G5PHH.js";
240
+ } from "../chunk-M6HSLBWY.js";
243
241
  import {
244
242
  hashText,
245
243
  normalizeMessage,
@@ -247,14 +245,11 @@ import {
247
245
  resetMutationAttribution,
248
246
  stableFindingId
249
247
  } from "../chunk-IBGIOBEE.js";
250
- import {
251
- resolveGitCheckout,
252
- resolveLinkedWorktreeOwner
253
- } from "../chunk-PNQDPDRC.js";
254
248
  import {
255
249
  mapWithConcurrency
256
250
  } from "../chunk-XIMYZ3JA.js";
257
251
  import {
252
+ canWriteAnalysisRoot,
258
253
  classifyCascadeWaitTier,
259
254
  customServerSpecsOf,
260
255
  describeRootFallback,
@@ -272,11 +267,17 @@ import {
272
267
  resetLSPCaseSensitivityState,
273
268
  resolveLspCwdForFile,
274
269
  shouldInitializeSessionRoot
275
- } from "../chunk-ESBQHFMJ.js";
276
- import {
277
- hasAmbientPythonEnvironment
278
- } from "../chunk-34WSVGEM.js";
270
+ } from "../chunk-EU63SDCG.js";
279
271
  import "../chunk-VWCXW2E7.js";
272
+ import {
273
+ emitBounded,
274
+ hasAmbientPythonEnvironment,
275
+ resetBoundedTelemetry
276
+ } from "../chunk-FCSOVF55.js";
277
+ import {
278
+ resolveGitCheckout,
279
+ resolveLinkedWorktreeOwner
280
+ } from "../chunk-PNQDPDRC.js";
280
281
  import {
281
282
  PROJECT_SNAPSHOT_VERSION,
282
283
  getProjectSnapshotLegacyPath,
@@ -360,7 +361,7 @@ import {
360
361
  commitDurableStore,
361
362
  resetResolvedPathCache,
362
363
  resetZizmorTokenAvailability
363
- } from "../chunk-66VMUL7Q.js";
364
+ } from "../chunk-ACXEQZOU.js";
364
365
  import {
365
366
  resolveToolCwd
366
367
  } from "../chunk-Q7DUK4LX.js";
@@ -2937,13 +2938,13 @@ async function buildBootstrapClients() {
2937
2938
  }
2938
2939
  }
2939
2940
  const [ruffClient, biomeClient, knipClient, todoScanner, jscpdClient, depChecker, testRunnerClient, metricsClient, complexityClient, goClient, govulncheckClient, gitleaksClient, trivyClient, opengrepClient, rustClient, agentBehaviorClient2, deadCodeClients] = await Promise.all([
2940
- load("ruff", async () => new (await import("../chunk-PFNSLWU5.js")).RuffClient()),
2941
- load("biome", async () => new (await import("../chunk-QZVW3AAK.js")).BiomeClient()),
2942
- load("knip", async () => new (await import("../chunk-7ULNCDCO.js")).KnipClient()),
2941
+ load("ruff", async () => new (await import("../chunk-T6CPIZNT.js")).RuffClient()),
2942
+ load("biome", async () => new (await import("../chunk-ZWFS3OEF.js")).BiomeClient()),
2943
+ load("knip", async () => new (await import("../chunk-YIUAVF7E.js")).KnipClient()),
2943
2944
  load("todo", async () => new (await import("../chunk-JSQFTSC6.js")).TodoScanner()),
2944
- load("jscpd", async () => new (await import("../chunk-3UUPUE3O.js")).JscpdClient()),
2945
- load("dependency-checker", async () => new (await import("../chunk-3WA4HP4I.js")).DependencyChecker()),
2946
- load("test-runner", async () => new (await import("../chunk-Q6ZWTCLY.js")).TestRunnerClient()),
2945
+ load("jscpd", async () => new (await import("../chunk-CMMHNUZ2.js")).JscpdClient()),
2946
+ load("dependency-checker", async () => new (await import("../chunk-EC47DWFA.js")).DependencyChecker()),
2947
+ load("test-runner", async () => new (await import("../chunk-XAGLWMJ4.js")).TestRunnerClient()),
2947
2948
  load("metrics", async () => new (await import("../chunk-N3X6Q4YT.js")).MetricsClient()),
2948
2949
  load("complexity", async () => new (await import("../chunk-VSSBEUFT.js")).ComplexityClient()),
2949
2950
  // The process-wide singleton, NOT a fresh instance (#2455 fix round 4,
@@ -2952,14 +2953,14 @@ async function buildBootstrapClients() {
2952
2953
  // second instance here meant the reset never reached the surface a
2953
2954
  // user actually sees.
2954
2955
  load("go", async () => (await import("../chunk-Z527N6YQ.js")).goClient),
2955
- load("govulncheck", async () => new (await import("../chunk-XPZPXCBV.js")).GovulncheckClient()),
2956
- load("gitleaks", async () => new (await import("../chunk-WOKKRCJ5.js")).GitleaksClient()),
2957
- load("trivy", async () => new (await import("../chunk-IBRALRBR.js")).TrivyClient()),
2958
- load("opengrep", async () => new (await import("../chunk-XKIZ2HNN.js")).OpengrepClient()),
2956
+ load("govulncheck", async () => new (await import("../chunk-KDERNTCQ.js")).GovulncheckClient()),
2957
+ load("gitleaks", async () => new (await import("../chunk-XIJZVPD5.js")).GitleaksClient()),
2958
+ load("trivy", async () => new (await import("../chunk-FMSO6RDZ.js")).TrivyClient()),
2959
+ load("opengrep", async () => new (await import("../chunk-MXGY6KPT.js")).OpengrepClient()),
2959
2960
  // The process-wide singleton, for the same reason as "go" above.
2960
2961
  load("rust", async () => (await import("../chunk-BRGDSBJE.js")).rustClient),
2961
2962
  load("agent-behavior", async () => (await import("../chunk-23WOO7TX.js")).agentBehaviorClient),
2962
- loadList("dead-code", async () => (await import("../chunk-NW7BOILN.js")).getDeadCodeClients())
2963
+ loadList("dead-code", async () => (await import("../chunk-6STA6Z7I.js")).getDeadCodeClients())
2963
2964
  ]);
2964
2965
  if (failures.length > 0)
2965
2966
  await logBootstrapFailures(failures);
@@ -3046,7 +3047,7 @@ function resetAnalyzerBootstrapSessionState() {
3046
3047
  }
3047
3048
 
3048
3049
  // dist/clients/formatters-lazy.js
3049
- var lazyFormatters = createLazyImport(() => import("../chunk-GHB6AYCP.js"));
3050
+ var lazyFormatters = createLazyImport(() => import("../chunk-RXCOMYPY.js"));
3050
3051
  function warmFormatters() {
3051
3052
  return lazyFormatters.get();
3052
3053
  }
@@ -5670,7 +5671,7 @@ function scheduleManagedToolRefresh(dbg) {
5670
5671
  const timer = setTimeout(() => {
5671
5672
  void (async () => {
5672
5673
  try {
5673
- const refresh = await import("../chunk-CF24OIYI.js");
5674
+ const refresh = await import("../chunk-5UCAH366.js");
5674
5675
  const outcome = await refresh.runManagedToolRefresh();
5675
5676
  if (outcome.skipped) {
5676
5677
  dbg(`session_start tool-refresh: skipped (${outcome.skipped})`);
@@ -6184,7 +6185,7 @@ function scheduleStartupScansWithClients(deps, runtime, sessionGeneration, analy
6184
6185
  let callGraphIdentity;
6185
6186
  const callGraphTask = runTask("call-graph", async () => {
6186
6187
  const { FactStore: FactStore2 } = await import("../chunk-QGQ5CCCG.js");
6187
- const { buildOrUpdateGraph, extractSymbolsAndRefsFromGraph, getReviewGraphCacheIdentity } = await import("../chunk-2ZGIZPDG.js");
6188
+ const { buildOrUpdateGraph, extractSymbolsAndRefsFromGraph, getReviewGraphCacheIdentity } = await import("../chunk-2VUQMUMT.js");
6188
6189
  const { buildCallGraph, saveCallGraph, loadCallGraph: loadCallGraph2 } = await import("../chunk-BKE7E7TC.js");
6189
6190
  if (!runtime.isCurrentSession(sessionGeneration))
6190
6191
  return;
@@ -13784,7 +13785,7 @@ async function moduleReport(file, cwd, options) {
13784
13785
  let callGraphIdentity;
13785
13786
  let revisionDriftNote;
13786
13787
  try {
13787
- const { getCachedReviewGraph, getReviewGraphCacheIdentity, getReviewGraphSizeSkipVerdict, getReviewGraphRevisionDrift, formatReviewGraphRevisionDriftNote: formatReviewGraphRevisionDriftNote2 } = await import("../chunk-2ZGIZPDG.js");
13788
+ const { getCachedReviewGraph, getReviewGraphCacheIdentity, getReviewGraphSizeSkipVerdict, getReviewGraphRevisionDrift, formatReviewGraphRevisionDriftNote: formatReviewGraphRevisionDriftNote2 } = await import("../chunk-2VUQMUMT.js");
13788
13789
  graph = getCachedReviewGraph(cwd);
13789
13790
  graphFileCap = getReviewGraphSizeSkipVerdict(cwd)?.maxFileCount;
13790
13791
  const drift = graph ? getReviewGraphRevisionDrift(cwd) : void 0;
@@ -14820,7 +14821,7 @@ async function projectReport(cwd, options) {
14820
14821
  const limit = clampLimit(options?.limit);
14821
14822
  const focusTerms = normalizeFocus2(options?.focus);
14822
14823
  const view = options?.view;
14823
- const { getCachedReviewGraph, getReviewGraphSizeSkipVerdict, getLastReviewGraphBuildAttempt, buildOrUpdateGraph, isGraphBuildInFlight, getReviewGraphRevisionDrift } = await import("../chunk-2ZGIZPDG.js");
14824
+ const { getCachedReviewGraph, getReviewGraphSizeSkipVerdict, getLastReviewGraphBuildAttempt, buildOrUpdateGraph, isGraphBuildInFlight, getReviewGraphRevisionDrift } = await import("../chunk-2VUQMUMT.js");
14824
14825
  let graph;
14825
14826
  try {
14826
14827
  graph = getCachedReviewGraph(cwd);
@@ -15263,7 +15264,7 @@ async function symbolSearch(query, cwd, limit = 20, options = {}) {
15263
15264
  warmLease.release();
15264
15265
  }
15265
15266
  const hits = results.map(toSymbolSearchHit);
15266
- const { getCachedReviewGraph } = await import("../chunk-2ZGIZPDG.js");
15267
+ const { getCachedReviewGraph } = await import("../chunk-2VUQMUMT.js");
15267
15268
  const graph = getCachedReviewGraph(cwd);
15268
15269
  if (graph)
15269
15270
  annotateSymbolSearchHitsWithGraph(hits, centrality, graph);
@@ -2,34 +2,35 @@
2
2
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
3
3
  import {
4
4
  analyzeFile
5
- } from "../chunk-ODBNXWT4.js";
5
+ } from "../chunk-H6MF6EVN.js";
6
6
  import "../chunk-OXXKQCSV.js";
7
7
  import "../chunk-EJIUXPBX.js";
8
+ import "../chunk-2CD5RS6M.js";
8
9
  import "../chunk-FC4RP4I2.js";
9
- import "../chunk-66SXUJCA.js";
10
+ import "../chunk-UZ3TUTRV.js";
11
+ import "../chunk-XMSXXAHW.js";
12
+ import "../chunk-77M37OKR.js";
13
+ import "../chunk-CSHFH5IN.js";
10
14
  import "../chunk-VCHXCQFG.js";
11
- import "../chunk-IXXDFY73.js";
15
+ import "../chunk-3EFKIGZN.js";
12
16
  import "../chunk-MRXKYPCS.js";
13
- import "../chunk-2CD5RS6M.js";
14
- import "../chunk-UZ3TUTRV.js";
15
- import "../chunk-EETY4LF7.js";
16
- import "../chunk-GOYRYZ2R.js";
17
+ import "../chunk-7DYBLXYA.js";
18
+ import "../chunk-AB3YYG6N.js";
19
+ import "../chunk-YSZNHOBY.js";
17
20
  import "../chunk-RPLINGVB.js";
18
21
  import "../chunk-XCJN5IJU.js";
19
22
  import "../chunk-76MWC2K6.js";
20
23
  import "../chunk-GXW6K4YJ.js";
21
24
  import "../chunk-2B73ZPOK.js";
22
- import "../chunk-XMSXXAHW.js";
23
- import "../chunk-7DYBLXYA.js";
24
- import "../chunk-PV6LR5P5.js";
25
+ import "../chunk-YYOIQFRS.js";
25
26
  import "../chunk-3MED75HT.js";
26
- import "../chunk-CO2G5PHH.js";
27
+ import "../chunk-M6HSLBWY.js";
27
28
  import "../chunk-IBGIOBEE.js";
28
- import "../chunk-PNQDPDRC.js";
29
29
  import "../chunk-XIMYZ3JA.js";
30
- import "../chunk-ESBQHFMJ.js";
31
- import "../chunk-34WSVGEM.js";
30
+ import "../chunk-EU63SDCG.js";
32
31
  import "../chunk-VWCXW2E7.js";
32
+ import "../chunk-FCSOVF55.js";
33
+ import "../chunk-PNQDPDRC.js";
33
34
  import "../chunk-ZXYDQ3TZ.js";
34
35
  import "../chunk-5W3R6LFT.js";
35
36
  import "../chunk-QHJ6DQ2R.js";
@@ -45,7 +46,7 @@ import "../chunk-GAEGEPOC.js";
45
46
  import "../chunk-Z3CCVDUB.js";
46
47
  import "../chunk-L3BLXZG7.js";
47
48
  import "../chunk-2BEMIWEW.js";
48
- import "../chunk-66VMUL7Q.js";
49
+ import "../chunk-ACXEQZOU.js";
49
50
  import "../chunk-Q7DUK4LX.js";
50
51
  import "../chunk-AW7R2GWG.js";
51
52
  import "../chunk-RWWYJ623.js";
@@ -53,7 +53,7 @@ import {
53
53
  verifyNpmPackageEntry,
54
54
  verifyToolBinary,
55
55
  wasLastResolveTransient
56
- } from "../chunk-66VMUL7Q.js";
56
+ } from "../chunk-ACXEQZOU.js";
57
57
  import "../chunk-Q7DUK4LX.js";
58
58
  import "../chunk-AW7R2GWG.js";
59
59
  import "../chunk-RWWYJ623.js";
@@ -497,10 +497,11 @@ operator's private notes, so a different orchestrator can run the same train.
497
497
  - **Detection retrospective on every merged bug fix (2026-09-06).** The
498
498
  catalog records the CODE lesson of a bug (a shape, a screen, a guard). Before
499
499
  a bug-labelled lane's ledger row closes, the orchestrator also records the
500
- DETECTION lesson in one line: which verification layer caught it (external
501
- user, reviewer probe, CI job, governance sweep, install/compat/tool smoke,
502
- dogfood, release gate) and which layer SHOULD have caught it earlier and at
503
- what cost. If that layer does not exist, file it as an issue with the bug as
500
+ DETECTION lesson in one line: which verification layer caught it and which
501
+ layer SHOULD have caught it earlier and at what cost. The accepted layer
502
+ words are the `DETECTION_LAYERS` list exported by `scripts/check-pr-body.mjs`,
503
+ which the `## Detection` body check reads; the prose does not restate them.
504
+ If that layer does not exist, file it as an issue with the bug as
504
505
  its named recurrence — the same standard shapes are held to. The ledger
505
506
  carries a `caught by / should have been caught by` column. Record: #2587's
506
507
  manifest entry escaped the package for four releases; a second registration
@@ -613,6 +614,13 @@ Each row cost a lane at least once; the prose above carries the record.
613
614
  |---------|-----|
614
615
  | Writing incident numbers and examples into an `AGENTS.md` rule | AGENTS.md stays lean; issues, PRs and examples go to `HISTORY.md` (maintainer, 2026-10-10). `tests/config/agents-governance.test.ts` ratchets the reference count down only |
615
616
  | Routing a review finding as one PR's bug when it is a member of a class | Name the shape, grep for members, and record the verdict before the fix round; `plegma-delegate-guard` refuses a fix brief with a HIGH/MEDIUM finding and no `Shape:` line |
617
+ | Dispatching a fixer on an issue's text without checking it against the code | Grep the claimed gap on master before the brief. A stale premise turns the lane into a no-op or a witness-only PR |
618
+ | Writing off a worker's reds as "sandbox" without a same-env base run | Accept a sandbox attribution only with the same test names red on origin/master under the same env vars. Hundreds of guard reds can hide one real red |
619
+ | Folding a reviewer's remedy after running only the file the reviewer named | Run every test that references the changed symbol (`rg -l <symbol> tests`) before pushing a fold |
620
+ | Pushing with `-q` or a grep filter, then landing on whatever the PR head is | Read the push result unfiltered, check `git merge-base --is-ancestor <intended> origin/<branch>`, and land with `EXPECT_HEAD=<intended or its merge>` |
621
+ | Gating a background step on `until ! pgrep -f '<pattern>'` | That command line matches itself and never exits. Chain the steps in one command, or wait on a PID |
622
+ | Editing an orchestrator script while a chain or monitor runs it | Stop the chain first, or write a new file and `mv` it into place |
623
+ | Patching a CI-only red for a fifth round without CI evidence | When a red does not reproduce locally, put temporary instrumentation in a do-not-merge PR and read the CI log before the next fix round |
616
624
  | Taking a causal premise ("a later merge dropped X") from a hand-back into a PR body or brief | Bisect before writing it: `git show <sha>:<file>` along the path from the fix commit to master. A lane round can revert its own earlier round, and that is not a merge drop |
617
625
  | Trusting a wrapper script's exit status when it echoes a check's result | `pr-body.sh lint` printed `lint-exit=1` and exited 0, so a failing body went live; the wrapper now exits with the check's status. Read the check's own result line |
618
626
  | Hand-rolling the governance suite in a fresh worktree | `npm run build` alone left `dist/` missing and three census suites red; use the orchestrator's `gov-check.sh <tree>`, which builds both outputs and keeps the `node_modules` link for the commit hook |
@@ -80,6 +80,9 @@ real seam. Check that every gate the diff adds is exercised through that path.
80
80
  observability, changelog, commit, and PR-body requirements.
81
81
  - Re-run the PR's `## Class sweep` search yourself and widen it when the
82
82
  named shape is broader than the touched seam (#4273, #4268).
83
+ - On a bug-closing PR, check the `## Detection` lesson: the layer named under
84
+ `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).
83
86
  - For LSP, dispatch, cache, runner, or tool changes, test one non-TypeScript
84
87
  registry entry through the same seam.
85
88
  - On a net-count fold, mutate every predicate the deleted sibling used to
@@ -224,6 +224,11 @@ runner's own notes say which mode lifts it). Run Vitest as
224
224
  tree-sitter grammar prefetch hangs offline, verify through direct probes of the
225
225
  built code and say so; the orchestrator re-runs the files outside the sandbox.
226
226
 
227
+ A worker may call a red "sandbox" only with the same test names red on
228
+ `origin/master` in the same worktree, under the same env vars (including
229
+ `GITHUB_ACTIONS` when the test reads it). The plegma git guard reds hundreds
230
+ of fixture tests, and a real red hidden among them reaches CI (#4308).
231
+
227
232
  ## Follow-ups
228
233
 
229
234
  Fold a review follow-up into the same PR when it shares the seam or files, is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "type": "module",
5
5
  "description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
6
6
  "repository": {
@@ -1,84 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- incrementDegradationCount
4
- } from "./chunk-JAU72XNY.js";
5
- import {
6
- logLatency
7
- } from "./chunk-QQNQ7SJW.js";
8
-
9
- // dist/clients/bounded-telemetry.js
10
- var MAX_TRACKED_TURN_CAPS = 64;
11
- var turnCounts = /* @__PURE__ */ new Map();
12
- var latestCountedTurnIndex;
13
- var retiredThroughTurnIndex = Number.NEGATIVE_INFINITY;
14
- function admitBounded(phase, identity, options = {}) {
15
- try {
16
- let isRisingEdge = true;
17
- if (options.ledgerKind !== void 0) {
18
- isRisingEdge = incrementDegradationCount({
19
- kind: options.ledgerKind,
20
- subject: identity,
21
- reason: options.reason ?? phase
22
- });
23
- }
24
- if (options.risingEdgePer !== void 0 && !isRisingEdge)
25
- return false;
26
- return admitAgainstTurnCap(phase, options.capPerTurn);
27
- } catch {
28
- return true;
29
- }
30
- }
31
- function emitBounded(phase, identity, payload, options = {}) {
32
- try {
33
- if (!admitBounded(phase, identity, options))
34
- return false;
35
- logLatency({
36
- ...payload,
37
- type: payload.type ?? "phase",
38
- phase,
39
- // `filePath` is what existing latency.log queries filter on, so a site
40
- // may keep a coarser one; `metadata.identity` below always carries the
41
- // full discriminating identity. Aggregation that loses WHICH subject
42
- // is stuck is the failure AGENTS.md names.
43
- filePath: payload.filePath ?? identity,
44
- metadata: { ...payload.metadata, identity }
45
- });
46
- return true;
47
- } catch {
48
- return false;
49
- }
50
- }
51
- function admitAgainstTurnCap(phase, cap) {
52
- if (cap === void 0)
53
- return true;
54
- if (cap.turnIndex <= retiredThroughTurnIndex)
55
- return false;
56
- let counts = turnCounts.get(cap.turnIndex);
57
- if (!counts) {
58
- if (turnCounts.size >= MAX_TRACKED_TURN_CAPS) {
59
- const oldestTrackedTurn = Math.min(...turnCounts.keys());
60
- if (cap.turnIndex < oldestTrackedTurn)
61
- return false;
62
- turnCounts.delete(oldestTrackedTurn);
63
- retiredThroughTurnIndex = Math.max(retiredThroughTurnIndex, oldestTrackedTurn);
64
- }
65
- counts = /* @__PURE__ */ new Map();
66
- turnCounts.set(cap.turnIndex, counts);
67
- }
68
- latestCountedTurnIndex = Math.max(latestCountedTurnIndex ?? cap.turnIndex, cap.turnIndex);
69
- const used = counts.get(phase) ?? 0;
70
- if (used >= cap.limit)
71
- return false;
72
- counts.set(phase, used + 1);
73
- return true;
74
- }
75
- function resetBoundedTelemetry() {
76
- turnCounts = /* @__PURE__ */ new Map();
77
- latestCountedTurnIndex = void 0;
78
- retiredThroughTurnIndex = Number.NEGATIVE_INFINITY;
79
- }
80
-
81
- export {
82
- emitBounded,
83
- resetBoundedTelemetry
84
- };
File without changes
@@ -2,9 +2,6 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  HardFailureStamps
4
4
  } from "./chunk-7U2IDNXN.js";
5
- import {
6
- getScratchTreeFnmatchPatterns
7
- } from "./chunk-VCHXCQFG.js";
8
5
  import {
9
6
  formatToolFailure
10
7
  } from "./chunk-2CD5RS6M.js";
@@ -12,6 +9,9 @@ import {
12
9
  firstOutputLine,
13
10
  spawnFailedWithNoOutput
14
11
  } from "./chunk-UZ3TUTRV.js";
12
+ import {
13
+ getScratchTreeFnmatchPatterns
14
+ } from "./chunk-VCHXCQFG.js";
15
15
  import {
16
16
  listNestedLinkedWorktreeRoots
17
17
  } from "./chunk-PNQDPDRC.js";