feat: doctor warns on stale installs and editable source drift#115
Merged
Conversation
Add two WARN-only checks to run_doctor(), built on the SelfIdentity primitive (#108) and inventory's version classification (#101): - 'install up to date': running version < newest install found on the machine (names where the newer copy lives) — the dogfood case where a shell silently resolved a stale copy. - 'runtime matches install source': an editable install whose running package path no longer lives under its registered source (moved/shadowed). Neither name is in the required set, so the exit code is never affected — this does not auto-fix. identity and inventory_report are injectable for tests. Closes #110
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 #110. Third in the founder-dogfood self-identity chain; builds on
SelfIdentity(#108) and inventory classification (#101).Principle: a permission tool must clearly identify which copy of itself is guarding the user.
doctorpreviously ran six green checks while a stale v0.5.5 snapshot was guarding the user — it never noticed the running code was behind, or that an editable install had drifted from its source.What
Two WARN-only checks added to
run_doctor():install up to date— running version vs inventory'snewest_version. WARNs when an older copy is resolving ahead of a newer install, and names where the newer one lives:runtime matches install source— for editable installs, verifies the running package path still lives under its registered source; WARNs on drift (source moved, or a stale copy shadowing it).Scope discipline
doctor's required set, so the exit code is never affected and nothing is auto-fixed (explicit doctor detects stale installs and runtime mismatches #110 constraint).SelfIdentityand inventory'snewest_version/_version_keyrather than re-deriving versions.identityandinventory_reportare injectable intorun_doctor(...)for deterministic tests.Tests / validation
InstallHealthCheckTestsintests/test_doctor.py: stale pinned install (WARN + exit 0), editable source mismatch (WARN + exit 0), clean current install (both OK), plus unknown-version no-warn and a default-presence check.ruffclean.command_reference.mddoctorentry notes the new WARN-only checks.