1
0
Fork 0
llm-ingestion-pipeline-secu.../src/llm_ingestion_guard
Kjell Tore Guttormsen ee402e4ea8 refactor(calibration): consolidate tunable thresholds into calibration.py
Session D: move every calibration constant (entropy floors 5.4/128, 5.1/64,
4.7/40 + shape floors; MAX_SCAN_CHARS; rot13-min; cognitive-load lengths
2000/2500; disposition ranks; active-content severities) into one documented
calibration.py, so a parallel Node/TS port can mirror exactly the same numbers.

Pure refactor, zero behavior change: calibration is a leaf module (imports only
report.Severity) that entropy/lexicon/disposition/active_content now source
their thresholds from. MAX_SCAN_CHARS is re-exported from lexicon so output.py
and existing callers are unaffected. The 347 pre-existing tests pass unmodified;
new test_calibration.py freezes the values and asserts each detector actually
reads its threshold from calibration (identity-checked, not a dead copy).
2026-07-15 09:44:53 +02:00
..
__init__.py feat(guard): active-content detector wired into the output gate (review MAJOR #1) 2026-07-15 06:11:33 +02:00
active_content.py refactor(calibration): consolidate tunable thresholds into calibration.py 2026-07-15 09:44:53 +02:00
calibration.py refactor(calibration): consolidate tunable thresholds into calibration.py 2026-07-15 09:44:53 +02:00
contract.py fix(security): harden 5 adversarial-review findings (M1/M2/M3 + m4/m6) via TDD 2026-07-05 10:45:05 +02:00
disposition.py refactor(calibration): consolidate tunable thresholds into calibration.py 2026-07-15 09:44:53 +02:00
entropy.py refactor(calibration): consolidate tunable thresholds into calibration.py 2026-07-15 09:44:53 +02:00
fence.py feat(fence): randomized unspoofable delimiter + attacker marker-strip (TDD) [skip-docs] 2026-07-04 18:23:35 +02:00
grounding.py feat(grounding): SourceGroundingCheck protocol + pass-through default — the semantic-poisoning seam (TDD) [skip-docs] 2026-07-04 22:44:41 +02:00
injection_lexicon.json feat(lexicon): JSON injection lexicon + variant-set scan (TDD) [skip-docs] 2026-07-04 17:20:21 +02:00
lexicon.py refactor(calibration): consolidate tunable thresholds into calibration.py 2026-07-15 09:44:53 +02:00
neutralize.py feat(guard): active-content detector wired into the output gate (review MAJOR #1) 2026-07-15 06:11:33 +02:00
okf.py feat(okf): scan reserved index.md/log.md in mode-b import, not path-reject (review MAJOR #2) 2026-07-15 06:43:50 +02:00
output.py feat(egress): decode-rescan feeds base64 plaintext to secret-egress (review MINOR) 2026-07-15 07:11:29 +02:00
report.py feat: scaffold package + report and sanitize modules (TDD) 2026-07-04 09:24:20 +02:00
sanitize.py feat: scaffold package + report and sanitize modules (TDD) 2026-07-04 09:24:20 +02:00