gendesign/backend/tests/services/llm
bot-backend 5c5be890ab
Some checks failed
CI / changes (push) Successful in 8s
CI / changes (pull_request) Successful in 7s
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / backend-tests (push) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m42s
CI / backend-tests (pull_request) Failing after 8m59s
fix(llm): INN redaction requires context/checksum, stop eating large numbers (#1640)
_INN_RE now requires an explicit ИНН/inn keyword anchor (case-insensitive) within
~20 chars before a 10/12-digit block. Bare digit sequences without the keyword are
no longer candidates — eliminates false-positives on large monetary amounts such as
1 200 000 000 (which coincidentally passes the ФНС checksum). Checksum validation
is kept as a second gate to avoid redacting e.g. «ИНН 1234567890» with bad digits.

_inn_repl updated to use match.group(1) (digit-only capture group) instead of the
full match that now also includes the keyword prefix.

7 new regression tests in test_redaction.py: bare large numbers not redacted,
keyword-cued real INNs (10/12 digit) still redacted, bad-checksum + keyword left
intact, latin «inn:» accepted.
2026-06-17 20:41:39 +03:00
..
__init__.py feat(llm): foundational LLM infra package with §19 redaction + deterministic fallback (#960) 2026-06-08 15:44:16 +05:00
test_client.py fix(llm): cap серверного Retry-After через _MAX_BACKOFF_S=30s (#1209) 2026-06-13 06:07:46 +00:00
test_config.py feat(llm): foundational LLM infra package with §19 redaction + deterministic fallback (#960) 2026-06-08 15:44:16 +05:00
test_prompts.py fix(chat): clean квартирография rendering in chat_system prompt (v2, #957) 2026-06-09 15:07:14 +05:00
test_provider.py feat(llm): foundational LLM infra package with §19 redaction + deterministic fallback (#960) 2026-06-08 15:44:16 +05:00
test_redaction.py fix(llm): INN redaction requires context/checksum, stop eating large numbers (#1640) 2026-06-17 20:41:39 +03:00