Commit Graph

2 Commits

Author SHA1 Message Date
HAL9000 06d6acab94 fix(validation): normalise --key value option keys and reject consecutive flags
Restore the two behaviours that master had but were lost in this branch:

1. Convert hyphens to underscores in named-option keys before forwarding
   to the service layer (--coverage-threshold → coverage_threshold). This
   matches Typer/Click's universal convention and the documented
   attach_validation(args=...) contract, where keys must be Python-
   identifier-style strings.

2. Detect a missing value when the next token starts with -- (e.g.
   "--threshold --strict true" no longer silently sets threshold to the
   literal string "--strict"; it errors with a clear "Missing value for
   option" message).

Update the Behave step definitions and the Robot helper to assert the
underscore-normalised key (coverage_threshold), matching the restored
behaviour. The CLI-level option name (--coverage-threshold) is unchanged
in the feature file and Robot test — only the dict key the service
receives is normalised.
2026-06-14 17:33:45 -04:00
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