Skip to content

Adopt base_cli.ExitCode in production Python engines #1197

Description

@codeforester

Problem

Validated from Claude third-pass finding [83].

base_cli.ExitCode is documented in STANDARDS.md and lib/python/base_cli/README.md, and is exported from lib/python/base_cli/__init__.py, but production Python engine modules still return raw 1 and 2 values. A grep over cli/python/*/engine.py found raw return-code usage across release, setup, PR policy, history, logs, export-context, dev, projects, config, clean, GitHub Projects, and prompt engines, while production imports of ExitCode are limited to the base_cli package itself.

This makes policy adoption hard to audit and keeps command return semantics less grepable than the documented standard.

Desired outcome

Use base_cli.ExitCode for standard success, failure, and usage-error returns in production Python CLI engines where the meaning is one of the documented standard codes.

Scope

  • Replace raw standard return codes with base_cli.ExitCode in production Python engines.
  • Keep dynamic return codes, capped error counts, and non-standard external process codes where they are semantically meaningful.
  • Update tests only where they assert implementation details rather than exit values.

Acceptance criteria

  • Production Python CLI engines use base_cli.ExitCode for standard 0, 1, and 2 returns.
  • Remaining raw numeric returns are intentional and easy to explain by grep/review.
  • Existing command behavior and exit values do not change.

Classification

Review finding taxonomy: standardization drift.

Metadata

Metadata

Assignees

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