Skip to content

feat: doctor warns on multiple active installs#116

Merged
Ram9199 merged 2 commits into
mainfrom
feat/doctor-duplicate-installs
Jun 13, 2026
Merged

feat: doctor warns on multiple active installs#116
Ram9199 merged 2 commits into
mainfrom
feat/doctor-duplicate-installs

Conversation

@Ram9199

@Ram9199 Ram9199 commented Jun 13, 2026

Copy link
Copy Markdown
Member

Closes #111. Fourth in the founder-dogfood self-identity chain; reuses inventory's classification (#101).

Principle: a permission tool must clearly identify which copy of itself is guarding the user. The dogfood machine had three installs and doctor passed green — the duplicate signal existed only inside agent-sudo inventory, the command a confused user doesn't know to run.

What

One WARN-only check in run_doctor(): single active install. It counts distinct active, non-shim install roots from the inventory report and WARNs on more than one:

WARN: single active install - Multiple active Agent_Sudo installs detected. Run `agent-sudo inventory` to inspect and choose one canonical install.

Reuse, not new detection

Uses inventory's existing ACTIVE / PYENV-SHIM statuses (#101). No new discovery logic:

  • a pyenv shim and the version install it resolves to collapse to one (PYENV-SHIM records excluded) — no false duplicate;
  • two real installs stay distinct by root, including same-version editables at different source roots.

Scope discipline

Tests / validation

  • New DuplicateInstallCheckTests in tests/test_doctor.py, exactly the four requested cases:
    1. no duplicates → OK
    2. duplicate active installs → WARN (exact message) + exit 0
    3. pyenv shim + resolved install → not double-counted (OK)
    4. same-version editables at different roots → WARN
  • Full suite: 493 passed. ruff clean.
  • Docs: command_reference.md doctor entry notes the duplicate-install WARN.

Add a WARN-only 'single active install' check to run_doctor(), reusing
inventory's ACTIVE / PYENV-SHIM classification (#101). Counts distinct active,
non-shim install roots: a shim and the version it resolves to collapse to one,
while two real installs (even same-version editables at different source roots)
stay distinct.

WARN-only — the name is not in the required set, so the exit code stays 0; no
auto-fix, no cleanup. Message points to `agent-sudo inventory` to choose one
canonical install.

Closes #111
@Ram9199 Ram9199 merged commit 7a8e45c into main Jun 13, 2026
@Ram9199 Ram9199 deleted the feat/doctor-duplicate-installs branch June 13, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor surfaces duplicate installs (reuse inventory detection)

1 participant