Skip to content

feat: add clx health command with 9 system validators#13

Merged
blackaxgit merged 1 commit intomainfrom
feat/health-command
Mar 26, 2026
Merged

feat: add clx health command with 9 system validators#13
blackaxgit merged 1 commit intomainfrom
feat/health-command

Conversation

@blackaxgit
Copy link
Copy Markdown
Owner

Summary

Add clx health command that checks all CLX components and reports status with actionable fix hints.

Example Output

CLX Health Check (v0.2.1)
══════════════════════════════════════════════════

βœ“ Configuration     ~/.clx/config.yaml loaded (sensitivity: standard)
βœ“ Database          ~/.clx/data/clx.db (WAL, schema v4, 2.4MB)
βœ“ sqlite-vec        built-in (statically linked)
βœ“ Ollama service    http://127.0.0.1:11434 reachable (42ms)
βœ“ Validator model   qwen3:1.7b available
βœ“ Embedding model   qwen3-embedding:0.6b available
βœ“ Hook binary       ~/.clx/bin/clx-hook
βœ“ MCP binary        ~/.clx/bin/clx-mcp
βœ“ Validator prompt  standard (built-in)

══════════════════════════════════════════════════
All checks passed (9/9)

Failures show fix hints:

βœ— Ollama service    http://127.0.0.1:11434 unreachable
                    β†’ Start Ollama: ollama serve

Features

  • 9 concurrent validators (config, DB, sqlite-vec, Ollama, 2 models, 2 binaries, prompt)
  • --json flag for scripting
  • Exit code 0 (healthy) / 1 (any failure)
  • Actionable fix hints on failures
  • No new dependencies

Files Changed

File Change
crates/clx/src/commands/health.rs NEW: 729 lines, 9 validators + output formatting + 10 tests
crates/clx/src/commands/mod.rs Add pub mod health
crates/clx/src/main.rs Add Health subcommand with --json flag
crates/clx-core/src/policy/llm.rs Widen load_validator_prompt to pub
crates/clx-core/src/policy/mod.rs Re-export load_validator_prompt

Test Plan

  • 159 tests pass in clx crate (128 unit + 31 integration)
  • 0 clippy warnings
  • Manual test: table output with Ollama down (shows failures + hints)
  • Manual test: JSON output parses correctly
  • Exit code 1 when checks fail, 0 when all pass

Checks configuration, database, sqlite-vec, Ollama service,
validator model, embedding model, hook/MCP binaries, and
validator prompt. Runs all checks concurrently.

Supports --json output for scripting. Exit code 0 when healthy,
1 when any check fails. Actionable fix hints on failures.
@blackaxgit blackaxgit merged commit 455a452 into main Mar 26, 2026
7 checks passed
@blackaxgit blackaxgit deleted the feat/health-command branch March 26, 2026 00:50
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.

1 participant