UAT: ActionArgumentSchema does not enforce min_value/max_value for float arguments — spec requires enforcement for both integer and float #2985

Open
opened 2026-04-05 03:09:13 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/action-argument-schema-float-min-max-enforcement
  • Commit Message: fix(action): enforce min_value/max_value bounds for float arguments in ActionArgumentSchema
  • Milestone: v3.7.0
  • Parent Epic: #392

Background

The specification states that min_value and max_value constraints apply to both integer and float arguments:

"Minimum acceptable value for integer and float arguments."
"Maximum acceptable value for integer and float arguments."

However, the implementation in src/cleveragents/action/schema.py (ActionArgumentSchema) only enforces these bounds for integer type arguments. For float arguments, min_value and max_value are stored but never validated at runtime.

This is explicitly acknowledged in the BDD test features/consolidated_action.feature with the comment:

# Float type with min/max - the code currently does NOT check min/max for float,
# so a float with min/max set should still pass (only int has min/max enforcement)

And the scenario:

Scenario: Validate arguments - float with min max bounds still passes
  Given I have an action with a bounded float argument "temperature" min 0.0 max 1.0
  When I validate the action arguments with "temperature" as float 0.5
  Then the action argument validation should pass with no errors

This test passes a value of 0.5 which is within bounds, but the test comment indicates that even out-of-bounds float values would pass — which is incorrect per spec.

Bug Details

Expected behavior (per spec):

  • When a float argument has min_value set and the provided value is below it, validation should fail
  • When a float argument has max_value set and the provided value is above it, validation should fail

Actual behavior:

  • float arguments with min_value/max_value constraints pass validation regardless of the provided value

Code location: src/cleveragents/action/schema.pyActionArgumentSchema class, argument validation logic

Steps to reproduce:

  1. Define an action with a float argument with min_value: 0.0 and max_value: 1.0
  2. Attempt to validate with a value of 2.0 (above max)
  3. Observe that validation passes instead of failing

Subtasks

  • Locate the argument validation logic in src/cleveragents/action/schema.py (ActionArgumentSchema)
  • Extend the min_value/max_value enforcement branch to cover float type in addition to integer
  • Update the BDD scenario in features/consolidated_action.feature to add out-of-bounds float test cases that expect validation failure
  • Add BDD scenarios for: float below min_value → validation fails, float above max_value → validation fails, float within bounds → validation passes
  • Remove or correct the misleading comment that states float min/max is not enforced
  • Ensure all nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e coverage_report)

Definition of Done

  • ActionArgumentSchema enforces min_value for float arguments (value below min → validation error)
  • ActionArgumentSchema enforces max_value for float arguments (value above max → validation error)
  • BDD scenarios cover: float below min fails, float above max fails, float within bounds passes
  • The misleading test comment is removed/corrected
  • No regression in existing integer min/max enforcement tests
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/action-argument-schema-float-min-max-enforcement` - **Commit Message**: `fix(action): enforce min_value/max_value bounds for float arguments in ActionArgumentSchema` - **Milestone**: v3.7.0 - **Parent Epic**: #392 ## Background The specification states that `min_value` and `max_value` constraints apply to **both** `integer` and `float` arguments: > "Minimum acceptable value for integer and float arguments." > "Maximum acceptable value for integer and float arguments." However, the implementation in `src/cleveragents/action/schema.py` (`ActionArgumentSchema`) only enforces these bounds for `integer` type arguments. For `float` arguments, `min_value` and `max_value` are stored but never validated at runtime. This is explicitly acknowledged in the BDD test `features/consolidated_action.feature` with the comment: ``` # Float type with min/max - the code currently does NOT check min/max for float, # so a float with min/max set should still pass (only int has min/max enforcement) ``` And the scenario: ```gherkin Scenario: Validate arguments - float with min max bounds still passes Given I have an action with a bounded float argument "temperature" min 0.0 max 1.0 When I validate the action arguments with "temperature" as float 0.5 Then the action argument validation should pass with no errors ``` This test passes a value of `0.5` which is within bounds, but the test comment indicates that even out-of-bounds float values would pass — which is incorrect per spec. ## Bug Details **Expected behavior** (per spec): - When a `float` argument has `min_value` set and the provided value is below it, validation should **fail** - When a `float` argument has `max_value` set and the provided value is above it, validation should **fail** **Actual behavior**: - `float` arguments with `min_value`/`max_value` constraints pass validation regardless of the provided value **Code location**: `src/cleveragents/action/schema.py` — `ActionArgumentSchema` class, argument validation logic **Steps to reproduce**: 1. Define an action with a `float` argument with `min_value: 0.0` and `max_value: 1.0` 2. Attempt to validate with a value of `2.0` (above max) 3. Observe that validation passes instead of failing ## Subtasks - [ ] Locate the argument validation logic in `src/cleveragents/action/schema.py` (`ActionArgumentSchema`) - [ ] Extend the `min_value`/`max_value` enforcement branch to cover `float` type in addition to `integer` - [ ] Update the BDD scenario in `features/consolidated_action.feature` to add out-of-bounds float test cases that expect validation failure - [ ] Add BDD scenarios for: float below `min_value` → validation fails, float above `max_value` → validation fails, float within bounds → validation passes - [ ] Remove or correct the misleading comment that states float min/max is not enforced - [ ] Ensure all nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e coverage_report`) ## Definition of Done - [ ] `ActionArgumentSchema` enforces `min_value` for `float` arguments (value below min → validation error) - [ ] `ActionArgumentSchema` enforces `max_value` for `float` arguments (value above max → validation error) - [ ] BDD scenarios cover: float below min fails, float above max fails, float within bounds passes - [ ] The misleading test comment is removed/corrected - [ ] No regression in existing `integer` min/max enforcement tests - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-05 03:10:33 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels: Priority/Medium, State/Unverified, Type/Bug
  • Reason: Issue was missing all required labels per CONTRIBUTING.md. Inferred Type/Bug from the "UAT:" prefix. Applied Priority/Medium and State/Unverified as defaults.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Added missing labels: `Priority/Medium`, `State/Unverified`, `Type/Bug` - Reason: Issue was missing all required labels per CONTRIBUTING.md. Inferred `Type/Bug` from the "UAT:" prefix. Applied `Priority/Medium` and `State/Unverified` as defaults. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2985
No description provided.