Skip to content

Use enum for KerML checksum algorithms#128

Merged
andrius-puksta-sensmetry merged 16 commits intomainfrom
ap/checksum-enum
Dec 8, 2025
Merged

Use enum for KerML checksum algorithms#128
andrius-puksta-sensmetry merged 16 commits intomainfrom
ap/checksum-enum

Conversation

@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry commented Nov 24, 2025

Changes

  • style: consistently use `` for quoting everything (mostly IRIs). This is consistent with how Cargo
    uses quoting in output
  • use serialization instead of serialisation to match common usage other crates/ecosystems
  • use an enum for valid sysml/kerml file checksum algorithms, since the list is short and fixed
  • always append newline to generated .project.json and .meta.json. Fixes Consider adding end-of-file newline when printing human readable JSON #112.
  • remove Beta1 (20230201) std lib metadata

CLI improvements

  • improve error and log messages in many places
  • correctly strip color and other styling from text in tests, when using pipes, etc. with anstream. It's already used by default in env_logger, so the only place where we used color unconditionally was in sysand/src/main.rs
  • don't panic when including invalid sysml/kerml files; give proper errors instead. Fixes Produce explanatory error messages on lexer/parser failure #33. Example:
$ echo \"hello\" > a.sysml
$ sysand include a.sysml
error: failed to extract symbol names from `a.sysml`: error at line 1, byte 1:
`"hello"`: unexpected string
$ sysand info metamodel --help
Get or set the metamodel of the project

Usage: sysand info metamodel [OPTIONS]

Options:
      --set <KIND>
          Set a SysML v2 or KerML metamodel. To set a custom metamodel, use `--set-custom`

          Possible values:
          - sysml: SysML v2 metamodel. Identifier: `https://www.omg.org/spec/SysML/<release>`
          - kerml: KerML metamodel. Identifier: `https://www.omg.org/spec/KerML/<release>`

      --release <YYYYMMDD>
          Choose the release of the SysML v2 or KerML metamodel.
          SysML 2.0 and KerML 1.0 have the same release dates

          Possible values:
          - 20250201: SysMLv2/KerML Release or Beta4

          [default: 20250201]

      --release-custom <YYYYMMDD>
          Choose a custom release of the SysML v2 or KerML metamodel

      --set-custom <METAMODEL>
          Set a custom metamodel. To set a SysML v2 or KerML metamodel, use `--set`

      --clear


Global options:
[...]
  • include a bit more info about Sysand in sysand --help by using a custom clap help template (based on default template):
$ sysand --help
A project and package manager for SysML v2 and KerML

Documentation:
<https://docs.sysand.org/>
Package index and more information:
<https://beta.sysand.org/>
Project repository:
<https://github.com/sensmetry/sysand/>

Usage: sysand [OPTIONS] <COMMAND>

Commands:
[...]

Options:
[...]

Global options:
[...]

sysand v0.0.6
Developed by: Sensmetry <opensource@sensmetry.com>
  • mention project metadata editing in sysand info --help:
$ sysand info --help
Describe or modify the current project or resolve
and describe a project at a specified path or IRI/URL
[...]

Docs

  • add guide on how to format text (errors, log messages, docstrings) to DEVELOPMENT.md

Tests

  • test setting metamodel in various ways

@andrius-puksta-sensmetry andrius-puksta-sensmetry force-pushed the ap/checksum-enum branch 3 times, most recently from 9b6fdb6 to fa31469 Compare November 24, 2025 11:22
@andrius-puksta-sensmetry andrius-puksta-sensmetry force-pushed the ap/checksum-enum branch 2 times, most recently from e1b238c to d42bebd Compare November 26, 2025 07:19
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The metamodel stuff looks good for now. We can update it later in a separate PR after I discuss the design with the Reference Implementation working group.

Copy link
Copy Markdown
Collaborator

@victor-linroth-sensmetry victor-linroth-sensmetry left a comment

Choose a reason for hiding this comment

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

This is starting to feel finished, just merge/rebase main and make sure all tests still pass.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…ent `` quoting

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

clarify comment about using `None` checksum algorithm

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…ements

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
… log messages

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

improve checksum hex validation

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Copy link
Copy Markdown
Collaborator

@victor-linroth-sensmetry victor-linroth-sensmetry left a comment

Choose a reason for hiding this comment

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

Okay, looks like everything is good.

@andrius-puksta-sensmetry andrius-puksta-sensmetry merged commit e4f1cc3 into main Dec 8, 2025
51 checks passed
@andrius-puksta-sensmetry andrius-puksta-sensmetry deleted the ap/checksum-enum branch December 8, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants