Skip to content

fix: guard TypeDef.check_value() against constraint exceptions #86

@rororowyourboat

Description

@rororowyourboat

Problem

packages/gds-framework/gds/types/typedef.py:31-35 — If a user-supplied constraint predicate throws (e.g., ZeroDivisionError, TypeError), the exception propagates uncaught through all verification paths (TypeDef.check_value()ParameterDefStateVariable).

def check_value(self, value: Any) -> bool:
    if not isinstance(value, self.python_type):
        return False
    return self.constraint is None or self.constraint(value)  # unguarded

Expected behavior

Constraint evaluation should catch exceptions and return False (or wrap in a Finding), not crash the verification pipeline.

Scope

  • TypeDef.check_value() in types/typedef.py
  • Cascading callers in parameters.py and state.py

Priority

Critical — affects all verification paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions