Skip to content

Bring base_setup diagnostics helper under the Base CLI framework #1195

Description

@codeforester

Problem

Validated from Claude third-pass finding [80].

cli/python/base_setup/diagnostics.py still builds its own argparse.ArgumentParser and exposes python -m base_setup.diagnostics outside the base_cli.App command framework. It is invoked from setup_common.sh for JSON diagnostics and check-record work, but does not participate in the standard Base CLI behavior for debug flags, log-file handling, run IDs, history records, or shared usage-error handling.

This is partly an architecture issue rather than an immediate user-facing crash: the shell setup layer intentionally orchestrates host probes, but the Python helper now owns structured diagnostics enough that its command boundary should either use the Base CLI framework or be documented and tested as an internal helper with equivalent observability behavior.

Desired outcome

Make the diagnostics helper conform to the Base Python CLI contract, or explicitly narrow it to an internal API and add the missing observability/error-handling coverage.

Scope

  • Evaluate whether base_setup.diagnostics should become a base_cli.App command.
  • Preserve existing shell callers in cli/bash/commands/basectl/subcommands/setup_common.sh.
  • Preserve current JSON payload schema and exit codes.
  • Add tests for the chosen command boundary.

Acceptance criteria

  • The diagnostics helper no longer silently bypasses the relevant Base CLI contract, or the exception is documented and covered by tests.
  • Debug/log/history/run-id behavior is either supported or explicitly ruled out for this internal helper.
  • Existing basectl check --format json, basectl doctor --format json, and check-record behavior remain compatible.

Classification

Review finding taxonomy: implementation/architecture drift.

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions