feat: add pythonlings doctor diagnostics - #67
Open
Huoyanlifusu wants to merge 2 commits into
Open
Conversation
added 2 commits
August 17, 2026 08:54
Add a `pythonlings doctor` subcommand that inspects the runtime, package version, workspace structure, manifest, solutions, state, reset snapshots, and bundled docs without mutating any files. Warnings do not fail the command; required failures exit 1.
Path.resolve() no longer raises on symlink loops in Python 3.13, so detect the loop explicitly with os.stat (errno.ELOOP) instead of relying on resolve()/exists() behavior that differs across versions.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Closes #46
Summary
Adds
pythonlings [--root PATH] doctor, a read-only diagnostic command that reports:Warnings never fail the command; required failures exit 1. The command never
creates, repairs, renames, or otherwise modifies workspace files — it uses its own
non-mutating inspection path (no reuse of the mutating state loader) and mirrors
core/reset.py's snapshot-path logic only.Behavior
pythonlings --helpand respects global--root(explicit--rootwins over the current workspace).~user) are reported as a friendly[FAIL] Workspace:line with no traceback.belong) are caught and reported as
[FAIL] Manifest:with no traceback..bak, no repair).os.stat(errno.ELOOP) so it is consistent acrossPython versions (
Path.resolve()stopped raising on loops in Python 3.13).Tests
python -m pytest tests/unit/test_doctor.py tests/integration/test_cli_doctor.py -q18 passedpython -m pytest -q203 passedpythonlings --root tests/fixtures/passing_curriculum verifypythonlings --root tests/fixtures/passing_curriculum doctor8 checks, 3 warning(s), 0 failure(s)(fixture lacks solutions/snapshots/docs)inited workspace (1172 files): SHA-256 hashesidentical before and after
doctorRepresentative output (healthy workspace)