ModelRule

interface ModelRule

A model rule dispatched by viewpoint and container type, or over ModelIndex by ModelInventoryRule.

A physical source file is not a logical container. Results retain their subject, ownership, and kind; only SarifKind.FAIL establishes a violation. evaluation identifies who decides the obligation, independently of its outcome.

Identity is the class name. id is derived from it, with a lowercase initial and the Rule suffix removed. Override name with a concise statement of what is wrong with the reviewed object; display wording does not change the stable identifier.

Inheritors

Properties

Link copied to clipboard

Canonical problem category used by JSON, SARIF, HTML, and aggregate reports.

Link copied to clipboard

The container type this rule applies to (e.g. Design::class, Requirements::class). The check task uses this to dispatch rules only to matching containers, avoiding unnecessary calls. Defaults to MetamodelEntity (matches all).

Link copied to clipboard

Default SARIF kind for this rule. Most rules produce SarifKind.FAIL results.

Link copied to clipboard

Default SARIF level for this rule — derived from defaultSeverity via ProblemSeverity.sarifLevel.

Link copied to clipboard

Default severity for a violation of this rule's contract.

Link copied to clipboard
abstract val description: String

Normative condition, including applicability, exceptions, and required evidence.

Link copied to clipboard

Kotlin decides executable obligations; humans or AI decide semantic obligations.

Link copied to clipboard

The reviewed object retains a finding because the faulty child contributor cannot be identified. Ordinary missing content in a known local container does not have this property.

Link copied to clipboard
open val id: String

Short identifier — derived from the class's simple name by default (e.g. FailurePropagationUsedInConsistencyRule → "failurePropagationUsedInConsistency"). Equivalent to a referenceName for the rule itself; rename the class to rename the ID.

Link copied to clipboard
open val name: String

Human-readable name — derived from the class's simple name by default (e.g. FailurePropagationUsedInConsistencyRule → "Failure propagation used in consistency").

Link copied to clipboard

All severities emitted by check, including informational comparisons and pending reviews.

Link copied to clipboard

One short correction paragraph. Detailed, finding-specific guidance belongs to ModelProblem.remediation.

Link copied to clipboard

When true, the runner invokes check once per viewpoint instead of once per container in that viewpoint. Use this for rules that iterate the global MetamodelEntity registry (e.g. NameDefinedInXxxPackageRule, ElementParentDefinedRule) — they produce identical problems regardless of which container is passed, so repeating the work containerCount times wastes CPU and forces task-layer dedup to clean up afterward.

Link copied to clipboard
abstract val viewpoint: Viewpoint

The viewpoint this rule applies to.

Functions

Link copied to clipboard
abstract fun check(container: MetamodelEntity): List<ModelProblem>

Checks the dispatch container and returns typed results. Empty output means no records; it does not establish that every applicable subject was assessed or that a rule ran.

Generated with STIG