Add files using upload-large-folder tool
Browse files
.gitattributes
CHANGED
|
@@ -1 +1,4 @@
|
|
| 1 |
graph/wiki-graph.tar.gz filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
graph/wiki-graph.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
graph/viz-overview.png filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
graph/viz-security.png filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
graph/skills-sh-catalog.json.gz filter=lfs diff=lfs merge=lfs -text
|
src/tests/test_similarity_precision_recall.py
CHANGED
|
@@ -44,6 +44,7 @@ model (~100MB on first run). Skip in fast CI with ``-m 'not integration'``.
|
|
| 44 |
from __future__ import annotations
|
| 45 |
|
| 46 |
import json
|
|
|
|
| 47 |
import sys
|
| 48 |
from dataclasses import dataclass
|
| 49 |
from pathlib import Path
|
|
@@ -66,6 +67,7 @@ FIXTURE_DIR = Path(__file__).parent / "fixtures" / "similarity"
|
|
| 66 |
# Raising these is easy; lowering them requires a plan, not a fixup.
|
| 67 |
_MIN_PRECISION = 0.90
|
| 68 |
_MIN_RECALL = 0.90
|
|
|
|
| 69 |
|
| 70 |
|
| 71 |
# ────────────────────────────────────────────────────────────────────
|
|
@@ -191,15 +193,24 @@ def _evaluate_pair(pair: _Pair, embedder, cache_root: Path) -> _Outcome:
|
|
| 191 |
def _embedder():
|
| 192 |
"""Load the real configured embedder once per module run.
|
| 193 |
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
"""
|
| 198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
try:
|
| 200 |
return cfg.build_intake_embedder()
|
| 201 |
-
except Exception as exc: # noqa: BLE001
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
|
| 205 |
@pytest.fixture
|
|
|
|
| 44 |
from __future__ import annotations
|
| 45 |
|
| 46 |
import json
|
| 47 |
+
import os
|
| 48 |
import sys
|
| 49 |
from dataclasses import dataclass
|
| 50 |
from pathlib import Path
|
|
|
|
| 67 |
# Raising these is easy; lowering them requires a plan, not a fixup.
|
| 68 |
_MIN_PRECISION = 0.90
|
| 69 |
_MIN_RECALL = 0.90
|
| 70 |
+
_REQUIRE_SIMILARITY_EVAL = os.environ.get("CTX_REQUIRE_SIMILARITY_EVAL") == "1"
|
| 71 |
|
| 72 |
|
| 73 |
# ────────────────────────────────────────────────────────────────────
|
|
|
|
| 193 |
def _embedder():
|
| 194 |
"""Load the real configured embedder once per module run.
|
| 195 |
|
| 196 |
+
Local runs may skip when the embedding backend is unavailable. The
|
| 197 |
+
dedicated CI similarity gate sets CTX_REQUIRE_SIMILARITY_EVAL=1, in
|
| 198 |
+
which case dependency/model setup failures are hard failures.
|
| 199 |
"""
|
| 200 |
+
try:
|
| 201 |
+
import sentence_transformers # noqa: F401
|
| 202 |
+
except ImportError as exc:
|
| 203 |
+
message = f"sentence-transformers is required for similarity evaluation: {exc}"
|
| 204 |
+
if _REQUIRE_SIMILARITY_EVAL:
|
| 205 |
+
pytest.fail(message)
|
| 206 |
+
pytest.skip(message)
|
| 207 |
try:
|
| 208 |
return cfg.build_intake_embedder()
|
| 209 |
+
except Exception as exc: # noqa: BLE001 - fail/skip policy depends on CI mode
|
| 210 |
+
message = f"cannot build intake embedder: {exc}"
|
| 211 |
+
if _REQUIRE_SIMILARITY_EVAL:
|
| 212 |
+
pytest.fail(message)
|
| 213 |
+
pytest.skip(message)
|
| 214 |
|
| 215 |
|
| 216 |
@pytest.fixture
|