# TDD bug-capture test for bug #1038.
#
# The specification (docs/specification.md line 22339) states that the
# validation mode can be set "via --required/--informational on agents
# validation add", and numerous workflow examples in the spec use the
# --required flag.
#
# Bug #1038 reported that the ``add`` command did not accept these flags,
# causing a ``NoSuchOption`` error.  The fix adds --required and
# --informational as mutually exclusive boolean options that override the
# mode field in the YAML config when specified.
#
# These scenarios were originally tagged @tdd_expected_fail while the bug
# was unfixed.  Now that the fix is in place, the tag has been removed and
# the tests run normally as permanent regression guards.

@tdd_issue @tdd_issue_1038
Feature: Bug #1038 — validation add missing --required flag
  As a user of the CleverAgents CLI
  I want the ``agents validation add`` command to accept a ``--required`` flag
  So that I can override the validation mode at registration time per the spec

  Background:
    Given a tdd 1038 CLI test runner with mocked services
    And a tdd 1038 temporary validation YAML config

  Scenario: The --required flag is accepted by validation add
    When I tdd 1038 invoke validation add with --required flag
    Then the tdd 1038 CLI result should succeed
    And the tdd 1038 registered validation mode should be "required"

  Scenario: The --informational flag is accepted by validation add
    When I tdd 1038 invoke validation add with --informational flag
    Then the tdd 1038 CLI result should succeed
    And the tdd 1038 registered validation mode should be "informational"

  Scenario: The --required flag overrides YAML config mode
    Given a tdd 1038 temporary validation YAML config with mode "informational"
    When I tdd 1038 invoke validation add with --required flag
    Then the tdd 1038 CLI result should succeed
    And the tdd 1038 registered validation mode should be "required"

  Scenario: The --informational flag overrides YAML config mode
    Given a tdd 1038 temporary validation YAML config with mode "required"
    When I tdd 1038 invoke validation add with --informational flag
    Then the tdd 1038 CLI result should succeed
    And the tdd 1038 registered validation mode should be "informational"

  Scenario: Passing both --required and --informational is rejected
    When I tdd 1038 invoke validation add with both flags
    Then the tdd 1038 CLI result should be aborted
