Skip to content

P-022 step 7b: implement Rust own-cli with command, output, and exit-code parity #261

Description

@PhysShell

Parent: #250
Recommended tier: strong or medium-strong
Blocked by: #259
Preferably after: #256
Related: #260

Goal

Implement a Rust own-cli binary that exposes the current command surface with exact normalized behavior, without yet making Rust the public default engine.

Target command surface

Port the currently supported commands and formats, including where applicable:

  • check;
  • cfg;
  • emit;
  • report;
  • ownir;
  • explain;
  • --help;
  • --version;
  • human/GitHub/MSBuild/SARIF/report formats;
  • input validation and stable exit codes.

The exact list must be inventoried from the current Python/.NET public and internal CLI surfaces before implementation.

Architecture

own-cli may wire the completed Rust crates:

own-ir
own-syntax
own-cfg
own-analysis
own-diagnostics
own-codegen
own-bridge

The CLI owns argument parsing, I/O and process exit behavior. It must not absorb analysis or bridge logic.

CLI parity fixture

Add a Python-authored fixture for each command containing:

arguments
working-directory assumptions
stdin/files
stdout
stderr
exit code
created artifacts

Normalize only explicitly non-semantic fields such as temp-root prefixes where unavoidable. Paths visible to users remain contractual.

Rust steady-state replay runs with zero Python.

Required controls

  • help and version;
  • unknown command/argument;
  • supported file, directory, .csproj and .sln inputs where the command supports them;
  • unsupported input → the current explicit exit code;
  • clean findings → exit 0;
  • diagnostics found → current non-zero code;
  • extractor/core operational failure → current operational-error code;
  • human/GitHub/MSBuild output;
  • SARIF and report artifact generation;
  • cfg, emit, ownir, and explain output;
  • Windows and Unix paths;
  • spaces and non-ASCII paths;
  • stdin behavior where supported;
  • deterministic output and artifact names;
  • interrupted/cancelled run behavior.

Integration with engine modes

The Rust binary must support the engine selection needed by #260, but this issue does not make Rust the default for the public Owen package.

At minimum, development/dogfood users must be able to select:

  • Python/reference;
  • Rust;
  • compare/shadow.

Do not silently fallback from a Rust crash to Python success.

Distribution boundary

This issue produces and tests the Rust binary. It does not yet:

  • remove Python from Owen.Cli;
  • replace the current public launcher;
  • publish a new package version;
  • choose the default engine.

Guardrails

  • No new command semantics.
  • No diagnostic behavior changes.
  • No bridge/analysis logic in argument handlers.
  • No public cutover.
  • No Python dependency removal.
  • No raw byte fixture weakening merely due to different CLI libraries.

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions