Skip to content

memory: holographic health_check + collapse doctor branches (closes #42)#52

Merged
PowerCreek merged 1 commit into
mainfrom
holographic-health-check-and-doctor-collapse
May 23, 2026
Merged

memory: holographic health_check + collapse doctor branches (closes #42)#52
PowerCreek merged 1 commit into
mainfrom
holographic-health-check-and-doctor-collapse

Conversation

@PowerCreek

Copy link
Copy Markdown

Summary

Closes #42. Final two steps of the RFC migration.

Step 2h — holographic health_check

Holographic is local-only (SQLite); no remote service. But a read-only HERMES_HOME (RO mount, wrong perms) would still break it at runtime. Override verifies db_path's parent directory is writable.

Tuple When
(True, "") Parent mkdir + W_OK pass
(False, "unreachable: <msg>") mkdir failed or W_OK denied
(False, "config_error: <msg>") get_hermes_home raised

Step 3 — doctor branch collapse

Every shipped provider now implements health_check() with the RFC #42 reason-prefix taxonomy. The provider-specific Honcho + Mem0 elif blocks (~120 lines combined) are gone. The unified dispatch is one ~80-line block in doctor.py keyed on the prefix:

Prefix Doctor action
(healthy) check_ok("<name> reachable")
no_api_key / no_credentials _fail_and_issue (setup hint)
no_url / no_endpoint _fail_and_issue (URL hint)
no_config check_warn (run setup)
disabled check_info
sdk_missing _fail_and_issue (plugin docs)
auth: _fail_and_issue (rotate key)
not_found: _fail_and_issue (verify base URL)
http: check_warn (unexpected status)
unreachable: check_warn (transient hint)
config_error: check_warn
health_check_raised: check_warn (contract violation per RFC #42 — flag it)
Other check_warn (unknown verbatim)

Doctor's Memory Provider section is now ~80 lines instead of ~200, and adding the 9th provider requires zero doctor changes.

Migration table (8 providers)

Provider PR Probe
mem0 #44 MemoryClient.get_all(user_id, limit=1)
honcho #45 get_honcho_client(cfg) handshake
byterover #46 brv status (CLI + login)
supermemory #48 client.profile(container_tag=...)
openviking #49 GET <endpoint>/health
retaindb #50 GET /v1/memory/profile/<probe>
hindsight #51 mode-dependent (local import / GET /version)
holographic this PR db_path parent writability

Test plan

  • 6 new tests for holographic health_check (writable / mkdir / read-only / mkdir-failure / config-error / HERMES_HOME-expansion).
  • Updated 3 doctor tests to assert the new unified dispatch (auth:_fail_and_issue; unreachable:check_warn with "credentials may still be valid" hint; healthy → <name> reachable) instead of the now-removed elif-block strings.
  • pytest tests/plugins/memory/ tests/honcho_plugin/test_health_check.py tests/agent/test_memory_provider.py tests/hermes_cli/test_doctor.py → 228 passed. Pre-existing test_get_client_passes_idle_timeout_to_hindsight_embedded failure is an env-specific PEP-668 issue, not a regression (verified on main).

The #42 RFC is fully implemented across all shipped memory providers. Closing the issue with this PR.

Filed by hermes-maintainer (PowerCreek).

…s 2h + 3)

Closes #42. Final two steps of the RFC migration.

Step 2h — holographic health_check:
  Holographic is local-only (SQLite); no remote service. But a
  read-only HERMES_HOME (RO mount, wrong perms) would still
  break it at runtime. Override verifies db_path's parent
  directory is writable.

    (True, "")                     — parent mkdir + W_OK pass.
    (False, "unreachable: <msg>")  — mkdir failed or W_OK denied.
    (False, "config_error: <msg>") — get_hermes_home raised.

Step 3 — doctor branch collapse:
  Every shipped provider now implements health_check() with the
  RFC #42 reason-prefix taxonomy. The provider-specific Honcho +
  Mem0 elif blocks (~120 lines combined) are gone. The unified
  dispatch is one ~80-line block in doctor.py keyed on the prefix:

    healthy → check_ok("<name> reachable")
    no_api_key / no_credentials → _fail_and_issue (setup hint)
    no_url / no_endpoint        → _fail_and_issue (URL hint)
    no_config                   → check_warn (run setup)
    disabled                    → check_info
    sdk_missing                 → _fail_and_issue (plugin docs)
    auth:                       → _fail_and_issue (rotate key)
    not_found:                  → _fail_and_issue (verify base URL)
    http:                       → check_warn (unexpected status)
    unreachable:                → check_warn (transient hint)
    config_error:               → check_warn (config raised)
    health_check_raised:        → check_warn (provider bug; RFC
                                   #42 says health_check MUST NOT
                                   raise, so this is a contract
                                   violation worth flagging)
    other                       → check_warn (unknown verbatim)

Doctor's Memory Provider section is now ~80 lines instead of
~200, and adding the 9th provider requires zero doctor changes.

Migration table (8 providers total):
  mem0       — PR #44  GET /v1/memory profile
  honcho     — PR #45  get_honcho_client handshake
  byterover  — PR #46  brv status (CLI + login)
  supermemory — PR #48  client.profile probe
  openviking — PR #49  /health endpoint probe
  retaindb   — PR #50  /v1/memory/profile GET
  hindsight  — PR #51  mode-dependent (local import / cloud /version)
  holographic — this PR  db_path parent writability

Tests:
  - 6 new tests for holographic health_check
  - Updated 3 doctor tests to assert the new unified dispatch
    (auth → _fail_and_issue; unreachable → check_warn; healthy
    → "<name> reachable") instead of the now-removed elif-block
    output strings.
  - 228 health_check + doctor tests pass total.

The #42 RFC is now fully implemented across all shipped memory
providers. Closing the issue with this PR.
@PowerCreek PowerCreek merged commit be84f2a into main May 23, 2026
@PowerCreek PowerCreek deleted the holographic-health-check-and-doctor-collapse branch May 23, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Add MemoryProvider.health_check() ABC method for doctor-visible reachability probes (#36 follow-up)

1 participant