Skip to content

fix(completion): preserve the published argument struct - #1501

Closed
jdx wants to merge 1 commit into
mainfrom
codex/aube-completion-api-compat
Closed

fix(completion): preserve the published argument struct#1501
jdx wants to merge 1 commit into
mainfrom
codex/aube-completion-api-compat

Conversation

@jdx

@jdx jdx commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

The late API check on #1496 caught an accidental Rust API break: adding CompletionArgs.bin prevents existing callers from constructing the public struct with its original fields.

Move executable selection into a crate-private CompletionCliArgs, keep the public CompletionArgs and completion::run interface compatible with v2.2.11, and preserve aube completion SHELL --bin PROGRAM behavior. Regenerate the CLI metadata and documentation.

Validation:

  • cargo-semver-checks --baseline-rev v2.2.11 --package aube: all 223 checks pass, no semver update required.
  • Four focused integration tests pass, including construction with the original public fields.
  • All 12 native scripts pass shell syntax and actual completion callback checks.
  • Strict Clippy for all aube targets, formatting, and documentation generation pass.

The advisory CI comparison against current main may report removal of the field introduced in #1496. That removal is intentional: this restores the v2.2.11 API, as verified above, while retaining the CLI feature in a private type.

AI-assisted — Tool: Codex; model: OpenAI/GPT-6; version: unavailable.

Summary by CodeRabbit

  • Documentation

    • Reordered the completion command options in the CLI reference for consistency.
    • Clarified the documented ordering of --bin, --force, and --install.
  • Tests

    • Added end-to-end coverage for constructing completion command arguments, including shell, force, and install options.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 910e936e-5f6b-4ee2-b33b-84f9cccb5f1a

📥 Commits

Reviewing files that changed from the base of the PR and between 6d1ae52 and 33fbce6.

📒 Files selected for processing (6)
  • aube.usage.kdl
  • crates/aube/src/commands/completion.rs
  • crates/aube/src/lib.rs
  • crates/aube/tests/e2e.rs
  • docs/cli/commands.json
  • docs/cli/completion.md

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The completion command now imports shared completion-args flags. The public CompletionArgs excludes --bin, while CLI-only parsing retains it and passes it separately to completion execution. Tests and CLI documentation reflect the updated argument structure.

Changes

Completion argument separation

Layer / File(s) Summary
Shared completion flag contract
aube.usage.kdl
Adds the reusable completion-args flagset and updates completion to import it while retaining --bin.
CLI argument and dispatch wiring
crates/aube/src/commands/completion.rs, crates/aube/src/lib.rs
Moves bin into CompletionCliArgs and passes it separately to run_selected.
Construction test and CLI documentation
crates/aube/tests/e2e.rs, docs/cli/commands.json, docs/cli/completion.md
Tests public CompletionArgs construction and preserves the documented --bin behavior and ordering.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 33fbc

This change restores the published completion argument interface while retaining the CLI-only --bin option and its completion filtering behavior. No merge-blocking current-head risk is identified.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Completion
  participant run_selected
  CLI->>Completion: Parse CompletionCliArgs
  Completion->>run_selected: Pass CompletionArgs and bin
  run_selected->>run_selected: Apply executable filtering and completion options
Loading

Suggested reviewers: colinhacks

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: preserving the published completion argument struct for compatibility.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/aube-completion-api-compat

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.97.1)

Clippy execution timed out


Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant