5.4 KB · updated 2026-07-31 · md

doctor.md

docs/doctor.md

tesserae doctor — project health checks

<!-- translations:start -->

한국어 · 中文 · 日本語 · Русский · Español · Français · Deutsch

<!-- translations:end --> tesserae doctor inspects a Tesserae workspace end to end — initialization, graph integrity, registry consistency, freshness, locks, LLM login, and disk hygiene — and prints a checklist. It is read-only by default; --fix applies only the repairs that are safe to re-run and can never destroy live state.

tesserae doctor                 # check the current project
tesserae doctor --fix           # apply the safe repairs, then re-check
tesserae doctor --all --json    # every registered project, JSON report
tesserae doctor --project ~/src/other

What it checks

Twenty checks, grouped by category:

CheckCategoryWhat it verifies--fix action
project_initializedcore.tesserae/ exists and looks like a Tesserae workspacereport-only (suggests tesserae init)
graph_parsecoregraph.json parses and has the expected shapereport-only (suggests tesserae compile)
config_validcore.tesserae/config.json parses and validates against the init templatereport-only
vault_configuredcorethe configured vault path resolvesSAFE: creates the resolved vault directory when it lives inside the project
registry_consistentregistry~/.tesserae/registry.json entries point at real project rootsSAFE: prunes entries whose root is gone, drops the legacy active key; a missing graph is report-only
graph_stalenessfreshnessgit delta since the last compile's recorded git_headreport-only (suggests tesserae refresh — compiles are heavy)
site_search_indexfreshnessthe static site / search-index.json is newer than graph.jsonSAFE: rebuilds the site
backend_artifactsfreshnessRAG-Anything artifacts are currentreport-only (their refresh is LLM/network heavy)
session_chunksfreshnessdaily session-chunk coverage has no gaps in the recent windowreport-only (suggests tesserae sessions chunk-backfill)
wiki_lintgraphgraph ⇄ wiki drift + trivially fixable lint findingsSAFE: applies the lint trivial fixes (fix_trivial)
compile_lockprocesseswhether a live compile lock is held, and by which pidreport-only — doctor never kills or removes a live lock
daemon_pidprocessesdaemon.pid points at a live engine processSAFE: removes the pidfile when its owner is dead
llm_loginenvironmentthe configured LLM backend is actually usable (claude/codex CLI logged in, or API key present)report-only (suggests claude /login / codex login)
optional_depsenvironmentstatus of optional dependencies (memex, raganything)report-only (installs are networked)
embedding_backendenvironmenta real semantic embedding backend is availablereport-only (suggests pip install tesserae[semantic])
environmentenvironmentwholesale environment detection summaryreport-only section
build_historyhygiene.build-history size and shapeSAFE: trims it, always preserving the newest git_head entry (the staleness check depends on it)
idempotencehygienethe output-snapshot idempotence_suspect tripwirereport-only (it's a bug signal, not something to auto-repair)
orphan_worktreeshygienestale git worktree registrationsSAFE: git worktree prune; deleting directories is report-only
hook_log_bloathygiene.tesserae/.session-*-hook.log growthSAFE: rotates/truncates logs over 10 MB

A crashing check is reported as an error finding — doctor itself never raises.

--fix policy

  • --fix runs only the checks marked SAFE above, then re-detects so the report reflects the post-fix state.
  • Every fix is idempotent: running doctor --fix twice leaves the second run clean.
  • Doctor never kills a process and never removes a live compile lock — a held lock is reported with its owning pid and left alone.
  • Heavy or networked operations (recompiles, dependency installs, backend refreshes) are never folded into --fix; doctor prints the command for you to run instead.

Exit codes

Same convention as tesserae lint:

Exit codeMeaning
0healthy — no findings above OK
1warnings present
2errors present

Report artifacts

Every run writes both report forms into the workspace:

.tesserae/doctor-report.md      # human checklist
.tesserae/doctor-report.json    # structured findings

--json additionally prints the JSON report to stdout instead of the markdown checklist. --all iterates every project in the registry (ignoring --project) and reports per project.

MCP: doctor_report

The MCP server exposes the same report as the doctor_report tool (mirroring lint_report, including its byte cap on returned content), so an agent can check workspace health mid-conversation without shelling out. It requires a project root — pass graph_path/project or configure a default graph.