Commit Graph

5 Commits

Author SHA1 Message Date
Bernd (Hermes) b8a76b6337 booster: replace substring matching with hyphen-insensitive keyword_matcher
Replace naive 'kw in text_lower' substring matching (lines 104-106)
with match_keyword() from keyword_matcher, which provides:

- Strategy 1: Exact substring match (case-insensitive, normalized)
- Strategy 1b: Hyphen-insensitive match ('presence-engine' matches
  'Presence Engine' in text)
- Strategy 2: Stemming match (snowballstemmer German)
- Strategy 3: Fuzzy match (Levenshtein)

Changes:
- Import match_keyword from .keyword_matcher
- matched_keywords now uses match_keyword(kw, text) instead of kw in text_lower
- _count_unique_matches: same replacement
- _record_matches: parameter renamed text_lower -> text (no logic change)
- Removed now-unused text_lower = text.lower() line

All 35 booster tests pass.
2026-08-05 04:55:23 +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) d005eb769d feat(archivar): Booster-Gewichtung verstärkt — FAISS + Keywords
Booster-Strategie: IMMER aktiv (nicht nur bei Konflikten)
- router.py: Konfliktbedingung entfernt, Booster auf alle FAISS-Treffer
- booster.py: Boost +0.05→+0.10, zusätzlich +0.05 pro weiterem unique Keyword
- config.py: FAISS_AUTO_ROUTE 0.85→0.70

Kombiniert semantische Breite (FAISS) mit präziser Keyword-Diskriminierung.
Ziel: granulare Raum-Entscheidungen bei überlappenden Themen.
2026-06-18 07:55:14 +02:00
Bernd (Hermes) 03d3bb44df BUGFIX: FAISS Phase-1 TypeError float+str in adapter_integration.py:292
Root cause: RoomIndexManager.stats() returns a dict with mixed types
(bool, int, float, str). sum() iterated over all values and crashed
when hitting built_at_iso (str) after built_at (float).

Fix: Replace stats() call with direct .size and .room_ids properties.
Also commit FAISS Phase-1 files (booster.py, room_index.py, seed_data.py)
that were deployed to Gateway but not yet in repo.

Tests: 58 passed (0 failures)
2026-06-16 20:31:57 +02:00