Skip to content

doctor --fix says nothing in text mode when the consent gate suppresses it -- the customer cannot tell 'nothing to fix' from 'tan declined' #375

Description

@alpCaner

Found by running the merged dev freeze in a pristine ubuntu:24.04

Measured against ac79d4c (PR #352 merged), frozen from that tree, run in a container carrying only what the quickstart says to install: ca-certificates, git, python3.

tan doctor --build --fix silently does nothing in text mode when the consent gate suppresses it.

The suppression itself is correct and deliberate (tan-cli#91): a container has no TTY, so can_prompt() is false and --fix must not mutate the host unwatched. The defect is that only the JSON envelope says so.

Reproduction

# pristine ubuntu:24.04, only ca-certificates + git + python3 installed
tan doctor --build --fix --sdk-root ./alp-sdk

Text mode, last lines the customer sees:

[   pass] sdkProvenance: alp-sdk 0.15.0 @ 8af7f28

5 passed, 5 warning(s), 4 failed.

Grepping the entire text output for suppress|--fix|did not run|no repair|not.*interactive|terminal returns no match. The customer typed --fix, got a report, and is never told the repair did not run.

The same invocation with --format json does carry it:

issue codes : ['doctor.boardYaml', 'doctor.workspace', 'doctor.westResolved',
               'doctor.pythonFloor', 'bootstrap.prerequisites-missing',
               'doctor.west', 'doctor.zephyrSdk', 'doctor.setools',
               'doctor.jlink', 'doctor.fix-suppressed']
fix:* checks : 0

doctor.fix-suppressed is emitted; no fix:* check is, which is consistent — nothing was attempted.

Why this matters more than it looks

tan-cli#360's acceptance criteria say, verbatim: "Text and JSON modes both explain that no repair ran." That was written about a missing installer; the same requirement applies to a suppressed run, and text mode meets it in neither case today.

It is also the exact shape #360 was filed for — the least-equipped host gets the least diagnostic behaviour. A customer on a fresh machine, in CI, over SSH without a TTY, or piping output to a file, runs the command tan's own bootstrap message recommends and cannot distinguish "nothing needed fixing" from "tan declined to fix anything".

The bootstrap message that sends them there (tan-cli#355/#370) reads:

Or run `tan doctor --build --fix`: it prints the exact command for each tool
from the SDK's manifest, and runs the ones needing no elevation (tan never
spawns `sudo` itself).

Accurate — but on this host it printed the commands via hostPrerequisites' own fix: line and ran nothing, and said nothing about the second half.

Acceptance criteria

  • Text mode states plainly that --fix did not run, and why (no TTY / --non-interactive / --ci / --format json), naming which condition applied.
  • The same holds for the missing-installer case doctor --fix silently skips every repair when brew or winget is absent #360 covers.
  • A test asserts the text-mode sentence with stdin/stderr not a TTY, so it cannot regress to JSON-only.
  • The report still ends with the summary line; the notice must be findable, not buried mid-report.

Related: #91, #355, #360, #370.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions