UAT: agents validation attach args format mismatch — spec shows --coverage-threshold 90 named options but implementation requires coverage_threshold=90 positional key=value pairs #2998

Open
opened 2026-04-05 03:25:21 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/cli-validation-attach-args-format
  • Commit Message: fix(cli): align agents validation attach argument format with spec named options
  • Milestone: v3.7.0
  • Parent Epic: #936

What Was Tested

The argument-passing mechanism for agents validation attach <ARGS>... was analyzed against the specification examples.

Expected Behavior (from spec)

Per docs/specification.md § agents validation attach, the spec examples show validation-specific arguments as named CLI options:

$ agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90

The output panel shows: Args: coverage_threshold=90

The spec also shows:

$ agents validation attach --project local/staging-api local/api-repo local/run-tests --coverage-threshold 70

This implies that validation-specific arguments are passed as named CLI options (e.g., --coverage-threshold 90), not as positional key=value strings.

Actual Behavior

In src/cleveragents/cli/commands/validation.py, the attach() command (lines 288–327) accepts <ARGS>... as positional arguments and parses them as key=value pairs:

args: Annotated[
    list[str] | None,
    typer.Argument(help="Additional arguments (key=value pairs)"),
] = None
...
for arg in args:
    if "=" not in arg:
        console.print(f"[red]Invalid argument format:[/red] {arg} (expected key=value)")
        raise typer.Abort()
    key, val = arg.split("=", 1)
    extra_args[key] = val

To pass coverage_threshold=90, the user must type:

agents validation attach local/api-repo local/run-tests coverage_threshold=90

NOT the spec-shown:

agents validation attach local/api-repo local/run-tests --coverage-threshold 90

Impact

  • Users following the spec examples will get errors when they try --coverage-threshold 90
  • The key=value format is not documented in the spec and is non-standard for CLI tools
  • The spec's <ARGS>... description says "Optional validation-specific arguments (passed through to the validation tool's input_schema at execution time)" — the format is ambiguous in the description but the examples clearly show named options

Code Location

  • src/cleveragents/cli/commands/validation.py, attach() function, lines 288–327

Severity

Medium — users following the spec examples will encounter errors. The workaround (using key=value format) is not documented.

Subtasks

  • Write a failing Behave scenario reproducing the --coverage-threshold 90 named-option invocation being rejected
  • Refactor attach() in src/cleveragents/cli/commands/validation.py to accept named CLI options (e.g., --coverage-threshold 90) instead of positional key=value pairs
  • Ensure the parsed argument dict still maps coverage_threshold → 90 (underscore-normalised key) when passed through to the validation tool's input_schema
  • Update any existing unit/integration tests that exercise the old key=value positional format
  • Verify the fix against all spec examples in docs/specification.md § agents validation attach
  • Run nox and confirm all stages pass with coverage ≥ 97%

Definition of Done

  • A failing Behave test that reproduces the bug exists and is merged before the fix (TDD workflow)
  • agents validation attach local/api-repo local/run-tests --coverage-threshold 90 works as shown in the spec
  • agents validation attach local/api-repo local/run-tests coverage_threshold=90 (old format) either works via backward-compat shim or raises a clear, spec-aligned error
  • No regression in existing agents validation attach tests
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/cli-validation-attach-args-format` - **Commit Message**: `fix(cli): align agents validation attach argument format with spec named options` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## What Was Tested The argument-passing mechanism for `agents validation attach <ARGS>...` was analyzed against the specification examples. ## Expected Behavior (from spec) Per `docs/specification.md` § agents validation attach, the spec examples show validation-specific arguments as named CLI options: ```bash $ agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90 ``` The output panel shows: `Args: coverage_threshold=90` The spec also shows: ```bash $ agents validation attach --project local/staging-api local/api-repo local/run-tests --coverage-threshold 70 ``` This implies that validation-specific arguments are passed as named CLI options (e.g., `--coverage-threshold 90`), not as positional `key=value` strings. ## Actual Behavior In `src/cleveragents/cli/commands/validation.py`, the `attach()` command (lines 288–327) accepts `<ARGS>...` as positional arguments and parses them as `key=value` pairs: ```python args: Annotated[ list[str] | None, typer.Argument(help="Additional arguments (key=value pairs)"), ] = None ... for arg in args: if "=" not in arg: console.print(f"[red]Invalid argument format:[/red] {arg} (expected key=value)") raise typer.Abort() key, val = arg.split("=", 1) extra_args[key] = val ``` To pass `coverage_threshold=90`, the user must type: ```bash agents validation attach local/api-repo local/run-tests coverage_threshold=90 ``` NOT the spec-shown: ```bash agents validation attach local/api-repo local/run-tests --coverage-threshold 90 ``` ## Impact - Users following the spec examples will get errors when they try `--coverage-threshold 90` - The `key=value` format is not documented in the spec and is non-standard for CLI tools - The spec's `<ARGS>...` description says "Optional validation-specific arguments (passed through to the validation tool's `input_schema` at execution time)" — the format is ambiguous in the description but the examples clearly show named options ## Code Location - `src/cleveragents/cli/commands/validation.py`, `attach()` function, lines 288–327 ## Severity Medium — users following the spec examples will encounter errors. The workaround (using `key=value` format) is not documented. ## Subtasks - [ ] Write a failing Behave scenario reproducing the `--coverage-threshold 90` named-option invocation being rejected - [ ] Refactor `attach()` in `src/cleveragents/cli/commands/validation.py` to accept named CLI options (e.g., `--coverage-threshold 90`) instead of positional `key=value` pairs - [ ] Ensure the parsed argument dict still maps `coverage_threshold → 90` (underscore-normalised key) when passed through to the validation tool's `input_schema` - [ ] Update any existing unit/integration tests that exercise the old `key=value` positional format - [ ] Verify the fix against all spec examples in `docs/specification.md` § agents validation attach - [ ] Run `nox` and confirm all stages pass with coverage ≥ 97% ## Definition of Done - [ ] A failing Behave test that reproduces the bug exists and is merged before the fix (TDD workflow) - [ ] `agents validation attach local/api-repo local/run-tests --coverage-threshold 90` works as shown in the spec - [ ] `agents validation attach local/api-repo local/run-tests coverage_threshold=90` (old format) either works via backward-compat shim or raises a clear, spec-aligned error - [ ] No regression in existing `agents validation attach` tests - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 03:26:04 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2998
No description provided.