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

engmodel

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 41 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, TypeScript, Rust)

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

  • strict YAML loading for architecture/catalog/requirements/design documents
  • 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
  • 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
    • Rust

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)
  • GenerateThreatModelExportFromFile(architecturePath, options)
  • GenerateTRLCRequirementsFromFile(requirementsPath, options)
  • GenerateLobsterActivityTraceFromDir(testsDir, options)
  • BuildTraceMatrixFromFiles(architecturePath, requirementsPath, options)

Example:

res, err := engmodel.GenerateFromFile("examples/payments-engineering-sample/architecture.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 architecture.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

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)

Top-level (sibling to authoredArchitecture) composition entities:

  • 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 (authoredArchitecture.flows[].steps[]) support:

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

OSCAL authoring fields in authoredArchitecture:

  • controls
  • risks
  • poamItems

OSCAL catalog/profile integration is authored in top-level compliance:

  • 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

Optional per-view publication metadata (in architecture.yml):

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

Verification metadata is inferred from test artifacts (not authored in architecture.yml):

  • 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 requirements.yml only when no blocking diagnostics are present.

Generate a single Mermaid view:

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

Generate architecture AsciiDoc:

go run ./cmd/engdoc \
  --model examples/payments-engineering-sample/architecture.yml \
  --requirements examples/payments-engineering-sample/requirements.yml \
  --design examples/payments-engineering-sample/design.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 decisions.yml) as a separate DECISIONS.adoc document.

Generate the machine-readable traceability matrix:

go run ./cmd/engtrace \
  --model examples/payments-engineering-sample/architecture.yml \
  --requirements examples/payments-engineering-sample/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/architecture.yml --format threat-dragon-v2 --out examples/payments-engineering-sample/generated/threat-dragon-v2.json
go run ./cmd/engdragon --model examples/payments-engineering-sample/architecture.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/architecture.yml --out examples/payments-engineering-sample/generated/STRUCTURIZR.dsl

Generate TRLC requirements package:

go run ./cmd/engtrlc --requirements examples/payments-engineering-sample/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

Render 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 design.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 can compose downward over child systems via a top-level composition block. Each entry under composition.subsystems references a child model either from a local subdirectory or from an external git repository:

composition:
  subsystems:
    - id: SUB-TELEMETRY
      name: Machine Telemetry Subsystem
      ref: ./subsystems/telemetry        # local subdirectory model
    - id: SUB-CLOUD-API
      name: Cloud API Subsystem
      git: https://example.com/org/cloud-api.git   # external repo
      rev: main                           # optional branch/tag/commit
      path: model                         # optional subdir inside the repo
  allocations:
    - requirement: REQ-COF-001            # this system's requirement
      to: SUB-TELEMETRY                   # target subsystem (or hardware item) id
      target: CAP-TELEM-REPORT            # provided contract id inside the subsystem
      rationale: Reporting is realized by the telemetry subsystem.
  satisfactions:
    - need: SUB-OTA-AGENT/NEED-TELEMETRY-FEED   # a subsystem's required interface
      by: SUB-TELEMETRY/CAP-TELEM-REPORT        # the provider that satisfies it

External git: subsystems are cloned into a local .engmod/subsystems/<id> cache before resolution. Composition is validated against the workspace boundary and the cross-system provides/requires contracts, surfacing diagnostics such as composition.cycle, composition.out_of_workspace, composition.missing_ref, composition.invalid_ref, composition.clone_failed, composition.unsatisfied_require, and composition.untraceable_delegation.

See examples/coffee-fleet-ota-cloud-sample for an end-to-end composed model.

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/architecture.yml --ssp-out examples/payments-engineering-sample/generated/ARCHITECTURE.ssp.json

Full chain:

go run ./cmd/engoscal \
  --model examples/payments-engineering-sample/architecture.yml \
  --requirements examples/payments-engineering-sample/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/architecture.yml \
  --requirements examples/payments-engineering-sample/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 <architecture.yml> --requirements <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:

  • catalog.yml
  • architecture.yml
  • requirements.yml
  • design.yml
  • decisions.yml (architecture decision records; auto-discovered next to architecture.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-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-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-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-CODEMAP-INFERENCE

ENGMODEL-OWNER-UNIT: FU-LOBSTER-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-THREAT-EXPORTER

ENGMODEL-OWNER-UNIT: FU-ALLOCATION-TRACE

ENGMODEL-OWNER-UNIT: FU-TRLC-EXPORTER

Index

Constants

View Source
const GemaraVersion = "1.1.0"

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

Variables

This section is empty.

Functions

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 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 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 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

Types

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

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 // id of this system within its parent (empty for the root)
	Dir          string // resolved directory of this system's model
	Bundle       model.Bundle
	Requirements model.RequirementsDocument // this system's own requirements (for delegation target resolution)
	Children     []*ComposedSystem
}

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

type CompositionResult

type CompositionResult struct {
	Root        *ComposedSystem
	Allocations []MaterializedAllocation
	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(architecturePath string) (CompositionResult, error)

GenerateCompositionFromFile resolves the system-of-systems rooted at architecturePath. TRLC-LINKS: REQ-EMG-016 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 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)
}

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 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 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 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 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
}

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 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
}

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 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 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
	CatalogHref       string
	SystemName        string
	SystemDescription 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 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 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
	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 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 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 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 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 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 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 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"`
	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
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
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
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
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
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
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