16 Commits
Author SHA1 Message Date
mvdbeek 154509dee6 Reject non-numeric float input bounds at workflow import
A float input's in_range counted as min/max bounds whatever its values
were, so check_validators skipped it and bounds like "one" or [5]
imported and failed only when the workflow ran. Float bounds must now be
numbers, as integer bounds must be integers; others are validated as
regular validators and rejected.
2026-10-25 16:34:09 +01:00
mvdbeek 359a687670 Show imported inverted workflow input bounds in the editor's min/max fields
An imported in_range with min > max is reported as a step error so it
can be corrected in the editor, but the form put it in the hidden
extra_validators field: the min/max fields stayed empty, and entering
new bounds stored them next to the inverted range, which kept the error.
Numeric ranges now go to min/max by the same rule split_numeric_bounds
uses, without model validation.
2026-10-25 16:34:08 +01:00
mvdbeek bc37219d72 Report inverted workflow input bounds as a step error, not at import
Import and save checked every validator, so a workflow input with
min > max was rejected with a 400 while the editor, export and run form
report it as a step error. min/max bounds now skip the save check and
are reported the same way everywhere; other invalid validators,
including an inverted range min/max cannot express, are still rejected.
2026-10-24 12:41:24 +02:00
mvdbeek 98b0e078ec Use a length validator as the form-hidden example in validator tests
A negated regex is now a row in the editor form, so tests of validators
the form cannot show use a length validator instead, and a new test
checks that a negated regex survives editor re-save as a form row.
2026-10-24 12:24:32 +02:00
mvdbeek 4cbb70cce9 Adapt parameter input validator unit tests to release_26.1
MockTrans gets security, for serializing select options in the config
form, and a default workflow_building_mode. release_26.1 has no
populate_state_from_tool_form, so the form round-trip calls
populate_state the way build_module does.
2026-10-24 12:24:32 +02:00
John Chilton e42ef8a68b One hidden field for form-hidden validators and their declared positions
Merge extra_validator_positions into extra_validators as [position, validator]
pairs, parsed strictly (400 on malformed) instead of a silent go-last fallback.
Integer bound check moves into the form shape table; check_validators typed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 57e1cb42c05512917338ecfceddc423323b798f5)
2026-10-24 12:24:32 +02:00
John Chilton 5fae326920 Keep declared workflow parameter validator order; reject malformed lists
Codex review: hidden validators were always appended after the editor's,
changing which error is reported first; a non-object entry crashed
import with an AttributeError instead of a 400.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 36b0954ce68aeff57de486b96d43761f62fd8329)
2026-10-24 12:24:32 +02:00
John Chilton 09f78f19a0 Assert full validator type error; test malformed hidden validators
Fold the allowed-types test into the incompatible-type cases, which now
assert the whole message. Cover the extra_validators JSON list check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6c3e7a1d1a6a893a795c06e06861b53314db29b1)
2026-10-24 12:24:32 +02:00
John Chilton 2c9af42a4f Check validator types for every workflow parameter type
Boolean and color inputs allow none; error lists the allowed types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 00f3667f7564d9162a64f89584dd6b6c1de92682)
2026-10-24 12:24:32 +02:00
John Chilton c3345b64d8 Reject workflow parameter validators that do not suit the input type
E.g. in_range on a text input or regex on an integer input, which the
input could never apply sensibly; checked at save like other invalid
validators, using the tool linter's compatibility table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 30c1bc91aabd98555b5503a3471dac37dad209cf)
2026-10-24 12:24:31 +02:00
John Chilton ad1d2a477b Pure check_validators beside the form codec; one form-shape table
Move the save-time validator check next to validators_to_form/
validators_from_form, describe form-showable validators with
FORM_VALIDATOR_SHAPES; modules.py keeps only call sites. Assert full
unsafe-validator message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 32602bf03316337a93df07d489c971180111dbdc)
2026-10-24 12:24:31 +02:00
John Chilton 57d5cc696e Keep fractional integer bounds; reject regex validators that do not compile
Codex review: integer min/max form fields truncated fractional bounds,
and invalid regex expressions imported then failed at validate time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 578b3048f9e2afc07f0f444322b5dd1a7cdce91d)
2026-10-24 12:24:20 +02:00
John Chilton 12884e8bb8 Tighten workflow parameter validator unit tests
Make every non-baseline test red on base: check both bounds of a split
min/max range in one case and pair the spelled-out-default regex with a
hidden validator. Drop cases the API tests already cover; match the full
error prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit fad8d5cf13588934c228293ac30408b2c0cf5ef1)
2026-10-24 12:24:20 +02:00
John Chilton 17a6d76a7b Build workflow parameter validators at save; derive form shape from models
Reject any validator get_runtime_inputs could not build (e.g. length
min > max), keep validators that spell out defaults editable, and drop
pydantic's prefix from import errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b9832becd5810a06e80411be5aa92877680f1681)
2026-10-24 12:24:19 +02:00
John Chilton 67e6f2671e Keep workflow parameter input validators as declared
Import and editor re-save rewrote parameter input validators to what the
editor form shows: negate, extra ranges, range messages and exclusive
bounds were dropped, inverting negated validators (#24200).

Validators the form cannot show now travel in a hidden extra_validators
field and are merged back on save. Saving parses validators with the
untrusted validator parser and rejects invalid ones with a 400, and
InRangeParameterValidatorModel now requires min <= max. Unbounded
min/max fields no longer store a no-op in_range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5056fb88a4fe52c284f398de3a9440d12c2ac1bb)
2026-10-24 12:24:19 +02:00
John Chilton cfa22f61df Baseline tests for workflow parameter input validators
Pin regex/range round trip through import and editor re-save, and that a
stored min > max range still loads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4a685def277c0ad02c7f4e71cc45307b5352005b)
2026-10-24 12:24:09 +02:00