Commit Graph

6 Commits

Author SHA1 Message Date
Igor Lins e Silva 94a41ee217 fix(hermes): stop second Chroma client racing the filing worker
MemoryStack/Layer1 opened a second PersistentClient on the same palace
while the Hermes provider already held one for live filing. Concurrent
access corrupted local Chroma SQLite (disk I/O / Failed to get segments)
and failed CI on develop after #1915.

Wake-up L1 now scans the long-lived collection under the collection lock,
and filing holds that lock for the full upsert. Also rewrite the RFC 001
section-4.4 docstring to avoid the internal §N jargon guard.
2026-08-11 08:13:19 -03:00
raman325 fc3beb71ab
fix(hermes): mirror default-target memory writes into the knowledge graph
Hermes' memory tool defaults to target="memory" (the agent's own
notes); filtering on_memory_write to target == "user" silently dropped
the majority of writes. Mirror both targets under distinct subjects —
user→asserted for user facts, hermes→noted for agent notes — so
kg_query("user") never surfaces environment quirks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:08:58 -04:00
raman325 bb1d502ddc
fix(hermes): resolve palace, collection, and KG against one config chain
The provider filed and searched self._palace_path while the mcp_server
passthrough tools resolved mempalace's global config — a custom Hermes
palace_path searched one palace while drawer CRUD, duplicate checks,
and tunnels wrote another. Publish the resolved palace to
MEMPALACE_PALACE_PATH (mcp_server's own --palace mechanism) with
ownership tracking so a stale bridge never outranks edited config and
a user-set env var is never touched. The KG tools become native
handlers: mcp_server resolves its KG from DEFAULT_KG_PATH unless its
own CLI flag was given, which no env bridge can influence.
collection_name and the unset-palace default now defer to
MempalaceConfig — the same single chain the MCP server itself uses.
Also document that hermes backup does not cover ~/.mempalace (no ABC
hook exists for contributing external paths).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:08:58 -04:00
raman325 2d6580b1f1
fix(hermes): make sync_turn the sole filing path
on_session_end and on_pre_compress blind-re-filed the raw message list,
duplicating every turn sync_turn had already stored — filed_at is hashed
into the drawer id, so upserts cannot collapse the copies. Drop the
re-filing (and the pre-compress hint that over-promised persistence);
on_session_end keeps only the wake-up cache refresh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:08:58 -04:00
raman325 37bc50d98a
fix(hermes): address PR #1915 review findings
- _scan_metadatas: fetch cap+1 and compare len > cap, so a collection
  holding exactly STATUS_SCAN_LIMIT rows is no longer reported as
  truncated (the view is complete). Callers still get at most cap rows.
- status/list_wings/list_rooms: tolerate None metadata entries from
  legacy palaces / raw writers instead of failing the tool call.
- _match_wing_by_keywords: skip non-string keywords so a hand-edited
  wing_config.json can't break live turn filing.
- file_conversation_exchange: extra_metadata can no longer overwrite
  canonical keys (matches the documented append-only contract), and
  wing/room are validated with sanitize_name — invalid names fall back
  to wing_general / conversations rather than dropping the turn, per
  the verbatim-first mandate.
- Fix two stale docstrings left from the pre-split layout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:08:58 -04:00
raman325 9553ed9940
feat(integrations): Hermes memory provider core
The Hermes provider from feat/hermes-integration, split out per review
on #1684 — provider + tests only; backfill, the hermes install CLI,
and docs follow in a stacked PR.

Changes vs the original branch:
- _file_turn routes through convo_miner.file_conversation_exchange()
  instead of a hand-rolled col.upsert, so live turns carry canonical
  drawer metadata and the ids.py ID recipe.
- The backfill/live wing-routing parity test moves to the backfill PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:08:20 -04:00