Skip to content

doctor --fix silently skips every repair when brew or winget is absent #360

Description

@alpCaner

Found while reviewing

PR #352, feat/v06-batch at 1cab240df85d5896c5390697c069720ff2bb24d3.

doctor_cmd.run_fix resolves the first word of each manifest-owned install command through on_path. If it cannot resolve that executable, it immediately continues and emits no outcome check:

resolved_exe = on_path(argv[0])
if resolved_exe is None:
    continue

The new test explicitly pins this silence for a missing winget.

Why this is reachable

The real alp-sdk manifest uses:

macOS:  brew install git/cmake/python3/ninja/xz/wget
Windows: winget install ...

A fresh/minimal macOS host without Homebrew or a Windows image without a usable winget reports tools missing, accepts doctor --fix, then produces no fix:* check for any command because the package manager itself is absent.

This contradicts run_fix's own stated invariant that each entry is either run or refused and that every outcome becomes a check. The user sees the original doctor failures with no indication that --fix did nothing.

Impact

The least-equipped hosts—the primary audience for --fix—get the least diagnostic behavior. They cannot distinguish “nothing needed fixing” from “tan could not find the installer needed to attempt any fix.”

Acceptance criteria

  • An unresolved installer executable emits a named outcome such as doctor.fix-installer-not-found, including the installer and affected tool.
  • Text and JSON modes both explain that no repair ran.
  • Multiple tools sharing the same missing installer are reported without misleading duplicate guidance.
  • The existing test expecting [] is replaced with a verdict assertion.

Related: #91, PR #352.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpython-portRust-to-Python port of the tan command surface

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions