Skip to content

Commit d4e7cfe

Browse files
author
MSCodeBase Agent
committed
fix(deps): pin runtime deps to exact versions
Audit finding unpinned-dependency (38 items): manifest kept ranges (>=,<) while requirements-lock.txt froze the extension venv (Python 3.14). Pins: 33 from requirements-lock.txt (live venv); 17 tree-sitter grammars from PyPI latest, API-verified against src/core/indexing/parser.py import patterns (scratch venv, all OK); numpy/pandas/onnxruntime get per-python markers (== on >=3.11, range on <3.11 - lock versions require >=3.11, CI matrix still runs 3.10). requirements.txt now mirrors pyproject and drops the stale CVE note pointing below 4.56.0, contradicting pyproject lower bound 5.3.0.
1 parent 1973e68 commit d4e7cfe

2 files changed

Lines changed: 116 additions & 79 deletions

File tree

pyproject.toml

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ classifiers = [
2424
"Environment :: Plugins",
2525
]
2626
dependencies = [
27+
# Политика пинов (2026-08-18, аудит unpinned-dependency): ВСЕ runtime-зависимости
28+
# запинены к точным версиям (==). Источник версий — requirements-lock.txt (венв
29+
# расширения, Python 3.14, live-проверка) + проверка колёс PyPI на 3.10..3.14.
30+
# Бамп — только по §5.19: проверка API целевой версии + verify_clean_state.
31+
# Исключение: numpy/pandas/onnxruntime на Python<3.11 (CI matrix включает 3.10,
32+
# EOL 2026-10; lock-версия требует >=3.11) — там per-Python диапазон; после дропа 3.10 запинить.
2733
# MCP Protocol
28-
"mcp>=1.0.0,<2", # upper bound: mcp 2.x меняет транспортный протокол
34+
"mcp==1.28.1", # 1.x: транспортный протокол; 2.x меняет его — не бампить без проверки
2935
# LSP Protocol
30-
"pygls>=2.0.0",
31-
"lsprotocol>=24.0.0",
36+
"pygls==2.1.1",
37+
"lsprotocol==2025.0.0",
3238
# Vector DB & Embeddings
3339
# Pinned: lancedb 0.x менял публичный API внутри минорных релизов
3440
# (сломал тест-сьют 2026-07 через lancedb.LanceDB). Ребилд/бамп —
@@ -38,50 +44,56 @@ dependencies = [
3844
# (known_hashes bulk load, index_project_runner.py). Проверено 2026-08-01:
3945
# pylance 9.0.0 + lance-namespace 0.8.6, API to_lance().to_pandas() работает.
4046
"pylance==9.0.0",
41-
"pyarrow>=14.0.0", # + pyarrow.compute для to_arrow
42-
"huggingface_hub>=0.20.0",
43-
"numpy>=1.24.0,<3", # upper bound: numpy 3.x ломает ABI для pyarrow/onnxruntime
47+
"pyarrow==25.0.0", # + pyarrow.compute для to_arrow
48+
"huggingface_hub==1.24.0",
49+
"numpy==2.4.6; python_version >= '3.11'",
50+
"numpy>=1.24.0,<3; python_version < '3.11'", # 3.10: lock-версия требует >=3.11
4451
# Code parsing (Tree-sitter) — 23 пакета для 23 языков
45-
# Core: полный граф (chunking + calls + data flow + imports)
46-
"tree-sitter>=0.21.0,<1",
47-
"tree-sitter-python>=0.21.0,<1",
48-
"tree-sitter-rust>=0.21.0,<1",
49-
"tree-sitter-typescript>=0.21.0,<1", # .ts/.tsx
50-
"tree-sitter-javascript>=0.21.0,<1", # .js/.jsx
51-
"tree-sitter-go>=0.21.0,<1",
52-
"tree-sitter-java>=0.23.0,<1",
53-
"tree-sitter-c-sharp>=0.23.0,<1",
54-
"tree-sitter-ruby>=0.23.0,<1",
55-
"tree-sitter-php>=0.24.0,<1",
56-
"tree-sitter-kotlin>=1.1.0,<2",
57-
"tree-sitter-swift>=0.7.0,<1",
58-
"tree-sitter-c>=0.24.0,<1",
59-
"tree-sitter-cpp>=0.23.0,<1",
60-
"tree-sitter-scala>=0.26.0,<1",
61-
"tree-sitter-dart>=0.1.0,<1",
62-
"tree-sitter-bash>=0.25.0,<1", # shell, без data flow
63-
# Context-языки (только AST-парсинг и чанкинг)
64-
"tree-sitter-sql>=0.3.0,<1",
65-
"tree-sitter-yaml>=0.7.0,<1",
66-
"tree-sitter-toml>=0.7.0,<1",
67-
"tree-sitter-html>=0.23.0,<1",
68-
"tree-sitter-css>=0.25.0,<1",
69-
"tree-sitter-hcl>=1.2.0,<2", # HCL/Terraform
52+
# Core: полный граф (chunking + calls + data flow + imports).
53+
# Все грамматики: abi3-колёса (cp39/cp310-abi3) — один пин работает 3.10..3.14.
54+
# Импортируются лениво (src/core/indexing/parser.py) — отсутствие грамматики
55+
# деградирует язык, а не роняет индексацию.
56+
"tree-sitter==0.26.0",
57+
"tree-sitter-python==0.25.0",
58+
"tree-sitter-rust==0.24.2",
59+
"tree-sitter-typescript==0.23.2", # .ts/.tsx
60+
"tree-sitter-javascript==0.25.0", # .js/.jsx
61+
"tree-sitter-go==0.25.0",
62+
"tree-sitter-java==0.23.5",
63+
"tree-sitter-c-sharp==0.23.5",
64+
"tree-sitter-ruby==0.23.1",
65+
"tree-sitter-php==0.24.1",
66+
"tree-sitter-kotlin==1.1.0",
67+
"tree-sitter-swift==0.7.3",
68+
"tree-sitter-c==0.24.2",
69+
"tree-sitter-cpp==0.23.4",
70+
"tree-sitter-scala==0.26.2",
71+
"tree-sitter-dart==0.1.0",
72+
"tree-sitter-bash==0.25.1", # shell, без data flow
73+
# Context-языки (только AST-парсинг и чанкинг)
74+
"tree-sitter-sql==0.3.11",
75+
"tree-sitter-yaml==0.7.2",
76+
"tree-sitter-toml==0.7.0",
77+
"tree-sitter-html==0.23.2",
78+
"tree-sitter-css==0.25.0",
79+
"tree-sitter-hcl==1.2.0", # HCL/Terraform
7080
# Search & Utils
71-
"pathspec>=0.14.0",
72-
"httpx>=0.24.0",
73-
"python-dotenv>=1.0.0",
74-
"pandas>=2.0.0",
75-
"python-dateutil>=2.8.0",
81+
"pathspec==1.1.1",
82+
"httpx==0.28.1",
83+
"python-dotenv==1.2.2",
84+
"pandas==3.0.3; python_version >= '3.11'",
85+
"pandas>=2.0.0; python_version < '3.11'", # 3.10: lock-версия требует >=3.11
86+
"python-dateutil==2.9.0.post0",
7687
# ONNX Embedder
77-
"onnxruntime>=1.17.0",
78-
"openvino>=2026.0.0",
88+
"onnxruntime==1.27.0; python_version >= '3.11'",
89+
"onnxruntime>=1.17.0; python_version < '3.11'", # 3.10: lock-версия требует >=3.11
90+
"openvino==2026.2.1",
7991
# Reranker (transformers-based; легаси — llama.cpp, но tokenizers используются)
8092
# Pinned: >=5.3.0 закрывает CVE-2026-1839 (фикс 5.0.0) и CVE-2026-4372
8193
# (RCE через _attn_implementation_internal, обходит trust_remote_code — фикс ТОЛЬКО 5.3.0).
82-
# Lock уже на 5.14.1; нижняя граница защищает установку БЕЗ lock. Проверено 2026-08-08 (OSV).
83-
"transformers>=5.3.0,<5.15.0",
84-
"tokenizers>=0.15.0",
94+
# 5.14.1 — из lock (проверено 2026-08-08, OSV); верхняя граница <5.15.0 сохранена пином.
95+
"transformers==5.14.1",
96+
"tokenizers==0.22.2",
8597
]
8698

8799
[project.optional-dependencies]

requirements.txt

Lines changed: 63 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,76 @@
1+
# МИРРОР runtime-зависимостей pyproject.toml — единый источник правды: pyproject.toml.
2+
# Правки вносить в pyproject и зеркалить сюда (дрейф = нарушение §6.2).
3+
# install.py (step_pip) предпочитает requirements-lock.txt (замороженный набор венва);
4+
# этот файл — фолбэк и человекочитаемый список пинов.
5+
# Политика пинов 2026-08-18 (аудит unpinned-dependency): все runtime-зависимости
6+
# запинены к точным версиям (==); версии из requirements-lock.txt (венв, Python 3.14)
7+
# + проверка колёс PyPI на 3.10..3.14. numpy/pandas/onnxruntime на Python<3.11 —
8+
# диапазон per-Python (CI matrix включает 3.10, EOL 2026-10).
9+
110
# MCP Protocol
2-
mcp>=1.0.0,<2
11+
mcp==1.28.1 # 1.x: транспортный протокол; 2.x меняет его — не бампить без проверки
312

413
# LSP Protocol
5-
pygls>=2.0.0
6-
lsprotocol>=24.0.0
14+
pygls==2.1.1
15+
lsprotocol==2025.0.0
716

817
# Vector DB & Embeddings
918
# Pinned: lancedb 0.x менял публичный API внутри минорных релизов
10-
# (сломал тест-сьют 2026-07 через lancedb.LanceDB). Бамп — только после проверки API.
19+
# (сломал тест-сьют 2026-07). Бамп — только после проверки API + verify_clean_state.
1120
lancedb==0.34.0
12-
# Pinned: lancedb>=0.30 требует table.to_lance() (known_hashes bulk load в
13-
# index_project_runner.py) — без него lancedb кидает "The lance library is
14-
# required" и индексация парсит все файлы заново. 2026-08-01 проверено:
15-
# pylance 9.0.0 + lance-namespace 0.8.6, to_lance().to_pandas() работает.
21+
# Pinned: pylance 9.0.0 + lance-namespace 0.8.6, to_lance().to_pandas() работает
22+
# (known_hashes bulk load, index_project_runner.py). Проверено 2026-08-01.
1623
pylance==9.0.0
17-
pyarrow>=14.0.0
18-
huggingface_hub>=0.20.0
19-
numpy>=1.24.0,<3
24+
pyarrow==25.0.0 # + pyarrow.compute для to_arrow
25+
huggingface_hub==1.24.0
26+
numpy==2.4.6; python_version >= '3.11'
27+
numpy>=1.24.0,<3; python_version < '3.11' # 3.10: numpy 2.4.x требует >=3.11
2028

21-
# Code parsing (Tree-sitter)
22-
tree-sitter>=0.21.0,<1
23-
tree-sitter-python>=0.21.0,<1
24-
tree-sitter-rust>=0.21.0,<1
25-
tree-sitter-typescript>=0.21.0,<1
26-
tree-sitter-javascript>=0.21.0,<1
27-
tree-sitter-go>=0.21.0,<1
29+
# Code parsing (Tree-sitter) — 23 пакета для 23 языков
30+
# Все грамматики: abi3-колёса (cp39/cp310-abi3) — один пин работает 3.10..3.14.
31+
# Импортируются лениво (src/core/indexing/parser.py) — отсутствие грамматики
32+
# деградирует язык, а не роняет индексацию.
33+
tree-sitter==0.26.0
34+
tree-sitter-python==0.25.0
35+
tree-sitter-rust==0.24.2
36+
tree-sitter-typescript==0.23.2 # .ts/.tsx
37+
tree-sitter-javascript==0.25.0 # .js/.jsx
38+
tree-sitter-go==0.25.0
39+
tree-sitter-java==0.23.5
40+
tree-sitter-c-sharp==0.23.5
41+
tree-sitter-ruby==0.23.1
42+
tree-sitter-php==0.24.1
43+
tree-sitter-kotlin==1.1.0
44+
tree-sitter-swift==0.7.3
45+
tree-sitter-c==0.24.2
46+
tree-sitter-cpp==0.23.4
47+
tree-sitter-scala==0.26.2
48+
tree-sitter-dart==0.1.0
49+
tree-sitter-bash==0.25.1 # shell, без data flow
50+
tree-sitter-sql==0.3.11
51+
tree-sitter-yaml==0.7.2
52+
tree-sitter-toml==0.7.0
53+
tree-sitter-html==0.23.2
54+
tree-sitter-css==0.25.0
55+
tree-sitter-hcl==1.2.0 # HCL/Terraform
2856

2957
# Search & Utils
30-
pathspec>=0.14.0
31-
httpx>=0.24.0
32-
python-dotenv>=1.0.0
33-
34-
# Data Processing
35-
pandas>=2.0.0
36-
37-
# ONNX Runtime (локальные эмбеддинги, fallback)
38-
# ⚠️ CVE-2026-4372 в transformers 4.56.0..5.2.x — запинено <4.56.0
39-
# В рантайме не используется (reranker через httpx).
40-
# Нужен только scripts/download_model.py для экспорта ONNX.
41-
onnxruntime>=1.17.0
42-
transformers>=4.36.0,<5.15.0
43-
tokenizers>=0.15.0
44-
45-
# OpenVINO (INT8 эмбеддинги, ~350 ch/s)
46-
openvino>=2026.0.0
58+
pathspec==1.1.1
59+
httpx==0.28.1
60+
python-dotenv==1.2.2
61+
pandas==3.0.3; python_version >= '3.11'
62+
pandas>=2.0.0; python_version < '3.11' # 3.10: pandas 3.x требует >=3.11
63+
python-dateutil==2.9.0.post0
4764

48-
# LanceDB native bindings (тянется транзитивно через lancedb)
65+
# ONNX Runtime / OpenVINO (локальные эмбеддинги; onnxruntime нужен только
66+
# scripts/download_model.py для ONNX-экспорта — reranker идёт через httpx)
67+
onnxruntime==1.27.0; python_version >= '3.11'
68+
onnxruntime>=1.17.0; python_version < '3.11' # 3.10: 1.27 требует >=3.11
69+
openvino==2026.2.1
4970

50-
# LanceDB dependency (dateutil для api_client)
51-
python-dateutil>=2.8.0
71+
# Reranker (transformers; токенизация)
72+
# Pinned: >=5.3.0 закрывает CVE-2026-1839 (фикс 5.0.0) и CVE-2026-4372 (RCE через
73+
# _attn_implementation_internal, обходит trust_remote_code — фикс ТОЛЬКО 5.3.0).
74+
# 5.14.1 — из lock (проверено 2026-08-08, OSV); верхняя граница <5.15.0 сохранена пином.
75+
transformers==5.14.1
76+
tokenizers==0.22.2

0 commit comments

Comments
 (0)