pi-lens 4.4.3 → 4.4.4

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 (143) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/README.md +13 -1
  3. package/dist/{chunk-SS36ZX4J.js → chunk-24AKHFGP.js} +6 -6
  4. package/dist/{chunk-JSQFTSC6.js → chunk-2FN63LPV.js} +11 -11
  5. package/dist/{chunk-5UCAH366.js → chunk-2KXTHF3M.js} +20 -20
  6. package/dist/{chunk-EU63SDCG.js → chunk-3DA2JDOL.js} +367 -281
  7. package/dist/{chunk-RWWYJ623.js → chunk-3KAZU3VR.js} +1 -1
  8. package/dist/chunk-3PTHXJXR.js +28 -0
  9. package/dist/chunk-3QED2P4V.js +31 -0
  10. package/dist/{chunk-N2H3ZPZY.js → chunk-3RKP3FMS.js} +1 -0
  11. package/dist/{chunk-XVF2VVXP.js → chunk-5HSRT26B.js} +2 -2
  12. package/dist/{chunk-MXGY6KPT.js → chunk-5IUSNGOC.js} +15 -15
  13. package/dist/{chunk-EJIUXPBX.js → chunk-5OFV52AM.js} +1 -1
  14. package/dist/{chunk-AW7R2GWG.js → chunk-5VSF4UUQ.js} +12 -7
  15. package/dist/{chunk-6STA6Z7I.js → chunk-5WRPDP2A.js} +18 -18
  16. package/dist/{chunk-YIUAVF7E.js → chunk-6DLWKFEX.js} +35 -34
  17. package/dist/{chunk-WOA4LN2R.js → chunk-7D6L4MTX.js} +2 -2
  18. package/dist/{chunk-GAEGEPOC.js → chunk-7HXE67BN.js} +2 -2
  19. package/dist/chunk-AGSS7277.js +84 -0
  20. package/dist/{chunk-R3PCY3YS.js → chunk-AMERCH6V.js} +13 -13
  21. package/dist/{chunk-WU567RSC.js → chunk-ATKJFDQN.js} +14 -10
  22. package/dist/{chunk-VSSBEUFT.js → chunk-AWSCPCN2.js} +16 -16
  23. package/dist/{chunk-VCHXCQFG.js → chunk-BWD5EPKO.js} +3 -3
  24. package/dist/{chunk-H6MF6EVN.js → chunk-CT4MN5IU.js} +1200 -230
  25. package/dist/{chunk-FCSOVF55.js → chunk-CUHSHSB6.js} +6 -6
  26. package/dist/{chunk-CHOW74WE.js → chunk-CYRKQRPM.js} +7 -10
  27. package/dist/{chunk-Q7DUK4LX.js → chunk-DEL2U6CM.js} +5 -5
  28. package/dist/{chunk-6C7JWPCP.js → chunk-DGUKIYSI.js} +26 -23
  29. package/dist/{chunk-PHDMFAKM.js → chunk-DUO2TU77.js} +2 -2
  30. package/dist/{chunk-MRXKYPCS.js → chunk-EBC36LNN.js} +2 -2
  31. package/dist/{chunk-CSHFH5IN.js → chunk-ED36RF6Y.js} +1 -1
  32. package/dist/{chunk-76MWC2K6.js → chunk-EUXZEFTV.js} +90 -97
  33. package/dist/{chunk-QOZXJ4NA.js → chunk-FM4RDMKT.js} +11 -8
  34. package/dist/{chunk-ACXEQZOU.js → chunk-GAQ7OQG6.js} +31 -28
  35. package/dist/{chunk-XAGLWMJ4.js → chunk-GL5LUMZE.js} +23 -23
  36. package/dist/{chunk-BKE7E7TC.js → chunk-GMX5OS7B.js} +9 -9
  37. package/dist/{chunk-ZHFZWTZV.js → chunk-GSLNCYGG.js} +11 -11
  38. package/dist/{chunk-3W7IEVVL.js → chunk-GSM5UU7A.js} +26 -34
  39. package/dist/{chunk-724UL2TJ.js → chunk-GXFV6MYU.js} +3 -3
  40. package/dist/chunk-HAD7QRQI.js +30 -0
  41. package/dist/{chunk-QOBUHWHX.js → chunk-HRNHZA3N.js} +6 -6
  42. package/dist/{chunk-VWCXW2E7.js → chunk-HWCCCQNX.js} +1 -1
  43. package/dist/{chunk-7DYBLXYA.js → chunk-HYGZEMX6.js} +3 -3
  44. package/dist/chunk-IJYGIDF4.js +186 -0
  45. package/dist/{chunk-4W4VLAPJ.js → chunk-IQWN5JCP.js} +11 -11
  46. package/dist/{chunk-SQ4TVJBR.js → chunk-IUE7SSKV.js} +7 -7
  47. package/dist/{chunk-IBGIOBEE.js → chunk-IWDLU6K3.js} +68 -5
  48. package/dist/{chunk-XCJN5IJU.js → chunk-IYNJ6YPZ.js} +4 -4
  49. package/dist/{chunk-JAU72XNY.js → chunk-J64T55EI.js} +3 -3
  50. package/dist/{chunk-2BBLFX75.js → chunk-J6MPGQTS.js} +5 -5
  51. package/dist/chunk-JORED7EX.js +44 -0
  52. package/dist/{chunk-6SDEP3AJ.js → chunk-JUKMK5Y4.js} +8 -8
  53. package/dist/{chunk-FMSO6RDZ.js → chunk-JW3YWBVB.js} +15 -15
  54. package/dist/{chunk-L3BLXZG7.js → chunk-KAPJINKN.js} +30 -69
  55. package/dist/{chunk-2B73ZPOK.js → chunk-KN35K52N.js} +3 -3
  56. package/dist/{chunk-C34ZXZ7O.js → chunk-KUA4OJ5Y.js} +24 -11
  57. package/dist/chunk-KYUB6QDC.js +72 -0
  58. package/dist/{chunk-67WMNWEE.js → chunk-LLJNQKQW.js} +12 -10
  59. package/dist/chunk-LZSEQW6A.js +57 -0
  60. package/dist/{chunk-ZANLILYD.js → chunk-M2IFVFWU.js} +2 -2
  61. package/dist/chunk-M2UD3LPU.js +88 -0
  62. package/dist/{chunk-XIJZVPD5.js → chunk-MBKQHGA7.js} +15 -15
  63. package/dist/{chunk-P7266HLM.js → chunk-MPNJLASA.js} +2 -2
  64. package/dist/{chunk-6GFRNVYR.js → chunk-MZGQNL3Y.js} +10 -10
  65. package/dist/{chunk-ZWFS3OEF.js → chunk-N5FLEO7W.js} +33 -32
  66. package/dist/{chunk-3JNKMP3B.js → chunk-O4NWQT6I.js} +4 -4
  67. package/dist/{chunk-T6CPIZNT.js → chunk-OHKJ7PQF.js} +33 -32
  68. package/dist/{chunk-VRZP76YM.js → chunk-P63GXC37.js} +4 -1
  69. package/dist/{chunk-XTMJ7XDT.js → chunk-POMLXPMY.js} +1 -1
  70. package/dist/{chunk-QQNQ7SJW.js → chunk-QBFBRV2B.js} +10 -4
  71. package/dist/{chunk-CMMHNUZ2.js → chunk-R3T7CLQ2.js} +60 -38
  72. package/dist/{chunk-23WOO7TX.js → chunk-R7YOCSNV.js} +10 -10
  73. package/dist/{chunk-2CD5RS6M.js → chunk-RKBXZN3A.js} +23 -2
  74. package/dist/{chunk-OCAGUNBC.js → chunk-RKKOYPRA.js} +12 -12
  75. package/dist/{chunk-52FUZI6K.js → chunk-RMLC67LF.js} +1 -1
  76. package/dist/{chunk-XMSXXAHW.js → chunk-ROYSX2S5.js} +2 -2
  77. package/dist/{chunk-M6HSLBWY.js → chunk-RVK72CZX.js} +6507 -7514
  78. package/dist/{chunk-FLKWCIZH.js → chunk-S2HEXIWI.js} +5 -5
  79. package/dist/{chunk-UZ3TUTRV.js → chunk-S67KYG37.js} +1 -1
  80. package/dist/{chunk-VCO24T4L.js → chunk-SD4I7ZO4.js} +14 -14
  81. package/dist/{chunk-Z527N6YQ.js → chunk-SKAMFC7A.js} +12 -12
  82. package/dist/{chunk-MQLUAEOC.js → chunk-SRYEJNES.js} +2 -2
  83. package/dist/{chunk-BRGDSBJE.js → chunk-SYE6T2EB.js} +12 -12
  84. package/dist/{chunk-GXW6K4YJ.js → chunk-T57LYLZT.js} +1 -1
  85. package/dist/{chunk-ZXYDQ3TZ.js → chunk-T7FEBKXN.js} +48 -15
  86. package/dist/{chunk-3EFKIGZN.js → chunk-TIQ2PKDW.js} +3 -3
  87. package/dist/{chunk-QILIYSJF.js → chunk-TLX72JTG.js} +1 -1
  88. package/dist/{chunk-TYM6OUIT.js → chunk-TOY6QKOH.js} +12 -12
  89. package/dist/{chunk-IZSHAIJ7.js → chunk-TRETHTQO.js} +12 -12
  90. package/dist/{chunk-3VPVG5SU.js → chunk-U44DJXQP.js} +10 -6
  91. package/dist/{chunk-PNQDPDRC.js → chunk-UA7ZXYDR.js} +1 -1
  92. package/dist/{chunk-OXXKQCSV.js → chunk-UBOQLVT2.js} +4 -4
  93. package/dist/{chunk-QGQ5CCCG.js → chunk-UMS2MFPZ.js} +2 -2
  94. package/dist/{chunk-QHJ6DQ2R.js → chunk-US7ECLD7.js} +55 -13
  95. package/dist/{chunk-AB3YYG6N.js → chunk-UZ2XCLYS.js} +8 -8
  96. package/dist/chunk-V35JG4JB.js +2667 -0
  97. package/dist/{chunk-N3X6Q4YT.js → chunk-VOOAPROD.js} +3 -3
  98. package/dist/{chunk-SAEFPSB6.js → chunk-W66O5E25.js} +21 -11
  99. package/dist/{chunk-KBG47GHP.js → chunk-WMYE35PX.js} +15 -11
  100. package/dist/{chunk-5NGR67U5.js → chunk-XBJVAEEO.js} +32 -5
  101. package/dist/{chunk-YYOIQFRS.js → chunk-XHJBS436.js} +122 -44
  102. package/dist/{chunk-GBPP5P7X.js → chunk-XTBDCR27.js} +4 -4
  103. package/dist/{chunk-4UNXBNE2.js → chunk-XTFDJI3T.js} +11 -11
  104. package/dist/{chunk-UXGETRP4.js → chunk-XYURS6EN.js} +13 -12
  105. package/dist/{chunk-RPLINGVB.js → chunk-Y6GZHWSJ.js} +6 -6
  106. package/dist/{chunk-2VUQMUMT.js → chunk-YCWYO6TQ.js} +41 -38
  107. package/dist/{chunk-77M37OKR.js → chunk-YH5MVY2U.js} +7 -7
  108. package/dist/{chunk-AOHZU2BM.js → chunk-YNE3RP52.js} +1 -1
  109. package/dist/{chunk-YSZNHOBY.js → chunk-ZHH37KZL.js} +12 -12
  110. package/dist/{chunk-ZGDGW2V3.js → chunk-ZIVJBOO3.js} +2 -2
  111. package/dist/{chunk-RXCOMYPY.js → chunk-ZVUL7QYY.js} +29 -28
  112. package/dist/index.js +11052 -5852
  113. package/dist/mcp/analyze-cli.js +10 -9
  114. package/dist/mcp/cli.js +41 -38
  115. package/dist/mcp/server.js +1120 -474
  116. package/dist/mcp/worker.js +61 -58
  117. package/dist/probes/installer.js +19 -19
  118. package/dist/workers/project-snapshot-persist-worker.js +28 -9
  119. package/dist/workers/review-graph-persist-worker.js +1 -1
  120. package/docs/configuration.md +11 -0
  121. package/docs/engineering-principles.md +32 -0
  122. package/docs/lsp-capability-matrix.md +1 -1
  123. package/docs/lsp-idle-eviction.md +15 -26
  124. package/docs/pi-lens-fixer.md +117 -13
  125. package/docs/pi-lens-merge-policy.md +97 -7
  126. package/docs/pi-lens-monitor.md +8 -2
  127. package/docs/pi-lens-retro.md +4 -1
  128. package/docs/pi-lens-reviewer.md +112 -4
  129. package/docs/pi-lens-subagent.md +22 -14
  130. package/docs/release-qa-baseline.md +3 -1
  131. package/docs/servercapabilities.md +9 -19
  132. package/package.json +7 -5
  133. package/scripts/download-grammars.js +40 -7
  134. package/scripts/lib/latency-log-phases.mjs +95 -0
  135. package/scripts/rpc-load-check.mjs +570 -81
  136. package/dist/chunk-3YN6V5TV.js +0 -85
  137. package/dist/chunk-466Z26MG.js +0 -30
  138. package/dist/chunk-EC47DWFA.js +0 -56
  139. package/dist/chunk-KDERNTCQ.js +0 -28
  140. package/dist/chunk-KSX3TXSZ.js +0 -69
  141. package/dist/chunk-LOP6GRPH.js +0 -31
  142. package/dist/chunk-UOPVJQ4N.js +0 -103
  143. /package/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
@@ -0,0 +1,186 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ stagePathFor
4
+ } from "./chunk-LJDODBBZ.js";
5
+
6
+ // dist/clients/gzip-stage-write.js
7
+ import * as fs from "node:fs";
8
+ import * as path from "node:path";
9
+ import { Readable } from "node:stream";
10
+ import { pipeline } from "node:stream/promises";
11
+ import { parentPort } from "node:worker_threads";
12
+ import { createGzip } from "node:zlib";
13
+ function routingFields(value) {
14
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
15
+ return `not a routable object (${value === null ? "null" : Array.isArray(value) ? "array" : typeof value})`;
16
+ }
17
+ const wire = value;
18
+ const missing = [];
19
+ const id = requiredNumber(wire, "id", missing);
20
+ const generation = requiredNumber(wire, "generation", missing);
21
+ if (missing.length > 0)
22
+ return `no numeric ${missing.join(" and ")}`;
23
+ return {
24
+ id,
25
+ generation,
26
+ ...fieldEntry(wire, "stagePath", "string", [])
27
+ };
28
+ }
29
+ function requiredNumber(wire, key, missing) {
30
+ const field = wire[key];
31
+ if (typeof field === "number")
32
+ return field;
33
+ missing.push(key);
34
+ return Number.NaN;
35
+ }
36
+ function fieldEntry(wire, key, type, malformed) {
37
+ const field = wire[key];
38
+ if (typeof field === type) {
39
+ return { [key]: field };
40
+ }
41
+ if (field !== void 0)
42
+ malformed.push(key);
43
+ return {};
44
+ }
45
+ function readGzipStageWorkerResult(value) {
46
+ const routing = routingFields(value);
47
+ if (typeof routing === "string")
48
+ return routing;
49
+ const wire = value;
50
+ const malformed = [];
51
+ const result = {
52
+ ...routing,
53
+ ...fieldEntry(wire, "rawBytes", "number", malformed),
54
+ ...fieldEntry(wire, "gzBytes", "number", malformed),
55
+ ...fieldEntry(wire, "serializeMs", "number", malformed),
56
+ ...fieldEntry(wire, "writeMs", "number", malformed),
57
+ ...fieldEntry(wire, "durationMs", "number", malformed),
58
+ ...fieldEntry(wire, "semanticFingerprint", "string", malformed),
59
+ ...fieldEntry(wire, "skippedUnchanged", "boolean", malformed),
60
+ ...fieldEntry(wire, "error", "string", malformed)
61
+ };
62
+ if (malformed.length === 0)
63
+ return result;
64
+ return {
65
+ ...routing,
66
+ error: `malformed worker result: ${malformed.join(", ")}`
67
+ };
68
+ }
69
+ function isGzipStageWorkerRequest(value) {
70
+ const routing = routingFields(value);
71
+ return typeof routing !== "string" && routing.stagePath !== void 0;
72
+ }
73
+ function reapStageFile(stagePath) {
74
+ try {
75
+ fs.rmSync(stagePath, { force: true });
76
+ return void 0;
77
+ } catch (err) {
78
+ return err instanceof Error ? err : new Error(String(err));
79
+ }
80
+ }
81
+ async function writeGzipStageFile(data, stagePath, testDelayMs, options) {
82
+ const startedAt = performance.now();
83
+ const tmpPath = stagePathFor(stagePath);
84
+ try {
85
+ if (testDelayMs) {
86
+ await new Promise((resolve) => setTimeout(resolve, testDelayMs));
87
+ }
88
+ const serializeStarted = performance.now();
89
+ const body = data instanceof Uint8Array ? data : JSON.stringify(data);
90
+ const serializeMs = performance.now() - serializeStarted;
91
+ const rawBytes = Buffer.byteLength(body);
92
+ const semanticFingerprint = options?.semanticFingerprint?.(body);
93
+ if (semanticFingerprint !== void 0 && options?.skipIfFingerprints?.includes(semanticFingerprint)) {
94
+ return {
95
+ rawBytes,
96
+ gzBytes: 0,
97
+ serializeMs,
98
+ writeMs: 0,
99
+ durationMs: performance.now() - startedAt,
100
+ semanticFingerprint,
101
+ skippedUnchanged: true
102
+ };
103
+ }
104
+ const writeStarted = performance.now();
105
+ await fs.promises.mkdir(path.dirname(stagePath), { recursive: true });
106
+ const chunks = function* () {
107
+ const chunkSize = 256 * 1024;
108
+ let offset = 0;
109
+ while (offset < body.length) {
110
+ let end = Math.min(offset + chunkSize, body.length);
111
+ if (typeof body === "string" && end < body.length) {
112
+ const last = body.charCodeAt(end - 1);
113
+ if (last >= 55296 && last <= 56319)
114
+ end--;
115
+ }
116
+ yield typeof body === "string" ? body.slice(offset, end) : body.subarray(offset, end);
117
+ offset = end;
118
+ }
119
+ };
120
+ await pipeline(Readable.from(chunks()), createGzip(), fs.createWriteStream(tmpPath));
121
+ await fs.promises.rename(tmpPath, stagePath);
122
+ const writeMs = performance.now() - writeStarted;
123
+ const gzBytes = (await fs.promises.stat(stagePath)).size;
124
+ return {
125
+ rawBytes,
126
+ gzBytes,
127
+ serializeMs,
128
+ writeMs,
129
+ durationMs: performance.now() - startedAt,
130
+ semanticFingerprint
131
+ };
132
+ } catch (err) {
133
+ await fs.promises.rm(tmpPath, { force: true }).catch(() => {
134
+ });
135
+ throw err;
136
+ }
137
+ }
138
+ function serveGzipStageWorker(buildBaseResult, options) {
139
+ const port = parentPort;
140
+ if (!port) {
141
+ throw new Error("gzip stage persist worker requires a parent port");
142
+ }
143
+ port.on("message", (message) => {
144
+ void (async () => {
145
+ try {
146
+ if (!isGzipStageWorkerRequest(message)) {
147
+ const routing = routingFields(message);
148
+ throw new Error(`malformed persist request: ${typeof routing === "string" ? routing : "no stage path"}`);
149
+ }
150
+ const request = message;
151
+ const result = {
152
+ ...buildBaseResult(request)
153
+ };
154
+ try {
155
+ const fingerprint = options?.semanticFingerprint;
156
+ const metrics = await writeGzipStageFile(request.data, request.stagePath, request.testDelayMs, {
157
+ semanticFingerprint: fingerprint ? (body) => fingerprint(request, body) : void 0,
158
+ skipIfFingerprints: options?.skipIfFingerprints?.(request)
159
+ });
160
+ result.rawBytes = metrics.rawBytes;
161
+ result.gzBytes = metrics.gzBytes;
162
+ result.serializeMs = metrics.serializeMs;
163
+ result.writeMs = metrics.writeMs;
164
+ result.durationMs = metrics.durationMs;
165
+ result.semanticFingerprint = metrics.semanticFingerprint;
166
+ result.skippedUnchanged = metrics.skippedUnchanged;
167
+ } catch (err) {
168
+ result.error = err instanceof Error ? err.message : String(err);
169
+ }
170
+ port.postMessage(result);
171
+ } catch (err) {
172
+ const routing = routingFields(message);
173
+ port.postMessage({
174
+ ...typeof routing === "string" ? {} : routing,
175
+ error: err instanceof Error ? err.message : String(err)
176
+ });
177
+ }
178
+ })();
179
+ });
180
+ }
181
+
182
+ export {
183
+ readGzipStageWorkerResult,
184
+ reapStageFile,
185
+ serveGzipStageWorker
186
+ };
@@ -15,22 +15,22 @@ import {
15
15
  getFilterStats,
16
16
  isBuildArtifact,
17
17
  sourceTwinCandidates
18
- } from "./chunk-6C7JWPCP.js";
19
- import "./chunk-5NGR67U5.js";
20
- import "./chunk-C34ZXZ7O.js";
18
+ } from "./chunk-DGUKIYSI.js";
19
+ import "./chunk-XBJVAEEO.js";
20
+ import "./chunk-KUA4OJ5Y.js";
21
21
  import "./chunk-QYF5S6P6.js";
22
- import "./chunk-PHDMFAKM.js";
23
- import "./chunk-2BBLFX75.js";
24
- import "./chunk-XVF2VVXP.js";
22
+ import "./chunk-DUO2TU77.js";
23
+ import "./chunk-J6MPGQTS.js";
24
+ import "./chunk-5HSRT26B.js";
25
25
  import "./chunk-2EECBNC5.js";
26
- import "./chunk-JAU72XNY.js";
27
- import "./chunk-XTMJ7XDT.js";
26
+ import "./chunk-J64T55EI.js";
27
+ import "./chunk-POMLXPMY.js";
28
28
  import "./chunk-JMYYOTQG.js";
29
- import "./chunk-QQNQ7SJW.js";
30
- import "./chunk-AOHZU2BM.js";
29
+ import "./chunk-QBFBRV2B.js";
30
+ import "./chunk-YNE3RP52.js";
31
31
  import "./chunk-LJDODBBZ.js";
32
32
  import "./chunk-ABBOA7UD.js";
33
- import "./chunk-N2H3ZPZY.js";
33
+ import "./chunk-3RKP3FMS.js";
34
34
  import "./chunk-NXL4FFQQ.js";
35
35
  export {
36
36
  ALL_SCANNABLE_EXTENSIONS,
@@ -2,29 +2,29 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  firstOutputLine,
4
4
  spawnFailedWithNoOutput
5
- } from "./chunk-UZ3TUTRV.js";
5
+ } from "./chunk-S67KYG37.js";
6
6
  import {
7
7
  SecurityScanClient
8
- } from "./chunk-3EFKIGZN.js";
8
+ } from "./chunk-TIQ2PKDW.js";
9
9
  import {
10
10
  probeToolAsync
11
- } from "./chunk-RWWYJ623.js";
11
+ } from "./chunk-3KAZU3VR.js";
12
12
  import {
13
13
  INSTALL_TRANSIENT_MAX_ATTEMPTS,
14
14
  classifyProbeFailure,
15
15
  describeProbeEvidence,
16
16
  logAvailabilityDecision,
17
17
  startHostStallSampler
18
- } from "./chunk-VRZP76YM.js";
18
+ } from "./chunk-P63GXC37.js";
19
19
  import {
20
20
  safeSpawnAsync
21
- } from "./chunk-C34ZXZ7O.js";
21
+ } from "./chunk-KUA4OJ5Y.js";
22
22
  import {
23
23
  assertInstallAllowed
24
- } from "./chunk-ZANLILYD.js";
24
+ } from "./chunk-M2IFVFWU.js";
25
25
  import {
26
26
  recordDegradationOnce
27
- } from "./chunk-JAU72XNY.js";
27
+ } from "./chunk-J64T55EI.js";
28
28
 
29
29
  // dist/clients/govulncheck-client.js
30
30
  import * as fs from "node:fs";
@@ -1,21 +1,21 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getProjectDataDir
4
- } from "./chunk-C34ZXZ7O.js";
4
+ } from "./chunk-KUA4OJ5Y.js";
5
5
  import {
6
6
  createNdjsonLogger,
7
7
  getGlobalPiLensLogDir,
8
8
  getProcessSingleton,
9
9
  getTurnId,
10
10
  isTestMode
11
- } from "./chunk-AOHZU2BM.js";
11
+ } from "./chunk-YNE3RP52.js";
12
12
  import {
13
13
  BoundedFifoMap
14
14
  } from "./chunk-ABBOA7UD.js";
15
15
  import {
16
16
  normalizeFilePath,
17
17
  normalizeMapKey
18
- } from "./chunk-N2H3ZPZY.js";
18
+ } from "./chunk-3RKP3FMS.js";
19
19
 
20
20
  // dist/clients/hashline-anchor.js
21
21
  var HASHLINE_ANCHOR_LENGTH = 3;
@@ -98,6 +98,62 @@ var FINDING_ID_HASH_LENGTH = 12;
98
98
  function normalizeMessage(message) {
99
99
  return message.replace(/\s+/g, " ").trim().toLowerCase();
100
100
  }
101
+ function findingIdentity(d) {
102
+ return JSON.stringify([
103
+ d.tool ?? "",
104
+ d.rule ?? "",
105
+ normalizeMessage(d.message)
106
+ ]);
107
+ }
108
+ function foldedFindingIdentity(d) {
109
+ return findingIdentity({ ...d, message: d.message.replace(/\d+/g, "#") });
110
+ }
111
+ var ANY_POSITION = "anywhere";
112
+ function retainRecordedFindings(prior, observed, options) {
113
+ const identity = foldedFindingIdentity;
114
+ const byPlace = /* @__PURE__ */ new Map();
115
+ const byIdentity = /* @__PURE__ */ new Map();
116
+ const file = (map, key, d) => {
117
+ const bucket = map.get(key);
118
+ if (bucket)
119
+ bucket.push(d);
120
+ else
121
+ map.set(key, [d]);
122
+ };
123
+ for (const d of observed) {
124
+ file(byIdentity, identity(d), d);
125
+ if (d.line !== void 0)
126
+ file(byPlace, `${identity(d)}@${d.line}`, d);
127
+ }
128
+ const taken = /* @__PURE__ */ new Set();
129
+ const take = (bucket, accepts = () => true) => {
130
+ const match = bucket?.find((d) => !taken.has(d) && accepts(d));
131
+ if (match !== void 0)
132
+ taken.add(match);
133
+ return match;
134
+ };
135
+ const positions = prior.map((d) => options.positionOf(d));
136
+ const matches = prior.map((d, i) => {
137
+ const at = positions[i];
138
+ return typeof at === "number" ? take(byPlace.get(`${identity(d)}@${at}`)) : void 0;
139
+ });
140
+ prior.forEach((d, i) => {
141
+ if (positions[i] === ANY_POSITION)
142
+ matches[i] = take(byIdentity.get(identity(d)), (o) => options.matchesAnywhere?.(d, o) ?? true);
143
+ });
144
+ const kept = [];
145
+ const retired = [];
146
+ prior.forEach((d, i) => {
147
+ const match = matches[i];
148
+ if (match !== void 0)
149
+ kept.push(match);
150
+ else if (options.keepUnobserved(d))
151
+ kept.push(d);
152
+ else
153
+ retired.push(d);
154
+ });
155
+ return { kept, retired };
156
+ }
101
157
  function hashText(value, length = FINDING_ID_HASH_LENGTH) {
102
158
  return createHash("sha256").update(value).digest("hex").slice(0, length);
103
159
  }
@@ -236,8 +292,11 @@ function shouldLogEvent(event) {
236
292
  // rising-edge gated once per file per session, so always-on
237
293
  // visibility costs nothing.
238
294
  event === "read_file_evicted" || event === "edits_cap_trimmed" || // #4131: a file's authorship ended because another writer changed its
239
- // bytes. Once per authorship episode: the retired file needs a read or
240
- // a known-content write before a writer can author it again.
295
+ // bytes, or a mutation-bridge write with no pre-write check landed on
296
+ // it (`writer: "bridge"`, #4187). Since #4387 an UNKNOWN-range credit
297
+ // never retires one. Once per authorship episode: the retired file
298
+ // needs a read or a known-content write before a writer can author it
299
+ // again.
241
300
  event === "authorship_retired";
242
301
  }
243
302
  var MAX_TELEMETRY_STRING = 512;
@@ -315,6 +374,10 @@ var RESOLVED_RANGE_CARRY = new BoundedFifoMap(RESOLVED_RANGE_CARRY_LIMIT);
315
374
 
316
375
  export {
317
376
  normalizeMessage,
377
+ findingIdentity,
378
+ foldedFindingIdentity,
379
+ ANY_POSITION,
380
+ retainRecordedFindings,
318
381
  hashText,
319
382
  stableFindingId,
320
383
  sanitizeCorrelationId,
@@ -1,18 +1,18 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  withFactTree
4
- } from "./chunk-GXW6K4YJ.js";
4
+ } from "./chunk-T57LYLZT.js";
5
5
  import {
6
6
  childrenOfType,
7
7
  firstChildOfType,
8
8
  walk
9
- } from "./chunk-QHJ6DQ2R.js";
9
+ } from "./chunk-US7ECLD7.js";
10
10
  import {
11
11
  isJstsFactFile
12
- } from "./chunk-PHDMFAKM.js";
12
+ } from "./chunk-DUO2TU77.js";
13
13
  import {
14
14
  logLatency
15
- } from "./chunk-QQNQ7SJW.js";
15
+ } from "./chunk-QBFBRV2B.js";
16
16
 
17
17
  // dist/clients/dispatch/facts/import-facts.js
18
18
  function importFactsApplyTo(filePath) {
@@ -1,13 +1,13 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  logExtension
4
- } from "./chunk-XTMJ7XDT.js";
4
+ } from "./chunk-POMLXPMY.js";
5
5
  import {
6
6
  DEPRECATED_CONFIG_SURFACES
7
7
  } from "./chunk-JMYYOTQG.js";
8
8
  import {
9
9
  logLatency
10
- } from "./chunk-QQNQ7SJW.js";
10
+ } from "./chunk-QBFBRV2B.js";
11
11
  import {
12
12
  PROCESS_SINGLETON_RESET_KIND,
13
13
  getProbeHomeRedirectEvent,
@@ -18,7 +18,7 @@ import {
18
18
  getSinkWriteFailures,
19
19
  resetSinkRotations,
20
20
  resetSinkWriteFailures
21
- } from "./chunk-AOHZU2BM.js";
21
+ } from "./chunk-YNE3RP52.js";
22
22
 
23
23
  // dist/clients/ledger-bounds.js
24
24
  var LEDGER_FIELD_MAX = 200;
@@ -14,7 +14,7 @@ import {
14
14
  findPiLensConfigMarkerInDir,
15
15
  getPiLensGlobalConfigPath,
16
16
  isResolvedGlobalConfigPath
17
- } from "./chunk-XVF2VVXP.js";
17
+ } from "./chunk-5HSRT26B.js";
18
18
  import {
19
19
  DEGRADATION_ENTRIES_PER_KIND,
20
20
  GLOBAL_NON_FLAG_CONFIG_SECTIONS,
@@ -31,10 +31,10 @@ import {
31
31
  readFlagConfigValue,
32
32
  readToolConfig,
33
33
  recordDegradationOnce
34
- } from "./chunk-JAU72XNY.js";
34
+ } from "./chunk-J64T55EI.js";
35
35
  import {
36
36
  logExtension
37
- } from "./chunk-XTMJ7XDT.js";
37
+ } from "./chunk-POMLXPMY.js";
38
38
  import {
39
39
  CONFIG_SCHEMA_ANCHOR_KEY,
40
40
  CONFIG_SCHEMA_ID,
@@ -45,7 +45,7 @@ import {
45
45
  import {
46
46
  redactSecrets,
47
47
  toPositiveFinite
48
- } from "./chunk-AOHZU2BM.js";
48
+ } from "./chunk-YNE3RP52.js";
49
49
  import {
50
50
  BoundedLruCache
51
51
  } from "./chunk-ABBOA7UD.js";
@@ -54,7 +54,7 @@ import {
54
54
  isAtOrAboveHomeDir,
55
55
  isWindowsPath,
56
56
  walkUpDirs
57
- } from "./chunk-N2H3ZPZY.js";
57
+ } from "./chunk-3RKP3FMS.js";
58
58
 
59
59
  // dist/clients/generated-artifacts.js
60
60
  import * as fs from "node:fs";
@@ -0,0 +1,44 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ DEPENDENCY_DRIFT_MAX_DELIVERIES,
4
+ _getForwardImportParsesForTests,
5
+ collectForwardImportMtimes,
6
+ extractForwardImportPaths,
7
+ extractForwardImports,
8
+ sweepInlineBlockerFreshness
9
+ } from "./chunk-V35JG4JB.js";
10
+ import "./chunk-XTBDCR27.js";
11
+ import "./chunk-MPNJLASA.js";
12
+ import "./chunk-US7ECLD7.js";
13
+ import "./chunk-Z54ZSOBZ.js";
14
+ import "./chunk-GXFV6MYU.js";
15
+ import "./chunk-FM4RDMKT.js";
16
+ import "./chunk-RMLC67LF.js";
17
+ import {
18
+ MTIME_DRIFT_TOLERANCE_MS
19
+ } from "./chunk-AGSS7277.js";
20
+ import "./chunk-P63GXC37.js";
21
+ import "./chunk-KUA4OJ5Y.js";
22
+ import "./chunk-DUO2TU77.js";
23
+ import "./chunk-J6MPGQTS.js";
24
+ import "./chunk-5HSRT26B.js";
25
+ import "./chunk-M2IFVFWU.js";
26
+ import "./chunk-2EECBNC5.js";
27
+ import "./chunk-J64T55EI.js";
28
+ import "./chunk-POMLXPMY.js";
29
+ import "./chunk-JMYYOTQG.js";
30
+ import "./chunk-QBFBRV2B.js";
31
+ import "./chunk-YNE3RP52.js";
32
+ import "./chunk-LJDODBBZ.js";
33
+ import "./chunk-ABBOA7UD.js";
34
+ import "./chunk-3RKP3FMS.js";
35
+ import "./chunk-NXL4FFQQ.js";
36
+ export {
37
+ DEPENDENCY_DRIFT_MAX_DELIVERIES,
38
+ MTIME_DRIFT_TOLERANCE_MS,
39
+ _getForwardImportParsesForTests,
40
+ collectForwardImportMtimes,
41
+ extractForwardImportPaths,
42
+ extractForwardImports,
43
+ sweepInlineBlockerFreshness
44
+ };
@@ -1,20 +1,20 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getProjectDataDir
4
- } from "./chunk-C34ZXZ7O.js";
5
- import "./chunk-2BBLFX75.js";
6
- import "./chunk-XVF2VVXP.js";
4
+ } from "./chunk-KUA4OJ5Y.js";
5
+ import "./chunk-J6MPGQTS.js";
6
+ import "./chunk-5HSRT26B.js";
7
7
  import "./chunk-2EECBNC5.js";
8
- import "./chunk-JAU72XNY.js";
9
- import "./chunk-XTMJ7XDT.js";
8
+ import "./chunk-J64T55EI.js";
9
+ import "./chunk-POMLXPMY.js";
10
10
  import "./chunk-JMYYOTQG.js";
11
- import "./chunk-QQNQ7SJW.js";
11
+ import "./chunk-QBFBRV2B.js";
12
12
  import {
13
13
  redactSecrets
14
- } from "./chunk-AOHZU2BM.js";
14
+ } from "./chunk-YNE3RP52.js";
15
15
  import "./chunk-LJDODBBZ.js";
16
16
  import "./chunk-ABBOA7UD.js";
17
- import "./chunk-N2H3ZPZY.js";
17
+ import "./chunk-3RKP3FMS.js";
18
18
  import "./chunk-NXL4FFQQ.js";
19
19
 
20
20
  // dist/clients/fix-worklog.js
@@ -9,26 +9,26 @@ import {
9
9
  resolveSeverityFloor,
10
10
  shouldScanTrivy,
11
11
  worktreeSkipDirs
12
- } from "./chunk-77M37OKR.js";
13
- import "./chunk-CSHFH5IN.js";
14
- import "./chunk-VCHXCQFG.js";
15
- import "./chunk-3EFKIGZN.js";
16
- import "./chunk-PNQDPDRC.js";
17
- import "./chunk-RWWYJ623.js";
18
- import "./chunk-VRZP76YM.js";
19
- import "./chunk-C34ZXZ7O.js";
12
+ } from "./chunk-YH5MVY2U.js";
13
+ import "./chunk-ED36RF6Y.js";
14
+ import "./chunk-BWD5EPKO.js";
15
+ import "./chunk-TIQ2PKDW.js";
16
+ import "./chunk-UA7ZXYDR.js";
17
+ import "./chunk-3KAZU3VR.js";
18
+ import "./chunk-P63GXC37.js";
19
+ import "./chunk-KUA4OJ5Y.js";
20
20
  import "./chunk-BW5KFIQC.js";
21
- import "./chunk-2BBLFX75.js";
22
- import "./chunk-XVF2VVXP.js";
21
+ import "./chunk-J6MPGQTS.js";
22
+ import "./chunk-5HSRT26B.js";
23
23
  import "./chunk-2EECBNC5.js";
24
- import "./chunk-JAU72XNY.js";
25
- import "./chunk-XTMJ7XDT.js";
24
+ import "./chunk-J64T55EI.js";
25
+ import "./chunk-POMLXPMY.js";
26
26
  import "./chunk-JMYYOTQG.js";
27
- import "./chunk-QQNQ7SJW.js";
28
- import "./chunk-AOHZU2BM.js";
27
+ import "./chunk-QBFBRV2B.js";
28
+ import "./chunk-YNE3RP52.js";
29
29
  import "./chunk-LJDODBBZ.js";
30
30
  import "./chunk-ABBOA7UD.js";
31
- import "./chunk-N2H3ZPZY.js";
31
+ import "./chunk-3RKP3FMS.js";
32
32
  import "./chunk-NXL4FFQQ.js";
33
33
  export {
34
34
  TrivyClient,