Add --target and --filter options to export command#28
Merged
Conversation
Adds containment-subtree scoping (--target) and filter-expression narrowing (--filter) to the export command, mirroring render's dynamic-view scoping and filter subsystems. --target resolves to a subtree (with usage-to-type expansion), --filter applies Core.Filtering's public parser/evaluator, and the two compose target-then-filter with dual-endpoint edge inclusion. Unresolved/stdlib-hidden targets produce a clean error; unparseable filter expressions fall back to the unfiltered (target-scoped) result with a synthetic diagnostic and console warning. Updates companion docs (design, reqstream, verification, README, user guide, roadmap) and adds parser/subsystem/integration tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 13, 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.
This pull request adds significant new features and documentation updates to the
sysml2tools exportcommand, introducing support for restricting export output to a containment subtree via--targetand for narrowing results with a filter expression via--filter. The changes also clarify error handling and update requirements and help documentation to reflect these enhancements.New export command features:
--target <qualified-name>option to restrict export output to the containment subtree rooted at a specified element. If the target is a usage/feature, its resolved type's subtree is also included. A clear error is reported if the target does not resolve to a visible declaration (either absent or stdlib-hidden), and no export is produced in that case. [1] [2] [3] [4]--filter <expr>option to narrow exported declarations and edges using a Phase 1 filter-expression, applied after--targetscoping. If the filter expression cannot be parsed, the export falls back to the unfiltered (but still target-scoped, if applicable) result, with a synthetic warning diagnostic in the output and a console warning. [1] [2] [3] [4]Documentation and requirements updates:
--targetand--filter, including command-line usage and help output. [1] [2] [3]--targetand--filteroptions, including error conditions and composition order. [1] [2] [3]These changes make the export command more flexible and robust, allowing users and downstream tools to extract focused slices of a model and apply complex filtering directly at export time.