You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SysML2 standard: facade packages with public imports for multi-file models - #73
Replaces the package rules in sysml2-modeling.md (and the matching text in the sysml2tools-query skill) with a facade pattern for multi-file SysML2 models. This refines #64, #65, #70, and #71.
One unique top-level package per file. A package is never reopened across files.
System and subsystem packages are facades: they public import the packages they own, downward only, so {SystemName}::{AnyItem} resolves through chained re-exports.
Units private import exactly what they reference. Upward or sideways references import the specific item package, never a facade (that would form an import cycle).
Never name a package after a standard library package (Views shadows the library and leaves GeneralView unresolved).
A small cohesive namespace may be one file with one package.
New "Migrating split packages" section (rename packages, generate private imports from sysml2tools query dependencies with 0.3.0-beta.3, make system/subsystem files facades; existing {System}::X references keep working).
Skill: describes the facade layout and notes that query describe -e needs the declared qualified name, not a facade path.
.textlint.yaml: adds the proper names Sensmetry, Syside, and the rule-name word distinguishability.
The template branch counterpart is in a separate PR.
Evidence
Spec (normative)
Each file is its own root namespace, and top-level names share one flat global scope (KerML 1.0 §7.2.5.3, §10.2–10.3; SysML 2.0 §7.5.5). Folders do not create namespaces.
No package merging: duplicate top-level names give an unspecified resolution (KerML §8.2.3.5.4), and the OMG Pilot warns "Duplicate of other owned member name".
public import makes imported members visible members of the importing package (KerML §8.2.3.5.3; SysML §7.5.3).
Imports owned directly by a file's root namespace must be private (KerML §8.3.2.4.2 validateImportTopLevelVisibility), so facades must be packages.
Cyclic imports are legal (KerML §8.2.3.5.1) but stop the Pilot loading files one at a time.
Practice: the OMG libraries (ISQ re-exports 12 ISQ* packages; SI re-exports ISQ), Sensmetry smart-home-hub (DETECT_* prefix; Syside rule global-namespace-distinguishability), Airbus Apollo-11, and DE4SDV all use one top-level package per file, unique and often prefixed names, private import for dependencies, and facades with public import.
Experiments (OMG Pilot 2026-09.1 and SysML2Tools 0.3.0-beta.4 / main, same synthetic 2-subsystem model in eight layouts):
Split same-named packages: neither tool merges them. Pilot fails to load every file; SysML2Tools keeps the first Acme and ignores the rest, leaving unresolved references.
Unique packages with private imports only: valid, but Acme::Parser and import Acme::* do not resolve.
Facade with downward public imports: the only layout where Acme::Parser and import Acme::* both resolve. Strict lint is clean in SysML2Tools, and Pilot loads every file one at a time (when units do not back-reference the system).
Facade plus back-imports: SysML2Tools reports six Circular import detected warnings, and Pilot cannot load any file order.
A package named Views shadows the library, so GeneralView is unresolved.
…odels
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>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Two moderate active documentation issues remain: direct system-owned units are not covered by the facade guidance, and the migration instructions can create redundant or conflicting imports.
Updates SysML2 modeling guidance and the query skill to standardize unique per-file packages with downward-facing facade packages and public imports for multi-file models.
Changes:
Replaces split-package guidance with unique package names, facade and import-direction rules, migration instructions, and updated quality checks.
Updates the sysml2tools-query skill with facade layout and qualified-name query behavior.
Adds SysML2 terminology and proper names to the text-lint dictionary.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
An active documentation issue remains because the migration command omits the required model-file glob, preventing users from generating imports as instructed.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Dependency query omits required model files
src/.github/standards/sysml2-modeling.md:153
This migration command omits the model-file glob even though the guidance above says every sysml2tools invocation must load all .sysml files. A user following step 2 will run query dependencies without the model and cannot generate the imports. Include the quoted full-model glob (or explicitly require passing the complete model file set) here.
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
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
Replaces the package rules in
sysml2-modeling.md(and the matching text in thesysml2tools-queryskill) with a facade pattern for multi-file SysML2 models. This refines #64, #65, #70, and #71.public importthe packages they own, downward only, so{SystemName}::{AnyItem}resolves through chained re-exports.private importexactly what they reference. Upward or sideways references import the specific item package, never a facade (that would form an import cycle).Viewsshadows the library and leavesGeneralViewunresolved).private imports fromsysml2tools query dependencieswith 0.3.0-beta.3, make system/subsystem files facades; existing{System}::Xreferences keep working).query describe -eneeds the declared qualified name, not a facade path..textlint.yaml: adds the proper namesSensmetry,Syside, and the rule-name worddistinguishability.The
templatebranch counterpart is in a separate PR.Evidence
Spec (normative)
public importmakes imported members visible members of the importing package (KerML §8.2.3.5.3; SysML §7.5.3).validateImportTopLevelVisibility), so facades must be packages.Practice: the OMG libraries (
ISQre-exports 12ISQ*packages;SIre-exportsISQ), Sensmetry smart-home-hub (DETECT_*prefix; Syside ruleglobal-namespace-distinguishability), Airbus Apollo-11, and DE4SDV all use one top-level package per file, unique and often prefixed names,private importfor dependencies, and facades withpublic import.Experiments (OMG Pilot 2026-09.1 and SysML2Tools 0.3.0-beta.4 / main, same synthetic 2-subsystem model in eight layouts):
Acmeand ignores the rest, leaving unresolved references.Acme::Parserandimport Acme::*do not resolve.Acme::Parserandimport Acme::*both resolve. Strict lint is clean in SysML2Tools, and Pilot loads every file one at a time (when units do not back-reference the system).Circular import detectedwarnings, and Pilot cannot load any file order.Viewsshadows the library, soGeneralViewis unresolved.Checks
pwsh ./fix.ps1andpwsh ./lint.ps1pass.