Files
cleveragents-core/features/tdd_validation_attach_named_options.feature
T
freemo 58c9760856 fix(validation): replace positional key=value args with --key value named options in validation attach command
Refactors the 'agents validation attach' command to accept extra validation
arguments as named CLI options using '--key value' format (e.g.
'--coverage-threshold 90'), as required by the specification.

Changes:
- validation.py: Replace positional 'key=value' Argument with Typer context
  settings (allow_extra_args=True, ignore_unknown_options=True) to capture
  '--key value' named options from ctx.args. Strips '--' prefix and maps
  tokens to {key: value} dict entries. Rejects bare tokens (not '--key value')
  with a clear error message.
- features/tdd_validation_attach_named_options.feature: New TDD Behave
  scenarios covering single/multiple named options, no-args case, and
  rejection of old positional key=value format.
- features/steps/tdd_validation_attach_named_options_steps.py: Step
  definitions for the new feature.
- robot/validation_attach_named_options.robot: Robot Framework integration
  tests verifying spec-compliant '--key value' option format.
- robot/helper_validation_attach_named_options.py: Helper script for the
  Robot Framework tests.
- features/steps/tdd_cli_incomplete_subcommand_registration_steps.py: Fix
  pre-existing CliRunner(mix_stderr=False) incompatibility with current Typer.
- features/steps/tool_runtime_steps.py: Fix pre-existing AmbiguousStep error
  by converting conflicting parse-based step definitions to regex matchers.
- features/consolidated_tool.feature: Update step text to match renamed step.

Closes #3684
2026-06-14 17:33:45 -04:00

41 lines
2.3 KiB
Gherkin

Feature: Validation attach accepts --key value named option format
As a CleverAgents user
I want the "agents validation attach" command to accept --key value named options
So that I can use the spec-compliant format for extra validation arguments
Background:
Given a validation attach named options test runner
And a validation attach named options mocked environment
# --- Spec-compliant named option format ---
Scenario: Attach with a single named option --coverage-threshold 90
Given a genuine validation "local/coverage-check" is ready for named option attach
When I invoke validation attach "git-checkout/my-repo" "local/coverage-check" with args "--coverage-threshold 90"
Then the named option attach should succeed
And the service should have received coverage-threshold as "90"
Scenario: Attach with multiple named options
Given a genuine validation "local/lint-check" is ready for named option attach
When I invoke validation attach "git-checkout/my-repo" "local/lint-check" with args "--threshold 70 --strict true"
Then the named option attach should succeed
And the service should have received threshold as "70"
And the service should have received strict as "true"
Scenario: Attach without any extra named options still works
Given a genuine validation "local/basic-check" is ready for named option attach
When I invoke validation attach "git-checkout/my-repo" "local/basic-check" with no extra args
Then the named option attach should succeed
Scenario: Attach with a bare token (not --key value) is rejected
Given a genuine validation "local/coverage-check" is ready for named option attach
When I invoke validation attach "git-checkout/my-repo" "local/coverage-check" with args "coverage-threshold=90"
Then the named option attach should be rejected
And the rejection output should contain "Invalid argument format"
Scenario: Attach with a named option missing its value is rejected
Given a genuine validation "local/coverage-check" is ready for named option attach
When I invoke validation attach "git-checkout/my-repo" "local/coverage-check" with args "--coverage-threshold"
Then the named option attach should be rejected
And the rejection output should contain "Missing value for option"