Skip to content

memo_artifacts_standards_traceability

SysML API

Public namespace memo::artifacts::standards
Declared package memo_artifacts_standards_traceability
Source src/artifacts/standards/memo_artifacts_standards_traceability.sysml

Namespace hierarchy

memomemo::artifactsmemo::artifacts::standards

Packages

Package
memo_artifacts_standards_traceability

Imports

Visibility Target
private Metaobjects::SemanticMetadata
private ScalarValues::*
private memo_core_common::*
private memo_core_enumerations::*
private memo_core_relationships::*
private memo_artifacts_core::*

Declarations

Name SysML kind Description Specializes
RegulatoryStandard item def Standards and clauses MemoArtifactItem
StandardClause item def Standard clause definition specializing MemoArtifactItem. MemoArtifactItem
ConformsTo connection def Relationships MemoRelationship
TracesToDocument connection def Typed relationship for traces to document. MemoRelationship

RegulatoryStandard

item def RegulatoryStandard :> MemoArtifactItem
Property Value
Description Standards and clauses
Kind item def
Abstract No
Specializes MemoArtifactItem
Owning package memo_artifacts_standards_traceability

StandardClause

item def StandardClause :> MemoArtifactItem
Property Value
Description Standard clause definition specializing MemoArtifactItem.
Kind item def
Abstract No
Specializes MemoArtifactItem
Owning package memo_artifacts_standards_traceability

ConformsTo

connection def ConformsTo :> MemoRelationship
Property Value
Description Relationships
Kind connection def
Abstract No
Specializes MemoRelationship
Owning package memo_artifacts_standards_traceability

TracesToDocument

connection def TracesToDocument :> MemoRelationship
Property Value
Description Typed relationship for traces to document.
Kind connection def
Abstract No
Specializes MemoRelationship
Owning package memo_artifacts_standards_traceability

Source

artifacts/standards/memo_artifacts_standards_traceability.sysml
// Clause-level traceability: the project-facing half of the regulatory axis.
//
// MEMO carries standards in two mechanisms, and this file is one of them:
//
//   @StandardReference metadata (core/semantics)  — provenance INSIDE the MEMO
//     library: "this ontology type exists because ISO 14971 §5.4 says so".
//     Library-internal, not project data.
//   ConformsTo (here)                             — PROJECT traceability:
//     "this requirement in this project satisfies IEC 62304 §5.2.2".
//     Queryable, reportable, auditable.
//
// Do not add a third. A standard is data in the ontology, not a code path:
// adding ISO 13485 must be one new file of RegulatoryStandard/StandardClause
// instances and zero TypeScript changes.
//
// Nothing here is abstract. An abstract def cannot be instantiated, so a
// traceability matrix over abstract clause types is empty by construction —
// which is the failure mode this whole area exists to prevent.
//
// ─── The clause library and how a document cites it ──────────────────────
//
// The concrete instances live one file per standard beside this one
// (iec_62304.sysml, iec_60601_1.sysml, …). A DHF template cites them from its
// frontmatter, in one of two shapes:
//
//   clauses: ["5.4"]                              relative — the clause number
//                                                 belongs to this document's
//                                                 own `standard:`
//   clauses: ["ISO 14971:2019 §7"]                qualified — the designation
//                                                 before the section sign, the
//                                                 clause number after it
//
// An entry containing "§" is qualified and nothing else is: that is the whole
// grammar. The designation must match a RegulatoryStandard's `designation`
// exactly, amendments included, and the clause number must match a
// StandardClause's `clauseNumber` exactly. Both are checked by
// standards-library.test.ts in memo-tools, which is what makes "adding a
// standard is one file" true rather than aspirational.
package memo_artifacts_standards_traceability {
    private import Metaobjects::SemanticMetadata;
    private import ScalarValues::*;
    private import memo_core_common::*;
    private import memo_core_enumerations::*;
    private import memo_core_relationships::*;
    private import memo_artifacts_core::*;

    // =========================================================================
    // Standards and clauses
    // =========================================================================

    item def RegulatoryStandard :> MemoArtifactItem {
        doc /* A regulatory or consensus standard a project claims conformance
             * to, identified by its full designation including edition and
             * amendments (e.g. "IEC 62366-1:2015+AMD1:2020"). Dropping the
             * amendment is a CE/MDR regression, so it is carried explicitly
             * rather than folded into the designation by convention. */
        attribute designation : String;
        attribute edition : String[0..1];
        attribute issuer : String[0..1];
        attribute amendments : String[0..*];
        // Which submission regimes this standard has standing in. Empty is a
        // MEANINGFUL value, not an unset one: it says no regime mandates this
        // standard, which is true of the method and reference standards MEMO
        // carries (IEC 60812's FMEA method, ISO/IEC/IEEE 42010's architecture
        // description). A regime-free standard never contributes to
        // `required(project)` — its clauses are claimable but not required.
        //
        // Because empty means something, it cannot also mean "the pack author
        // forgot". `memo standards check` prints regime-free standards in their
        // own section rather than dropping them, and standards-library.test.ts
        // names the exact set — the same way Phase 2 named the four document
        // types that derive no standards. A forgotten regime is a red test.
        attribute appliesToRegime : RegulatoryRegimeKind[0..*];
    }

    item def StandardClause :> MemoArtifactItem {
        doc /* One normative clause of a RegulatoryStandard, at the depth at
             * which the standard makes a distinct requirement a MEMO document
             * actually claims. `title` is a MEMO-authored scope phrase — a
             * representative synonym for what the clause governs ("§17" →
             * "electromagnetic compatibility") — never the standard's own
             * normative wording, which is copyrighted. The scope phrase is a
             * label: queries traverse ConformsTo to the clause instance, they
             * never match on its text.
             *
             * Clause containment uses the existing Composes relation
             * (standard as parent, clause as child; clause as parent,
             * sub-clause as child). There is no clause-specific composition
             * type, because whole/part decomposition is already one relation
             * in MEMO. */
        attribute clauseNumber : String;
        attribute title : String[0..1];
        attribute normativeStrength : String[0..1];
    }

    // =========================================================================
    // Relationships
    // =========================================================================

    connection def ConformsTo :> MemoRelationship {
        doc /* Any model element claims conformance to a standard clause.
             * This is the edge the standards traceability matrix and the
             * clause coverage report are computed over. */
        end conformingElement : MemoPart :>> source;
        end clause : StandardClause :>> target;
    }
    abstract connection conformsToLinks : ConformsTo[*];
    metadata def <conformsTo> ConformsToMetadata :> SemanticMetadata {
        :> annotatedElement : SysML::ConnectionDefinition;
        :> annotatedElement : SysML::ConnectionUsage;
        :>> baseType = conformsToLinks meta SysML::Usage;
    }

    connection def TracesToDocument :> MemoRelationship {
        doc /* Where the evidence for a clause claim is written down. The target
             * is the existing controlled-artifact type — MEMO does not model a
             * separate Document/DocumentSection family, because
             * ControlledArtifact / ModelOwnedArtifact / MarkdownDocumentSource
             * already carry version, owner and approval status. Section
             * granularity rides on the link as a reference string rather than
             * as a duplicate element type. */
        attribute sectionReference : String[0..1];
        end tracedElement : MemoPart :>> source;
        end artifact : ControlledArtifact :>> target;
    }
    abstract connection tracesToDocumentLinks : TracesToDocument[*];
    metadata def <tracesToDocument> TracesToDocumentMetadata :> SemanticMetadata {
        :> annotatedElement : SysML::ConnectionDefinition;
        :> annotatedElement : SysML::ConnectionUsage;
        :>> baseType = tracesToDocumentLinks meta SysML::Usage;
    }
}