Conversation
Self-diagnoses the 6 most common first-run failures — missing Python 3.11+, missing `ossmate` install, missing/unauthed `gh` CLI, broken MCP server, missing `.claude/commands/`, `.ossmate/` permission errors. Reports green/yellow/red with remediation hints; `--json` for CI. Exits 0 when healthy, 1 on any hard fail. Motivated by Phase 9 onboarding-friction review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Main's CI has been failing since Phase 7 (3 consecutive runs on main: 4ea7191 / a6787ea / f8fba38) from two independent bugs that the new doctor PR surfaced: 1. tests/test_plugin_manifest.py::test_referenced_hook_scripts_exist The regex captured a trailing `\` from the JSON-escaped `\"` after each `${CLAUDE_PLUGIN_ROOT}/...` path. Windows pathlib normalized it away, so the bug was invisible locally; Linux/macOS pathlib treated `\` as a literal character and the existence check failed. Fix: exclude `\` from the regex character class. 2. Widespread ruff violations - B008 in cli.py (9x) — Typer's idiom calls `_common_*()` helpers in argument defaults, which is unavoidable. Added a per-file-ignore in cli/ossmate/pyproject.toml rather than uglifying the call sites. - E501 in cli.py (3x) — broken into multi-line `@app.command(...)` decls. - E741 in user_prompt_router.py (1x) — `l` → `lbl`. - F401 in three test files and I001 in several modules — ruff --fix. Also drops a fragile `assert '--json' in result.output` from test_help_lists_doctor: rich's help-table renderer wraps flag names across ANSI sequences at narrow CI terminal widths, making the literal substring match unreliable. The --json flag is still exercised end-to-end by test_json_output_schema_via_clirunner. Local: 176 passed, ruff all-clear. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ossmate doctorsubcommand — self-diagnoses the 6 most common first-run failures: Python version,ossmateinstall,ghCLI + auth, MCP server reachability (python -m ossmate_mcp --selftest), project-root detection,.ossmate/artifact dir writabilityrich;--jsonflag for CI useChanges
cli/ossmate/src/ossmate/diagnostics.py(new) — 6 pure(project_root) -> CheckResultfunctions +run_allcomposer +render_pretty/render_jsoncli/ossmate/src/ossmate/cli.py— wireddoctorTyper subcommand (lazy import, no SDK round-trip)tests/test_doctor.py(new) — 15 hermetic tests;tests/test_cli.py— addeddoctorto CLI-only allowlist (1 line)CHANGELOG.md[Unreleased]/Added,README.md/README.en.mdQuickstart troubleshooting linerichwas already declared; first direct use in the CLITest plan
python -m pytest tests/— 176 passed, ~13s (161 existing + 15 new)python -m ossmate doctor --cwd <repo>— all 6 ✓, exit 0python -m ossmate doctor --json --cwd <repo>— valid JSON schema, 6 checkspython -m ossmate doctor --cwd \$HOME—project root⚠,.ossmate writable⚠ (skipped gracefully), exit 0python -m ossmate --help—doctorappears in subcommand list🤖 Generated with Claude Code