Skip to content

feat(cli): add deskaoy doctor platform diagnostic (Batch 12) - #22

Merged
Alajmah merged 1 commit into
mainfrom
batch-12/deskaoy-doctor
Jun 28, 2026
Merged

Alajmah merged 1 commit into
mainfrom
batch-12/deskaoy-doctor

Conversation

@Alajmah

@Alajmah Alajmah commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Batch 12 — deskaoy doctor platform diagnostic

Issue: #19

Adds a side-effect-free platform diagnostic command that exposes the adapter truthfulness work from Batches 5, 10, and 11 as user-facing diagnostics.

What it does

deskaoy doctor checks:

  • Package: version, import path, storage path
  • Platform: OS, Python, architecture
  • Adapter readiness:
    • Windows: comtypes, pywin32, pyautogui, mss
    • Linux: session type, DISPLAY, xdotool backend status
    • macOS: experimental gate, pyobjc, permission probes
  • Optional deps: LLM, grounding, Pillow, OpenTelemetry
  • Safety: key blocklist, sensitive apps
  • Known limitations: macOS gate, Wayland, lint debt

Output modes

  • Default: human-readable with section headers and PASS/WARN/FAIL/SKIP icons
  • --json: machine-readable JSON with stable top-level keys (status, checks, summary)
  • --verbose: show full detail for all checks

Status model

  • PASS: check succeeded
  • WARN: optional dependency or platform limitation
  • FAIL: hard failure (package broken, safety module missing)
  • SKIP: informational only

Exit codes: 0 for usable/warnings, 1 for hard failures.

Cross-platform: missing optional deps on the wrong platform are WARN/SKIP, never FAIL.

What was replaced

The old stale _cmd_doctor that referenced patchright/browser/mcp and said macOS/Linux are not implemented. Now uses real backend detection.

Verification

  • pytest tests/test_cli -q: 145 passed
  • pytest tests/test_adapters -q: 243 passed, 2 skipped
  • pytest tests/test_release_coherence.py -q: 22 passed
  • pytest tests/integration/test_desktop_integration.py -q: 10 passed
  • ruff check src/deskaoy/diagnostics tests/test_cli/test_doctor.py: clean

@gitwire-hq gitwire-hq Bot added the size/XL label Jun 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: acf861f6b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/deskaoy/cli/main.py
Comment on lines +628 to +629
if getattr(args, "json", False):
print(json_mod.dumps(result, indent=2))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return failure status in JSON mode

When deskaoy doctor --json is used and run_doctor() reports a hard failure, this branch prints the JSON and then falls off the end of _cmd_doctor, so main() returns None and console entry points exit successfully. This contradicts the documented exit-code contract and makes JSON mode unsafe for CI/automation that relies on nonzero status for broken package/safety checks.

Useful? React with 👍 / 👎.

Comment thread src/deskaoy/diagnostics/doctor.py Outdated
def _check_platform() -> list[CheckResult]:
results: list[CheckResult] = []
results.append(CheckResult("OS", Status.PASS, f"{platform.system()} {platform.release()}"))
results.append(CheckResult("Python", Status.PASS, sys.version.split()[0]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate the supported Python version

This now reports the running Python interpreter as PASS unconditionally. On an unsupported interpreter such as Python 3.10, deskaoy doctor can still conclude the environment is usable if the other hard checks pass, even though pyproject.toml requires Python >=3.11 and the previous doctor explicitly validated that requirement. Please compare sys.version_info against the package minimum and mark unsupported versions as a hard failure or warning.

Useful? React with 👍 / 👎.

@Alajmah
Alajmah force-pushed the batch-12/deskaoy-doctor branch from acf861f to 815650c Compare June 28, 2026 10:52
Batch 12 — deskaoy doctor platform diagnostic (Issue #19).

New diagnostics module (src/deskaoy/diagnostics/) with side-effect-free platform checks:

- Package: version, import path, storage path

- Platform: OS, Python, architecture

- Adapter readiness:

  - Windows: comtypes/pywin32/pyautogui/mss availability

  - Linux: session type, DISPLAY, xdotool backend status

  - macOS: experimental gate, pyobjc, Accessibility/Screen Recording permissions

- Optional deps: LLM, grounding, Pillow, OpenTelemetry

- Safety: key blocklist, sensitive apps

- Known limitations: macOS gate, Wayland, lint debt

Replaces the old stale doctor command that referenced patchright/browser.

Output modes: human-readable (default), --json, --verbose.

Status model: PASS/WARN/FAIL/SKIP. Exit 0 for usable, 1 for hard failures.

Cross-platform: missing optional deps are WARN/SKIP, not FAIL.

Tests: 13 tests covering JSON output, exit codes, Linux backend detection, status semantics, no-input-injection invariant.
Signed-off-by: Alajmah <55954113+Alajmah@users.noreply.github.com>
@Alajmah
Alajmah force-pushed the batch-12/deskaoy-doctor branch from 815650c to 136ae15 Compare June 28, 2026 11:30
@Alajmah
Alajmah merged commit 39d8d68 into main Jun 28, 2026
8 checks passed
@Alajmah
Alajmah deleted the batch-12/deskaoy-doctor branch June 28, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant