Skip to content

doctor

Non-mutating health check of a wiki’s docs/ structure and git clone.

CLASS DESCRIPTION
DoctorReport

Result of a doctor health check. Non-mutating: built entirely from reads.

FUNCTION DESCRIPTION
check_shallow_clone

Return True if root is a shallow git clone, False if not, None if not a git repo.

check_skills_version_drift

Compare the local .agents/skills/.provenance version to the installed wiki_toolkit version.

run_doctor

Run the non-mutating doctor health check against docs_dir.

validate_jsonl

Return a list of error messages for malformed lines in a JSONL file, empty if well-formed.

Classes

DoctorReport dataclass

DoctorReport(
    python_version: str,
    docs_dir: Path,
    docs_dir_source: ConfigSource,
    missing_structure: list[str] = list(),
    present_structure: list[str] = list(),
    note_count: int = 0,
    is_shallow_clone: bool | None = None,
    jsonl_errors: dict[str, list[str]] = dict(),
    skills_version_drift: tuple[str, str] | None = None,
)

Result of a doctor health check. Non-mutating: built entirely from reads.

ATTRIBUTE DESCRIPTION
ok

True if no missing structure, no shallow clone, no malformed JSONL, and no skills version drift.

TYPE: bool

Attributes

ok property
ok: bool

True if no missing structure, no shallow clone, no malformed JSONL, and no skills version drift.

Functions:

check_shallow_clone

check_shallow_clone(root: Path) -> bool | None

Return True if root is a shallow git clone, False if not, None if not a git repo.

check_skills_version_drift

check_skills_version_drift(docs_dir: Path) -> tuple[str, str] | None

Compare the local .agents/skills/.provenance version to the installed wiki_toolkit version.

Returns (local_version, installed_version) if they differ, None if they match or no local copy’s provenance marker exists.

run_doctor

run_doctor(
    docs_dir: Path,
    root: Path | None = None,
    docs_dir_source: ConfigSource = "default",
) -> DoctorReport

Run the non-mutating doctor health check against docs_dir.

root is the git repository root used for the shallow-clone check; it defaults to docs_dir’s parent, the common case where docs_dir is a docs/ subdirectory of the repo.

validate_jsonl

validate_jsonl(path: Path) -> list[str]

Return a list of error messages for malformed lines in a JSONL file, empty if well-formed.