Skip to content
andrew.dunn.dev

sysml

Source crates.io

sysml is a knowledge-graph toolkit for SysML v2 and a study instrument: a way to try, on real models, how a language model might work a large one without reading it whole. kebnf takes the same study to the grammar.

One Rust binary, sysml, runs as a clap CLI for people and CI or as a stdio MCP server for agents; both delegate to sysml-core. Parsing comes from tree-sitter-sysml, a grammar I also maintain.

ONE RUST BINARYSYSML V2model files.sysml sourcesGRAMMARtree-sitter-sysmlits own repoCOREsysml-coregraph, metamodelPEOPLE, CI, AGENTSclap CLIJSON on stdoutAGENTS, TOOLSMCP serverstdio, feature-gated
One graph served as CLI or MCP
  • A walker turns parsed files into elements and typed relationships; index writes the graph once.
  • The CLI emits JSON on stdout, so commands pipe into each other; the MCP server exposes the same functions as tools.
  • skill prints a page of commands with purpose and example, an agent’s way into the CLI without a tool schema.

Progressive disclosure is the shape of the command set.

QUESTIONplancommands to runCANDIDATESsearchscored, by layerONE ELEMENTinspectmembers, relationsNEIGHBOURHOODtracehops, directionDETAILl0 l1 l2per call
A question narrows to the slice it needs
  1. plan classifies a question and writes the commands that answer it.
  2. search scores elements on name, kind, documentation and relationship text.
  3. inspect takes one exact name and returns its kind, layer, members and relationships.
  4. trace walks relationships outward for a chosen number of hops.
  5. l0 is names and kinds, l1 adds the line, l2 the file and span; check reports counts until --detail.

Meta-modeling appears as rules the graph is held to.

  • A vocabulary lists every element and relationship kind the walker produces; tests fail by name when the grammar adds one it lacks.
  • Element kinds are classified into RFLP layers, so search and query filter by layer.
  • check metamodel enforces the language’s constraints: satisfy and verify targets must be requirements, allocations run logical to physical, ports carry a type.

CI templates gate a consuming project’s .sysml changes: validation with a completeness badge, and a merge-request diff of base against head.

Measuring whether any of this helps a model is sysml-bench‘s job. Vector search is an optional feature, off by default; every command runs without it.