photon_platform.clerk.doctor

Workspace, toolchain, Press manifest, agent symlink, and managed-service diagnostics.

Attributes

CONTEXT_MAX_BYTES

EXPECTED_PYTHON_MINOR

Functions

check_press_manifest_alignment(projects_dir) → dict[str, Any]

Compare geometor/press/resources/shelf.yaml against live geometor/ directories.

check_context_health(projects_dir, *[, max_bytes]) → dict[str, Any]

Audit workspace GEMINI.md hierarchy, symlinks, and root hygiene.

check_venv_health(projects_dir, *[, expected_python]) → dict[str, Any]

Audit Python/uv virtual environments across workspace orgs and repositories.

run_doctor([config]) → dict[str, Any]

Run an end-to-end health audit of the PHOTON / GEOMETOR workspace and services.

doctor_cmd(as_json) → None

Audit Python toolchain, managed web services, agents, Press manifest, and fleet health.

Module Contents

photon_platform.clerk.doctor.CONTEXT_MAX_BYTES = 20000
photon_platform.clerk.doctor.EXPECTED_PYTHON_MINOR = '3.13'
photon_platform.clerk.doctor.check_press_manifest_alignment(projects_dir: pathlib.Path) → dict[str, Any]

Compare geometor/press/resources/shelf.yaml against live geometor/ directories.

photon_platform.clerk.doctor.check_context_health(projects_dir: pathlib.Path, *, max_bytes: int = CONTEXT_MAX_BYTES) → dict[str, Any]

Audit workspace GEMINI.md hierarchy, symlinks, and root hygiene.

Parameters:
  • projects_dir – Workspace root (e.g. ~/PROJECTS).

  • max_bytes – Soft byte ceiling for GEMINI.md files (Antigravity truncates at 24 KB).

Returns:

Structured dictionary describing context-file health and any hygiene findings.

photon_platform.clerk.doctor.check_venv_health(projects_dir: pathlib.Path, *, expected_python: str = EXPECTED_PYTHON_MINOR) → dict[str, Any]

Audit Python/uv virtual environments across workspace orgs and repositories.

Flags empty stub .venv directories (zero installed distributions), virtual environments targeting an unexpected Python minor version (unless explicitly pinned via .python-version), legacy venv/ directories, and broken .venv symlinks.

Parameters:
  • projects_dir – Workspace root (e.g. ~/PROJECTS).

  • expected_python – Expected default Python major.minor version.

Returns:

Structured dictionary summarizing virtual-environment health.

photon_platform.clerk.doctor.run_doctor(config: photon_platform.clerk.config.ClerkConfig | None = None) → dict[str, Any]

Run an end-to-end health audit of the PHOTON / GEOMETOR workspace and services.

Parameters:

config – Optional ClerkConfig override.

Returns:

Structured JSON-serializable diagnostic report.

photon_platform.clerk.doctor.doctor_cmd(as_json: bool) → None

Audit Python toolchain, managed web services, agents, Press manifest, and fleet health.