Help us shape the future of Go! Take the 2026 Go Developer Survey

engmodel

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 51 Imported by: 0

README

engineering-model-go

engineering-model-go is a Go library and CLI for generating architecture views and AsciiDoc documentation from a typed engineering model.

It combines:

  • architecture model loading and validation
  • viewpoint projection (architecture-intent/communication/deployment/security/traceability)
  • Mermaid rendering
  • Structurizr DSL export
  • Threat Dragon/Open Threat Model JSON export
  • TRLC requirements export
  • LOBSTER activity trace export
  • design + requirement narrative generation to AsciiDoc
  • EARS requirement preflight linting
  • code trace mapping (Go, Python, JavaScript, TypeScript, Rust, Verilog modules)

YAML remains the canonical authored and persistence format, with CUE as the authoritative schema and cross-field constraint layer. The canonical YAML/CUE model is a semantic superset of the pinned formal SysML 2.0/KerML 1.0 abstract syntax, with typed Engineering:: extensions. This is evidenced by exhaustive inventory coverage, official-parser validation, and semantic project-interchange round trip. It does not claim execution/simulation semantics or graphical concrete syntax. SysML textual DSL is generated output, not another source model. See docs/sysml-v2-superset-plan.md.

Each model directory has one schema-v2 manifest entry point and eight required domain documents. An optional ninth documents.aviation document adds an airborne software evidence-readiness profile without changing models that omit it:

schemaVersion: 2
module:
  path: models.example/example-system@v0
  version: v0.1.0
  modelId: example-system
  title: Example System
  introduction: Example schema-v2 model.
  kind: system
documents:
  catalog: model/catalog.yml
  requirements: model/requirements.yml
  architecture: model/architecture.yml
  behavior: model/behavior.yml
  assurance: model/assurance.yml
  compliance: model/compliance.yml
  views: model/views.yml
  decisions: model/decisions.yml
  # aviation: model/aviation.yml
dependencies: []
publications:
  - id: public
    architecture: [FU-EXAMPLE]
    requirements: [REQ-EXAMPLE-001]
inferenceHints: {}

engmod.yml is the only model entry point. Every manifest and domain document uses schemaVersion: 2; paths are explicit and no companion filename is inferred. AI agents should call the no-argument MCP tool model.authoringContract first; it returns the resolved document set, schema files, top-level YAML fields, stable-ID conventions, dependency/source rules, and recommended editing order without requiring a broad repository scan.

Scope

This project models development-state architecture inputs from YAML and produces deterministic documentation/view artifacts.

It is not a runtime observability or incident/compliance runtime system.

Features

  • CUE-backed, closed-schema YAML loading for architecture, catalog, requirements, decisions, and design documents, followed by strict Go decoding
  • format-neutral document definitions and document-control metadata for downstream formal-document generators
  • model validation for IDs, references, relations, and viewpoint configuration
  • expanded mapping relation taxonomy for communication/deployment/security/traceability/lifecycle semantics
  • catalog-linked architecture relation labeling
  • deployment view extraction from:
    • Terraform (.tf) using HashiCorp HCL parsing
    • Flux resources (GitRepository/Kustomization/HelmRelease)
    • Helm chart metadata via Helm SDK chart loader
  • deterministic Mermaid view rendering
  • canonical semantic projection with stable IDs, typed relationships, ownership, source metadata, and explicit unsupported/lossy diagnostics
  • deterministic SysML v2 textual projection and executable coverage manifest
  • optional DO-178C/ED-12C evidence-readiness modeling and deterministic draft package generation; this is not a compliance or certification determination
  • AsciiDoc architecture generation with chapter scope diagrams
  • view-level filtering controls (includeKinds, excludeKinds, includeMappings, excludeMappings, maxDepth)
  • EARS preflight linting via github.com/labeth/ears-lint-go
    • lintRun.mode: strict is the default and recommended project mode
    • guided is optional for drafting workflows and non-blocking author guidance
  • Tree-sitter based code symbol extraction and trace mapping for:
    • Go
    • TypeScript/TSX
    • JavaScript (.js, .mjs, .cjs): named functions/generators, methods, classes and directly bound function values. Anonymous callbacks and top-level statements are not independent declarations; this does not infer classic-script load order or runtime behavior. Syntax errors and multiple declarations on one line produce errors rather than ambiguous trace credit.
    • Python (.py): functions (including async and nested definitions), methods and classes. Decorated declarations retain their definition-line coordinates; multiline decorators do not detach preceding trace comments. Strings and docstrings cannot create trace or ownership markers. Syntax errors fail declaration coverage. Lambdas and top-level script effects are outside this declaration scope. test_*.py and *_test.py are verification sources, with not-run status until result evidence is supplied.
    • Rust
  • Lexical Verilog (.v) module trace extraction, with one requirement-link block per module. This does not validate HDL syntax, elaborate designs, or expand macros. Unresolved macro invocations that may affect module declarations and malformed module boundaries produce errors. Macros recognized in expression positions inside a module produce warnings requiring independent build evidence; conditional branches are all inspected. inferenceHints.codeSources accepts directories or individual source files. Linked tb_*.v and *_tb.v testbenches produce verification links with not-run status until result evidence is supplied. Test-source links do not count as production implementation in the trace matrix.

Installation

go get github.com/labeth/engineering-model-go

Library API

Primary entry points:

  • GenerateFromFile(architecturePath, viewID)
  • Generate(bundle, viewID)
  • GenerateAsciiDocFromFiles(architecturePath, requirementsPath, designPath, options)
  • GenerateStructurizrDSLFromFile(architecturePath)
  • model.ProjectSemanticModel(bundle)
  • GenerateSysMLV2FromFile(architecturePath)
  • GenerateSysMLV2(bundle)
  • GenerateAirborneAssuranceFromFile(manifestPath, options)

For a model that declares documents.aviation, generate the readiness package:

go run ./cmd/engair --model engmod.yml --out-dir generated/do178c \
  --date 2026-09-19 --version v0.1.0

The package is visibly marked DRAFT / NOT A COMPLIANCE OR CERTIFICATION DETERMINATION, identifies exact authored baselines and open gaps, and uses only customer-supplied opaque objective references. See examples/dal-c-flight-control-sample/.

  • GenerateSysMLV2Projection(semanticModel)
  • SysMLV2Coverage()
  • GenerateThreatModelExportFromFile(architecturePath, options)
  • GenerateTRLCRequirementsFromFile(requirementsPath, options)
  • GenerateLobsterActivityTraceFromDir(testsDir, options)
  • BuildTraceMatrixFromFiles(architecturePath, requirementsPath, options)

Example:

res, err := engmodel.GenerateFromFile("examples/payments-engineering-sample/engmod.yml", "VIEW-ARCHITECTURE-INTENT")
if err != nil {
    panic(err)
}

fmt.Println(res.Mermaid)
for _, d := range res.Diagnostics {
    fmt.Printf("%s [%s] %s\n", d.Code, d.Severity, d.Message)
}

View IDs are free-form, but view kind must be one of:

  • architecture-intent
  • communication
  • deployment
  • security
  • traceability
  • state-lifecycle (optional)
  • interaction-flow (optional)

Optional view projection controls in model/views.yml:

  • includeKinds / excludeKinds: node kind filtering
  • includeMappings / excludeMappings: relation type filtering
  • maxDepth: bounded traversal from roots (0 means unlimited/default behavior)
  • audience, abstraction: optional publication metadata

Formal-document consumers can select canonical model content without adding format-specific payloads:

documents:
  - id: DOC-SYSTEM-SPECIFICATION
    title: System Specification
    kind: system-requirements-specification
    purpose: Define the system requirement baseline.
    audience: [systems-engineering, verification]
    stakeholderRefs: [ACT-SYSTEMS-ENGINEER]
    referenceRefs: [REF-SOURCE-SPECIFICATION]
    contentRefs: [REQ-SYSTEM-001, FU-CONTROL, VIEW-LOGICAL]
    sections:
      - id: scope
        title: Scope
        narrative: Defines the system boundary and intended use.
        includeRefs: [FU-CONTROL]
    control:
      identifier: SYS-SPEC-001
      revision: "1.0"
      status: draft
      issuedBy: Example Organization
      issueDate: 2026-09-20
      language: en
      documentType: specification
      confidentiality: internal
      securityClassification: unclassified
      exportControlled: false
      countryOfOrigin: Sweden
      confidentialityStamp: false

Requirements may additionally declare title, category, rationale, sourceRefs, verificationMethods, verificationCriteria, priority, criticality, status, derived, derivedRationale, and tags. These fields remain generic model input; exporters use only fields that have a native representation in their target format.

Authored architecture optionally supports additional first-class entities:

  • interfaces
  • dataObjects
  • deploymentTargets
  • controls
  • trustBoundaries
  • states
  • events
  • flows (with ordered steps)
  • hardwareItems (physical items with DO-254 DAL safety levels, part numbers, suppliers)
  • hardwareInterfaces (HW/SW interface contracts: ICD/IRS with buses such as arinc429, can, spi, i2c, ethernet, cellular)

Structural composition entities in model/architecture.yml:

  • contract (the system's provides/requires public interface contract)
  • composition.subsystems (downward references to child system models)
  • composition.allocations (parent-requirement allocation onto a subsystem or hardware item)
  • composition.satisfactions (records of how a subsystem's required interface is satisfied by a provider)

engdoc renders HW/SW interface allocation views from hardwareItems, hardwareInterfaces, and composition.allocations. See System-of-Systems Composition for the composition gates.

Flow step fields (model/behavior.yml behavior.flows[].steps[]) support:

  • id, ref, kind, action
  • dataIn, dataOut
  • next, onError
  • async, optional

Assurance authoring fields in model/assurance.yml:

  • controls
  • risks
  • poamItems

OSCAL catalog/profile integration is authored in model/compliance.yml:

  • compliance.profiles[]: OSCAL profile/catalog sources for the selected baseline
  • compliance.mappings[]: maps local CTRL-* implementation controls to selected OSCAL controlIds and architecture appliesTo entities; unmapped controls remain local model controls and are not exported as OSCAL implementations

Expanded mapping relation vocabulary includes:

  • Base: contains, depends_on, interacts_with, targets
  • Communication/data: calls, publishes, subscribes, reads, writes, streams
  • Traceability/deployment: implements, satisfies, allocated_to, verified_by, deployed_to
  • Security/lifecycle: mitigated_by, bounded_by, transitions_to, triggered_by, guarded_by
  • Flow projection (view-only): flow_next, flow_error, flow_async, flow_ref

bounded_by links a functional unit, deployment target, interface, actor, hardware item or data object to a trust boundary. Default security views retain these member kinds. Membership describes the modeled boundary; it does not establish authentication or enforcement. Author an explicit relationship when it should appear in the projected view.

Optional per-view publication metadata (in model/views.yml):

  • authoredStatus (for example draft, in-review, stable)
  • authoredStatusExplanation (short rationale shown in Document Health Snapshot)

Verification metadata is inferred from test artifacts:

  • test sources under tests/ (for inferred verification checks and test code element links)
  • result artifacts under test-results/ (for inferred requirement-level outcomes)
  • requirement IDs in test sources are inferred from TRLC-LINKS: REQ-* markers
  • requirement IDs in result artifacts are inferred by matching REQ-* tokens in result content
  • published verification chain is Verification Check -> Test Code Element -> Requirement
  • functional ownership in verification tables is shown as derived context from requirement ownership
  • strict EARS lint also warns when catalog terms (systems, actors, events, states, features, modes, conditions, data terms) are not referenced by any requirement text (catalog.term_unreferenced)
Code trace markers

Source files link back to the model with two comment markers, scanned under --code-root:

  • TRLC-LINKS: lists requirement IDs (REQ-*) implemented or exercised by the code
  • ENGMODEL-LINKS: lists model element IDs (functional units, interfaces, controls, flows, data objects, etc.) realized by the code

Both markers are validated against the loaded model. Unresolved IDs are hard errors (code.dangling_requirement_link for TRLC-LINKS, code.dangling_model_link for ENGMODEL-LINKS), enforced by the engdoc zero-error gate and by engtrace (non-zero exit). Code is scoped to its nearest enclosing model root, so links resolve against the closest model rather than the whole tree. Requirements with no implementing or delegating code surface a requirement.orphan warning, and a requirement linked from code that does not exist raises requirement.internal_link.

CLI Usage

Plan, inspect, and atomically apply a requirements delta:

# requirements-delta.yml
version: 1
requirements:
  add:
    - id: REQ-PAY-011
      text: "When payment authorized event is received, the payments system shall persist authorization record."
      notes: "New audit behavior."
      appliesTo: [FU-PAYMENT-AUTHORIZATION]
  update: []
  remove: []
go run ./cmd/engchange validate --root examples/payments-engineering-sample --delta requirements-delta.yml
go run ./cmd/engchange diff --root examples/payments-engineering-sample --delta requirements-delta.yml
go run ./cmd/engchange apply --root examples/payments-engineering-sample --delta requirements-delta.yml

Delta version 1 supports requirement add, whole-entity update, and remove operations. Planning and diffing never write canonical files. Apply validates the complete candidate model, preserves unchanged YAML nodes and comments, and atomically replaces model/requirements.yml only when no blocking diagnostics are present.

Generate a single Mermaid view:

go run ./cmd/engview \
  --model examples/payments-engineering-sample/engmod.yml \
  --view VIEW-DEPLOYMENT \
  --out out.mmd

Generate every authored view as deterministic Mermaid and native SVG:

go run ./cmd/engview \
  --model examples/coffee-appliance-six-view/engmod.yml \
  --out-dir examples/coffee-appliance-six-view/generated

The coffee appliance fixture demonstrates use-case, logical, process, physical, implementation, and deployment concerns from canonical schema-v2 semantics. Its process output is a Mermaid sequence diagram, and every SVG includes an accessible title plus source and view provenance.

Generate architecture AsciiDoc:

go run ./cmd/engdoc \
  --model examples/payments-engineering-sample/engmod.yml \
  --requirements examples/payments-engineering-sample/model/requirements.yml \
  --design examples/payments-engineering-sample/model/views.yml \
  --code-root ./src \
  --view VIEW-ARCHITECTURE-INTENT \
  --view VIEW-TRACEABILITY \
  --decisions-out examples/payments-engineering-sample/generated/DECISIONS.adoc \
  --out examples/payments-engineering-sample/generated/ARCHITECTURE.adoc

--view is repeatable to scope the document to specific viewpoint IDs (omit to include all configured views). When --decisions-out is set, engdoc emits the architecture decision records (from model/decisions.yml) as a separate DECISIONS.adoc document.

Each authored view and each requirement coverage graph is published as one complete diagram. Large diagrams scale to fit the page instead of being split into repeated panels. Standalone Mermaid and SVG exports preserve the same complete graph and can be viewed at a larger scale. Deployment publications shorten relationship labels longer than 32 characters to numbered arrows and retain their full text in a table directly below the diagram. Extra routing space separates keyed edges; standalone graph exports retain the original labels. Browser and requirement flowcharts use wider spacing to reduce label collisions without removing nodes or relationships.

Generate the machine-readable traceability matrix:

go run ./cmd/engtrace \
  --model examples/payments-engineering-sample/engmod.yml \
  --requirements examples/payments-engineering-sample/model/requirements.yml \
  --code-root examples/payments-engineering-sample/src \
  --format json \
  --out examples/payments-engineering-sample/generated/TRACE-MATRIX.json

Use --format csv for a spreadsheet-friendly matrix instead. The emitted matrix rolls up per-requirement status (implemented/verified/delegated/orphan) together with code references and delegations. engtrace exits non-zero when it finds dangling code trace links (code.dangling_requirement_link / code.dangling_model_link), so it doubles as a CI gate.

Generate Threat Dragon/Open Threat Model exports:

go run ./cmd/engdragon --model examples/payments-engineering-sample/engmod.yml --format threat-dragon-v2 --out examples/payments-engineering-sample/generated/threat-dragon-v2.json
go run ./cmd/engdragon --model examples/payments-engineering-sample/engmod.yml --format open-otm --out examples/payments-engineering-sample/generated/open-threat-model.json

Generate Structurizr DSL:

go run ./cmd/engstruct --model examples/payments-engineering-sample/engmod.yml --out examples/payments-engineering-sample/generated/STRUCTURIZR.dsl

Generate the deterministic SysML v2 textual projection:

go run ./cmd/engsysml \
  --model examples/payments-engineering-sample/engmod.yml \
  --out examples/payments-engineering-sample/generated/architecture.sysml

Author NATO Architecture Framework 4.1 metadata in model/views.yml without duplicating the canonical architecture graph:

naf:
  framework: NAF
  version: "4.1"
  architectureDescription: Example NAF Architecture Description
  stakeholders:
    - actorRef: ACT-ARCHITECT
      role: Owns architecture decisions.
  concerns:
    - id: NAF-CONCERN-STRUCTURE
      name: System structure
      stakeholderRefs: [ACT-ARCHITECT]
  products:
    - id: NAF-P2-RESOURCE-STRUCTURE
      viewpoint: P2
      title: Physical resource structure
      viewRef: VIEW-DEPLOYMENT
      concernRefs: [NAF-CONCERN-STRUCTURE]

Each NAF product references an existing Engmod view. Capability, service, logical, resource, interface, behavior, and requirement concepts therefore remain represented once in the canonical SysML/KerML-aligned model. Generate the deterministic NAF architecture document with:

go run ./cmd/engnaf \
  --model engmod.yml \
  --out generated/ARCHITECTURE.naf.adoc

The profile accepts the official NAF 4.1 viewpoint codes (C*, S*, L*, P*, and A*, including roadmap and cross-domain viewpoints). CUE rejects unsupported framework versions and viewpoint codes; model validation also checks actor, stakeholder, concern, and Engmod view references. This output is a framework-aligned architecture description and is not a claim of NATO certification.

Emit the executable metaclass/property-level coverage manifest:

go run ./cmd/engsysml --coverage

The formal metamodel inventory is separate from that projection report. The formal Systems-Modeling/SysML-v2-Release tag 2026-04 is pinned at commit 9baca5908ca28b53da085de69336fde48420ea8f. That release does not contain a normative metamodel XMI/Ecore: its XMI directories are standard-library model instances, and the release notes explicitly state that their Eclipse XMI is not fully normative OMG XMI.

The closest official machine-readable metamodel artifact is therefore the Ecore published by the aligned official Pilot Implementation tag 2026-04, commit 20897e3122f2c2f8b29389745f0caaaeb7c6e21a:

Origin Path SHA-256
KerML 1.0 org.omg.sysml/model/kerml.ecore 62db52cbccf41266ccfa9b3b9cbb4a40384f16ab513f1d8522fd29d9d0fda8e7
SysML 2.0 org.omg.sysml.model/src/main/resources/model/SysML.ecore be71998ca0d9bb7e6081a25e8ead93ce49d623a47ca414b30ee8c572d6d0d753

Exact immutable URLs and authority notes are tracked in tools/sysml/metamodel-sources.json. Refresh downloads into the ignored .engmod/cache tree, verifies both hashes, and regenerates the compact inventory and semantic coverage binding:

scripts/refresh-sysml-metamodel.sh
scripts/check-sysml-metamodel.sh

The offline check uses only tracked artifacts. It inventories exactly 175 metaclasses, 415 owned properties, 13,318 effective properties, 209 inheritance edges, 328 derived properties, and 66 relationships. The strict binding records 262 mapped entries, 328 derived/implied entries, and zero unimplemented entries. Textual rendering classifies 54 metaclasses as native-rendered and 121 as abstract/implicit, with zero missing rules; all 66 relationships are classified. CI rejects stale inventory hashes, omitted properties or renderer classifications, partial/unsupported normative statuses, stale coverage JSON, official-parser failures, and semantic round-trip differences.

Install the pinned official parser wrapper and Sysand KPAR packager into the ignored .engmod tool/cache tree:

scripts/install-sysml-toolchain.sh

The installer verifies the official 2026-04 Pilot Implementation jupyter-sysml-kernel-0.59.0.zip checksum and the platform-specific Sysand 0.2.1 release checksum. The validator wrapper is checked out at commit 63abbd9fbc7851dc437d01b2dc07836b919770b8; GitHub does not publish a separate source-archive checksum for that commit, so the immutable Git object ID is the documented verification boundary.

Build and reopen a normative KPAR through Sysand:

go run ./cmd/engsysml \
  --model engmod.yml \
  --project-out .engmod/validation/sysml/project \
  --kpar-out .engmod/validation/sysml/engineering-model.kpar \
  --sysand .engmod/tooling/bin/sysand

go run ./cmd/engsysml \
  --model engmod.yml \
  --verify-kpar .engmod/validation/sysml/engineering-model.kpar \
  --reopen-out .engmod/validation/sysml/reopened \
  --sysand .engmod/tooling/bin/sysand

engsysml delegates KPAR creation and reopening to Sysand; it does not create or label a custom ZIP as KPAR. The generated project contains only native SysML source; engineering-model data without a native SysML representation is omitted rather than embedded in descriptions, metadata payloads, or extension bags. Verification reopens the KPAR and compares its SysML source byte-for-byte with a fresh deterministic projection. Run the complete blocking gate with scripts/validate-sysml.sh. Local users may explicitly skip unavailable external tools with ENGMOD_SYSML_SKIP_EXTERNAL=1 scripts/validate-all.sh; CI installs the pinned tools and never sets that skip.

The exporter preserves engineering-specific concepts and source properties in a typed metadata payload and reports unsupported, lossy, external-endpoint, and toolchain-conformance limitations as diagnostics. The generated text and KPAR are validated by the official parser baseline, but the coverage manifest still describes a documented subset/projection rather than claiming complete SysML v2 semantic conformance.

Every authored YAML document is validated against the embedded modular schemas in model/schema/ before strict Go decoding. CUE is authoritative for document shape and cross-field constraints, produces path-aware diagnostics, and rejects unknown fields recursively. A reflection-based contract test detects drift between CUE fields and the Go runtime API representations. The loader aggregates the domain documents into one canonical semantic graph for validation and projection.

Generate TRLC requirements package:

go run ./cmd/engtrlc --requirements examples/payments-engineering-sample/model/requirements.yml --out-dir examples/payments-engineering-sample/generated/trlc --package PaymentsRequirements

Generate LOBSTER activity trace from tests:

go run ./cmd/englobster --tests-dir examples/payments-engineering-sample/tests --requirements-package PaymentsRequirements --activity-namespace tests --out examples/payments-engineering-sample/generated/lobster/activities.lobster

Regenerate all maintained examples with scripts/generate-examples.sh. After generation, scripts/render-publication-pdfs.sh renders the self-model and every example architecture publication using the locally installed proven-docs. Review the rendered pages before release; a successful render does not establish visual quality. PDF rendering is separate from deterministic model-export validation.

Render an individual PDF with proven-docs:

proven-docs render \
  examples/payments-engineering-sample/generated/ARCHITECTURE.adoc \
  --output examples/payments-engineering-sample/generated/ARCHITECTURE.proven.pdf

The generated document starts with:

  • Introduction (from model.introduction)
  • Scope and Assumptions
  • How To Read This Document
  • Document Health Snapshot (per-view coverage and confidence)
  • Terms and Definitions as a compact Term | Definition table
    • terms are sorted A-Z by term text
    • term IDs are shown as Term (ID) in the term column

Each generated view includes:

  • What This View Answers
  • Coverage Gaps and Recommended Next Evidence Additions
  • view-scoped narratives from model/views.yml
    • for security, content is organized as attack-vector chapters with per-attack diagrams and related FU sections

The Traceability View includes:

  • Requirement-to-Unit Mapping (Compact)
  • Verification Result Mapping (inferred per-requirement outcomes)

The traceability appendix includes:

  • Requirement Details
  • Verification Inventory (inferred test/check mappings to test code elements and requirements)
  • Reference Index with consistent entry layout:
    • chapter per ID
    • short prose description
    • compact key/value table with the most relevant fields
    • Mentioned In backlinks to jump from registry entries to sections where each entry is referenced
    • sections: Authored References, Catalog References, Inferred Runtime References, Inferred Code References, Verification References

Machine-oriented development context is exposed through the MCP server.

Run the MCP server (Model Context Protocol, stdio JSON-RPC over Content-Length-framed messages on stdin/stdout):

go run ./cmd/engmcp

It exposes 50+ tools grouped into families, including:

  • requirements.*: requirement details, impact, support paths, and edit-plan suggestions
  • files.*: files and ownership for a requirement, control, or threat
  • verification.*: inferred verification status, gaps, and recommendations
  • threats.*: threat coverage, per-requirement threats, and unmitigated threats
  • flows.*: interaction-flow projections and diffs per requirement
  • graph.*: model graph search, neighborhood, and edge explanations
  • model.*: model entity lookup, listings, implementations, and RSL export
  • interfaces.*: software and HW/SW interface resolution and code matching
  • composition.resolve: the system-of-systems — subsystems, contracts, requirement allocations with the delegated subsystem requirement, and composition diagnostics
  • trace.matrix: per-requirement implemented/verified/delegated/orphan status, code references, and dangling code trace links
  • gemara.*: one tool per OpenSSF Gemara artifact type plus gemara.validate

Additional export/validation docs:

  • MCP-first agent workflow and tagging contract: docs/skills/architecture-mcp-workflow.md
  • OSCAL profile/catalog and compliance mapping workflow: docs/oscal-compliance-mapping.md
  • Threat Dragon export and schema checks: docs/threat-dragon-export-testing.md
  • Structurizr export and validation: docs/structurizr-export-testing.md
  • TRLC requirements export and validation: docs/trlc-export-testing.md
  • TRLC + LOBSTER traceability report pipeline: docs/lobster-traceability.md

System-of-Systems Composition

A model declares exact dependencies in engmod.yml and composes their selected publications from model/architecture.yml.

# engmod.yml
dependencies:
  - alias: telemetry
    path: models.example/coffee-fleet/telemetry@v0
    version: v0.1.0
    publications: [public]

# model/architecture.yml
architecture:
  composition:
    subsystems:
      - id: SUB-TELEMETRY
        name: Machine Telemetry Subsystem
        dependency: telemetry
        publication: public
    allocations:
      - requirement: REQ-COF-001
        to: SUB-TELEMETRY
        target: telemetry::CAP-TELEM-REPORT
        rationale: Reporting is realized by the telemetry subsystem.
    satisfactions:
      - need: ota-agent::NEED-TELEMETRY-FEED
        by: telemetry::CAP-TELEM-REPORT

Dependencies are standard CUE modules fetched from the OCI registry selected by CUE_REGISTRY and materialized under .engmod/modules. A module contains cue.mod/module.cue, engmod.yml, and the eight domain documents:

module: "models.example.com/company/security@v0"
language: version: "v0.17.0"

Publish with the standard CUE workflow:

export CUE_REGISTRY=registry.example.com/company-models
cue mod tidy
cue mod publish v0.3.1

For multi-repository local development, place engmod.work.yml above the repositories. Published coordinates stay unchanged while dependencies resolve from explicit sibling paths:

schemaVersion: 2
replacements:
  - module: models.example.com/company/security@v0
    path: ./repos/security

Replacement paths must remain inside the workspace and their cue.mod/module.cue identity must match. Composition rejects floating or invalid versions, path escapes, cycles, missing manifests, unpublished targets, and unsatisfied requirements.

See examples/coffee-fleet-ota-cloud-sample for local composition and examples/atlas-industries for a seven-repository company portfolio with two products reusing shared hardware/software, security, compliance, and cloud modules through OCI coordinates.

Requirement delegation (no tiers)

Delegation is flat — there are no requirement tiers. A parent requirement is satisfied by delegating it to a subsystem contract entry, expressed as a composition.allocations entry that binds the requirement to a subsystem (target naming the provided contract id within that subsystem). A delegation without a resolvable target raises composition.untraceable_delegation. A delegated requirement counts against the requirement.orphan rollup, so a requirement that is neither implemented in code nor delegated to a subsystem still surfaces as orphaned.

OSCAL chain generation

Use engoscal to generate SSP, Assessment Results, and POA&M artifacts from architecture inputs.

SSP only:

go run ./cmd/engoscal --model examples/payments-engineering-sample/engmod.yml --ssp-out examples/payments-engineering-sample/generated/ARCHITECTURE.ssp.json

Full chain:

go run ./cmd/engoscal \
  --model examples/payments-engineering-sample/engmod.yml \
  --requirements examples/payments-engineering-sample/model/requirements.yml \
  --code-root examples/payments-engineering-sample/src \
  --profile examples/payments-engineering-sample/oscal/profile-nist-800-53-low.json \
  --catalog examples/payments-engineering-sample/oscal/catalog-nist-800-53-rev5-subset.json \
  --ssp-out examples/payments-engineering-sample/generated/ARCHITECTURE.ssp.json \
  --ar-out examples/payments-engineering-sample/generated/ARCHITECTURE.ar.json \
  --poam-out examples/payments-engineering-sample/generated/ARCHITECTURE.poam.json \
  --ap-href ./ASSESSMENT-PLAN.json \
  --ssp-href ./ARCHITECTURE.ssp.json

Validation with OSCAL CLI (containerized):

podman run --rm -v "$PWD":/work:Z -w /work docker.io/matthewruge/oscal-cli:0.2.0 ssp validate --as json examples/payments-engineering-sample/generated/ARCHITECTURE.ssp.json
podman run --rm -v "$PWD":/work:Z -w /work docker.io/matthewruge/oscal-cli:0.2.0 ar validate --as json examples/payments-engineering-sample/generated/ARCHITECTURE.ar.json
podman run --rm -v "$PWD":/work:Z -w /work docker.io/matthewruge/oscal-cli:0.2.0 poam validate --as json examples/payments-engineering-sample/generated/ARCHITECTURE.poam.json

Gemara GRC rendering

Gemara is a first-class rendering of the model: enggemara projects the engineering model into OpenSSF Gemara documents using the official go-gemara SDK types, and every artifact validates against the published Gemara CUE schemas.

All 13 Gemara artifact types are produced:

  • L1 Vector Catalog ← attackVectors (with environment applicability)
  • L1 Principle Catalog ← standard governance principles
  • L1 Guidance Catalog ← control families (control guidelines link back to it)
  • L2 Capability Catalog ← functionalUnits (+ a synthetic system capability)
  • L2 Threat Catalog ← threatScenarios (capabilities, vectors, and threat actors)
  • L2 Control Catalog ← controls + controlVerifications (synthesized assessment-requirements)
  • L3 Risk Catalog ← risks (severity derived from likelihood × impact; unique rank)
  • L3 Policy ← compliance/risks/controls (scope, imports, risk treatment, adherence)
  • L5 Evaluation Log ← controlVerifications (pass and fail, with evidence)
  • L6 Enforcement Log ← poamItems (remediation actions)
  • L7 Audit Log ← controlVerifications + residual risks
  • Mapping Document ← control → threat relationships
  • Lexicon ← catalog terms (controlled vocabulary)

Generate the catalogs and logs:

go run ./cmd/enggemara \
  --model examples/payments-engineering-sample/engmod.yml \
  --requirements examples/payments-engineering-sample/model/requirements.yml \
  --out-dir examples/payments-engineering-sample/generated/gemara \
  --version 1.0.0 --date 2026-06-26T00:00:00Z

Optionally emit OSCAL via the Gemara SDK bridge (additive; the hand-written OSCAL SSP/AR/POA&M under engoscal are retained):

go run ./cmd/enggemara --model <engmod.yml> --requirements <model/requirements.yml> \
  --out-dir <dir> \
  --oscal-catalog-out <dir>/oscal-catalog.json \
  --oscal-ar-out <dir>/oscal-ar.json

Validation:

  • in-repo, via the go-gemara SDK loader + type discriminator: go test -run TestGemara ./...
  • against the official CUE schemas: scripts/validate-gemara.sh (needs the cue CLI and the Gemara schema module; set GEMARA_SCHEMA_DIR to a checkout of github.com/gemaraproj/gemara)

The generated AsciiDoc document includes a Gemara GRC Model chapter, and the MCP server exposes a gemara.* tool per artifact type (gemara.controlCatalog, gemara.threatCatalog, gemara.riskCatalog, gemara.vectorCatalog, gemara.capabilityCatalog, gemara.principleCatalog, gemara.guidanceCatalog, gemara.policy, gemara.lexicon, gemara.mappingDocument, gemara.auditLog, gemara.enforcementLog, gemara.evaluationLog) plus gemara.validate.

See docs/gemara-rendering.md for the field-by-field mapping and the OSCAL decision.

Agent Skills

Use these docs to drive AI-agent development workflows and tagging conventions:

  • OpenCode-ready skill (auto-discoverable by opencode debug skill): .opencode/skills/engineering-model-architecture-ai/SKILL.md
  • framework-neutral workflow and tagging contract: docs/skills/architecture-mcp-workflow.md
  • OpenCode adapter prompt: docs/skills/adapters/opencode-skill-prompt.md
  • generic adapter prompt for other frameworks: docs/skills/adapters/generic-agent-prompt.md

Example Project

End-to-end sample inputs and generated outputs are under:

  • examples/payments-engineering-sample
  • examples/bedrock-pr-review-github-app-sample
  • examples/coffee-fleet-ota-cloud-sample

Core files:

  • engmod.yml
  • model/catalog.yml
  • model/requirements.yml
  • model/architecture.yml
  • model/behavior.yml
  • model/assurance.yml
  • model/compliance.yml
  • model/views.yml
  • model/decisions.yml
  • infra/terraform
  • src (Go/Rust/TypeScript traced code)

Development

Unit checks:

go test ./...
go vet ./...

The canonical validation gauntlet is scripts/validate-all.sh — the single source of truth for both local development and CI:

bash scripts/validate-all.sh

It runs strict gates that always fail the build:

  • go build ./...
  • generation gates: engdoc exits non-zero on any error (transitively enforcing trace integrity / dangling links, EARS lint, and composition checks)
  • engtrace: zero dangling code trace links per model
  • artifact freshness: regenerated ARCHITECTURE.adoc / DECISIONS.adoc / TRACE-MATRIX.json must match what is committed (detected via git diff)

plus best-effort gates that run only when their tool is on PATH (a missing tool is skipped, a real failure still fails the build):

  • Gemara CUE schema validation (cue)
  • Structurizr DSL validation (behind ENGMOD_VALIDATE_STRUCTURIZR=1, via docker/podman)
  • TRLC validation (trlc)

.github/workflows/ci.yml runs scripts/validate-all.sh, so the same gates apply in CI.

Generated ARCHITECTURE.adoc, DECISIONS.adoc, and TRACE-MATRIX.json are deterministic and reproducible; CI fails on any drift, so when you change a model you must regenerate these artifacts and commit them alongside the model change.

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the MIT License. See LICENSE.

Documentation

Overview

ENGMODEL-OWNER-UNIT: FU-AIRBORNE-ASSURANCE-EXPORTER

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-ASCIIDOC-GENERATOR

ENGMODEL-OWNER-UNIT: FU-VALIDATION-ENGINE

ENGMODEL-OWNER-UNIT: FU-SYSTEM-COMPOSITION

ENGMODEL-OWNER-UNIT: FU-SYSTEM-COMPOSITION

ENGMODEL-OWNER-UNIT: FU-VALIDATION-ENGINE

ENGMODEL-OWNER-UNIT: FU-GEMARA-EXPORTER

ENGMODEL-OWNER-UNIT: FU-GEMARA-EXPORTER

ENGMODEL-OWNER-UNIT: FU-GEMARA-EXPORTER

ENGMODEL-OWNER-UNIT: FU-GEMARA-EXPORTER

ENGMODEL-OWNER-UNIT: FU-GEMARA-EXPORTER

ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION

ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-LOBSTER-EXPORTER

ENGMODEL-OWNER-UNIT: FU-NAF-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER

ENGMODEL-OWNER-UNIT: FU-MODEL-CHANGE

ENGMODEL-OWNER-UNIT: FU-STRUCTURIZR-EXPORTER

ENGMODEL-OWNER-UNIT: FU-SYSML-EXPORTER

ENGMODEL-OWNER-UNIT: FU-SYSML-EXPORTER

ENGMODEL-OWNER-UNIT: FU-SYSML-EXPORTER

ENGMODEL-OWNER-UNIT: FU-THREAT-EXPORTER

ENGMODEL-OWNER-UNIT: FU-ALLOCATION-TRACE

ENGMODEL-OWNER-UNIT: FU-TRLC-EXPORTER

Index

Constants

View Source
const AirborneDisclaimer = "DRAFT / NOT A COMPLIANCE OR CERTIFICATION DETERMINATION"
View Source
const CompositionLockFileName = "engmod.lock.yml"
View Source
const GemaraVersion = "1.1.0"

GemaraVersion is the Gemara specification version stamped into every artifact's metadata.

Variables

View Source
var ErrNoAviationProfile = errors.New("no aviation assurance profile is authored")
View Source
var ErrNoLobsterActivities = errors.New("LOBSTER activity trace requires at least one TRLC-linked source artifact")
View Source
var ErrNoOSCALCompliance = errors.New("OSCAL export requires at least one authored compliance mapping")
View Source
var ErrNoOSCALProfiles = errors.New("no OSCAL compliance profiles are authored")

ErrNoOSCALProfiles indicates that the model has no compliance profile to publish as an aggregate OSCAL profile.

View Source
var ErrNoPOAMItems = errors.New("OSCAL POA&M requires at least one authored POA&M item")

Functions

func CompareSysMLV2RoundTrip added in v0.2.0

func CompareSysMLV2RoundTrip(expected, actual model.SemanticModel) []string

CompareSysMLV2RoundTrip reports differences in stable identity, ownership, relationships, expressions, references, and typed extensions.

TRLC-LINKS: REQ-EMG-036, REQ-EMG-037

func GenerateGemaraOSCALAssessmentResults

func GenerateGemaraOSCALAssessmentResults(bundle model.Bundle, requirements model.RequirementsDocument, codeRoot string, options GemaraExportOptions) (string, error)

GenerateGemaraOSCALAssessmentResults converts the Gemara Evaluation Log to OSCAL Assessment Results JSON via the go-gemara SDK. Returns "" when there is nothing to evaluate. TRLC-LINKS: REQ-EMG-015, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraOSCALAssessmentResultsFromFiles

func GenerateGemaraOSCALAssessmentResultsFromFiles(architecturePath, requirementsPath, codeRoot string, options GemaraExportOptions) (string, error)

GenerateGemaraOSCALAssessmentResultsFromFiles loads inputs and emits OSCAL Assessment Results derived from the Gemara evaluation log. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraOSCALCatalog

func GenerateGemaraOSCALCatalog(bundle model.Bundle, options GemaraExportOptions) (string, error)

GenerateGemaraOSCALCatalog converts the Gemara Control Catalog to an OSCAL Catalog JSON document via the go-gemara SDK. Returns "" when there are no controls. TRLC-LINKS: REQ-EMG-015, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraOSCALCatalogFromFile

func GenerateGemaraOSCALCatalogFromFile(architecturePath string, options GemaraExportOptions) (string, error)

GenerateGemaraOSCALCatalogFromFile loads the model and emits an OSCAL Catalog derived from the Gemara Control Catalog. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateOSCALProfile added in v0.2.0

func GenerateOSCALProfile(bundle model.Bundle, options OSCALProfileOptions) (string, error)

GenerateOSCALProfile emits a deterministic OSCAL 1.1.2 aggregate profile so multi-framework SSPs import every framework they implement. TRLC-LINKS: REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateOSCALProfileFromFile added in v0.2.0

func GenerateOSCALProfileFromFile(path string, options OSCALProfileOptions) (string, error)

GenerateOSCALProfileFromFile loads a model and emits one profile importing every authored compliance profile. TRLC-LINKS: REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateSysMLV2Projection added in v0.2.0

func GenerateSysMLV2Projection(semantic model.SemanticModel) (string, []model.SemanticDiagnostic)

GenerateSysMLV2Projection renders a pre-built semantic graph. Missing rendering rules are errors; official concepts are never replaced by a generic item declaration.

TRLC-LINKS: REQ-EMG-036 ENGMODEL-LINKS: FU-SYSML-EXPORTER, DO-CANONICAL-SEMANTIC-MODEL, DO-SYSML-V2-MODEL

func HasComposition

func HasComposition(bundle model.Bundle) bool

HasComposition reports whether the model declares any subsystems. TRLC-LINKS: REQ-EMG-016 ENGMODEL-LINKS: FU-SYSTEM-COMPOSITION

func ImportSysMLV2Project added in v0.2.0

func ImportSysMLV2Project(sourcePath string) (model.SemanticModel, error)

ImportSysMLV2Project reconstructs the canonical semantic model from legacy projects that embedded an Engineering Model payload. Native projections do not embed non-SysML canonical data.

TRLC-LINKS: REQ-EMG-036, REQ-EMG-037

func ResolveCompositionProjection added in v0.2.0

func ResolveCompositionProjection(bundle model.Bundle) (CompositionProjection, CompositionResult, error)

ResolveCompositionProjection resolves and validates composition for a bundle. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

func ValidateSysMLV2Coverage added in v0.2.0

func ValidateSysMLV2Coverage(manifest SysMLCoverageManifest) error

ValidateSysMLV2Coverage rejects any gap or stale/tampered evidence.

TRLC-LINKS: REQ-EMG-039, REQ-EMG-040

func WriteCompositionLock added in v0.2.0

func WriteCompositionLock(path string, lock CompositionLockDocument) error

WriteCompositionLock writes deterministic generated dependency state. TRLC-LINKS: REQ-EMG-047, REQ-EMG-048, REQ-EMG-049, REQ-EMG-051

Types

type AirborneAssuranceOptions added in v0.2.0

type AirborneAssuranceOptions struct {
	Date    string
	Version string
}

type AirborneAssuranceResult added in v0.2.0

type AirborneAssuranceResult struct {
	Files       map[string][]byte
	Diagnostics []model.AviationDiagnostic
}

func GenerateAirborneAssuranceFromFile added in v0.2.0

func GenerateAirborneAssuranceFromFile(manifestPath string, options AirborneAssuranceOptions) (AirborneAssuranceResult, error)

GenerateAirborneAssuranceFromFile validates and renders the complete evidence-readiness package. It does not determine compliance or certification. TRLC-LINKS: REQ-EMG-053, REQ-EMG-054, REQ-EMG-055

type AsciiDocOptions

type AsciiDocOptions struct {
	ViewIDs          []string
	CodeRoot         string
	DecisionsDocPath string
}

ENGMODEL-LINKS: FU-ASCIIDOC-GENERATOR, FU-CODEMAP-INFERENCE, CTRL-TRACEABILITY-COVERAGE, DEP-LOCAL-WORKSPACE

type AsciiDocResult

type AsciiDocResult struct {
	Document          string
	DecisionsDocument string
	Diagnostics       []validate.Diagnostic
}

ENGMODEL-LINKS: FU-ASCIIDOC-GENERATOR, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateAsciiDoc

func GenerateAsciiDoc(bundle model.Bundle, requirements model.RequirementsDocument, design model.DesignDocument, options AsciiDocOptions) (AsciiDocResult, error)

ENGMODEL-LINKS: FU-ASCIIDOC-GENERATOR, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS TRLC-LINKS: REQ-EMG-001, REQ-EMG-003, REQ-EMG-014, REQ-EMG-035, REQ-EMG-036

func GenerateAsciiDocFromFiles

func GenerateAsciiDocFromFiles(architecturePath, requirementsPath, designPath string, options AsciiDocOptions) (AsciiDocResult, error)

ENGMODEL-LINKS: FU-ASCIIDOC-GENERATOR, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS TRLC-LINKS: REQ-EMG-001, REQ-EMG-003, REQ-EMG-014

type ComposedSystem

type ComposedSystem struct {
	SubsystemID    string
	Dependency     string
	Publication    string
	ModulePath     string
	Version        string
	Dir            string
	Bundle         model.Bundle
	Requirements   model.RequirementsDocument
	PublishedIDs   map[string]bool
	PublishedFacet map[string]string
	Children       []*ComposedSystem
}

ComposedSystem is a resolved system together with its resolved subsystems. ENGMODEL-LINKS: FU-SYSTEM-COMPOSITION, DO-ARCHITECTURE-MODEL

type CompositionLockDependency added in v0.2.0

type CompositionLockDependency struct {
	Alias        string   `yaml:"alias"`
	Path         string   `yaml:"path"`
	Version      string   `yaml:"version"`
	Publications []string `yaml:"publications"`
	Digest       string   `yaml:"digest"`
}

type CompositionLockDocument added in v0.2.0

type CompositionLockDocument struct {
	SchemaVersion int                         `yaml:"schemaVersion"`
	Dependencies  []CompositionLockDependency `yaml:"dependencies"`
}

CompositionLockDocument is deterministic generated dependency state. TRLC-LINKS: REQ-EMG-047, REQ-EMG-048, REQ-EMG-049, REQ-EMG-051

type CompositionProjection added in v0.2.0

type CompositionProjection struct {
	Publications []PublishedProjection
	Entities     []PublishedProjectionEntity
}

CompositionProjection is the reusable, read-only projection boundary used by every output format. It never mutates an authored bundle. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

func BuildCompositionProjection added in v0.2.0

func BuildCompositionProjection(result CompositionResult) CompositionProjection

BuildCompositionProjection materializes only direct, explicitly selected dependency publications. Transitive or unexported child data is not exposed. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

func (CompositionProjection) Domain added in v0.2.0

func (projection CompositionProjection) Domain(domain string) []PublishedProjectionEntity

Domain returns published entities from one manifest publication facet. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

func (CompositionProjection) EnrichBundle added in v0.2.0

func (projection CompositionProjection) EnrichBundle(bundle model.Bundle, domains ...string) model.Bundle

EnrichBundle returns a projection-only copy containing typed published entities. It is intended for native generators after the authored bundle has been validated; unsupported relationships are omitted rather than flattened. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

type CompositionResult

type CompositionResult struct {
	Root        *ComposedSystem
	Allocations []MaterializedAllocation
	Provenance  []ImportedEntityProvenance
	Lock        CompositionLockDocument
	Diagnostics []validate.Diagnostic
}

CompositionResult is the resolved tree plus materialized allocation trace and diagnostics. ENGMODEL-LINKS: FU-SYSTEM-COMPOSITION, FU-ALLOCATION-TRACE

func GenerateCompositionFromFile

func GenerateCompositionFromFile(manifestPath string) (CompositionResult, error)

GenerateCompositionFromFile resolves the system-of-systems rooted at engmod.yml. TRLC-LINKS: REQ-EMG-016, REQ-EMG-047, REQ-EMG-048, REQ-EMG-049, REQ-EMG-051 ENGMODEL-LINKS: FU-SYSTEM-COMPOSITION, FU-MODEL-LOADER, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type DanglingLink struct {
	Kind   string `json:"kind"` // requirement | model
	Target string `json:"target"`
	From   string `json:"from"` // file:line
}

DanglingLink is a code trace link that resolves to nothing in the model. ENGMODEL-LINKS: FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE

type GemaraEvaluationResult

type GemaraEvaluationResult struct {
	EvaluationLog gemara.EvaluationLog
	YAML          string
	HasContent    bool // false when there is nothing to evaluate (no controls)
}

GemaraEvaluationResult holds the L5 Evaluation Log and its serialization. ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraEvaluationLog

func GenerateGemaraEvaluationLog(bundle model.Bundle, requirements model.RequirementsDocument, codeRoot string, options GemaraExportOptions) (GemaraEvaluationResult, error)

GenerateGemaraEvaluationLog builds an L5 Evaluation Log from the model bundle. requirements and codeRoot are reserved for inferred-verification augmentation. TRLC-LINKS: REQ-EMG-015, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraEvaluationLogFromFiles

func GenerateGemaraEvaluationLogFromFiles(architecturePath, requirementsPath, codeRoot string, options GemaraExportOptions) (GemaraEvaluationResult, error)

GenerateGemaraEvaluationLogFromFiles loads inputs and renders the Evaluation Log. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type GemaraExportOptions

type GemaraExportOptions struct {
	AuthorID           string // metadata.author.id (default "engmod")
	AuthorName         string // metadata.author.name (default "Engineering Model")
	Version            string // metadata.version (optional)
	Date               string // metadata.date, ISO 8601 (optional; omitted when empty for reproducibility)
	AssessmentPlanHref string // OSCAL Assessment Results import-ap href
}

GemaraExportOptions configures the deterministic metadata stamped into artifacts. ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type GemaraExportResult

type GemaraExportResult struct {
	ControlCatalog    gemara.ControlCatalog
	ThreatCatalog     gemara.ThreatCatalog
	RiskCatalog       gemara.RiskCatalog
	VectorCatalog     gemara.VectorCatalog
	CapabilityCatalog gemara.CapabilityCatalog

	// Extended artifacts (emitted only when the model has supporting data).
	PrincipleCatalog     gemara.PrincipleCatalog
	GuidanceCatalog      gemara.GuidanceCatalog
	Policy               gemara.Policy
	Lexicon              gemara.Lexicon
	ControlThreatMapping gemara.MappingDocument
	AuditLog             gemara.AuditLog
	EnforcementLog       gemara.EnforcementLog
	HasGuidance          bool
	HasPolicy            bool
	HasMapping           bool
	HasAudit             bool
	HasEnforcement       bool

	// YAML maps an artifact short-name (e.g. "control-catalog") to its serialized document.
	YAML map[string]string
}

GemaraExportResult holds the typed Gemara documents and their YAML serializations. ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemara

func GenerateGemara(bundle model.Bundle, options GemaraExportOptions) (GemaraExportResult, error)

GenerateGemara renders the engineering model bundle into Gemara L1-L3 documents. TRLC-LINKS: REQ-EMG-015, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateGemaraFromFile

func GenerateGemaraFromFile(architecturePath string, options GemaraExportOptions) (GemaraExportResult, error)

GenerateGemaraFromFile loads the model bundle and renders the Gemara catalogs. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type ImportedEntityProvenance added in v0.2.0

type ImportedEntityProvenance struct {
	QualifiedID string `yaml:"qualifiedId"`
	Alias       string `yaml:"alias"`
	ModulePath  string `yaml:"path"`
	Version     string `yaml:"version"`
	SourceModel string `yaml:"sourceModelId"`
	Publication string `yaml:"publicationId"`
	Domain      string `yaml:"domain"`
	SourceID    string `yaml:"sourceId"`
	ResolvedDir string `yaml:"resolvedDirectory"`
}

ImportedEntityProvenance records where each visible imported identifier came from without leaking composition metadata into generic target properties. TRLC-LINKS: REQ-EMG-047, REQ-EMG-049, REQ-EMG-051

type LobsterActivityExportOptions

type LobsterActivityExportOptions struct {
	RequirementsPackage string
	ActivityNamespace   string
}

ENGMODEL-LINKS: FU-LOBSTER-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FU-TRLC-EXPORTER

type LobsterActivityExportResult

type LobsterActivityExportResult struct {
	JSON string
}

ENGMODEL-LINKS: FU-LOBSTER-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateLobsterActivityTraceFromDir

func GenerateLobsterActivityTraceFromDir(testsDir string, options LobsterActivityExportOptions) (LobsterActivityExportResult, error)

TRLC-LINKS: REQ-EMG-006, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-LOBSTER-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-TRLC-EXPORTER, FU-CODEMAP-INFERENCE, DEP-LOCAL-WORKSPACE

type MaterializedAllocation

type MaterializedAllocation struct {
	System            string // owning (parent) system id
	Requirement       string
	Subsystem         string
	Target            string // public id within the subsystem
	TargetRef         string // the subsystem requirement that realizes the target (its contract ref)
	Resolved          bool   // target is published in the subsystem contract
	TargetRefResolved bool   // TargetRef names a requirement that exists in the subsystem
	Note              string
}

MaterializedAllocation is a parent->subsystem allocation with its composed-view resolution status. ENGMODEL-LINKS: FU-ALLOCATION-TRACE, CTRL-TRACEABILITY-COVERAGE

type NAFExportResult added in v0.2.0

type NAFExportResult struct {
	Document    string
	Diagnostics []validate.Diagnostic
}

NAFExportResult is a deterministic NAF v4.1 architecture document and its diagnostics.

func GenerateNAFV41 added in v0.2.0

func GenerateNAFV41(bundle model.Bundle) (NAFExportResult, error)

GenerateNAFV41 validates and projects existing Engmod views into NAF products. TRLC-LINKS: REQ-EMG-041, REQ-EMG-042, REQ-EMG-043

func GenerateNAFV41FromFile added in v0.2.0

func GenerateNAFV41FromFile(architecturePath string) (NAFExportResult, error)

GenerateNAFV41FromFile loads canonical YAML and generates the selected NAF products. TRLC-LINKS: REQ-EMG-041, REQ-EMG-042, REQ-EMG-043 ENGMODEL-LINKS: FU-NAF-EXPORTER, IF-CLI-ENGNAF, DO-NAF-V4-ARCHITECTURE, REF-NAF-V4-1-SPECIFICATION

type OSCALAPDocument added in v0.2.0

type OSCALAPDocument struct {
	AssessmentPlan oscalAssessmentPlan `json:"assessment-plan"`
}

type OSCALAPOptions added in v0.2.0

type OSCALAPOptions struct {
	SSPHref      string
	ProfileHref  string
	CatalogHref  string
	LastModified string
}

type OSCALAPResult added in v0.2.0

type OSCALAPResult struct {
	JSON        string
	Document    OSCALAPDocument
	Diagnostics []validate.Diagnostic
}

func GenerateOSCALAssessmentPlan added in v0.2.0

func GenerateOSCALAssessmentPlan(bundle model.Bundle, options OSCALAPOptions) (OSCALAPResult, error)

TRLC-LINKS: REQ-EMG-012, REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FU-VALIDATION-ENGINE

func GenerateOSCALAssessmentPlanFromFile added in v0.2.0

func GenerateOSCALAssessmentPlanFromFile(architecturePath string, options OSCALAPOptions) (OSCALAPResult, error)

TRLC-LINKS: REQ-EMG-012, REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type OSCALARDocument

type OSCALARDocument struct {
	AssessmentResults oscalAssessmentResults `json:"assessment-results"`
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALAROptions

type OSCALAROptions struct {
	AssessmentPlanHref string
	RequirementsPath   string
	CodeRoot           string
	ProfileHref        string
	CatalogHref        string
	LastModified       string
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALARResult

type OSCALARResult struct {
	JSON        string
	Document    OSCALARDocument
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALAssessmentResults

func GenerateOSCALAssessmentResults(bundle model.Bundle, requirements model.RequirementsDocument, options OSCALAROptions) (OSCALARResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-THREAT-EXPORTER, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALAssessmentResultsFromFile

func GenerateOSCALAssessmentResultsFromFile(architecturePath string, options OSCALAROptions) (OSCALARResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type OSCALPOAMDocument

type OSCALPOAMDocument struct {
	PlanOfActionAndMilestones oscalPOAMRoot `json:"plan-of-action-and-milestones"`
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALPOAMOptions

type OSCALPOAMOptions struct {
	SSPHref      string
	LastModified string
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALPOAMResult

type OSCALPOAMResult struct {
	JSON        string
	Document    OSCALPOAMDocument
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALPOAM

func GenerateOSCALPOAM(bundle model.Bundle, options OSCALPOAMOptions) (OSCALPOAMResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-THREAT-EXPORTER, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALPOAMFromFile

func GenerateOSCALPOAMFromFile(architecturePath string, options OSCALPOAMOptions) (OSCALPOAMResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type OSCALProfileOptions added in v0.2.0

type OSCALProfileOptions struct {
	Title        string
	Version      string
	LastModified string
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALSSPDocument

type OSCALSSPDocument struct {
	SystemSecurityPlan oscalSystemSecurityPlan `json:"system-security-plan"`
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALSSPOptions

type OSCALSSPOptions struct {
	ProfileHref       string
	ImportProfileHref string
	CatalogHref       string
	SystemName        string
	SystemDescription string
	LastModified      string
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type OSCALSSPResult

type OSCALSSPResult struct {
	JSON        string
	Document    OSCALSSPDocument
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALSSP

func GenerateOSCALSSP(bundle model.Bundle, options OSCALSSPOptions) (OSCALSSPResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-VALIDATION-ENGINE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateOSCALSSPFromFile

func GenerateOSCALSSPFromFile(architecturePath string, options OSCALSSPOptions) (OSCALSSPResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-013 ENGMODEL-LINKS: FU-OSCAL-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type PublishedProjection added in v0.2.0

type PublishedProjection struct {
	Alias       string
	Publication string
	ModulePath  string
	Version     string
	SourceModel string
	Entities    []PublishedProjectionEntity
}

PublishedProjection groups the entities selected from one dependency publication. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

type PublishedProjectionEntity added in v0.2.0

type PublishedProjectionEntity struct {
	QualifiedID string
	SourceID    string
	Domain      string
	Facet       string
	Value       any
	Source      *model.Bundle
	Provenance  ImportedEntityProvenance
}

PublishedProjectionEntity is one explicitly published dependency entity, retaining its typed value, qualified identity, source bundle, and provenance. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

type RequirementsDelta

type RequirementsDelta struct {
	Version      int                         `yaml:"version"`
	Requirements RequirementsDeltaOperations `yaml:"requirements"`
}

RequirementsDelta describes stable-ID operations against requirements.yml. Updates replace the complete requirement entity. ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

type RequirementsDeltaOperations

type RequirementsDeltaOperations struct {
	Add    []model.Requirement `yaml:"add"`
	Update []model.Requirement `yaml:"update"`
	Remove []string            `yaml:"remove"`
}

RequirementsDeltaOperations groups supported requirement mutations. ENGMODEL-LINKS: FU-MODEL-CHANGE, DO-REQUIREMENTS-DELTA

type RequirementsDeltaResult

type RequirementsDeltaResult struct {
	Candidate   model.RequirementsDocument
	YAML        []byte
	Diff        string
	Added       []string
	Updated     []string
	Removed     []string
	Diagnostics []validate.Diagnostic
}

RequirementsDeltaResult is the validated candidate and deterministic change summary. ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

func ApplyRequirementsDelta

func ApplyRequirementsDelta(root, deltaPath string) (result RequirementsDeltaResult, err error)

ApplyRequirementsDelta validates and atomically writes a requirements delta. TRLC-LINKS: REQ-EMG-031, REQ-EMG-032, REQ-EMG-033 ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-MODEL-LOADER, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT, DEP-LOCAL-WORKSPACE

func PlanRequirementsDelta

func PlanRequirementsDelta(root, deltaPath string) (RequirementsDeltaResult, error)

PlanRequirementsDelta loads a delta, applies it in memory, and validates the complete candidate. It never modifies requirements.yml. TRLC-LINKS: REQ-EMG-031, REQ-EMG-032 ENGMODEL-LINKS: FU-MODEL-CHANGE, FU-MODEL-LOADER, FU-VALIDATION-ENGINE, DO-REQUIREMENTS-DELTA, DO-REQUIREMENTS-DOCUMENT

type Result

type Result struct {
	Bundle      model.Bundle
	View        view.ProjectedView
	Mermaid     string
	SVG         string
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-CLI-ORCHESTRATION, FU-VIEW-PROJECTION, FU-ASCIIDOC-GENERATOR, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func Generate

func Generate(bundle model.Bundle, viewID string) (Result, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-003, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-CLI-ORCHESTRATION, FU-VIEW-PROJECTION, FU-ASCIIDOC-GENERATOR, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateFromFile

func GenerateFromFile(architecturePath, viewID string) (Result, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-003 ENGMODEL-LINKS: FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-CLI-ORCHESTRATION, FU-VIEW-PROJECTION

type StructurizrExportResult

type StructurizrExportResult struct {
	DSL         string
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-STRUCTURIZR-EXPORTER, DO-STRUCTURIZR-DSL, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateStructurizrDSL

func GenerateStructurizrDSL(bundle model.Bundle) (StructurizrExportResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-005, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-STRUCTURIZR-EXPORTER, DO-STRUCTURIZR-DSL, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, DEP-LOCAL-WORKSPACE, DEP-CI-PIPELINE, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateStructurizrDSLFromFile

func GenerateStructurizrDSLFromFile(architecturePath string) (StructurizrExportResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-005 ENGMODEL-LINKS: FU-STRUCTURIZR-EXPORTER, DO-STRUCTURIZR-DSL, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type SysMLCoverageAuthority added in v0.2.0

type SysMLCoverageAuthority struct {
	Baseline             string                       `json:"baseline"`
	MetamodelAuthority   string                       `json:"metamodelAuthority"`
	FormalRelease        sysmlmetamodel.FormalRelease `json:"formalRelease"`
	SourceManifestSHA256 string                       `json:"sourceManifestSha256"`
	InventorySHA256      string                       `json:"inventorySha256"`
	Sources              []sysmlmetamodel.Source      `json:"sources"`
}

type SysMLCoverageCheckEvidence added in v0.2.0

type SysMLCoverageCheckEvidence struct {
	ID       string   `json:"id"`
	Status   string   `json:"status"`
	Evidence []string `json:"evidence"`
}

type SysMLCoverageManifest added in v0.2.0

type SysMLCoverageManifest struct {
	SchemaVersion string                       `json:"schemaVersion"`
	Claim         string                       `json:"claim"`
	Limitations   []string                     `json:"limitations"`
	Authority     SysMLCoverageAuthority       `json:"authority"`
	Totals        SysMLCoverageTotals          `json:"totals"`
	Metaclasses   []SysMLMetaclassCoverage     `json:"metaclasses"`
	Properties    []SysMLPropertyCoverage      `json:"properties"`
	Relationships []SysMLRelationshipCoverage  `json:"relationships"`
	Extensions    []SysMLExtensionCoverage     `json:"engineeringExtensions"`
	Checks        []SysMLCoverageCheckEvidence `json:"checks"`
}

func SysMLV2Coverage added in v0.2.0

func SysMLV2Coverage() SysMLCoverageManifest

SysMLV2Coverage returns metaclass/property-level evidence generated from the pinned official inventory and strict binding.

TRLC-LINKS: REQ-EMG-039, REQ-EMG-040

type SysMLCoverageTotals added in v0.2.0

type SysMLCoverageTotals struct {
	Metaclasses             int `json:"metaclasses"`
	OwnedProperties         int `json:"ownedProperties"`
	EffectiveProperties     int `json:"effectiveProperties"`
	InheritanceEdges        int `json:"inheritanceEdges"`
	DerivedProperties       int `json:"derivedProperties"`
	Relationships           int `json:"relationships"`
	CoverageMapped          int `json:"coverageMapped"`
	CoverageDerived         int `json:"coverageDerived"`
	CoverageUnimplemented   int `json:"coverageUnimplemented"`
	NativeRendered          int `json:"nativeRendered"`
	AbstractOrImplicit      int `json:"abstractOrImplicit"`
	MissingRenderer         int `json:"missingRenderer"`
	ClassifiedRelationships int `json:"classifiedRelationships"`
}

type SysMLExportResult added in v0.2.0

type SysMLExportResult struct {
	Text        string                     `json:"text"`
	Diagnostics []model.SemanticDiagnostic `json:"diagnostics"`
}

SysMLExportResult is a deterministic textual projection plus explicit projection and conformance diagnostics.

func ExportSysMLV2Project added in v0.2.0

func ExportSysMLV2Project(architecturePath, projectDir, kparPath, sysandPath string) (SysMLExportResult, error)

ExportSysMLV2Project creates a Sysand interchange project and builds its KPAR. Sysand, rather than a custom ZIP writer, owns all normative KPAR packaging.

TRLC-LINKS: REQ-EMG-036, REQ-EMG-037 ENGMODEL-LINKS: FU-SYSML-EXPORTER, IF-CLI-ENGSYSML, DO-SYSML-V2-MODEL, REF-SYSML-V2-TOOLCHAIN

func GenerateSysMLV2 added in v0.2.0

func GenerateSysMLV2(bundle model.Bundle) (SysMLExportResult, error)

GenerateSysMLV2 validates and projects a Bundle before rendering.

TRLC-LINKS: REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-SYSML-EXPORTER, DO-CANONICAL-SEMANTIC-MODEL, DO-SYSML-V2-MODEL

func GenerateSysMLV2FromFile added in v0.2.0

func GenerateSysMLV2FromFile(architecturePath string) (SysMLExportResult, error)

GenerateSysMLV2FromFile loads the canonical YAML input and generates a SysML v2 textual projection.

TRLC-LINKS: REQ-EMG-035, REQ-EMG-036, REQ-EMG-037, REQ-EMG-047, REQ-EMG-050 ENGMODEL-LINKS: FU-SYSML-EXPORTER, IF-CLI-ENGSYSML, DO-CANONICAL-SEMANTIC-MODEL, DO-SYSML-V2-MODEL, REF-SYSML-V2-TOOLCHAIN

type SysMLExtensionCoverage added in v0.2.0

type SysMLExtensionCoverage struct {
	ID        string   `json:"id"`
	Namespace string   `json:"namespace"`
	Status    string   `json:"status"`
	Evidence  []string `json:"evidence"`
}

type SysMLMetaclassCoverage added in v0.2.0

type SysMLMetaclassCoverage struct {
	ID                     string   `json:"id"`
	Origin                 string   `json:"origin"`
	Abstract               bool     `json:"abstract"`
	Relationship           bool     `json:"relationship"`
	Status                 string   `json:"status"`
	RendererClassification string   `json:"rendererClassification"`
	Syntax                 string   `json:"syntax,omitempty"`
	Evidence               []string `json:"evidence"`
}

type SysMLPropertyCoverage added in v0.2.0

type SysMLPropertyCoverage struct {
	ID        string   `json:"id"`
	Metaclass string   `json:"metaclass"`
	Status    string   `json:"status"`
	Evidence  []string `json:"evidence"`
}

type SysMLRelationshipCoverage added in v0.2.0

type SysMLRelationshipCoverage struct {
	ID             string   `json:"id"`
	Status         string   `json:"status"`
	Classification string   `json:"classification"`
	Evidence       []string `json:"evidence"`
}

type SysMLRendererCoverage added in v0.2.0

type SysMLRendererCoverage struct {
	OfficialMetaclasses int                     `json:"officialMetaclasses"`
	NativeRules         int                     `json:"nativeRules"`
	NonInstantiable     int                     `json:"nonInstantiable"`
	MissingRules        int                     `json:"missingRules"`
	Relationships       int                     `json:"relationships"`
	Entries             []SysMLRendererEvidence `json:"entries"`
}

type SysMLRendererEvidence added in v0.2.0

type SysMLRendererEvidence struct {
	Metaclass   string `json:"metaclass"`
	Status      string `json:"status"`
	Syntax      string `json:"syntax,omitempty"`
	Explanation string `json:"explanation,omitempty"`
}

type SysMLRoundTripResult added in v0.2.0

type SysMLRoundTripResult struct {
	ProjectDir  string
	KPARPath    string
	ReopenedDir string
	SourcePath  string
	SourceText  string
}

SysMLRoundTripResult captures the normative KPAR path and reopened native SysML source used for source-integrity comparison.

func ReopenSysMLV2Project added in v0.2.0

func ReopenSysMLV2Project(kparPath, reopenedDir, sysandPath string) (SysMLRoundTripResult, error)

ReopenSysMLV2Project clones a KPAR with Sysand and returns its native SysML project source.

TRLC-LINKS: REQ-EMG-036, REQ-EMG-037

func VerifySysMLV2RoundTrip added in v0.2.0

func VerifySysMLV2RoundTrip(architecturePath, kparPath, reopenedDir, sysandPath string) (SysMLRoundTripResult, error)

VerifySysMLV2RoundTrip compares the reopened KPAR source to a fresh native SysML projection of the authored Engineering Model.

TRLC-LINKS: REQ-EMG-036, REQ-EMG-037

type TRLCExportOptions

type TRLCExportOptions struct {
	PackageName string
}

ENGMODEL-LINKS: FU-TRLC-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type TRLCExportResult

type TRLCExportResult struct {
	PackageName      string
	ModelRSL         string
	RequirementsTRLC string
}

ENGMODEL-LINKS: FU-TRLC-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func GenerateTRLCRequirements

func GenerateTRLCRequirements(requirements model.RequirementsDocument, options TRLCExportOptions) (TRLCExportResult, error)

TRLC-LINKS: REQ-EMG-006, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-TRLC-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

func GenerateTRLCRequirementsFromFile

func GenerateTRLCRequirementsFromFile(requirementsPath string, options TRLCExportOptions) (TRLCExportResult, error)

TRLC-LINKS: REQ-EMG-006 ENGMODEL-LINKS: FU-TRLC-EXPORTER, CTRL-TRACEABILITY-COVERAGE, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type ThreatModelExportOptions

type ThreatModelExportOptions struct {
	Format ThreatModelFormat
}

ENGMODEL-LINKS: FU-THREAT-EXPORTER, DO-THREAT-DRAGON-JSON

type ThreatModelExportResult

type ThreatModelExportResult struct {
	JSON        string
	Diagnostics []validate.Diagnostic
}

ENGMODEL-LINKS: FU-THREAT-EXPORTER, DO-THREAT-DRAGON-JSON, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateThreatModelExport

func GenerateThreatModelExport(bundle model.Bundle, options ThreatModelExportOptions) (ThreatModelExportResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-004, REQ-EMG-011, REQ-EMG-035, REQ-EMG-036 ENGMODEL-LINKS: FU-THREAT-EXPORTER, DO-THREAT-DRAGON-JSON, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS, FU-VALIDATION-ENGINE, CTRL-TRACEABILITY-COVERAGE, STATE-MODEL-INVALID, EVT-VALIDATION-FAILED

func GenerateThreatModelExportFromFile

func GenerateThreatModelExportFromFile(architecturePath string, options ThreatModelExportOptions) (ThreatModelExportResult, error)

TRLC-LINKS: REQ-EMG-001, REQ-EMG-004, REQ-EMG-011 ENGMODEL-LINKS: FU-THREAT-EXPORTER, DO-THREAT-DRAGON-JSON, FLOW-MODEL-CHANGE-TO-VERIFIED-ARTIFACTS

type ThreatModelFormat

type ThreatModelFormat string

ENGMODEL-LINKS: FU-THREAT-EXPORTER, DO-THREAT-DRAGON-JSON

const (
	ThreatModelFormatThreatDragonV2 ThreatModelFormat = "threat-dragon-v2"
	ThreatModelFormatOpenOTM        ThreatModelFormat = "open-otm"
)

type TraceCodeRef

type TraceCodeRef struct {
	Symbol string `json:"symbol"`
	Path   string `json:"path"`
	Line   int    `json:"line,omitempty"`
}

TraceCodeRef is a code symbol that implements a requirement. ENGMODEL-LINKS: FU-CODEMAP-INFERENCE

type TraceDelegation

type TraceDelegation struct {
	Subsystem         string `json:"subsystem"`
	Target            string `json:"target"`
	TargetRequirement string `json:"targetRequirement,omitempty"`
}

TraceDelegation is the downward allocation of a requirement onto a subsystem. ENGMODEL-LINKS: FU-ALLOCATION-TRACE

type TraceMatrix

type TraceMatrix struct {
	Model         string         `json:"model"`
	Requirements  []TraceRow     `json:"requirements"`
	DanglingLinks []DanglingLink `json:"danglingLinks"`
	Orphans       []string       `json:"orphanRequirements"`
	Summary       TraceSummary   `json:"summary"`
}

TraceMatrix is the consolidated, machine-readable traceability matrix for one model. ENGMODEL-LINKS: FU-ALLOCATION-TRACE, CTRL-TRACEABILITY-COVERAGE

func BuildTraceMatrixFromFiles

func BuildTraceMatrixFromFiles(modelPath, requirementsPath, codeRoot string) (TraceMatrix, []validate.Diagnostic, error)

BuildTraceMatrixFromFiles loads a model, scans its code root, scopes the code to the model, validates trace integrity, and returns the matrix together with diagnostics. TRLC-LINKS: REQ-EMG-028, REQ-EMG-030, REQ-EMG-050, REQ-EMG-051 ENGMODEL-LINKS: FU-ALLOCATION-TRACE, FU-MODEL-LOADER, FU-CODEMAP-INFERENCE

func (TraceMatrix) CSV

func (m TraceMatrix) CSV() []byte

CSV renders the matrix as one row per requirement for spreadsheet/diff consumption. TRLC-LINKS: REQ-EMG-030 ENGMODEL-LINKS: FU-ALLOCATION-TRACE

type TraceProvenance added in v0.2.0

type TraceProvenance struct {
	Alias       string `json:"alias"`
	ModulePath  string `json:"modulePath"`
	Version     string `json:"version"`
	SourceModel string `json:"sourceModel"`
	Publication string `json:"publication"`
	SourceID    string `json:"sourceId"`
}

TraceProvenance identifies the selected dependency publication that supplied an imported requirement. TRLC-LINKS: REQ-EMG-050, REQ-EMG-051

type TraceRow

type TraceRow struct {
	ID            string           `json:"id"`
	Text          string           `json:"text,omitempty"`
	Units         []string         `json:"units,omitempty"`
	Code          []TraceCodeRef   `json:"code,omitempty"`
	Verifications []string         `json:"verifications,omitempty"`
	DelegatedTo   *TraceDelegation `json:"delegatedTo,omitempty"`
	Provenance    *TraceProvenance `json:"provenance,omitempty"`
	Status        string           `json:"status"`
}

TraceRow is one requirement and everything that traces to it. ENGMODEL-LINKS: FU-ALLOCATION-TRACE, CTRL-TRACEABILITY-COVERAGE

type TraceSummary

type TraceSummary struct {
	Requirements  int `json:"requirements"`
	Implemented   int `json:"implemented"`
	Verified      int `json:"verified"`
	Delegated     int `json:"delegated"`
	Orphan        int `json:"orphan"`
	DanglingLinks int `json:"danglingLinks"`
}

TraceSummary is the headline coverage roll-up. ENGMODEL-LINKS: FU-ALLOCATION-TRACE

Directories

Path Synopsis
cmd
engair command
ENGMODEL-OWNER-UNIT: FU-AIRBORNE-ASSURANCE-EXPORTER
ENGMODEL-OWNER-UNIT: FU-AIRBORNE-ASSURANCE-EXPORTER
engchange command
ENGMODEL-OWNER-UNIT: FU-MODEL-CHANGE
ENGMODEL-OWNER-UNIT: FU-MODEL-CHANGE
engdoc command
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
engdragon command
ENGMODEL-OWNER-UNIT: FU-THREAT-EXPORTER
ENGMODEL-OWNER-UNIT: FU-THREAT-EXPORTER
enggemara command
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION Command enggemara renders the engineering model into OpenSSF Gemara documents (L1 Vector/Principle/Guidance, L2 Capability/Threat/Control, L3 Risk/Policy, L5 Evaluation Log, L6 Enforcement Log, L7 Audit Log) using the official go-gemara SDK types, with an optional OSCAL catalog and assessment-results bridge.
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION Command enggemara renders the engineering model into OpenSSF Gemara documents (L1 Vector/Principle/Guidance, L2 Capability/Threat/Control, L3 Risk/Policy, L5 Evaluation Log, L6 Enforcement Log, L7 Audit Log) using the official go-gemara SDK types, with an optional OSCAL catalog and assessment-results bridge.
englobster command
ENGMODEL-OWNER-UNIT: FU-LOBSTER-EXPORTER
ENGMODEL-OWNER-UNIT: FU-LOBSTER-EXPORTER
engmcp command
ENGMODEL-OWNER-UNIT: FU-MCP-SERVER
ENGMODEL-OWNER-UNIT: FU-MCP-SERVER
engnaf command
ENGMODEL-OWNER-UNIT: FU-NAF-EXPORTER
ENGMODEL-OWNER-UNIT: FU-NAF-EXPORTER
engoscal command
ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER
ENGMODEL-OWNER-UNIT: FU-OSCAL-EXPORTER
engstruct command
ENGMODEL-OWNER-UNIT: FU-STRUCTURIZR-EXPORTER
ENGMODEL-OWNER-UNIT: FU-STRUCTURIZR-EXPORTER
engsysml command
ENGMODEL-OWNER-UNIT: FU-SYSML-EXPORTER
ENGMODEL-OWNER-UNIT: FU-SYSML-EXPORTER
engtrace command
ENGMODEL-OWNER-UNIT: FU-ALLOCATION-TRACE
ENGMODEL-OWNER-UNIT: FU-ALLOCATION-TRACE
engtrlc command
ENGMODEL-OWNER-UNIT: FU-TRLC-EXPORTER
ENGMODEL-OWNER-UNIT: FU-TRLC-EXPORTER
engview command
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
sysmlmetamodel command
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
ENGMODEL-OWNER-UNIT: FU-CLI-ORCHESTRATION
ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE
ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE
examples
bedrock-pr-review-github-app-sample/src
ENGMODEL-OWNER-UNIT: FU-LAMBDA-RUNTIME-OPERATIONS ENGMODEL-CODE-DESCRIPTION: wires Lambda runtime entrypoints and shared execution dependencies
ENGMODEL-OWNER-UNIT: FU-LAMBDA-RUNTIME-OPERATIONS ENGMODEL-CODE-DESCRIPTION: wires Lambda runtime entrypoints and shared execution dependencies
coffee-fleet-ota-cloud-sample/src
ENGMODEL-OWNER-UNIT: FU-CLOUD-RUNTIME-OPERATIONS ENGMODEL-CODE-DESCRIPTION: wires cloud runtime handlers and integration entrypoints
ENGMODEL-OWNER-UNIT: FU-CLOUD-RUNTIME-OPERATIONS ENGMODEL-CODE-DESCRIPTION: wires cloud runtime handlers and integration entrypoints
payments-engineering-sample/src
ENGMODEL-OWNER-UNIT: FU-CHECKOUT ENGMODEL-CODE-DESCRIPTION: accepts checkout requests and forwards payment authorization flow input
ENGMODEL-OWNER-UNIT: FU-CHECKOUT ENGMODEL-CODE-DESCRIPTION: accepts checkout requests and forwards payment authorization flow input
internal
sysmlmetamodel
ENGMODEL-OWNER-UNIT: FU-MODEL-LOADER
ENGMODEL-OWNER-UNIT: FU-MODEL-LOADER
ENGMODEL-OWNER-UNIT: FU-MCP-SERVER
ENGMODEL-OWNER-UNIT: FU-MCP-SERVER
ENGMODEL-OWNER-UNIT: FU-MODEL-LOADER
ENGMODEL-OWNER-UNIT: FU-MODEL-LOADER
render
diagramstyle
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
mermaid
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
svg
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
ENGMODEL-OWNER-UNIT: FU-VALIDATION-ENGINE
ENGMODEL-OWNER-UNIT: FU-VALIDATION-ENGINE
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION
ENGMODEL-OWNER-UNIT: FU-VIEW-PROJECTION

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL