Repository navigation
feat: make the repository a KerML 10.3 project interchange - #13
Merged
Merged
Conversation
Add .project.json and .meta.json at the root so a tagged tree is itself a project any tool can install as pkg:github/Open-MBEE/OpenSysML-Extensions-Library. scripts/write-project-meta.py generates .meta.json and, with --check, fails when a checksum, the index or .project.json's fields and derived usage list drift from the tree; build-kpar.py now archives exactly what the manifests record, keeping the libraries/ layout, and refuses a --version that differs from .project.json. release.yml asserts the tag equals that version before building. README and CONTRIBUTING describe depending on the library as a package and the release-prep step. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ls it Co-Authored-By: jason.han <hanhuijun@gmail.com>
…manager Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
A tagged commit of this repository is now a KerML 10.3 project on its own, so a package manager can install it from its git host as
pkg:git/github.com/Open-MBEE/OpenSysML-Extensions-Library@X.Y.Zwith nothing but the OMG format, and the release.kparis derived from the tree's manifests instead of constants in a script..project.json(root, Table 12):name"OpenSysML Extensions Library",publisher"Open-MBEE",version1.0.0 (proposed first tagv1.0.0; nothing is tagged here),description,licenseApache-2.0,website,usage= the 9 OMG 20250201 archives the units depend on..meta.json(root, Table 13):indexroot namespace →libraries/<Unit>,metamodel,created,checksumSHA-256 per unit and forLICENSE; keys and entries sorted.scripts/write-project-meta.pywrites.meta.json;--check(run in CI and in the release job) fails when a checksum, the index, the canonical form, or.project.json's fields/semver/usagedrift from the tree.scripts/build-kpar.pyno longer carries a project description: it runs the same check, then archives exactly the manifests plus every file.meta.jsonchecksums at its repository path (libraries/...), deflate, 1980-01-01 dates, sorted.--versionmust equal.project.jsonversionor it fails. Default output nameopensysml-extensions-library-<version>.kpar.release.ymlassertsv<version>== tag before anything else, then--check, then builds and attaches the archive.ci.ymlruns--checkand builds the archive from the committed version (the former0.0.0-dev.Nversion could not pass the equality check)..kparderived, and the release-prep step (bumpversion, merge, tag).namediffers from the briefThe brief asked for
name"OpenSysML Extension Libraries". OpenSysML's reader (internal/workspace/project/interchange.go:Uses) matches a usage IRI by the slug of its last two path segments againstpublisher/name:pkg:git/github.com/Open-MBEE/OpenSysML-Extensions-Library→open-mbee/opensysml-extensions-library, while "Extension Libraries" slugs toopensysml-extension-librariesand never matches by name (probe below). The manifest uses "OpenSysML Extensions Library" (the repository's own name as words), whose slug equals the repository slug. The README title is unchanged.How
usagewas derivedwrite-project-meta.pystrips comments and strings from every unit, collects the root of everyimport X::…and the first name of every qualified referenceX::…, drops the 16 roots declared here, and maps the rest through a table of the root namespaces each OMG archive declares (taken from theindexof the archives' own.meta.jsonafter downloading all ten; two corrections to the OMG indexes are noted in the script:RequirementsDerivationis indexed for a unit declaringRequirementDerivation, andUSCUis the short name ofUSCustomaryUnits). An import root that is neither local nor OMG is an error. Result (checked by--check, so a new dependency changes the committed list): Semantic, Data-Type, Function, Systems, Analysis-Domain, Cause-and-Effect-Domain, Metadata-Domain, Quantities-and-Units-Domain, Requirement-Derivation-Domain. Geometry-Domain is the one 20250201 archive nothing here uses.Verification
OpenSysML
developbuilt withmake build-sysml(sysml v0.11.0-685-g48f60b4b8, which readslib/beside.project.json).Drift probes (each restored afterwards): appending a line to
libraries/Stochastic.sysml→.meta.json: checksum does not match the tree;version"1.0" →not a semantic version; dropping ausageentry →usage does not match the imports under libraries/ (missing: …/Data-Type-Library.kpar); editing anindexpath →index does not match the tree; reserialising.meta.jsonon one line →not in the canonical form. All exit 1.Consumer probe — fresh project whose
.project.jsonhasusage: [{"resource": "pkg:git/github.com/Open-MBEE/OpenSysML-Extensions-Library", "versionConstraint": "1.0.0"}]and a model importingDiagramLayout::*,RandomFunctions::*,OpenSysMLMathFunctions::*(@Layout,uniform(0.0, 1.0)), with this tree installed atlib/opensysml-extensions-library/beside the consumer's.project.json; OpenSysML reads thatlib/directly:Same probe with
lib/removed: only✓ package Modelis listed and the imports still resolve, because OpenSysML bundles a vendored copy of these libraries — the package listing, not the error count, is the discriminator. With the installed copy'snamechanged to "OpenSysML Extension Libraries" the 16 packages are still listed: the usage matches no installed project by publisher/name, and OpenSysML'susedfalls back to the single unclaimed installed project by elimination (discovery.go:used→pickUnclaimed); a second installed project would make the name decisive, so the manifest keeps the matching name.sysml -bundle .vsbuild-kpar.pysysml -bundle . -o /tmp/bundle.kpar→ 36 files;build-kpar.py→ 19. Differences by category:-bundleincludes every non-hidden file of the tree (README, CONTRIBUTING, engine-contract.json,scripts/**,validation/, even ascripts/__pycache__/*.pycleft by Python);build-kpar.pyincludes only the two manifests plus what.meta.jsonchecksums (16 units + LICENSE). Both.project.jsonand.meta.jsonmembers are byte-identical, so OpenSysML's own metadata generation agrees with the committed.meta.json(same index, same metamodel, same checksum set and values).-bundlewritescreate_system3 (Unix) with external attributes0100644, Python writescreate_system0 with mode0600; deflate streams differ by a few bytes (Gocompress/flatevs zlib), so the two archives are not byte-identical though they hold the same bytes per member.OpenSysML reader notes for the parallel work
internal/workspace/project/interchange.go:Uses— usage IRI matching is slug(name)-based; a manifestnamethat is not the repository name as words will not match apkg:git/<host>/<owner>/<repo>IRI. Either keep that contract documented or match on an explicit identifier.internal/workspace/project/discovery.go:used— a usage no installed project matches by name is answered by elimination among the unclaimed installed projects, so a wrongnameis only caught once two or more projects are installed.internal/workspace/project/bundle.go:Bundle— includes every non-hidden file rather than the checksummed set, and does not skip__pycache__.Analysis/.project.json), not at the archive root; the Requirement Derivation archive'sindexnamesRequirementsDerivationfor a unit declaringRequirementDerivation.Semver impact: MINOR for the repository's consumers (new files
.project.json/.meta.json, archive layout moves units underlibraries/, archive file name changes toopensysml-extensions-library-<version>.kpar; no library content changes). Proposed first tag:v1.0.0, after this merges, by a maintainer.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/2e708b6a96b74f12994487e6595d3cfc
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/2e708b6a96b74f12994487e6595d3cfc?variant=devin
Requested by: @HuiJun