release: dev → main (сдача хакатона) #106

Merged
Eleboba merged 128 commits from dev into main 2026-10-04 23:00:56 +03:00
Showing only changes of commit 123111bc9d - Show all commits
+7
View File
@@ -6,6 +6,7 @@ from pathlib import Path
import pytest import pytest
import yaml import yaml
from app.core.privacy import scrub
from app.core.safety import ( from app.core.safety import (
CrisisScript, CrisisScript,
SafetyResult, SafetyResult,
@@ -40,6 +41,12 @@ def test_acute_recall_is_100_percent(case: dict) -> None:
assert check(ScrubbedText(case["text"])).level == RiskLevel.ACUTE assert check(ScrubbedText(case["text"])).level == RiskLevel.ACUTE
@pytest.mark.parametrize("case", ACUTE, ids=_ids(ACUTE))
def test_acute_recall_survives_scrub(case: dict) -> None:
# Real pipeline: scrub() runs first, so PII placeholders must not break crisis detection.
assert check(scrub(case["text"])).level == RiskLevel.ACUTE
@pytest.mark.parametrize("case", NOT_ACUTE, ids=_ids(NOT_ACUTE)) @pytest.mark.parametrize("case", NOT_ACUTE, ids=_ids(NOT_ACUTE))
def test_non_acute_cases_match_label(case: dict) -> None: def test_non_acute_cases_match_label(case: dict) -> None:
# Exact level documents the calibration; the hard requirement is "never ACUTE" for these. # Exact level documents the calibration; the hard requirement is "never ACUTE" for these.