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)
This commit is contained in:
Bernd (Hermes)
2026-08-05 05:43:14 +02:00
parent b8a76b6337
commit 374e2e7700
3 changed files with 93 additions and 49 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ def main() -> int:
]
print(f"FAISS+Booster Smoke-Test: {idx.size} Raeume, Version {idx._version}")
print(f"Booster: {len(booster._keyword_to_rooms)} Keywords, immer aktiv, +0.10/unique")
print(f"Booster: {len(booster._kw100_to_rooms)} kw100 + {len(booster._kwctx_to_rooms)} kwctx Keywords, +0.10/unique")
print()
ok = 0