tensor-grep 1.63.2__tar.gz → 1.63.4__tar.gz

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.

Potentially problematic release.


This version of tensor-grep might be problematic. Click here for more details.

Files changed (131) hide show
  1. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/PKG-INFO +1 -1
  2. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/pyproject.toml +3 -1
  3. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/Cargo.lock +1 -1
  4. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/Cargo.toml +3 -1
  5. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/orient_capsule.py +18 -1
  6. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/repo_map.py +26 -9
  7. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/LICENSE +0 -0
  8. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/NOTICE +0 -0
  9. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/README.md +0 -0
  10. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/deny.toml +0 -0
  11. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/rust-toolchain.toml +0 -0
  12. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/backend_ast.rs +0 -0
  13. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/backend_ast_workflow.rs +0 -0
  14. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/backend_cpu.rs +0 -0
  15. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/bin/tg_search_fast.rs +0 -0
  16. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/cli.rs +0 -0
  17. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/crossover.rs +0 -0
  18. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/editor_plane.rs +0 -0
  19. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/gpu_native.rs +0 -0
  20. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/index.rs +0 -0
  21. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/lib.rs +0 -0
  22. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/main.rs +0 -0
  23. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/mmap_arrow.rs +0 -0
  24. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/native_search.rs +0 -0
  25. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/python_sidecar.rs +0 -0
  26. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/rg_passthrough.rs +0 -0
  27. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/routing.rs +0 -0
  28. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/src/runtime_paths.rs +0 -0
  29. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_ast_backend.rs +0 -0
  30. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_ast_cache.rs +0 -0
  31. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_ast_grep_embed.rs +0 -0
  32. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_ast_rewrite.rs +0 -0
  33. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_audit_manifest_symlink_unix.rs +0 -0
  34. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native.rs +0 -0
  35. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native_error_handling.rs +0 -0
  36. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native_graphs.rs +0 -0
  37. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native_integration.rs +0 -0
  38. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native_long_lines.rs +0 -0
  39. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_gpu_native_streams.rs +0 -0
  40. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_index.rs +0 -0
  41. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_mmap_arrow.rs +0 -0
  42. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_native_search.rs +0 -0
  43. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_output.rs +0 -0
  44. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_public_native_cli_parity.rs +0 -0
  45. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_python_bootstrap.rs +0 -0
  46. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_release_profile.rs +0 -0
  47. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_replace.rs +0 -0
  48. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_resident_worker.rs +0 -0
  49. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_routing.rs +0 -0
  50. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_runtime_path_resolution.rs +0 -0
  51. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_schema_compat.rs +0 -0
  52. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_search.rs +0 -0
  53. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_search_golden.rs +0 -0
  54. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_sidecar_ipc.rs +0 -0
  55. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/rust_core/tests/test_smart_routing.rs +0 -0
  56. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/__init__.py +0 -0
  57. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/__main__.py +0 -0
  58. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/__init__.py +0 -0
  59. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/ast_backend.py +0 -0
  60. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/ast_wrapper_backend.py +0 -0
  61. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/base.py +0 -0
  62. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/cpu_backend.py +0 -0
  63. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/cudf_backend.py +0 -0
  64. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/cybert_backend.py +0 -0
  65. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/ripgrep_backend.py +0 -0
  66. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/rust_backend.py +0 -0
  67. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/stringzilla_backend.py +0 -0
  68. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/backends/torch_backend.py +0 -0
  69. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/__init__.py +0 -0
  70. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/_index_lock.py +0 -0
  71. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/agent_capsule.py +0 -0
  72. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/apply_policy.py +0 -0
  73. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/ast_workflows.py +0 -0
  74. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/audit_manifest.py +0 -0
  75. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/bootstrap.py +0 -0
  76. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/checkpoint_store.py +0 -0
  77. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/commands.py +0 -0
  78. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/docs_coverage.py +0 -0
  79. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/dogfood.py +0 -0
  80. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/evidence_receipt.py +0 -0
  81. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/__init__.py +0 -0
  82. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/base.py +0 -0
  83. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/csv_fmt.py +0 -0
  84. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/json_fmt.py +0 -0
  85. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/ripgrep_fmt.py +0 -0
  86. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/formatters/table_fmt.py +0 -0
  87. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/inventory.py +0 -0
  88. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/lang_go.py +0 -0
  89. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/lang_registry.py +0 -0
  90. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/lsp_external_provider.py +0 -0
  91. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/lsp_provider_setup.py +0 -0
  92. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/lsp_server.py +0 -0
  93. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/main.py +0 -0
  94. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/mcp_server.py +0 -0
  95. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/progress.py +0 -0
  96. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/rg_contract.py +0 -0
  97. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/rule_packs.py +0 -0
  98. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/runtime_paths.py +0 -0
  99. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/scan_guardrails.py +0 -0
  100. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/session_daemon.py +0 -0
  101. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/session_store.py +0 -0
  102. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/cli/subprocess_policy.py +0 -0
  103. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/__init__.py +0 -0
  104. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/config.py +0 -0
  105. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/hardware/__init__.py +0 -0
  106. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/hardware/device_detect.py +0 -0
  107. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/hardware/device_inventory.py +0 -0
  108. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/hardware/memory_manager.py +0 -0
  109. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/observability.py +0 -0
  110. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/pipeline.py +0 -0
  111. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/query_analyzer.py +0 -0
  112. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/registration_check.py +0 -0
  113. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/reranker.py +0 -0
  114. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/result.py +0 -0
  115. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_bm25.py +0 -0
  116. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_chunker.py +0 -0
  117. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_dense.py +0 -0
  118. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_fusion.py +0 -0
  119. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_late.py +0 -0
  120. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_lexical.py +0 -0
  121. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/retrieval_scoring.py +0 -0
  122. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/core/semantic_index.py +0 -0
  123. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/__init__.py +0 -0
  124. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/base.py +0 -0
  125. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/directory_scanner.py +0 -0
  126. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/reader_cudf.py +0 -0
  127. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/reader_dstorage.py +0 -0
  128. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/reader_fallback.py +0 -0
  129. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/io/reader_kvikio.py +0 -0
  130. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/perf_guard.py +0 -0
  131. {tensor_grep-1.63.2 → tensor_grep-1.63.4}/src/tensor_grep/sidecar.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tensor-grep
3
- Version: 1.63.2
3
+ Version: 1.63.4
4
4
  Requires-Dist: typer>=0.12,<0.26
5
5
  Requires-Dist: rich>=13.0
6
6
  Requires-Dist: mcp>=1.2.0
@@ -482,12 +482,14 @@ version_variables = [
482
482
 
483
483
 
484
484
 
485
+
486
+
485
487
 
486
488
 
487
489
 
488
490
  [project]
489
491
  name = "tensor-grep"
490
- version = "1.63.2"
492
+ version = "1.63.4"
491
493
  description = "High-performance grep-compatible CLI with Rust, GPU, and AST/NLP routing"
492
494
  readme = { file = "rust_core/README.md", content-type = "text/markdown" }
493
495
  requires-python = ">=3.11"
@@ -1579,7 +1579,7 @@ dependencies = [
1579
1579
 
1580
1580
  [[package]]
1581
1581
  name = "tensor_grep_rs"
1582
- version = "1.63.2"
1582
+ version = "1.63.4"
1583
1583
  dependencies = [
1584
1584
  "aho-corasick",
1585
1585
  "anyhow",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "tensor_grep_rs"
3
- version = "1.63.2"
3
+ version = "1.63.4"
4
4
  edition = "2021"
5
5
  description = "Rust core engine for tensor-grep"
6
6
  license = "Apache-2.0"
@@ -390,6 +390,8 @@ path = "src/bin/tg_search_fast.rs"
390
390
 
391
391
 
392
392
 
393
+
394
+
393
395
 
394
396
 
395
397
 
@@ -194,10 +194,27 @@ def _detect_vendored_subtrees(rm: dict[str, Any]) -> dict[str, dict[str, Any]]:
194
194
  _code_files, _resolved_imports, reverse_importers = _code_files_and_import_graph(rm)
195
195
  code_file_set = set(_code_files)
196
196
 
197
+ # Precompute each code file's path-parts relative to root ONCE, on the SAME lexical basis the
198
+ # candidate_dirs scan above used (`Path(f).relative_to(root)`; root is already resolved). Subtree
199
+ # membership is then a cheap tuple-prefix test -- NO per-(subtree, file) filesystem resolve. The
200
+ # old `_path_is_relative_to(Path(f), abs_dir)` did two `.resolve()` (realpath) syscalls per pair,
201
+ # i.e. O(subtrees x files) realpath calls: ~15% of `tg agent` wall on an 872-file repo and
202
+ # pathological on WSL 9p mounts (profile 2026-07-11). A file not lexically under root never
203
+ # contributed a candidate dir, so it cannot belong to any detected subtree -- skipping it here is
204
+ # consistent with how the subtrees were found.
205
+ code_rel_parts: list[tuple[str, tuple[str, ...]]] = []
206
+ for f in code_file_set:
207
+ try:
208
+ code_rel_parts.append((f, Path(f).relative_to(root).parts))
209
+ except ValueError:
210
+ continue
211
+
197
212
  result: dict[str, dict[str, Any]] = {}
198
213
  for rel_dir in subtree_rel_roots:
199
214
  abs_dir = root / rel_dir
200
- tree_files = {f for f in code_file_set if _repo_map._path_is_relative_to(Path(f), abs_dir)}
215
+ prefix = rel_dir.parts
216
+ depth = len(prefix)
217
+ tree_files = {f for f, parts in code_rel_parts if parts[:depth] == prefix}
201
218
  if not tree_files:
202
219
  continue
203
220
  # An import-island needs POSITIVE evidence of an internally-cohesive-but-externally-isolated
@@ -1661,12 +1661,29 @@ def _python_dynamic_import_entries(tree: ast.AST) -> list[dict[str, Any]]:
1661
1661
  return entries
1662
1662
 
1663
1663
 
1664
+ @lru_cache(maxsize=2048)
1665
+ def _cached_ast_parse(source: str) -> ast.Module:
1666
+ """Content-addressed AST parse cache. `build_agent_capsule` parses each Python file 2-3x
1667
+ across phases -- once in the map-build imports/symbols pass and again in the caller/blast-radius
1668
+ consumer scan (and the `tg imports`/`importers` extractors) -- all on the SAME source read the
1669
+ same way (`path.read_text(encoding="utf-8")`). Profiling `tg agent` on an 872-file repo (2026-
1670
+ 07-11) showed ~40% of the wall in `ast.parse` + `ast.walk` over those duplicate parses (1512
1671
+ parses for ~783 files). Keying on the source TEXT (not the path) is staleness-free: an edited
1672
+ file has different content -> a fresh key -> a fresh parse, so this stays correct even under the
1673
+ reused session-daemon process (no mtime races). Callers only ever READ the tree (`tree.body` /
1674
+ `ast.walk` + `isinstance`, no mutation -- audited), so sharing one parsed tree is safe. Raises
1675
+ on invalid syntax exactly like `ast.parse` (lru_cache does not cache the exception, so a
1676
+ syntax-error file simply re-raises + re-parses each time -- the caller's try/except is
1677
+ unchanged). Bounded at 2048 entries to cap resident memory in the long-lived daemon."""
1678
+ return ast.parse(source)
1679
+
1680
+
1664
1681
  def _python_imports_and_symbols(path: Path) -> tuple[list[str], list[dict[str, Any]]]:
1665
1682
  if path.suffix != ".py":
1666
1683
  return [], []
1667
1684
 
1668
1685
  try:
1669
- tree = ast.parse(path.read_text(encoding="utf-8"))
1686
+ tree = _cached_ast_parse(path.read_text(encoding="utf-8"))
1670
1687
  except (OSError, SyntaxError, UnicodeDecodeError):
1671
1688
  return [], []
1672
1689
 
@@ -3119,7 +3136,7 @@ def _python_file_imports_symbol_from_definition(
3119
3136
  repo_root: Path | str | None = None,
3120
3137
  ) -> bool:
3121
3138
  try:
3122
- tree = ast.parse(source)
3139
+ tree = _cached_ast_parse(source)
3123
3140
  except SyntaxError:
3124
3141
  return False
3125
3142
 
@@ -3314,7 +3331,7 @@ def _python_import_update_target(
3314
3331
  return None
3315
3332
 
3316
3333
  try:
3317
- tree = ast.parse(source)
3334
+ tree = _cached_ast_parse(source)
3318
3335
  except SyntaxError:
3319
3336
  return None
3320
3337
 
@@ -4197,7 +4214,7 @@ def _python_references_and_calls(
4197
4214
 
4198
4215
  try:
4199
4216
  source = path.read_text(encoding="utf-8")
4200
- tree = ast.parse(source)
4217
+ tree = _cached_ast_parse(source)
4201
4218
  except (OSError, SyntaxError, UnicodeDecodeError):
4202
4219
  return [], []
4203
4220
 
@@ -4264,7 +4281,7 @@ def _python_provider_alias_calls(path: Path, symbol: str) -> list[dict[str, Any]
4264
4281
 
4265
4282
  try:
4266
4283
  source = path.read_text(encoding="utf-8")
4267
- tree = ast.parse(source)
4284
+ tree = _cached_ast_parse(source)
4268
4285
  except (OSError, SyntaxError, UnicodeDecodeError):
4269
4286
  return []
4270
4287
 
@@ -5207,7 +5224,7 @@ def _python_symbol_sources(path: Path, symbol: str) -> list[dict[str, Any]]:
5207
5224
 
5208
5225
  try:
5209
5226
  source = path.read_text(encoding="utf-8")
5210
- tree = ast.parse(source)
5227
+ tree = _cached_ast_parse(source)
5211
5228
  except (OSError, SyntaxError, UnicodeDecodeError):
5212
5229
  return []
5213
5230
 
@@ -5674,7 +5691,7 @@ def _python_imports_with_lines(path: Path) -> list[dict[str, Any]]:
5674
5691
  if file_size > _max_parse_bytes():
5675
5692
  return []
5676
5693
  try:
5677
- tree = ast.parse(path.read_text(encoding="utf-8"))
5694
+ tree = _cached_ast_parse(path.read_text(encoding="utf-8"))
5678
5695
  except (OSError, SyntaxError, UnicodeDecodeError):
5679
5696
  return []
5680
5697
 
@@ -8973,7 +8990,7 @@ def _best_test_function_candidate(
8973
8990
  def _python_test_function_candidates(test_path: str) -> tuple[str, ...]:
8974
8991
  path = Path(test_path)
8975
8992
  try:
8976
- tree = ast.parse(path.read_text(encoding="utf-8"))
8993
+ tree = _cached_ast_parse(path.read_text(encoding="utf-8"))
8977
8994
  except (OSError, SyntaxError, UnicodeDecodeError):
8978
8995
  return ()
8979
8996
 
@@ -8996,7 +9013,7 @@ def _python_test_function_candidates(test_path: str) -> tuple[str, ...]:
8996
9013
  def _python_parametrized_test_function_candidates(test_path: str) -> tuple[str, ...]:
8997
9014
  path = Path(test_path)
8998
9015
  try:
8999
- tree = ast.parse(path.read_text(encoding="utf-8"))
9016
+ tree = _cached_ast_parse(path.read_text(encoding="utf-8"))
9000
9017
  except (OSError, SyntaxError, UnicodeDecodeError):
9001
9018
  return ()
9002
9019
 
File without changes
File without changes