UAT: agents validation attach extra args must use --key value format per spec, but implementation requires key=value positional format #1420

Open
opened 2026-04-02 17:46:18 +00:00 by freemo · 0 comments
Owner

Bug Report

Feature Area: Validation Pipeline (v3.4.0)

What Was Tested

The argument format for validation-specific arguments passed to agents validation attach.

Expected Behavior (from spec)

Per docs/specification.md line 9725 (example):

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

The spec shows validation-specific arguments using --key value option syntax (e.g., --coverage-threshold 90).

Actual Behavior

The implementation expects key=value positional format:

# In validation.py attach():
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)

When using the spec-documented --coverage-threshold 90 syntax:

$ agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90
Error: No such option: --coverage-threshold

Steps to Reproduce

agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90
# Error: No such option: --coverage-threshold

The workaround (not documented in spec) would be:

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

Code Location

src/cleveragents/cli/commands/validation.pyattach() function. The args parameter is defined as list[str] positional arguments expecting key=value format, but the spec uses --key value option syntax.

Severity

Medium — The functionality works with the key=value workaround, but the CLI interface does not match the spec's documented syntax, causing confusion and breaking spec-compliant scripts.


Metadata

  • Branch: bugfix/m5-validation-attach-args-format
  • Commit Message: fix(cli): align validation attach extra-args format with spec (--key value instead of key=value)
  • Milestone: v3.5.0
  • Parent Epic: #357

Subtasks

  • Investigate how Typer supports dynamic/unknown --key value options (e.g., typer.Context with allow_extra_args=True and ignore_unknown_options=True)
  • Refactor attach() to accept extra args as --key value pairs via Typer context
  • Update argument parsing logic to extract key-value pairs from ctx.args in --key value format
  • Update CLI help text and docstring to document the --key value format
  • Tests (Behave): Update existing key=value scenarios to use --key value format
  • Tests (Behave): Add scenario for --key value format with multiple args
  • Tests (Robot): Update integration tests to use --key value format
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

  • All subtasks are completed and checked off
  • agents validation attach ... --coverage-threshold 90 works as documented in the spec
  • The old key=value format is either removed or documented as deprecated
  • CLI help text reflects the --key value format
  • BDD scenarios use the spec-documented format
  • A PR is opened from the branch to master, reviewed, and merged
  • All nox stages pass
  • Coverage >= 97%
## Bug Report **Feature Area:** Validation Pipeline (v3.4.0) ### What Was Tested The argument format for validation-specific arguments passed to `agents validation attach`. ### Expected Behavior (from spec) Per `docs/specification.md` line 9725 (example): ``` $ agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90 ``` The spec shows validation-specific arguments using `--key value` option syntax (e.g., `--coverage-threshold 90`). ### Actual Behavior The implementation expects `key=value` positional format: ```python # In validation.py attach(): 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) ``` When using the spec-documented `--coverage-threshold 90` syntax: ``` $ agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90 Error: No such option: --coverage-threshold ``` ### Steps to Reproduce ```bash agents validation attach --project local/api-service local/api-repo local/run-tests --coverage-threshold 90 # Error: No such option: --coverage-threshold ``` The workaround (not documented in spec) would be: ```bash agents validation attach --project local/api-service local/api-repo local/run-tests coverage_threshold=90 ``` ### Code Location `src/cleveragents/cli/commands/validation.py` — `attach()` function. The `args` parameter is defined as `list[str]` positional arguments expecting `key=value` format, but the spec uses `--key value` option syntax. ### Severity Medium — The functionality works with the `key=value` workaround, but the CLI interface does not match the spec's documented syntax, causing confusion and breaking spec-compliant scripts. --- ## Metadata - **Branch**: `bugfix/m5-validation-attach-args-format` - **Commit Message**: `fix(cli): align validation attach extra-args format with spec (--key value instead of key=value)` - **Milestone**: v3.5.0 - **Parent Epic**: #357 ## Subtasks - [ ] Investigate how Typer supports dynamic/unknown `--key value` options (e.g., `typer.Context` with `allow_extra_args=True` and `ignore_unknown_options=True`) - [ ] Refactor `attach()` to accept extra args as `--key value` pairs via Typer context - [ ] Update argument parsing logic to extract key-value pairs from `ctx.args` in `--key value` format - [ ] Update CLI help text and docstring to document the `--key value` format - [ ] Tests (Behave): Update existing `key=value` scenarios to use `--key value` format - [ ] Tests (Behave): Add scenario for `--key value` format with multiple args - [ ] Tests (Robot): Update integration tests to use `--key value` format - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] All subtasks are completed and checked off - [ ] `agents validation attach ... --coverage-threshold 90` works as documented in the spec - [ ] The old `key=value` format is either removed or documented as deprecated - [ ] CLI help text reflects the `--key value` format - [ ] BDD scenarios use the spec-documented format - [ ] A PR is opened from the branch to `master`, reviewed, and merged - All nox stages pass - Coverage >= 97%
freemo added this to the v3.5.0 milestone 2026-04-02 17:48:04 +00:00
freemo self-assigned this 2026-04-02 18:45:12 +00:00
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.

Dependencies

No dependencies set.

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