pi-lens 4.4.6 → 4.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/README.md +17 -3
  3. package/config/markdownlint/run-no-fix.mjs +36 -0
  4. package/dist/{chunk-ZQ6NZZTB.js → chunk-2453RRJ2.js} +44 -6
  5. package/dist/{chunk-GZE7WOI4.js → chunk-2BKUFQKR.js} +696 -330
  6. package/dist/chunk-2TS4GLOJ.js +31 -0
  7. package/dist/{chunk-2DMLM3ZO.js → chunk-2ZE3AUJQ.js} +12 -14
  8. package/dist/{chunk-OJLTLYHB.js → chunk-35WKJWO5.js} +51 -33
  9. package/dist/chunk-3JAHQBSY.js +27 -0
  10. package/dist/{chunk-PO45POGF.js → chunk-3O5EII3W.js} +2 -2
  11. package/dist/chunk-447YZL4S.js +25 -0
  12. package/dist/{chunk-TIYGSODX.js → chunk-4B2YFN4U.js} +28 -22
  13. package/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
  14. package/dist/{chunk-XQCSWV2G.js → chunk-4LL2VRNY.js} +27 -28
  15. package/dist/{chunk-MA77RSFN.js → chunk-4NBWFYWW.js} +9 -9
  16. package/dist/{chunk-75SY4F24.js → chunk-4QG55RRC.js} +12 -12
  17. package/dist/{chunk-K2YGBXOA.js → chunk-4W52ZKZX.js} +2 -2
  18. package/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
  19. package/dist/{chunk-CFRQMBGP.js → chunk-57X2CDRX.js} +23 -23
  20. package/dist/{chunk-XAIT2YGS.js → chunk-5F3XF3SX.js} +7 -15
  21. package/dist/{chunk-UHGF5UT5.js → chunk-5RNB4HVK.js} +1 -1
  22. package/dist/{chunk-Q4EMRFNA.js → chunk-5T5A6YAJ.js} +35 -34
  23. package/dist/{chunk-W5LGKNET.js → chunk-6FIRFP6A.js} +12 -12
  24. package/dist/{chunk-KLQVC3XC.js → chunk-6GMGEKQN.js} +36 -9
  25. package/dist/{chunk-UN4TEBWN.js → chunk-6LJOJ6EO.js} +20 -15
  26. package/dist/{chunk-HK6JVFZC.js → chunk-6YUNI7B5.js} +3 -3
  27. package/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
  28. package/dist/{chunk-VQH24FIP.js → chunk-7CGIDRIK.js} +16 -15
  29. package/dist/{chunk-SCIUNBPF.js → chunk-7MAD5ZAY.js} +16 -17
  30. package/dist/{chunk-OOU2WZZE.js → chunk-7TNILKGY.js} +1 -1
  31. package/dist/{chunk-LEJOJDXL.js → chunk-A5GRLYPZ.js} +9 -9
  32. package/dist/{chunk-AE37FEGH.js → chunk-AGGUWKRK.js} +1 -1
  33. package/dist/{chunk-BWYQUPOS.js → chunk-BBET6HD6.js} +1 -1
  34. package/dist/{chunk-GAACZY6R.js → chunk-BHWW6FAX.js} +14 -13
  35. package/dist/{chunk-A3YNG5KP.js → chunk-BOPDQ7AZ.js} +23 -21
  36. package/dist/{chunk-MKVZQUEG.js → chunk-BQG2QFVO.js} +215 -134
  37. package/dist/{chunk-EVDGNG4F.js → chunk-BUZIQDFS.js} +3 -3
  38. package/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
  39. package/dist/{chunk-63RIVFQI.js → chunk-CUDD35TW.js} +10 -9
  40. package/dist/{chunk-BM5GS6ZH.js → chunk-CZL44WFN.js} +2 -2
  41. package/dist/{chunk-QGSTQH4D.js → chunk-DIWK3LBC.js} +12 -15
  42. package/dist/{chunk-JL6CXUMW.js → chunk-DYRZGUMA.js} +2 -2
  43. package/dist/{chunk-NDMCVUYK.js → chunk-FHEV6T4L.js} +22 -18
  44. package/dist/{chunk-4PCQCU47.js → chunk-FRLAUP2B.js} +4 -4
  45. package/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
  46. package/dist/{chunk-2RLWJO5K.js → chunk-G6JKM4O7.js} +7 -7
  47. package/dist/chunk-GGYOZWHW.js +27 -0
  48. package/dist/{chunk-DC4CFXM5.js → chunk-GIRBSBGL.js} +6 -5
  49. package/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
  50. package/dist/{chunk-ZUUI3ZSA.js → chunk-HHR7WGCI.js} +3 -3
  51. package/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
  52. package/dist/{chunk-VPBIMOAQ.js → chunk-HUAM7QG3.js} +15 -13
  53. package/dist/{chunk-ZYNI26MI.js → chunk-HXFUTMX2.js} +2 -2
  54. package/dist/{chunk-W5R5SABV.js → chunk-I22THIHI.js} +12 -12
  55. package/dist/chunk-IE5D3RA5.js +58 -0
  56. package/dist/{chunk-MT6BVNFW.js → chunk-IYVYZQRL.js} +10 -16
  57. package/dist/{chunk-ARD426WI.js → chunk-JBP7KESM.js} +1 -1
  58. package/dist/{chunk-MN7MHUXQ.js → chunk-JE6HKLC7.js} +2 -2
  59. package/dist/{chunk-3MYEA7QD.js → chunk-JPRDTY5S.js} +85 -3
  60. package/dist/{chunk-CJYKEW2L.js → chunk-JYLOYTZD.js} +17 -1
  61. package/dist/{chunk-5APMQ2IJ.js → chunk-JZRP4DGP.js} +2 -2
  62. package/dist/{chunk-AMXIUN2R.js → chunk-KZ4ALBCH.js} +2 -2
  63. package/dist/{chunk-W2V54OCL.js → chunk-L3CLUGDY.js} +3 -3
  64. package/dist/{chunk-DMSLNKF7.js → chunk-L4NEVZ4T.js} +28 -27
  65. package/dist/chunk-LPYTPNOJ.js +22 -0
  66. package/dist/{chunk-BI5LAQ3Y.js → chunk-LSFXZLPW.js} +2071 -1725
  67. package/dist/{chunk-2DDDCJDL.js → chunk-MC6VB2E5.js} +4 -4
  68. package/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
  69. package/dist/{chunk-Q4FCYCRE.js → chunk-NSPVR3FN.js} +19 -18
  70. package/dist/{chunk-VG5JS5SW.js → chunk-O2ARHQKF.js} +2 -2
  71. package/dist/{chunk-KSR7RGQY.js → chunk-O4N5BQ3T.js} +10 -10
  72. package/dist/{chunk-5ZR3APIM.js → chunk-OC7VWJBZ.js} +39 -40
  73. package/dist/chunk-OFNMHPBT.js +89 -0
  74. package/dist/{chunk-YSBHPOY6.js → chunk-OWTG6UMO.js} +21 -21
  75. package/dist/{chunk-7RQXA5GG.js → chunk-OY7WZI7Q.js} +13 -12
  76. package/dist/{chunk-5CV5ITZF.js → chunk-OZWXLJMX.js} +2 -2
  77. package/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
  78. package/dist/chunk-PKLB2XJL.js +8 -0
  79. package/dist/{chunk-DQXSPYRI.js → chunk-PKSUMEPT.js} +17 -4
  80. package/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
  81. package/dist/{chunk-4AVZ3TG7.js → chunk-R2QQC33W.js} +14 -14
  82. package/dist/{chunk-GMTFDAOK.js → chunk-R4QWJQ2H.js} +11 -11
  83. package/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
  84. package/dist/{chunk-SJJYRZB4.js → chunk-RZG472YW.js} +116 -26
  85. package/dist/{chunk-NIU2IPC5.js → chunk-SDFKOLSF.js} +6 -6
  86. package/dist/{chunk-H7HTEQUZ.js → chunk-SFLHSL5R.js} +9 -9
  87. package/dist/{chunk-FA5LDARD.js → chunk-SP4TFY5F.js} +14 -13
  88. package/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
  89. package/dist/{chunk-T7FTXGS3.js → chunk-T2S3FNNJ.js} +44 -42
  90. package/dist/{chunk-S67UJDGQ.js → chunk-TV6RXRYH.js} +10 -10
  91. package/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
  92. package/dist/{chunk-WIZWZR4C.js → chunk-UHHLR2VY.js} +43 -41
  93. package/dist/chunk-UYXV5NIS.js +20 -0
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
  95. package/dist/{chunk-FFL3A2VP.js → chunk-VN3L2JWZ.js} +46 -72
  96. package/dist/{chunk-Z7IGUAXL.js → chunk-VOP4PJKA.js} +12 -8
  97. package/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
  98. package/dist/{chunk-NNKXDXXS.js → chunk-VPLBLWFO.js} +14 -8
  99. package/dist/chunk-W3BGKBBK.js +27 -0
  100. package/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
  101. package/dist/{chunk-Q3UZHW6N.js → chunk-WMDUT4KH.js} +1150 -1138
  102. package/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
  103. package/dist/chunk-WXUDRAG6.js +24 -0
  104. package/dist/{chunk-OLAWH5UQ.js → chunk-X35S7HSB.js} +29 -10
  105. package/dist/{chunk-YBSONGSZ.js → chunk-X66YJ2SS.js} +40 -34
  106. package/dist/{chunk-U6OC3QEM.js → chunk-XOMGO63G.js} +22 -21
  107. package/dist/{chunk-WQOIR3QY.js → chunk-XWIME22V.js} +13 -13
  108. package/dist/{chunk-3WEPUD2V.js → chunk-XYLC35E4.js} +202 -103
  109. package/dist/{chunk-UCGQT677.js → chunk-YHGYAEFH.js} +18 -18
  110. package/dist/{chunk-V3APN3DY.js → chunk-ZFORSIED.js} +13 -13
  111. package/dist/{chunk-BHUWL2Y3.js → chunk-ZKLTNLAW.js} +64 -73
  112. package/dist/chunk-ZONZ6YY3.js +74 -0
  113. package/dist/chunk-ZSM35JF4.js +30 -0
  114. package/dist/{chunk-PPIBVH4R.js → chunk-ZZDIOAAJ.js} +15 -6
  115. package/dist/index.js +8817 -6239
  116. package/dist/mcp/analyze-cli.js +10 -10
  117. package/dist/mcp/cli.js +44 -42
  118. package/dist/mcp/server.js +2236 -861
  119. package/dist/mcp/worker.js +62 -61
  120. package/dist/probes/installer.js +20 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +29 -11
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/ast-grep_rules_catalog.md +6 -4
  125. package/docs/ci-bot-pr-checks.md +126 -0
  126. package/docs/configuration.md +99 -3
  127. package/docs/defect-shapes.md +68 -11
  128. package/docs/dependencies.md +1 -0
  129. package/docs/engineering-principles.md +27 -2
  130. package/docs/environment-variables.md +14 -0
  131. package/docs/features.md +13 -3
  132. package/docs/globalconfig.md +12 -1
  133. package/docs/invariants/git-guard-host.md +38 -0
  134. package/docs/invariants/language-config.md +15 -4
  135. package/docs/invariants/lsp-trust-exec.md +22 -2
  136. package/docs/invariants/paths-os.md +4 -2
  137. package/docs/invariants/session-telemetry.md +42 -2
  138. package/docs/lsp-capability-matrix.md +208 -84
  139. package/docs/lsp-idle-eviction.md +3 -5
  140. package/docs/merge-queue-rollout.md +1 -1
  141. package/docs/pi-lens-fixer.md +31 -17
  142. package/docs/pi-lens-merge-policy.md +27 -15
  143. package/docs/pi-lens-monitor.md +9 -0
  144. package/docs/pi-lens-orchestration.md +4 -1
  145. package/docs/pi-lens-reviewer.md +5 -5
  146. package/docs/pi-lens-subagent.md +13 -7
  147. package/docs/public-api-stability.md +18 -2
  148. package/docs/schema/pi-lens-config-v1.json +33 -0
  149. package/docs/servercapabilities.md +1 -1
  150. package/docs/settings.md +15 -6
  151. package/docs/usage.md +5 -0
  152. package/docs/word-index.md +17 -5
  153. package/package.json +5 -3
  154. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  155. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  156. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  157. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  158. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  159. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  160. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  161. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  162. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  163. package/dist/chunk-2F47TQOA.js +0 -73
  164. package/dist/chunk-2X4VLOCC.js +0 -55
  165. package/dist/chunk-4WX4CTUE.js +0 -57
  166. package/dist/chunk-FJIVKLPH.js +0 -31
  167. package/dist/chunk-G2B7F6ZU.js +0 -88
  168. package/dist/chunk-GTAI2J6U.js +0 -27
  169. package/dist/chunk-IPDG45G5.js +0 -26
  170. package/dist/chunk-P4QNXS6I.js +0 -27
  171. package/dist/chunk-Q6D6VMI4.js +0 -22
  172. package/dist/chunk-SXGD4ANG.js +0 -25
  173. package/dist/chunk-XCUHKYCQ.js +0 -23
  174. package/dist/chunk-YRD4ISED.js +0 -30
@@ -0,0 +1,31 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ calcCyclomaticComplexity,
4
+ functionFactProvider
5
+ } from "./chunk-6YUNI7B5.js";
6
+ import "./chunk-7TNILKGY.js";
7
+ import "./chunk-5W3R6LFT.js";
8
+ import "./chunk-BHWW6FAX.js";
9
+ import "./chunk-Z54ZSOBZ.js";
10
+ import "./chunk-HHR7WGCI.js";
11
+ import "./chunk-HKIL6DCL.js";
12
+ import "./chunk-PPKECBPP.js";
13
+ import "./chunk-JYLOYTZD.js";
14
+ import "./chunk-JZRP4DGP.js";
15
+ import "./chunk-WMDUT4KH.js";
16
+ import "./chunk-G5GV2Q7K.js";
17
+ import "./chunk-X35S7HSB.js";
18
+ import "./chunk-SQC7K3SP.js";
19
+ import "./chunk-JE6HKLC7.js";
20
+ import "./chunk-2453RRJ2.js";
21
+ import "./chunk-WQV6BI4Q.js";
22
+ import "./chunk-S26LC76R.js";
23
+ import "./chunk-565VRUP4.js";
24
+ import "./chunk-VLQ7UKZH.js";
25
+ import "./chunk-LJDODBBZ.js";
26
+ import "./chunk-GMROJJRN.js";
27
+ import "./chunk-NXL4FFQQ.js";
28
+ export {
29
+ calcCyclomaticComplexity,
30
+ functionFactProvider
31
+ };
@@ -3,45 +3,43 @@ import {
3
3
  HardFailureStamps
4
4
  } from "./chunk-7U2IDNXN.js";
5
5
  import {
6
- formatToolFailure
7
- } from "./chunk-SJJYRZB4.js";
6
+ getScratchTreeFnmatchPatterns
7
+ } from "./chunk-KZ4ALBCH.js";
8
8
  import {
9
9
  firstOutputLine,
10
+ formatToolFailure,
10
11
  spawnFailedWithNoOutput
11
- } from "./chunk-2X4VLOCC.js";
12
- import {
13
- getScratchTreeFnmatchPatterns
14
- } from "./chunk-AMXIUN2R.js";
12
+ } from "./chunk-RZG472YW.js";
15
13
  import {
16
14
  extractTomlTableSection,
17
15
  parseTomlStringArray
18
- } from "./chunk-ZKXQKGWZ.js";
16
+ } from "./chunk-WC6WRNQT.js";
19
17
  import {
20
18
  findLocalBinsAt
21
- } from "./chunk-Z7IGUAXL.js";
19
+ } from "./chunk-VOP4PJKA.js";
22
20
  import {
23
21
  probeToolAsync
24
- } from "./chunk-ARD426WI.js";
22
+ } from "./chunk-JBP7KESM.js";
25
23
  import {
26
24
  classifyProbeFailure,
27
25
  createAvailabilityLatch,
28
26
  logAvailabilityDecision,
29
27
  startHostStallSampler
30
- } from "./chunk-5APMQ2IJ.js";
28
+ } from "./chunk-JZRP4DGP.js";
31
29
  import {
32
30
  VENV_BIN_DIRS,
33
31
  listNestedLinkedWorktreeRoots,
34
32
  safeSpawnAsync
35
- } from "./chunk-Q3UZHW6N.js";
33
+ } from "./chunk-WMDUT4KH.js";
36
34
  import {
37
35
  incrementDegradationCount
38
- } from "./chunk-ZQ6NZZTB.js";
36
+ } from "./chunk-2453RRJ2.js";
39
37
  import {
40
38
  createSubsystemLogger
41
- } from "./chunk-KXF5R4UN.js";
39
+ } from "./chunk-WQV6BI4Q.js";
42
40
  import {
43
41
  findNearestMarkerRoot
44
- } from "./chunk-PQJFG24Z.js";
42
+ } from "./chunk-GMROJJRN.js";
45
43
 
46
44
  // dist/clients/dead-code-client.js
47
45
  import * as fs from "node:fs";
@@ -1,58 +1,59 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  buildModuleGraph
4
- } from "./chunk-63RIVFQI.js";
4
+ } from "./chunk-CUDD35TW.js";
5
5
  import {
6
6
  aliasedImportTargets,
7
7
  referencedProjectImportTarget
8
- } from "./chunk-PKES3ISE.js";
8
+ } from "./chunk-7ANZ7XDD.js";
9
9
  import {
10
10
  getSharedTreeSitterClient,
11
11
  loadWebTreeSitter,
12
12
  logTreeSitterDiagnostic,
13
13
  resolveTreeSitterLanguage,
14
14
  wasmQueryInput
15
- } from "./chunk-GAACZY6R.js";
15
+ } from "./chunk-BHWW6FAX.js";
16
16
  import {
17
17
  EXTENSION_TO_GRAMMAR,
18
18
  KIND_TO_GRAMMAR
19
- } from "./chunk-YISME6ON.js";
19
+ } from "./chunk-PPKECBPP.js";
20
20
  import {
21
21
  HOOK_WALL_BUDGET_MS
22
22
  } from "./chunk-CKEQFGLT.js";
23
23
  import {
24
24
  bounded
25
- } from "./chunk-CJYKEW2L.js";
25
+ } from "./chunk-JYLOYTZD.js";
26
26
  import {
27
27
  hashContentBytes,
28
28
  toRunnerDisplayPath
29
- } from "./chunk-NNKXDXXS.js";
29
+ } from "./chunk-VPLBLWFO.js";
30
30
  import {
31
31
  loadPiLensGlobalConfig
32
- } from "./chunk-Q3UZHW6N.js";
32
+ } from "./chunk-WMDUT4KH.js";
33
33
  import {
34
34
  isFileKind
35
- } from "./chunk-RZOXUSPC.js";
35
+ } from "./chunk-G5GV2Q7K.js";
36
36
  import {
37
37
  isDeclarationFile
38
- } from "./chunk-OLAWH5UQ.js";
38
+ } from "./chunk-X35S7HSB.js";
39
39
  import {
40
40
  incrementDegradationCount,
41
41
  recordDegradationOnce
42
- } from "./chunk-ZQ6NZZTB.js";
42
+ } from "./chunk-2453RRJ2.js";
43
43
  import {
44
44
  freshnessFromMtime
45
45
  } from "./chunk-S26LC76R.js";
46
46
  import {
47
47
  toPositiveFinite
48
- } from "./chunk-VSFLRN5Y.js";
48
+ } from "./chunk-VLQ7UKZH.js";
49
49
  import {
50
50
  BoundedFifoMap,
51
51
  BoundedLruCache,
52
52
  isUnderDir,
53
53
  normalizeEphemeralMapKey,
54
- normalizeMapKey
55
- } from "./chunk-PQJFG24Z.js";
54
+ normalizeMapKey,
55
+ walkUpDirs
56
+ } from "./chunk-GMROJJRN.js";
56
57
 
57
58
  // dist/clients/blocker-freshness.js
58
59
  import * as fs4 from "node:fs";
@@ -652,11 +653,10 @@ function resolveCxx(cwd, filePath, source) {
652
653
  function pythonRoots(cwd, fileDir) {
653
654
  let p = fileDir;
654
655
  const root = path2.resolve(cwd);
655
- while (isFile(path2.join(p, "__init__.py")) && isWithin(cwd, p)) {
656
- const parent = path2.dirname(p);
657
- if (parent === p)
656
+ for (const dir of walkUpDirs(fileDir, { spelling: true })) {
657
+ p = dir;
658
+ if (!(isFile(path2.join(dir, "__init__.py")) && isWithin(cwd, dir)))
658
659
  break;
659
- p = parent;
660
660
  }
661
661
  const roots = /* @__PURE__ */ new Set([p, root, path2.join(root, "src")]);
662
662
  return [...roots].filter((r) => isDir(r));
@@ -691,9 +691,11 @@ function resolvePython(cwd, filePath, source) {
691
691
  return [];
692
692
  }
693
693
  function findGoModule(cwd, filePath) {
694
- let dir = path2.dirname(path2.resolve(filePath));
694
+ const start = path2.dirname(path2.resolve(filePath));
695
695
  const root = path2.resolve(cwd);
696
- while (true) {
696
+ for (const dir of walkUpDirs(start, { spelling: true })) {
697
+ if (dir !== start && !isWithin(cwd, dir))
698
+ break;
697
699
  try {
698
700
  const content = fs3.readFileSync(path2.join(dir, "go.mod"), "utf-8");
699
701
  const m = content.match(/^[^\S\n\r\u2028\u2029]*module\s+(\S+)/m);
@@ -703,10 +705,6 @@ function findGoModule(cwd, filePath) {
703
705
  }
704
706
  if (dir === root)
705
707
  break;
706
- const parent = path2.dirname(dir);
707
- if (parent === dir || !isWithin(cwd, parent))
708
- break;
709
- dir = parent;
710
708
  }
711
709
  return null;
712
710
  }
@@ -726,15 +724,13 @@ function javaSourceRoots(cwd, filePath) {
726
724
  for (const c of ["src/main/java", "src/test/java", "src", ""]) {
727
725
  roots.add(path2.join(root, c));
728
726
  }
729
- let p = path2.dirname(path2.resolve(filePath));
730
- while (true) {
731
- roots.add(p);
732
- if (p === root)
727
+ const start = path2.dirname(path2.resolve(filePath));
728
+ for (const dir of walkUpDirs(start, { spelling: true })) {
729
+ if (dir !== start && !isWithin(cwd, dir))
733
730
  break;
734
- const parent = path2.dirname(p);
735
- if (parent === p || !isWithin(cwd, parent))
731
+ roots.add(dir);
732
+ if (dir === root)
736
733
  break;
737
- p = parent;
738
734
  }
739
735
  return [...roots].filter((r) => isDir(r));
740
736
  }
@@ -1563,7 +1559,8 @@ var TreeSitterSymbolExtractor = class _TreeSitterSymbolExtractor {
1563
1559
  definitions: this.defQuery ? "complete" : "unavailable",
1564
1560
  references: this.refQuery ? "complete" : "unavailable",
1565
1561
  imports: this.importQuery ? "complete" : "unavailable"
1566
- }
1562
+ },
1563
+ ...tree.rootNode.hasError === true ? { syntaxErrors: true } : {}
1567
1564
  };
1568
1565
  }
1569
1566
  /**
@@ -1671,7 +1668,10 @@ var TreeSitterSymbolExtractor = class _TreeSitterSymbolExtractor {
1671
1668
  ...visibility ? { visibility } : {},
1672
1669
  ...decorators.length > 0 ? { decorators } : {},
1673
1670
  ...isAsync ? { isAsync: true } : {},
1674
- ...docInfo ? { doc: docInfo.text, docStartLine: docInfo.startLine } : {}
1671
+ ...docInfo ? {
1672
+ doc: docInfo.text,
1673
+ ...docInfo.startLine !== void 0 ? { docStartLine: docInfo.startLine } : {}
1674
+ } : {}
1675
1675
  };
1676
1676
  }
1677
1677
  // Comment node kinds across grammars that use tree-sitter's conventional
@@ -1695,9 +1695,23 @@ var TreeSitterSymbolExtractor = class _TreeSitterSymbolExtractor {
1695
1695
  * summarized text (`doc`) and the 1-based start line of the attached comment
1696
1696
  * block (`docStartLine`, #523) — readSymbol extends its returned range to that
1697
1697
  * line so an agent reading a symbol sees its contract, not just its body.
1698
+ * A Python docstring (#4948) is the first string statement INSIDE the body, so
1699
+ * it yields `text` only: its `startLine` stays undefined, because a start line
1700
+ * below the signature would make readSymbol's range cut the signature off.
1698
1701
  */
1699
1702
  // biome-ignore lint/suspicious/noExplicitAny: web-tree-sitter node
1700
1703
  extractDocCommentInfo(declNode) {
1704
+ if (this.languageId === "python" && (declNode.type === "function_definition" || declNode.type === "class_definition")) {
1705
+ const first = declNode.childForFieldName("body")?.namedChild(0);
1706
+ let expr = first?.type === "expression_statement" ? first.namedChild(0) : void 0;
1707
+ if (expr?.type === "parenthesized_expression")
1708
+ expr = expr.namedChild(0);
1709
+ const parts = expr?.type === "concatenated_string" ? expr.namedChildren : expr ? [expr] : [];
1710
+ const bodies = parts.map((part) => part.type === "string" ? /^[rRuU]?("""|'''|"|')([\s\S]*)\1$/.exec(String(part.text))?.[2] : void 0);
1711
+ const text2 = bodies.length > 0 && bodies.every((x) => x !== void 0) ? this.summarizeDocComment(bodies.join("")) : void 0;
1712
+ if (text2)
1713
+ return { text: text2 };
1714
+ }
1701
1715
  const isComment = (n) => !!n && n.type === _TreeSitterSymbolExtractor.COMMENT_NODE_KIND;
1702
1716
  const isDeco = (n) => !!n && _TreeSitterSymbolExtractor.DECORATOR_NODE_KINDS.has(n.type);
1703
1717
  const sameStartRow = (a, b) => a?.startPosition?.row === b?.startPosition?.row;
@@ -1907,6 +1921,7 @@ var TreeSitterSymbolExtractor = class _TreeSitterSymbolExtractor {
1907
1921
 
1908
1922
  // dist/clients/blocker-freshness.js
1909
1923
  var DEPENDENCY_DRIFT_MAX_DELIVERIES = 3;
1924
+ var SELF_DRIFT_MAX_DELIVERIES = 3;
1910
1925
  var SELF_DRIFT_HASH_BUDGET_BYTES = 8 * 1024 * 1024;
1911
1926
  var MAX_IMPLICIT_SCOPE_PARSES = 32;
1912
1927
  var GLOBAL_SCOPE_ROLE_MEMO_ENTRIES = 1024;
@@ -2282,7 +2297,9 @@ async function sweepInlineBlockerFreshness(runtime, cwd, options) {
2282
2297
  }
2283
2298
  let inlineEntries;
2284
2299
  try {
2285
- inlineEntries = runtime.getInlineBlockersSnapshot();
2300
+ inlineEntries = runtime.getInlineBlockersSnapshot({
2301
+ sessionId: options?.sessionId
2302
+ });
2286
2303
  } catch {
2287
2304
  return counts;
2288
2305
  }
@@ -2477,6 +2494,7 @@ export {
2477
2494
  symbolExtractionGrammar,
2478
2495
  TreeSitterSymbolExtractor,
2479
2496
  DEPENDENCY_DRIFT_MAX_DELIVERIES,
2497
+ SELF_DRIFT_MAX_DELIVERIES,
2480
2498
  _getForwardImportParsesForTests,
2481
2499
  extractForwardImports,
2482
2500
  extractForwardImportPaths,
@@ -0,0 +1,27 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ RustClient,
4
+ resetRustAvailability,
5
+ rustClient
6
+ } from "./chunk-4W52ZKZX.js";
7
+ import "./chunk-BUZIQDFS.js";
8
+ import "./chunk-JBP7KESM.js";
9
+ import "./chunk-JZRP4DGP.js";
10
+ import "./chunk-WMDUT4KH.js";
11
+ import "./chunk-AWQWXSW4.js";
12
+ import "./chunk-X35S7HSB.js";
13
+ import "./chunk-SQC7K3SP.js";
14
+ import "./chunk-JE6HKLC7.js";
15
+ import "./chunk-2453RRJ2.js";
16
+ import "./chunk-WQV6BI4Q.js";
17
+ import "./chunk-S26LC76R.js";
18
+ import "./chunk-565VRUP4.js";
19
+ import "./chunk-VLQ7UKZH.js";
20
+ import "./chunk-LJDODBBZ.js";
21
+ import "./chunk-GMROJJRN.js";
22
+ import "./chunk-NXL4FFQQ.js";
23
+ export {
24
+ RustClient,
25
+ resetRustAvailability,
26
+ rustClient
27
+ };
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  createToolchainAvailability
4
- } from "./chunk-EVDGNG4F.js";
4
+ } from "./chunk-BUZIQDFS.js";
5
5
  import {
6
6
  createSubsystemLogger
7
- } from "./chunk-KXF5R4UN.js";
7
+ } from "./chunk-WQV6BI4Q.js";
8
8
 
9
9
  // dist/clients/go-client.js
10
10
  import * as path from "node:path";
@@ -0,0 +1,25 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ getSourceFiles,
4
+ getSourceFilesAsync
5
+ } from "./chunk-BBET6HD6.js";
6
+ import "./chunk-G6JKM4O7.js";
7
+ import "./chunk-O2ARHQKF.js";
8
+ import "./chunk-WMDUT4KH.js";
9
+ import "./chunk-QYF5S6P6.js";
10
+ import "./chunk-G5GV2Q7K.js";
11
+ import "./chunk-X35S7HSB.js";
12
+ import "./chunk-SQC7K3SP.js";
13
+ import "./chunk-JE6HKLC7.js";
14
+ import "./chunk-2453RRJ2.js";
15
+ import "./chunk-WQV6BI4Q.js";
16
+ import "./chunk-S26LC76R.js";
17
+ import "./chunk-565VRUP4.js";
18
+ import "./chunk-VLQ7UKZH.js";
19
+ import "./chunk-LJDODBBZ.js";
20
+ import "./chunk-GMROJJRN.js";
21
+ import "./chunk-NXL4FFQQ.js";
22
+ export {
23
+ getSourceFiles,
24
+ getSourceFilesAsync
25
+ };
@@ -2,15 +2,18 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  buildSymbolId
4
4
  } from "./chunk-3MED75HT.js";
5
+ import {
6
+ UNRESOLVED_NAME_NODE_PREFIX
7
+ } from "./chunk-PKLB2XJL.js";
5
8
  import {
6
9
  buildReverseDependencyIndexFromGraph,
7
10
  getLSPService,
8
11
  rankFilesByReverseDependencyCentrality
9
- } from "./chunk-GZE7WOI4.js";
12
+ } from "./chunk-2BKUFQKR.js";
10
13
  import {
11
14
  notePersistWorkerMessageFault,
12
15
  readWorkerHeapStatistics
13
- } from "./chunk-PPIBVH4R.js";
16
+ } from "./chunk-ZZDIOAAJ.js";
14
17
  import {
15
18
  buildQualifiedName,
16
19
  findOwnerName
@@ -26,48 +29,48 @@ import {
26
29
  resolveProjectReferenceImport,
27
30
  resolveWorkspacePackageImport,
28
31
  symbolExtractionGrammar
29
- } from "./chunk-OJLTLYHB.js";
32
+ } from "./chunk-35WKJWO5.js";
30
33
  import {
31
34
  classifyTreeSitterWasmError,
32
35
  getSharedTreeSitterClient,
33
36
  logTreeSitterCacheStats,
34
37
  withTreeSitterRoot
35
- } from "./chunk-GAACZY6R.js";
38
+ } from "./chunk-BHWW6FAX.js";
36
39
  import {
37
40
  getReviewGraphMaxFilesDerived
38
- } from "./chunk-ZYNI26MI.js";
41
+ } from "./chunk-HXFUTMX2.js";
39
42
  import {
40
43
  readGzipStageWorkerResult,
41
44
  reapStageFile
42
45
  } from "./chunk-IJYGIDF4.js";
43
46
  import {
44
47
  collectSourceFilesWithBudgetAsync
45
- } from "./chunk-2RLWJO5K.js";
48
+ } from "./chunk-G6JKM4O7.js";
46
49
  import {
47
50
  collectUntrackedIgnoredIds,
48
51
  createGitIdentityResolver,
49
52
  getProjectDataDir,
50
53
  isStaleStageFile,
51
54
  resolveGitIdentity
52
- } from "./chunk-Q3UZHW6N.js";
55
+ } from "./chunk-WMDUT4KH.js";
53
56
  import {
54
57
  KIND_EXTENSIONS,
55
58
  detectFileKind
56
- } from "./chunk-RZOXUSPC.js";
59
+ } from "./chunk-G5GV2Q7K.js";
57
60
  import {
58
61
  detectFileRole
59
- } from "./chunk-OLAWH5UQ.js";
62
+ } from "./chunk-X35S7HSB.js";
60
63
  import {
61
64
  writeFileAtomic
62
- } from "./chunk-MN7MHUXQ.js";
65
+ } from "./chunk-JE6HKLC7.js";
63
66
  import {
64
67
  compareOrdinal,
65
68
  escapeRegExp,
66
69
  incrementDegradationCount
67
- } from "./chunk-ZQ6NZZTB.js";
70
+ } from "./chunk-2453RRJ2.js";
68
71
  import {
69
72
  logLatency
70
- } from "./chunk-Z2XAOKHK.js";
73
+ } from "./chunk-565VRUP4.js";
71
74
  import {
72
75
  createNdjsonLogger,
73
76
  getGlobalPiLensLogDir,
@@ -75,10 +78,10 @@ import {
75
78
  getTurnId,
76
79
  isTestMode,
77
80
  lazyEnvNumber
78
- } from "./chunk-VSFLRN5Y.js";
81
+ } from "./chunk-VLQ7UKZH.js";
79
82
  import {
80
83
  FactStore
81
- } from "./chunk-OSTKYB55.js";
84
+ } from "./chunk-4BKU7PV3.js";
82
85
  import {
83
86
  BoundedFifoMap,
84
87
  BoundedLruCache,
@@ -86,12 +89,15 @@ import {
86
89
  isUnderDir,
87
90
  normalizeFilePath,
88
91
  normalizeMapKey,
92
+ realpathOrResolve,
93
+ toPosix,
89
94
  toProjectRelativePath
90
- } from "./chunk-PQJFG24Z.js";
95
+ } from "./chunk-GMROJJRN.js";
91
96
 
92
97
  // dist/clients/review-graph/builder.js
93
98
  import { createHash as createHash2 } from "node:crypto";
94
99
  import * as fs2 from "node:fs";
100
+ import * as os from "node:os";
95
101
  import * as path2 from "node:path";
96
102
  import { Worker } from "node:worker_threads";
97
103
  import { constants as zlibConstants, gunzipSync, gzipSync } from "node:zlib";
@@ -119,7 +125,7 @@ var fileContentProvider = {
119
125
 
120
126
  // dist/clients/feature-hints.js
121
127
  function normalizeHintInput(value) {
122
- return value.replace(/\\/g, "/");
128
+ return toPosix(value);
123
129
  }
124
130
  function hasHintToken(value, tokens) {
125
131
  const escaped = tokens.map((token) => escapeRegExp(token));
@@ -2478,8 +2484,8 @@ async function ensureReviewGraphFacts(filePath, cwd, facts, contentOverride) {
2478
2484
  }
2479
2485
  try {
2480
2486
  const [{ importFactProvider }, { functionFactProvider }] = await Promise.all([
2481
- import("./chunk-YRD4ISED.js"),
2482
- import("./chunk-FJIVKLPH.js")
2487
+ import("./chunk-ZSM35JF4.js"),
2488
+ import("./chunk-2TS4GLOJ.js")
2483
2489
  ]);
2484
2490
  await importFactProvider.run(ctx, facts);
2485
2491
  await functionFactProvider.run(ctx, facts);
@@ -2654,7 +2660,7 @@ function addJsTsFile(graph, cwd, filePath, facts, ignoredIds) {
2654
2660
  for (const callee of fn.outgoingCalls) {
2655
2661
  if (memberCallTexts.has(callee))
2656
2662
  continue;
2657
- const targetId = callee.includes(".") ? `external:${callee}` : `symbol-name:${callee}`;
2663
+ const targetId = callee.includes(".") ? `external:${callee}` : `${UNRESOLVED_NAME_NODE_PREFIX}${callee}`;
2658
2664
  if (!graph.nodes.has(targetId)) {
2659
2665
  addNode(graph, {
2660
2666
  id: targetId,
@@ -2853,7 +2859,7 @@ function addTreeSitterFile(graph, cwd, filePath, languageId, extracted, ignoredI
2853
2859
  }
2854
2860
  for (const ref of extracted.refs) {
2855
2861
  const refName = ref.symbolName ?? ref.symbolId;
2856
- const targetId = `symbol-name:${refName}`;
2862
+ const targetId = `${UNRESOLVED_NAME_NODE_PREFIX}${refName}`;
2857
2863
  if (!graph.nodes.has(targetId)) {
2858
2864
  addNode(graph, {
2859
2865
  id: targetId,
@@ -3604,7 +3610,7 @@ async function _doBuildGraph(cwd, changedFiles, facts, seqHint, buildId) {
3604
3610
  const normalizedChanged = changedFiles.map((file) => normalizeMapKey(file));
3605
3611
  const normalizedChangedSet = new Set(normalizedChanged);
3606
3612
  logCwdWorktreeMismatchOnce(cwd, resolveIdentity);
3607
- if (isAtOrAboveHomeDir(path2.resolve(cwd))) {
3613
+ if (isAtOrAboveHomeDir(normalizedCwd, realpathOrResolve(os.homedir()))) {
3608
3614
  const graph2 = createEmptyGraph();
3609
3615
  for (const file of normalizedChanged) {
3610
3616
  upsertChangedSymbols(graph2, facts, file);
@@ -4104,7 +4110,7 @@ function extractSymbolsAndRefsFromGraph(graph) {
4104
4110
  const referenceKind = edge.kind === "calls" ? "call" : metadata.referenceKind === "call" ? "call" : metadata.referenceKind === "type" ? "type" : "unknown";
4105
4111
  const resolution = edge.resolution ?? (targetNode && !targetNode.metadata?.unresolvedName ? "exact" : "unresolved");
4106
4112
  const targetSymbol = nodeSymbols.get(edge.to);
4107
- const targetName = targetNode?.symbolName ?? (edge.to.startsWith("symbol-name:") ? edge.to.slice("symbol-name:".length) : void 0);
4113
+ const targetName = targetNode?.symbolName ?? (edge.to.startsWith(UNRESOLVED_NAME_NODE_PREFIX) ? edge.to.slice(UNRESOLVED_NAME_NODE_PREFIX.length) : void 0);
4108
4114
  const line = typeof metadata.line === "number" ? metadata.line : numberMetadata(fromNode, "line") ?? 1;
4109
4115
  const column = typeof metadata.column === "number" ? metadata.column : numberMetadata(fromNode, "column") ?? 1;
4110
4116
  addRef({
@@ -3,7 +3,7 @@ import {
3
3
  BoundedLruCache,
4
4
  BoundedSet,
5
5
  normalizeMapKey
6
- } from "./chunk-PQJFG24Z.js";
6
+ } from "./chunk-GMROJJRN.js";
7
7
 
8
8
  // dist/clients/dispatch/fact-store.js
9
9
  var capacityEvictionReporter;