Skip to content

SysML2: one uniquely named package per file; no package merging - #65

Merged
Malcolmnixon merged 3 commits into
templatefrom
sysml2-unique-packages-template
Nov 20, 2026
Merged

Malcolmnixon merged 3 commits into
templatefrom
sysml2-unique-packages-template

Conversation

@Malcolmnixon

@Malcolmnixon Malcolmnixon commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary The template's SysML2 model files reopened the SystemName package in every file, relying on same-named packages merging into one namespace. That is not SysML v2. The spec has no package merging: each file is its own root namespace, and two same-named root packages are duplicate members of the global namespace. ## Evidence The OMG SysML v2 Pilot Implementation reports Duplicate of other owned member name for each same-named root package, and references across the split halves do not resolve. SysML2Tools only accepted the pattern through leniency, which SysML2Tools#146 turns into a lint warning. The replacement pattern is the one in SysML2Tools#143 (docs/sysml2/, branch sysml2-self-model), which loads in the Pilot with 0 errors and 0 warnings. ## Changes - docs/sysml2/model/system-name.sysml: package SystemName privately imports each direct member's package. - docs/sysml2/model/system-name/subsystem-name.sysml: own package SystemName_SubsystemNameSubsystem, importing its units' packages. - docs/sysml2/model/system-name/subsystem-name/unit-name.sysml: own package SystemName_UnitName. The directive explains using a qualified name instead of an import where an import would form a cycle. - docs/sysml2/views/design-views.sysml: package RepoNameDesignViews imports what it exposes. The multi-system note now reads filter not (@SysML::Documentation); (parentheses are required, SysML2Tools#147). - repository-map.md: docs/sysml2/ tree comments now show each file's package name. The standard and skill text is in the companion PR against main. ## Validation - pwsh ./lint.ps1 passes, including sysml2tools lint (0 errors). - sysml2tools render of the template model produces the same three views.

Malcolm Nixon and others added 2 commits November 20, 2026 15:46
SysML v2 has no package merging; same-named root packages in different
files are duplicate members of the global namespace (Pilot: "Duplicate
of other owned member name"). Declare one uniquely named package per
file, named {System}_{Subsystem}Subsystem / {System}_{Unit}, reference
other files through private import or qualified names, and write
filter not (@x); with parentheses.

See demaconsulting/SysML2Tools#143, #146, #147.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the repository-wide uniqueness rule with a subsystem-path-qualified
fallback, and use one repository-level views package, matching
demaconsulting/SysML2Tools#143 (SysML2ToolsDesignViews).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The newly added template comment contains a grammatical error and still inaccurately describes the package structure, leaving active documentation issues to correct.

2 open issues
What changed in this PR

Updates the SysML2 templates so each file declares a uniquely named root package instead of relying on non-standard package merging, while adjusting imports, views, and documentation.

Changes:

  • Gives system, subsystem, unit, and view files distinct package names.
  • Adds private imports for cross-file model dependencies.
  • Updates view filtering syntax and repository-map package documentation.
File Description
repository-map.md Documents the package names associated with each SysML2 model and view file.
docs/​sysml2/​views/​design-views.sysml Introduces a repository-level views package and updates imports, exposure paths, and filter syntax.
docs/​sysml2/​model/​system-name/​subsystem-name/​unit-name.sysml Gives each unit file an independent package and documents cross-unit reference conventions.
docs/​sysml2/​model/​system-name/​subsystem-name.sysml Gives the subsystem its own package and imports its unit package.
docs/​sysml2/​model/​system-name.sysml Keeps the system package as the root model package and imports its direct subsystem packages.

Review effort: Lite

Comment thread docs/sysml2/views/design-views.sysml Resolved
Comment thread docs/sysml2/views/design-views.sysml Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit 353ae2a into template Nov 20, 2026
@Malcolmnixon
Malcolmnixon deleted the sysml2-unique-packages-template branch November 20, 2026 21:44
Malcolmnixon added a commit that referenced this pull request Nov 22, 2026
…74)

Refines #64, #65, #70, #71. System and subsystem example packages now
public-import the packages they own (downward only); the unit and views
directives explain private imports of specific item packages.

Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Malcolmnixon added a commit that referenced this pull request Nov 22, 2026
…odels (#73)

* SysML2 standard: facade packages with public imports for multi-file models

Refines #64, #65, #70, #71. Each file keeps one unique top-level package; the
system and subsystem packages become facades that public-import the packages
they own (downward only), units private-import what they reference, and a
migration section covers models that split one package across files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* SysML2 standard: clarify facade imports for owned units and migration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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