You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A whole-number float in an integer field passes config validate, then crashes the command that reads it #602
A whole-number float in an integer field of a declaration passes cloudfall config validate and then crashes the command that reads it.
JSON Schema's "type": "integer" accepts 8100.0 (draft 2020-12 counts a number with a zero fractional part as an integer), so the schema lets it through, while the value objects behind the fields (TcpPort.from_boundary, RequestBodyMegabytes.from_boundary and the others built on _required_bounded_integer in sdk/src/cloudfall/domain.py) refuse anything that isn't a Python int with a TypeError.
Reproduce
On main at 8659e4b, in a copy of config/examples, set the Domain's spec.proxy.upstream.port to 8100.0:
cloudfall config validate --project <copy> reports ok
cloudfall domains apply on the same project fails with HANDLER_CRASHED (TypeError) instead of a validation error
The same holds for spec.proxy.maxRequestBodyMegabytes: 55.0 once #601 lands; it was found reviewing that PR.
Expected
config validate refuses a float in an integer field with the field's path, as it refuses "55m", so no command gets as far as the value object. Either the validator rejects floats for integer (a format checker or a custom type checker on the validator), or validation runs the value objects and reports their refusal as a validation error. Q-1: a config that validates must not crash a later command.
Touches: the schema validator in sdk/src/cloudfall/validation.py, the integer value objects in sdk/src/cloudfall/domain.py.
Confirmed on main at 3a5e60f: SchemaCatalog builds a stock Draft202012Validator (sdk/src/cloudfall/validation.py:292), whose integer type accepts 8100.0, while _required_bounded_integer (sdk/src/cloudfall/domain.py:646) refuses any non-int with a TypeError. That breaks Q-1: a config that validates must not crash a later command. This is a bug fix that restores documented behaviour, so it skips the design gate.
The plan:
Build the catalog's validators from a Draft202012Validator extended with a type checker whose integer accepts only a Python int (and still refuses bool), so every integer field in every schema refuses 8100.0 at config validate, reported with the field's path like any other schema error
Keep the value objects' TypeError as the second line of defence
Regression tests: config validate refuses spec.proxy.upstream.port: 8100.0 with its path, and a plain 8100 still passes
Behaviour change: a project that writes a whole-number float (8100.0) in any integer field now fails config validate instead of passing it. Every such value already crashed the command that read it through a value object. I'll link the PR here.
The fix is in #603: the config validator's integer type now accepts only whole numbers written as integers (still refusing true/false), so config validate refuses 8100.0 with the field's path before any command reads it. The value objects' TypeError stays as a second check. A project with such a value now fails validation where it passed before, so the changelog lists it under Breaking per D-14, with the step to take before upgrading; the decision and its veto window are on #603. The MCP tool-argument validator in investigation.py is left as is: it checks agent tool input, not config. This issue closes when #603 merges.
Activity
shipmill-romamo commentedon Nov 23, 2026
Triage: implement.
Confirmed on main at 3a5e60f:
SchemaCatalogbuilds a stockDraft202012Validator(sdk/src/cloudfall/validation.py:292), whoseintegertype accepts8100.0, while_required_bounded_integer(sdk/src/cloudfall/domain.py:646) refuses any non-intwith aTypeError. That breaks Q-1: a config that validates must not crash a later command. This is a bug fix that restores documented behaviour, so it skips the design gate.The plan:
Draft202012Validatorextended with a type checker whoseintegeraccepts only a Pythonint(and still refusesbool), so every integer field in every schema refuses8100.0atconfig validate, reported with the field's path like any other schema errorTypeErroras the second line of defenceconfig validaterefusesspec.proxy.upstream.port: 8100.0with its path, and a plain8100still passesBehaviour change: a project that writes a whole-number float (
8100.0) in any integer field now failsconfig validateinstead of passing it. Every such value already crashed the command that read it through a value object. I'll link the PR here.shipmill-romamo commentedon Nov 23, 2026
The fix is in #603: the config validator's
integertype now accepts only whole numbers written as integers (still refusingtrue/false), soconfig validaterefuses8100.0with the field's path before any command reads it. The value objects'TypeErrorstays as a second check. A project with such a value now fails validation where it passed before, so the changelog lists it under Breaking per D-14, with the step to take before upgrading; the decision and its veto window are on #603. The MCP tool-argument validator ininvestigation.pyis left as is: it checks agent tool input, not config. This issue closes when #603 merges.Move the strict-integer changelog entry under Breaking
Refuse a whole-number float in retainReleases like every integer field
Name retainReleases in the strict-integer Breaking entry