Commit Graph

3 Commits

Author SHA1 Message Date
Bernd (Hermes) 793351bf15 fix(archivar): room_name_to_topic aus Lern-Pfad entfernt + Audit-Skript (V2)
- Red-Flag-Feedback nutzt extract_thematic_keyword (Schicht 4) statt
  room_name_to_topic(target_name) als Keyword-Quelle (P-112 strukturell)
- red_flag_state trägt Originaltext (routing_text) für die Extraktion
- source-Tag wird an ask_routing_learning_choice durchgereicht
- scripts/audit_learn_keywords.py: prüft room-map auf ungültige
  keywords_100 (identisch/Substring mit Raumname) — findet 6 reale Einträge
- 4 Regression-Tests (kein room_name_to_topic im Lern-Pfad)
2026-08-26 10:08:55 +02:00
Bernd (Hermes) 374e2e7700 P-028 Mitigation: split keyword matching — match_keyword_exact for kw100, match_keyword for kwctx
TEIL 1 — booster.py:
- Split _keyword_to_rooms into _kw100_to_rooms + _kwctx_to_rooms
- keywords_100 matched via match_keyword_exact (no fuzzy/stemming, hyphen-insensitive)
- keywords_context matched via match_keyword (fuzzy/stemming preserved)
- _build_mapping() builds both mappings separately
- boost() uses separate matchers per keyword type
- _count_unique_matches() checks both mappings with respective matchers
- _record_matches() now takes only matched_kw100 (context keywords never tracked)
- cleanup_orphaned_rooms() rebuilds both mappings

TEIL 2 — room-map.json (data, not in git):
- Removed 39 space-variant dual keywords (e.g. 'presence engine' removed,
  'presence-engine' kept). No longer needed since match_keyword_exact
  is hyphen-insensitive.
- Backup: .bak-pre-curation-20260805

Tests: 35/35 passed (pytest -k booster)
2026-08-05 05:43:14 +02:00
Bernd (Hermes) cd7fae1ad0 chore: move test scripts to scripts/ directory (rebuild_index, smoke_test_booster, smoke_test_faiss) 2026-06-20 17:00:10 +02:00