Files
cleveragents-core/features/tdd_validation_add_required_flag.feature
brent.edwards a5cc81354d
CI / security (pull_request) Successful in 51s
CI / build (pull_request) Successful in 14s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m26s
CI / typecheck (pull_request) Successful in 3m54s
CI / quality (pull_request) Successful in 3m39s
CI / integration_tests (pull_request) Successful in 6m34s
CI / unit_tests (pull_request) Successful in 6m41s
CI / docker (pull_request) Successful in 1m21s
CI / coverage (pull_request) Successful in 9m10s
CI / e2e_tests (pull_request) Successful in 25m30s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 55m10s
fix: add --required/--informational flags to validation add CLI
Add --required and --informational as mutually exclusive boolean options
to the `agents validation add` CLI command. When specified, they override
the `mode` field from the YAML config file. This aligns the CLI with the
specification (specification.md line 22339) which states the validation
mode can be set "via --required/--informational on agents validation add".

The fix resolves the spec contradiction by:
- Implementing the flags in the CLI (per Core Concepts > Validation Mode)
- Updating the formal CLI reference to include the new flags
- Adding an exception to Design Principle #3 for validation add
- Removing the spurious positional name argument from the walkthrough

TDD tests from #1102 now run normally with @tdd_expected_fail removed.
New edge-case tests cover mutual exclusivity (both flags rejected).

Also excludes tool/wrapping.py from semgrep exec/compile rules since
that module intentionally uses exec() in a controlled sandbox for the
validation transform feature.

ISSUES CLOSED: #1038
2026-03-31 07:42:06 +00:00

52 lines
2.4 KiB
Gherkin

# 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