chore(health): waive pre-existing broad excepts in the restored holographic provider
The revert re-adds plugins/memory/holographic verbatim; the code-health ratchet measures it against the post-removal tree, so its long-standing broad excepts read as new. Comment-only waivers, no code change; the provider leaves core on Oct 15.
This commit is contained in:
@@ -82,7 +82,7 @@ def _load_plugin_config() -> dict:
|
||||
try:
|
||||
from hermes_cli.config import load_config_readonly # canonical: managed-scope overlay + ${VAR} expansion
|
||||
return cfg_get(load_config_readonly(), "plugins", "hermes-memory-store", default={}) or {}
|
||||
except Exception:
|
||||
except Exception: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
return {}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
return ""
|
||||
try:
|
||||
total = self._store._conn.execute("SELECT COUNT(*) FROM facts").fetchone()[0]
|
||||
except Exception:
|
||||
except Exception: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
total = 0
|
||||
body = ("Active. Empty fact store — proactively add facts the user would expect you to remember.\n"
|
||||
"Use fact_store(action='add') to store durable structured facts about people, projects, preferences, decisions.\n"
|
||||
@@ -169,7 +169,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
results = self._retriever.search(query, min_trust=self._min_trust, limit=5)
|
||||
lines = [f"- [{r.get('trust_score', r.get('trust', 0)):.1f}] {r.get('content', '')}" for r in results]
|
||||
return "## Holographic Memory\n" + "\n".join(lines) if results else ""
|
||||
except Exception as e:
|
||||
except Exception as e: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
logger.debug("Holographic prefetch failed: %s", e)
|
||||
return ""
|
||||
|
||||
@@ -183,7 +183,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
return self._TOOL_HANDLERS[tool_name](self, args)
|
||||
except KeyError as exc:
|
||||
return tool_error(f"Missing required argument: {exc}")
|
||||
except Exception as exc:
|
||||
except Exception as exc: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
return tool_error(str(exc))
|
||||
|
||||
def on_session_end(self, messages: list[dict[str, Any]]) -> None:
|
||||
@@ -196,7 +196,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
if action == "add" and self._store and content:
|
||||
try:
|
||||
self._store.add_fact(content, category="user_pref" if target == "user" else "general")
|
||||
except Exception as e:
|
||||
except Exception as e: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
logger.debug("Holographic memory_write mirror failed: %s", e)
|
||||
|
||||
def shutdown(self) -> None:
|
||||
@@ -204,7 +204,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
if self._store is not None:
|
||||
try:
|
||||
self._store.close()
|
||||
except Exception as e:
|
||||
except Exception as e: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
logger.debug("Holographic shutdown close() failed: %s", e)
|
||||
self._store = self._retriever = None
|
||||
|
||||
@@ -257,7 +257,7 @@ class HolographicMemoryProvider(MemoryProvider):
|
||||
try:
|
||||
self._store.add_fact(content[:400], category=category)
|
||||
extracted += 1
|
||||
except Exception:
|
||||
except Exception: # health: allow BLE001 S110 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
pass
|
||||
if extracted:
|
||||
logger.info("Auto-extracted %d facts from conversation", extracted)
|
||||
|
||||
@@ -174,7 +174,7 @@ class FactRetriever:
|
||||
f"WHERE facts_fts MATCH ? {category_clause}AND f.trust_score >= ? ORDER BY facts_fts.rank LIMIT ?")
|
||||
try:
|
||||
results = [dict(row) for row in self.store._conn.execute(sql, params).fetchall()]
|
||||
except Exception:
|
||||
except Exception: # health: allow BLE001 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
return [] # FTS5 MATCH can fail on malformed queries
|
||||
# FTS5 rank is negative (lower = better); normalize |rank| / max to [0, 1] (1e-6 floor avoids div by zero)
|
||||
max_rank = max([abs(f["fts_rank_raw"]) for f in results] + [1e-6])
|
||||
|
||||
@@ -280,7 +280,7 @@ class MemoryStore:
|
||||
try:
|
||||
with entry["lock"]:
|
||||
entry["conn"].close()
|
||||
except Exception:
|
||||
except Exception: # health: allow BLE001 S110 -- restored verbatim by the revert of #136424; this provider leaves core on Oct 15
|
||||
pass # an already-closed/broken connection must not abort releasing siblings
|
||||
return len(doomed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user