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

gemara

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const Version = "1.1.0"

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

Variables

This section is empty.

Functions

func GenerateOSCALAssessmentResults

func GenerateOSCALAssessmentResults(bundle model.Bundle, requirements model.RequirementsDocument, codeRoot string, options Options) (string, error)

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

func GenerateOSCALAssessmentResultsFromFiles(architecturePath, requirementsPath, codeRoot string, options Options) (string, error)

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

func GenerateOSCALCatalog(bundle model.Bundle, options Options) (string, error)

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

func GenerateOSCALCatalogFromFile(architecturePath string, options Options) (string, error)

GenerateOSCALCatalogFromFile 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

Types

type CrossReferenceError

type CrossReferenceError struct {
	Artifact    string `json:"artifact"`
	Path        string `json:"path"`
	ReferenceId string `json:"referenceId"`
	EntryId     string `json:"entryId,omitempty"`
	Message     string `json:"message"`
}

CrossReferenceError reports one reference that does not resolve within the rendered artifact set. ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func CheckCrossReferences

func CheckCrossReferences(docs map[string]string) []CrossReferenceError

CheckCrossReferences parses the artifacts (short-name -> YAML) and returns every EntryMapping, MultiEntryMapping, artifact import and mapping document source/target that does not resolve within the set. Documents that fail to parse are reported as errors too. TRLC-LINKS: REQ-EMG-015 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

func CheckModelConsistency

func CheckModelConsistency(bundle model.Bundle, docs map[string]string) []CrossReferenceError

CheckModelConsistency compares the treatment claims in a rendered artifact set (short-name -> YAML) with the model they were rendered from: an enforcement action's disposition must follow its POA&M item's status (only completed is Enforced, only accepted is Tolerated), the log's aggregate must follow the actions, the policy may list a risk as mitigated only when it is closed and as accepted only when it is accepted. It reports each claim the model does not support with the same error shape as the cross-reference check. TRLC-LINKS: REQ-EMG-015, REQ-EMG-062 ENGMODEL-LINKS: FU-GEMARA-EXPORTER, CTRL-TRACEABILITY-COVERAGE

type EvaluationResult

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

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

func GenerateEvaluationLog

func GenerateEvaluationLog(bundle model.Bundle, requirements model.RequirementsDocument, codeRoot string, options Options) (EvaluationResult, error)

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

func GenerateEvaluationLogFromFiles(architecturePath, requirementsPath, codeRoot string, options Options) (EvaluationResult, error)

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

type Options

type Options struct {
	AuthorID   string // metadata.author.id (default "engmod")
	AuthorName string // metadata.author.name (default "Engineering Model")
	// AuthorType is metadata.author.type. The default author is this generator,
	// so the zero value renders Software; set Human when a person signs.
	AuthorType         gemaraproj.EntityType
	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
}

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

type Result

type Result struct {
	ControlCatalog    gemaraproj.ControlCatalog
	ThreatCatalog     gemaraproj.ThreatCatalog
	RiskCatalog       gemaraproj.RiskCatalog
	VectorCatalog     gemaraproj.VectorCatalog
	CapabilityCatalog gemaraproj.CapabilityCatalog

	// Extended artifacts (emitted only when the model has supporting data).
	PrincipleCatalog     gemaraproj.PrincipleCatalog
	GuidanceCatalog      gemaraproj.GuidanceCatalog
	Policy               gemaraproj.Policy
	Lexicon              gemaraproj.Lexicon
	ControlThreatMapping gemaraproj.MappingDocument
	AuditLog             gemaraproj.AuditLog
	EnforcementLog       gemaraproj.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

	// Diagnostics reports values Gemara requires that the model does not state
	// (rendered as "not set") so they are not mistaken for authored content.
	Diagnostics []validate.Diagnostic
}

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

func Generate

func Generate(bundle model.Bundle, options Options) (Result, error)

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

func GenerateFromFile(architecturePath string, options Options) (Result, error)

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

Jump to

Keyboard shortcuts

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