schema(): Split draft context managers from schema state#1983
Merged
benflexcompute merged 6 commits intoBenY/CentralizedSchemafrom Apr 10, 2026
Merged
Conversation
Contributor
Coverage report (flow360)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f3e3607. Configure here.
angranl-flex
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
CoordinateSystemManagerinto a thin client facade over schema-sideCoordinateSystemStateMirrorManagerinto a thin client facade over schema-sideMirrorStateFlow360ValueErrorWhy
The simulation schema migration was about to drag full client draft managers into schema. That would blur the package boundary and make the migration PR harder to review.
This PR isolates the client-facing manager layer from the reusable state/core layer first, so the later migration PR can stay focused on mostly 1:1 model movement.
Impact
Validation
pytest tests/simulation/draft_context/test_coordinate_system_assignment.pypytest tests/simulation/validation/test_coordinate_system_constraints.pypytest tests/simulation/draft_context/test_mirror_action.pypytest tests/simulation/params/test_simulation_params.py::test_transformation_matrixpytest tests/simulation/translator/test_gai_coordinate_system_e2e.pypytest tests/simulation/translator/test_mirrored_entity_translation.pypytest tests/simulation/translator/test_surface_meshing_translator.pyNotes
Local
pyproject.toml/poetry.lockpath-dependency drift in the client worktree was intentionally left out of this PR.Note
Medium Risk
Moderate refactor of draft-context coordinate system and mirror managers to delegate core behavior to schema-side state objects; regressions would impact entity transformations and mirrored-entity generation/serialization. Also bumps
flow360-schemadependency, which can change runtime behavior beyond this repo.Overview
Refactors draft-context managers to use schema state via composition.
CoordinateSystemManagernow wrapsCoordinateSystemStateand delegates graph validation, matrix composition, status (de)serialization, and entity assignment helpers while preserving a small internal compatibility surface (_coordinate_systems,_coordinate_system_parents,_entity_key_to_coordinate_system_id).Mirroring logic is similarly moved behind
MirrorState.MirrorManagerdrops its local derived-entity/build/serialization helpers in favor ofMirrorState(and schema-exported_derive_mirrored_entities_from_actions/MIRROR_SUFFIX), adjustsMirrorPlaneimport, and keeps compatibility accessors for draft plumbing.Behavioral/contract tweaks. Manager-raised errors are normalized to
Flow360ValueError, draft-context tests are updated accordingly (plus a new invalid-input test forcreate_mirror_of), andflow360-schemais bumped to~0.1.24inpyproject.toml/poetry.lock.Reviewed by Cursor Bugbot for commit 5a86d6d. Bugbot is set up for automated code reviews on this repo. Configure here.