-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Summary
Modifier condition evaluation failures are currently logged as warnings and treated as "modifier does not apply." This can silently disable intended logic and flatten distributions.
Why This Matters
A malformed or mismatched when condition should not quietly degrade behavior in critical runs.
Current Behavior (Code)
In /Users/adithyasrinivasan/Projects/extropy/extropy/population/sampler/modifiers.py:
apply_modifiers_and_sample(...)wrapseval_condition(...)in try/except (line ~59-66)- exceptions are logged and ignored
In /Users/adithyasrinivasan/Projects/extropy/extropy/utils/eval_safe.py:
- default condition failures return
False(line ~272)
Expected Behavior
For strict-quality sampling, condition-eval failures should fail validation/sampling (or at least be escalated), not become silent no-ops.
Proposed Fix
- Add strict mode behavior for modifier condition errors:
- collect structured errors (attribute, modifier index, condition, exception)
- fail sampling when any occur (in strict mode)
-
Keep permissive mode for backward compatibility, but expose counts in output.
-
Improve diagnostics:
- include offending condition string and referenced unknown values/names where possible.
Tests
- malformed condition causes strict sampling failure
- permissive mode logs and continues with explicit warning count
- valid conditions unaffected
Acceptance Criteria
- No silent modifier disablement in strict runs.
- Users can reliably detect condition-eval failures before trusting sample outputs.
Pipeline Impact
Prevents hidden rule dropouts in step 3 and reduces iterative debugging.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels