4 Commits

Author SHA1 Message Date
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) 6a701dcce4 feat: V8.5 — P1-Points: 90-Tage-Demotion + ::curate run Routine 2026-07-19 11:07:44 +02:00
Bernd (Hermes) 3179ce8b7b M13: Vollständige Garbage Collection — FAISS-Rebuild + KeywordBooster-Reset + ArchivarState-Bereinigung + Onboarding-StayTracker-Cleanup
Erweitert _sync_room_map_with_membership() um die von Andreas geforderten
Bereinigungsschritte nach room-map.json-GC:

1. FAISS-Index: rebuild + save (war bereits in M13, jetzt robuster)
2. KeywordBooster: cleanup_orphaned_rooms() — baut _keyword_to_rooms
   Mapping aus bereinigter RoomMap neu
3. ArchivarState: cleanup_orphaned_rooms() — entfernt stay_decision,
   keyword_weights, sticky_keywords, manual_overrides, promotion_candidates
   für gelöschte Räume
4. Onboarding _stay_tracker: entfernt Einträge für gelöschte Räume

Reihenfolge im Gateway-Start (adapter.py connect()):
  DDP connect → _sync_room_map_with_membership() → DDP subscribe →
  Archivar init → Auto-Onboarding

Alle neuen Methoden sind idempotent und mit Tests abgedeckt:
- test_archivar_state.py: +8 Tests (cleanup_orphaned_rooms)
- test_booster.py: +4 Tests (cleanup_orphaned_rooms)
2026-07-12 15:49:17 +02:00
Bernd (Hermes) 4fff5980c7 F4-Tests: Archivar v5 Quality Gate — Cold-Start, Rebuild, Boost, Konfliktlösung
4 kritische Pfade (Rainer):
  F4.1 Cold-Start: Leerer FAISS-Index → search() raises RoomIndexError
  F4.2 Rebuild: seed_data-Räume → build_index() → search() findet korrekten Raum
  F4.3 Boost: Eindeutiges Keyword +0.05, mehrdeutiges neutral
  F4.4 Konfliktlösung: Top-2 Diff < 0.03 → mehr unique keywords gewinnt +0.02

Mock-FAISS-Index (MockIndexFlatIP) — faiss-cpu muss NICHT installiert sein.
Mock-EmbeddingClient — deterministische Vektoren, keine echten Ollama-Calls.
35 Tests, alle grün (0.23s).
2026-06-16 19:31:24 +02:00