feat(export): portable MJCF_PATH + pre-export validation#5
Merged
Conversation
Two loose ends from the export audit: Portable MJCF_PATH. Uploaded XMLs were writing /tmp/tmpXXX.xml into exports, unusable anywhere else. _portable_mjcf now prefers xmlBasename (the original upload filename, passed through from the frontend) and falls back to reducing any absolute path to models/<basename> — the stac-mjx convention. Relative paths pass through unchanged. Pre-export validation. validateMappings reports two classes of issue: errors (mapping to a body not in the loaded model) that block the export, and warnings (unmapped keypoint, mapping for a keypoint not in the dataset) that go through but are summarized in the status message.
63040d3 to
f5ba971
Compare
Collaborator
Author
This was referenced May 19, 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.
Summary
Two loose ends from the export audit:
1. Portable
MJCF_PATH. Uploaded XMLs were writing/tmp/tmpXXX.xmlinto the exported YAML, which is unusable to anyone else._portable_mjcfnow prefersxmlBasename(the original upload filename, passed through from the frontend viasetXmlData) and falls back to reducing any absolute path tomodels/<basename>— the stac-mjx convention acrossconfigs/model/*.yaml. Relative paths pass through unchanged.2. Pre-export validation. New
frontend/src/validation.tsreports two classes of issue on export:Test plan
pytest --ignore=tests/test_acm_processing.py→ 11/11 pass, including 5 new tests for_portable_mjcfand end-to-end use throughdump_stac_yamlnpm run buildclean (tsc+vite build)TestClient.post('/api/export-config')withxmlBasenameset producesMJCF_PATH: models/<basename>MJCF_PATHismodels/<original_filename>rather than a/tmp/pathInteraction with #3
Independent of PR #3 (template overlay). If #3 merges first, this one needs a trivial rebase to move the
_portable_mjcf(config)call into_ui_managed_fields(the place #3 factored the canonical model fields into). If this merges first, #3 picks up the same wrapping automatically. Happy to rebase whichever lands second.