Class: ClaudeMemory::Dashboard::Health

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/dashboard/health.rb

Overview

Aggregates the dashboard “/health” report from four checks: per-database schema/fact health (global + project), claude-code hooks installation, and the sqlite-vec vector index. Each check returns a status, message, fix? hash; the report’s overall status escalates to the worst individual status (error > warning > healthy).

Pulled out of Dashboard::API so the wiring lives next to the data rather than next to the HTTP routing.

Constant Summary collapse

HOOKS_SETTINGS_PATHS =
[".claude/settings.json", ".claude/settings.local.json"].freeze
VEC_LOW_COVERAGE_PCT =
10
VEC_WARN_COVERAGE_PCT =
50

Instance Method Summary collapse

Constructor Details

#initialize(manager) ⇒ Health

Returns a new instance of Health.



20
21
22
# File 'lib/claude_memory/dashboard/health.rb', line 20

def initialize(manager)
  @manager = manager
end

Instance Method Details

#reportObject



24
25
26
27
28
29
30
31
32
# File 'lib/claude_memory/dashboard/health.rb', line 24

def report
  checks = [
    db_check("global", @manager.global_db_path),
    db_check("project", @manager.project_db_path),
    hooks_check,
    vec_check
  ]
  {status: aggregate_status(checks), checks: checks, version: ClaudeMemory::VERSION}
end