/health
Run 10 diagnostic checks on the knowledge base -- find orphans, drift, duplicates.
Usage
/health [--fix]
What It Does
Runs a comprehensive health check on the knowledge base. Detects orphaned files, stale contexts, duplicate entries, broken cross-references, missing indexes, and structural issues. Reports findings with severity levels.
Implementation
Runs: cd engine && mix optimal.health
Diagnostic checks:
- Orphaned files -- files not referenced by any context or signal.
- Stale contexts -- context.md files not updated in 30+ days.
- Duplicate entries -- same information stored in multiple places.
- Broken cross-references -- links pointing to nonexistent files.
- Missing indexes -- files that exist but aren't in the search index.
- Empty nodes -- folders with no meaningful content.
- Inconsistent metadata -- frontmatter that doesn't match content.
- Drift detection -- L0 abstracts that no longer match full content.
- Missing context.md -- nodes without their required context file.
- Signal routing errors -- signals filed in the wrong node.
Examples
# Run full health check
/health
# Run health check and auto-fix what's possible
/health --fix