Skip to content

Modeling Guide

GUIDE · OVERVIEW

This guide walks through building a Syscribe model from scratch — from a directory skeleton to a fully traced, validated system description.

Prerequisites

  • Rust toolchain (stable, 1.75+)
  • cargo available on $PATH
  • A text editor with YAML syntax highlighting

Directory skeleton

model/
  _index.md          # root namespace (type: Namespace or Package)
  Requirements/
    _index.md        # Requirements package
  Verification/
    _index.md
  Decisions/
    _index.md
  MySystem/
    _index.md

Each _index.md declares the package:

---
type: Package
name: Requirements
---

System requirements for the XYZ project.

Running the validator

cargo run --package syscribe -- -m model/

This prints a full Markdown report to stdout with all errors, warnings, and a traceability matrix. Pipe it to a file for review:

cargo run --package syscribe -- -m model/ > reports/validation.md

Running the web browser

cargo run --package syscribe-server -- -m model/
# Listening on http://127.0.0.1:3000

The server watches the model directory for changes and reloads automatically.

Typical workflow

  1. Identify stakeholder goals — write parent Requirement elements with REQ-SYS-000 style IDs
  2. Decompose requirements — create child requirements with derivedFrom: and breakdownAdr:
  3. Write an ADR for each decomposition decision — the validator enforces this (E310)
  4. Build the architecture — create PartDef, PortDef, InterfaceDef elements
  5. Assign requirements — add satisfies: and domain: to architecture elements
  6. Link implementation — add implementedBy: on Part/PartDef/Interface/InterfaceDef to point at the source artifact that realises each element (§12.8); the validator flags missing paths with W023
  7. Write test cases — create TestCase elements with verifies: and Gherkin bodies
  8. Draw diagrams — create Diagram elements; add layout: for SVG rendering
  9. Validate — run the validator; fix all errors; review warnings

Going further: a product line

If the system ships in more than one configuration, model the whole family as one 150% model instead of copying it per product:

  1. Declare a feature model — add FeatureDef elements under Features/ (XOR/or/optional groups, requires:/excludes:, typed parameters:)
  2. Condition the variants — add appliesWhen: to the elements (parts, requirements, test cases) that belong only to some products
  3. Name the products — add Configuration elements (CONF-*) selecting one variant per group
  4. Analyse and certify — feature-check --deep proves the feature model is sound; validate --config <C> certifies one product; validate --all-configs gates the whole family in CI

See the Variability & Product Lines guide for the full treatment, and the worked example below.

Worked example — the UAV product line

The bundled model/ is a UAV product line you can run every command against:

syscribe -m model/ feature-check --deep                      # feature model is sound
syscribe -m model/ matrix                                    # Requirement × Configuration grid
syscribe -m model/ validate --all-configs                    # certify every product
syscribe -m model/ diff --config CONF-UAV-SURVEY-001 \
                        --config CONF-UAV-DELIVERY-001        # what differs between products
syscribe -m model/ links UAV::Avionics::FlightController     # see its implementedBy code link
syscribe -m model/ refs firmware/flight_control/             # which elements that code realises

Its shape:

  • Feature model (model/Features/) — three mandatory XOR groups (Propulsion = Quad ⊕ Hex, Payload = Survey ⊕ Mapping ⊕ Delivery, DataLink = LoRa ⊕ Cellular ⊕ Satcom), an optional DualFlightController, cross-tree constraints (Delivery/DualFlightController requires Hex), and a typed parameter (Delivery.payloadCapacityKg).
  • Configurations (model/Configurations/) — three products: CONF-UAV-SURVEY-001, CONF-UAV-MAPPING-001, CONF-UAV-DELIVERY-001.
  • Conditioned elements — variant parts (PropulsionChoices, PayloadChoices, DataLinkChoices, BackupFlightController) and variant requirements/tests (REQ-UAV-MAP-001, REQ-UAV-CARGO-001, REQ-UAV-REDUN-001) carry appliesWhen:, all derived under ADR-SYS-PLE-001.
  • Implementation trace — architecture elements point at repo:firmware/... via implementedBy:.

Further reading

  • Requirements & Test Cases — stable IDs, lifecycle, Gherkin
  • Traceability — the seven §12 rules, including implementedBy:/W023, plus suspect-link detection (traceBaselines:/W090, the suspect commands)
  • Architecture Decisions — ADR lifecycle and breakdown rules
  • State Machines — StateDef transitions, hierarchy/parallel regions, the W070–W079 and W929 completeness checks
  • System Composition — executing the parts of a composite together: send effects, port connections with delay, bindings, part-qualified scenarios (E930–E934, W936)
  • FMU Plants (FMI) — co-simulating FMI 2.0/3.0 Co-Simulation FMUs with a state machine behind the fmi build feature (E888, E889, E966, I011)
  • In-process Plants — PlantDef plants written in the expression language and standard library plants, run in a composite with no toolchain (E938, E939)
  • Action Flows — executable ActionDefs: token semantics, scenarios, coverage, mutation
  • Variability & Product Lines — feature models, appliesWhen, matrix, feature-check, the --config lens
  • Multi-Repository Composition — [repos], repoImports:, cross-repo resolution, the E510–E515/W510–W512 reproducibility gates, git-submodule integration
  • Native SysMLv2 Submodels — sysmlSubmodel: true, in-process .sysml/.kerml parsing, satisfy/verify/@SyscribeFeature cross-references, the W540–W542 diagnostics
  • Foreign-Format Plugins (stdio) — foreignFormat:, [plugins.<alias>], the JSON stdio envelope, E550/E551/W550–W553/E108
  • MagicGrid — the B/W/S × 1-4 overlay (mg_ custom fields), MoEs/MoPs, logical/physical layers, the magicgrid / trade-study reports
  • Annotated-Source Ingestion — annotationFormat: packages, comment markers carrying frontmatter, implementedBy: auto-fill, E560/E561/W560–W563
  • Link Types — project-declared relationships ([linkTypes], links:), extends/relax/coverage, the follow command, E630–E636
  • Suspect links design note — why content baselines, what is hashed, and how suspect accept fits review workflows
  • Test Plans — TestPlan scope, membership and configuration targeting
  • Custom Fields — custom_fields: metadata and --where queries
  • Build System Integration — build-config, buildExports, per-configuration build variables
  • Safety Analysis — HARA/TARA, fault trees, FMEA, attack trees, the safety case
  • LLM Workflow — authoring models with an LLM and the validator in the loop