Skip to content

Python support-bundle returns ok:true when its doctor checks fail and omits the oracle debug report #357

Description

@alpCaner

Found while reviewing

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

The Python support-bundle port is not contract-compatible with the Rust oracle in two coupled ways:

  1. It always sets ExitCode.SUCCESS after writing the file, even when its embedded doctor report contains failed checks and the emitted envelope contains error-severity issues.
  2. It deliberately substitutes Python's build/flash-readiness doctor_cmd._collect checklist for the oracle's debug-focused report, omitting debugger state and changing the checks/content.

The module and tests describe this as a known divergence, but the Rust implementation explicitly makes doctor.summary.fail > 0 a doctor failure.

Direct oracle reproduction

Run both binaries with the same resolved SDK/project, an empty PATH, and separate bundle destinations:

Rust:   rc=4, ok=false, exitCode=4
        issues=[support-bundle.hostPrerequisites:error]

Python: rc=0, ok=true, exitCode=0
        issues include workspace/error, westResolved/error,
        hostPython/error, hostPrerequisites/error, zephyrSdk/error, ...

The Rust bundle's context/checks included:

context: debuggerExtensions, projectSelected, ...
checks: workspaceRoot, sdkRoot, boardYaml, codeLLDBExtension,
        lldb, hostPrerequisites, zephyrSdkAvailableForHost, homePath

The Python bundle omitted debuggerExtensions and projectSelected, and used a different checklist (sdk, workspace, westResolved, hostPython, zephyrSdk, setools, jlink, ...).

Impact

  • Automation sees ok:true and exit 0 even though the envelope reports errors.
  • A support bundle attached for a debug failure omits the debugger/LLDB facts the command exists to collect.
  • Consumers cannot treat the Python port as the command that the v0.4.1 contract describes.

Acceptance criteria

  • Failed doctor checks produce DOCTOR_FAILURE / exit 4 / ok:false, matching the oracle.
  • The bundle carries the debug-focused doctor report, including standalone values for projectSelected and debuggerExtensions and checks for CodeLLDB/LLDB where applicable.
  • A live oracle-parity test compares the same failing-host case; no deliberate-divergence exemption.

Related: #260, #257, PR #352.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenvelope-contractThe {command,ok,exitCode,project,data,issues} contract consumed by alp-sdk-vscodeoracle-parityDivergence from the released Rust oracle; measure by RUNNING the binarypython-portRust-to-Python port of the tan command surfacerelease-blockerBlocks the next release; must land before the tag

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions