agora.doctor
One preflight: agora doctor.
Every entry point calls THIS module — no entry point reimplements a health
check (integration-hardening Stage 4). Each check returns a structured
CheckResult with a one-line red/green verdict and a fix hint; the
report() helper prints them and yields a non-zero exit code on any red.
Library-clean: every check RECEIVES the endpoints/values it needs (composition
roots inject them from Settings). This module never reads os.environ or
Settings itself, so it stays off the config-import allowlist.
Functions
|
Conduit is reachable AND the system account can log in — if you use it. |
|
The active cast's models are present in |
|
Ollama daemon answers |
|
(--dev) The PlantUML render server answers. |
|
Enough free VRAM for |
|
We are inside a git work tree and the workspace root is creatable/writable. |
|
|
|
Required model tags ( |
|
Report and raise |
|
Print each verdict; return 0 when all green, 1 when any check is red. |
|
Run the standard preflight and return every result (order = display order). |
|
A check that did not run, and says so. |
Classes
One preflight check outcome. |
- class agora.doctor.CheckResult[source]
Bases:
objectOne preflight check outcome.
hintis shown only whenokis False.skippedis a THIRD state, deliberately not folded intook: a check that never ran is not a check that passed. A run with the Matrix surface off should report[SKIP] conduit— reading[ OK ] conduitthere would claim a homeserver was verified when none was contacted.- __init__(name, ok, detail, hint='', skipped=False)
- agora.doctor.ollama_missing_models(tags, required)[source]
Required model tags (
name:tag) absent from an/api/tagspayload.
- agora.doctor.check_ollama_models(base_url, required)[source]
The active cast’s models are present in
/api/tags.
- async agora.doctor.check_vram(model, base_url, safety_margin_mib)[source]
Enough free VRAM for
model(existing vram.py fit math). An unavailable probe is GREEN — we never block a run on an unknown (matches vram.py policy).
- async agora.doctor.check_conduit(homeserver, user_id, password)[source]
Conduit is reachable AND the system account can log in — if you use it.
An unset password is a SKIP, not a red. The Matrix surface is opt-in (C2): the core path is Python + Ollama and needs no homeserver, and you opt in by configuring one. “You never set it up” is not a failure to report; it is a check that does not apply.
This used to return red, which blocked every Tier-1 newcomer at the doctor gate on a service SETUP.md had just told them they did not need — the doc said “you don’t need Matrix”, the doctor said FAIL, and the doc also said “do not proceed until nothing is red”. Caught by the v0.1.0 front-door smoke on a fresh public clone; invisible on any box that happens to run Conduit.
- agora.doctor.check_workspace_git(repo_root, work_dir)[source]
We are inside a git work tree and the workspace root is creatable/writable.
- agora.doctor.check_plantuml(url)[source]
(–dev) The PlantUML render server answers. Dev-only: diagram tooling.
- async agora.doctor.run_checks(*, ollama_base_url, required_models=(), vram_model, vram_safety_margin_mib, repo_root, work_dir, homeserver=None, matrix_user_id=None, matrix_password=None, dev=False, plantuml_url=None)[source]
Run the standard preflight and return every result (order = display order).
homeserverset ⇒ the Conduit reachable+login check runs.dev⇒ the PlantUML check is appended.
- agora.doctor.skipped(name, reason)[source]
A check that did not run, and says so.
Not a green: nothing was verified. Used where a dependency is genuinely absent from a run’s path (e.g. Conduit when the Matrix surface is off), so the report neither fails on it nor pretends it was checked.