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.
Problem
Validated from Claude third-pass finding
[80].cli/python/base_setup/diagnostics.pystill builds its ownargparse.ArgumentParserand exposespython -m base_setup.diagnosticsoutside thebase_cli.Appcommand framework. It is invoked fromsetup_common.shfor 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
base_setup.diagnosticsshould become abase_cli.Appcommand.cli/bash/commands/basectl/subcommands/setup_common.sh.Acceptance criteria
basectl check --format json,basectl doctor --format json, and check-record behavior remain compatible.Classification
Review finding taxonomy: implementation/architecture drift.