Skip to content

Fix context_validator running CASE validators during meshing-only JSON generation#1913

Merged
benflexcompute merged 4 commits intomainfrom
BenY/fix-context-validator-skip-on-no-context
Mar 23, 2026
Merged

Fix context_validator running CASE validators during meshing-only JSON generation#1913
benflexcompute merged 4 commits intomainfrom
BenY/fix-context-validator-skip-on-no-context

Conversation

@benflexcompute
Copy link
Collaborator

@benflexcompute benflexcompute commented Mar 19, 2026

Summary

  • generate_process_json with upTo=SurfaceMesh fails when velocity_magnitude=0 without reference_velocity_magnitude, even though operating condition validation is irrelevant for meshing
  • Root cause: _intersect_validation_levels returned None when validation_level=None, and context_validator treated None as "run all validators"
  • Fix: _intersect_validation_levels returns [] instead of None; context_validator skips when current_levels is None, consistent with validate_conditionally_required_field behavior

Test plan

  • Added unit test for _intersect_validation_levels returning [] when validation_level=None
  • Added integration test: generate_process_json with velocity_magnitude=0, upTo=SurfaceMesh succeeds
  • Existing test_validation_level_intersection and test_generate_process_json still pass

🤖 Generated with Claude Code


Note

Medium Risk
Changes validation gating semantics (None/unset levels now skip context-aware validators), which could hide expected validation errors if any callers relied on the previous behavior.

Overview
Fixes meshing-only generate_process_json failing due to unrelated Case validators by ensuring “no requested validation levels” means run no context-aware validators.

This updates _intersect_validation_levels to return [] (instead of None) when no levels are requested and adjusts context_validator to skip when there is no active ValidationContext. Tests are updated/added to cover the new intersection behavior and to assert meshing JSON generation succeeds even when velocity_magnitude=0 without a reference velocity.

Written by Cursor Bugbot for commit 26b071a. This will update automatically on new commits. Configure here.

…N generation

_intersect_validation_levels returned None when validation_level=None was
requested, but context_validator treated None as "run all". This caused
generate_process_json (upTo=SurfaceMesh) to fail when velocity_magnitude=0
without reference_velocity — a valid meshing-only scenario.

Two fixes:
- _intersect_validation_levels returns [] instead of None for no-match cases
- context_validator skips when current_levels is None, consistent with
  validate_conditionally_required_field behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…SE level

context_validator now skips when no ValidationContext is set, so the test
needs an explicit ValidationContext(levels=[CASE]) for the validator to fire.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@benflexcompute benflexcompute enabled auto-merge (squash) March 19, 2026 20:16
@benflexcompute benflexcompute merged commit add5d57 into main Mar 23, 2026
20 checks passed
@benflexcompute benflexcompute deleted the BenY/fix-context-validator-skip-on-no-context branch March 23, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants