Elements

graph TD; %% REQVIRE-AUTOGENERATED-DIAGRAM %% Graph styling classDef userRequirement fill:#D1C4E9,stroke:#7E57C2,stroke-width:2px; classDef systemRequirement fill:#E1D8EE,stroke:#673AB7,stroke-width:1.5px; classDef verification fill:#DCEDC8,stroke:#4CAF50,stroke-width:2px; classDef folder fill:#FAFAFA,stroke:#9E9E9E,stroke-width:3px; classDef file fill:#FFF8E1,stroke:#FFCA28,stroke-width:2px; classDef default fill:#F5F5F5,stroke:#424242,stroke-width:1.5px; subgraph 8735c0a811307e57["πŸ“ requirements/Functional/Core"] subgraph d1a073c5dbdc4a00["πŸ“„ Behaviors.md"] 6789e7e9e093c884["Two-Pass Validation Behavior"]; class 6789e7e9e093c884 default; click 6789e7e9e093c884 "Behaviors.html#two-pass-validation-behavior"; 5f843b087a10d61b["Type Validation Error Behavior"]; class 5f843b087a10d61b default; click 5f843b087a10d61b "Behaviors.html#type-validation-error-behavior"; fc1df5aa988472a["Validation Error Reporting Behavior"]; class fc1df5aa988472a default; click fc1df5aa988472a "Behaviors.html#validation-error-reporting-behavior"; end subgraph 793b6191caf1a62f["πŸ“„ Constraints.md"] c2c71cb34cb7b7c9["Cross-Section Duplicate Constraint"]; class c2c71cb34cb7b7c9 default; click c2c71cb34cb7b7c9 "Constraints.html#cross-section-duplicate-constraint"; end subgraph 98067cc5207d6b91["πŸ“„ Validation.md"] fcfc76ba4d193d75["Attachment Target Validation
πŸ“Ž ReservedSubsections.md"]; class fcfc76ba4d193d75 systemRequirement; click fcfc76ba4d193d75 "Validation.html#attachment-target-validation"; df9b3eb5275616dd["Cross-Component Dependency Validator"]; class df9b3eb5275616dd systemRequirement; click df9b3eb5275616dd "Validation.html#cross-component-dependency-validator"; 14c74cc4fb33d735["Cross-Section Duplicate Validation"]; class 14c74cc4fb33d735 systemRequirement; click 14c74cc4fb33d735 "Validation.html#cross-section-duplicate-validation"; a869d98120d611e3["Enhanced Validation Error Reporting"]; class a869d98120d611e3 userRequirement; click a869d98120d611e3 "Validation.html#enhanced-validation-error-reporting"; 327e10e1bebd5bde["Excluded File Relation Validation"]; class 327e10e1bebd5bde systemRequirement; click 327e10e1bebd5bde "Validation.html#excluded-file-relation-validation"; f1ee9af5e71df06a["GraphRegistry as Primary Registry
πŸ“Ž requirements/Functional/Core/Specifications.md#requirements-processing-specification"]; class f1ee9af5e71df06a systemRequirement; click f1ee9af5e71df06a "Validation.html#graphregistry-as-primary-registry"; b207bb8eb7f88839["Integrated Validation
πŸ“Ž requirements/Functional/Core/Behaviors.md#two-pass-validation-behavior"]; class b207bb8eb7f88839 systemRequirement; click b207bb8eb7f88839 "Validation.html#integrated-validation"; fed54223697ea04e["Internal Consistency Validator"]; class fed54223697ea04e systemRequirement; click fed54223697ea04e "Validation.html#internal-consistency-validator"; 4e665d02fddc5598["Markdown Structure Validator"]; class 4e665d02fddc5598 systemRequirement; click 4e665d02fddc5598 "Validation.html#markdown-structure-validator"; 9f1021634cff7f57["Relation Element Type Validator"]; class 9f1021634cff7f57 systemRequirement; click 9f1021634cff7f57 "Validation.html#relation-element-type-validator"; dcb530333efa6cc3["Relation Type Validation"]; class dcb530333efa6cc3 systemRequirement; click dcb530333efa6cc3 "Validation.html#relation-type-validation"; 32ca10d548006362["Two-Pass Validation Strategy"]; class 32ca10d548006362 systemRequirement; click 32ca10d548006362 "Validation.html#two-pass-validation-strategy"; dcd747ef36b02f8c["Type Validation Error Requirement"]; class dcd747ef36b02f8c systemRequirement; click dcd747ef36b02f8c "Validation.html#type-validation-error-requirement"; 6226bc768d0185df["Validate Cross-Component Dependencies"]; class 6226bc768d0185df userRequirement; click 6226bc768d0185df "Validation.html#validate-cross-component-dependencies"; 15086e20fb6e1f44["Validate Filesystem Structure"]; class 15086e20fb6e1f44 userRequirement; click 15086e20fb6e1f44 "Validation.html#validate-filesystem-structure"; ff8ff08f0c0500f0["Validate Internal Consistency"]; class ff8ff08f0c0500f0 userRequirement; click ff8ff08f0c0500f0 "Validation.html#validate-internal-consistency"; 76fbd08929220b2f["Validate Markdown Structure"]; class 76fbd08929220b2f userRequirement; click 76fbd08929220b2f "Validation.html#validate-markdown-structure"; 4a77e514d9e5539b["Validate Relation Types
πŸ“Ž requirements/Refinements.md#relation-semantics-specification"]; class 4a77e514d9e5539b userRequirement; click 4a77e514d9e5539b "Validation.html#validate-relation-types"; e5ee40ed53dd3c3["Validation Error Handling
πŸ“Ž requirements/Functional/Output/Specifications.md#error-message-format-specification"]; class e5ee40ed53dd3c3 systemRequirement; click e5ee40ed53dd3c3 "Validation.html#validation-error-handling"; end end subgraph 6c93988fc728d1f8["πŸ“ requirements/Functional/Core/Verifications"] subgraph 622a654342e7abad["πŸ“„ AttachmentsVerifications.md"] 18307065fb353848["Attachments Subsection Parsing Verification"]; class 18307065fb353848 verification; click 18307065fb353848 "Verifications/AttachmentsVerifications.html#attachments-subsection-parsing-verification"; ff62a0266193ee63["Attachments Validation Verification"]; class ff62a0266193ee63 verification; click ff62a0266193ee63 "Verifications/AttachmentsVerifications.html#attachments-validation-verification"; end subgraph 46a9d0ceb9db210e["πŸ“„ ValidationVerifications.md"] f0aeb8d3ad027b6e["Cross-Section Duplicate Validation Test"]; class f0aeb8d3ad027b6e verification; click f0aeb8d3ad027b6e "Verifications/ValidationVerifications.html#cross-section-duplicate-validation-test"; 4bbdeefb4231596e["Element Type Relation Compatibility Test"]; class 4bbdeefb4231596e verification; click 4bbdeefb4231596e "Verifications/ValidationVerifications.html#element-type-relation-compatibility-test"; 83d989f6ea529f74["Invalid Header Structure Test"]; class 83d989f6ea529f74 verification; click 83d989f6ea529f74 "Verifications/ValidationVerifications.html#invalid-header-structure-test"; ad323c8d4c0751e["Invalid Relations Test"]; class ad323c8d4c0751e verification; click ad323c8d4c0751e "Verifications/ValidationVerifications.html#invalid-relations-test"; cd31aec9ae0c3ed3["Requirements Files Search and Detection Test"]; class cd31aec9ae0c3ed3 verification; click cd31aec9ae0c3ed3 "Verifications/ValidationVerifications.html#requirements-files-search-and-detection-test"; 5352180257d54fb2["Same-File Fragment Relations Test"]; class 5352180257d54fb2 verification; click 5352180257d54fb2 "Verifications/ValidationVerifications.html#same-file-fragment-relations-test"; 776101677ee97029["Type Validation Errors Test
πŸ“Ž requirements/Functional/Core/Behaviors.md#type-validation-error-behavior"]; class 776101677ee97029 verification; click 776101677ee97029 "Verifications/ValidationVerifications.html#type-validation-errors-test"; 2d8c79b0a3233f70["Unstructured Documents Test"]; class 2d8c79b0a3233f70 verification; click 2d8c79b0a3233f70 "Verifications/ValidationVerifications.html#unstructured-documents-test"; end end subgraph 75874bcc96c01d2f["πŸ“ requirements/Functional/Operations/Verifications"] subgraph 264302f069db5bdb["πŸ“„ ElementManipulationVerifications.md"] f7d422af274a64cf["Add Command Error Messages Test"]; class f7d422af274a64cf verification; click f7d422af274a64cf "../Operations/Verifications/ElementManipulationVerifications.html#add-command-error-messages-test"; end end 499d48218b73f571["model.rs"]; class 499d48218b73f571 default; click 499d48218b73f571 "../../../core/src/model.rs"; fcfc76ba4d193d75 -->|satisfiedBy| 499d48218b73f571; 35bd98d101f36b62["parser.rs"]; class 35bd98d101f36b62 default; click 35bd98d101f36b62 "../../../core/src/parser.rs"; fcfc76ba4d193d75 -->|satisfiedBy| 35bd98d101f36b62; fcfc76ba4d193d75 -.->|verifiedBy| 18307065fb353848; fcfc76ba4d193d75 -.->|verifiedBy| ff62a0266193ee63; df9b3eb5275616dd -->|satisfiedBy| 499d48218b73f571; df9b3eb5275616dd -->|satisfiedBy| 35bd98d101f36b62; df9b3eb5275616dd -.->|verifiedBy| ad323c8d4c0751e; 14c74cc4fb33d735 -->|satisfiedBy| 499d48218b73f571; 14c74cc4fb33d735 -->|satisfiedBy| c2c71cb34cb7b7c9; 14c74cc4fb33d735 -.->|verifiedBy| f0aeb8d3ad027b6e; a869d98120d611e3 -.->|deriveReqT| dcb530333efa6cc3; a869d98120d611e3 -.->|deriveReqT| dcd747ef36b02f8c; a869d98120d611e3 -.->|deriveReqT| e5ee40ed53dd3c3; 637652e86464c11b["error.rs"]; class 637652e86464c11b default; click 637652e86464c11b "../../../core/src/error.rs"; a869d98120d611e3 -->|satisfiedBy| 637652e86464c11b; a869d98120d611e3 -->|satisfiedBy| fc1df5aa988472a; a869d98120d611e3 -.->|verifiedBy| f7d422af274a64cf; 327e10e1bebd5bde -->|satisfiedBy| 35bd98d101f36b62; 327e10e1bebd5bde -.->|verifiedBy| 2d8c79b0a3233f70; 95cf526671ec752c["graph_registry.rs"]; class 95cf526671ec752c default; click 95cf526671ec752c "../../../core/src/graph_registry.rs"; f1ee9af5e71df06a -->|satisfiedBy| 95cf526671ec752c; f1ee9af5e71df06a -->|satisfiedBy| 499d48218b73f571; f1ee9af5e71df06a -.->|verifiedBy| cd31aec9ae0c3ed3; 25bf5cc42f41e395["cli.rs"]; class 25bf5cc42f41e395 default; click 25bf5cc42f41e395 "../../../cli/src/cli.rs"; b207bb8eb7f88839 -->|satisfiedBy| 25bf5cc42f41e395; fed54223697ea04e -.->|deriveReqT| 14c74cc4fb33d735; fed54223697ea04e -->|satisfiedBy| 499d48218b73f571; fed54223697ea04e -->|satisfiedBy| 35bd98d101f36b62; fed54223697ea04e -.->|verifiedBy| ad323c8d4c0751e; 4e665d02fddc5598 -->|satisfiedBy| 499d48218b73f571; 4e665d02fddc5598 -->|satisfiedBy| 35bd98d101f36b62; 4e665d02fddc5598 -.->|verifiedBy| 83d989f6ea529f74; 4e665d02fddc5598 -.->|verifiedBy| ad323c8d4c0751e; 4e665d02fddc5598 -.->|verifiedBy| f7d422af274a64cf; 9f1021634cff7f57 -->|satisfiedBy| 95cf526671ec752c; 9f1021634cff7f57 -->|satisfiedBy| 499d48218b73f571; 9f1021634cff7f57 -->|satisfiedBy| 35bd98d101f36b62; 9f1021634cff7f57 -.->|verifiedBy| 4bbdeefb4231596e; 9f1021634cff7f57 -.->|verifiedBy| ad323c8d4c0751e; 1cfe88f8d3cc7aac["relation.rs"]; class 1cfe88f8d3cc7aac default; click 1cfe88f8d3cc7aac "../../../core/src/relation.rs"; dcb530333efa6cc3 -->|satisfiedBy| 1cfe88f8d3cc7aac; dcb530333efa6cc3 -.->|verifiedBy| ad323c8d4c0751e; dcb530333efa6cc3 -.->|verifiedBy| 5352180257d54fb2; 32ca10d548006362 -->|satisfiedBy| 499d48218b73f571; 32ca10d548006362 -->|satisfiedBy| 6789e7e9e093c884; e068cb8b03a77b4d["element.rs"]; class e068cb8b03a77b4d default; click e068cb8b03a77b4d "../../../core/src/element.rs"; dcd747ef36b02f8c -->|satisfiedBy| e068cb8b03a77b4d; dcd747ef36b02f8c -->|satisfiedBy| 1cfe88f8d3cc7aac; dcd747ef36b02f8c -->|satisfiedBy| 5f843b087a10d61b; dcd747ef36b02f8c -.->|verifiedBy| 776101677ee97029; 6226bc768d0185df -.->|deriveReqT| df9b3eb5275616dd; ff8ff08f0c0500f0 -.->|deriveReqT| fcfc76ba4d193d75; ff8ff08f0c0500f0 -.->|deriveReqT| f1ee9af5e71df06a; ff8ff08f0c0500f0 -.->|deriveReqT| b207bb8eb7f88839; ff8ff08f0c0500f0 -.->|deriveReqT| fed54223697ea04e; ff8ff08f0c0500f0 -.->|deriveReqT| 32ca10d548006362; 76fbd08929220b2f -.->|deriveReqT| 4e665d02fddc5598; 4a77e514d9e5539b -.->|deriveReqT| 9f1021634cff7f57; e5ee40ed53dd3c3 -->|satisfiedBy| 637652e86464c11b; e5ee40ed53dd3c3 -->|satisfiedBy| 499d48218b73f571; e5ee40ed53dd3c3 -.->|verifiedBy| ad323c8d4c0751e; d882e7ff8e1ffe95["test.sh"]; class d882e7ff8e1ffe95 default; click d882e7ff8e1ffe95 "../../../tests/test-assets/test.sh"; 18307065fb353848 -->|satisfiedBy| d882e7ff8e1ffe95; ff62a0266193ee63 -->|satisfiedBy| d882e7ff8e1ffe95; 5150ae05d0a88a84["test.sh"]; class 5150ae05d0a88a84 default; click 5150ae05d0a88a84 "../../../tests/test-invalid-relations/test.sh"; ad323c8d4c0751e -->|satisfiedBy| 5150ae05d0a88a84; 4179509ffe0be04b["test.sh"]; class 4179509ffe0be04b default; click 4179509ffe0be04b "../../../tests/test-duplicate-detection/test.sh"; f0aeb8d3ad027b6e -->|satisfiedBy| 4179509ffe0be04b; fe0a74a2cd2af425["test.sh"]; class fe0a74a2cd2af425 default; click fe0a74a2cd2af425 "../../../tests/test-add-command-error-messages/test.sh"; f7d422af274a64cf -->|satisfiedBy| fe0a74a2cd2af425; 3ee9a5ae2313e6b0["test.sh"]; class 3ee9a5ae2313e6b0 default; click 3ee9a5ae2313e6b0 "../../../tests/test-valid-relations/test.sh"; 2d8c79b0a3233f70 -->|satisfiedBy| 3ee9a5ae2313e6b0; b3573dfcbb8f5f40["test.sh"]; class b3573dfcbb8f5f40 default; click b3573dfcbb8f5f40 "../../../tests/test-excluded-patterns/test.sh"; cd31aec9ae0c3ed3 -->|satisfiedBy| b3573dfcbb8f5f40; 83d989f6ea529f74 -->|satisfiedBy| 5150ae05d0a88a84; 845fe9ccbc0f0550["test.sh"]; class 845fe9ccbc0f0550 default; click 845fe9ccbc0f0550 "../../../tests/test-element-type-relation-compatibility/test.sh"; 4bbdeefb4231596e -->|satisfiedBy| 845fe9ccbc0f0550; f0923d0189e77f4c["test.sh"]; class f0923d0189e77f4c default; click f0923d0189e77f4c "../../../tests/test-fragment-relations/test.sh"; 5352180257d54fb2 -->|satisfiedBy| f0923d0189e77f4c; ddd4d40b5d6bdcc9["test.sh"]; class ddd4d40b5d6bdcc9 default; click ddd4d40b5d6bdcc9 "../../../tests/test-type-validation-errors/test.sh"; 776101677ee97029 -->|satisfiedBy| ddd4d40b5d6bdcc9;

Enhanced Validation Error Reporting

The system shall include context for resolution in validation errors.

Details

The system shall define validation error reporting behavior.

Metadata

  • type: user-requirement

Relations


Relation Type Validation

The system shall validate relation types against a defined vocabulary and provide clear error messages for unsupported relation types, including suggestions for the correct relation types.

Metadata

  • type: requirement

Relations


Type Validation Error Requirement

The system shall display all valid type options when type validation fails.

Details

  • Invalid element types shall show list of valid element types including custom type pattern
  • Invalid relation types shall show list of valid relation types
  • Element type list format: β€œtype1, type2, … For custom types use: other-TYPENAME”
  • Relation type list format: β€œtype1, type2, …” (alphabetically sorted)

Metadata

  • type: requirement

Relations


Validation Error Handling

The system shall maintain consistent error handling across both validation passes, collecting all errors within each pass before reporting.

Details

Error handling shall follow these principles:

  1. Complete pass execution: Each pass runs to completion, collecting all errors found
  2. Aggregated reporting: All errors from a pass are reported together
  3. Early termination: Process exits after reporting errors from either pass
  4. Existing error format: Error messages maintain the current format and structure
  5. Exit codes: Non-zero exit codes indicate validation failures

This ensures users see all relevant errors at once rather than fixing issues one at a time.

Metadata

  • type: requirement

Attachments

Relations


Excluded File Relation Validation

The system shall properly validate relations targeting files matching excluded filename patterns, enabling references to excluded files while still respecting their exclusion from processing and formatting operations.

Details

The validation process for excluded files:

  1. Files matching excluded patterns are registered in the element registry for relation validation only
  2. Internal elements within excluded files are not processed or validated

Metadata

  • type: requirement

Relations


Validate Cross-Component Dependencies

The system shall validate dependencies across different components of the System model to identify mismatches or gaps.

Metadata

  • type: user-requirement

Relations


Cross-Component Dependency Validator

The system shall implement a specialized validator that analyzes dependencies across different model components, ensuring proper alignment between architectural layers, requirement levels, and verification elements.

Metadata

  • type: requirement

Relations


Validate Filesystem Structure

The system shall validate the organization of files and folders in the repository to ensure consistency with the MBSE methodology.

Metadata

  • type: user-requirement

Relations


Validate Internal Consistency

The system shall check the internal consistency of the system model, ensuring that relationships and elements align correctly.

Metadata

  • type: user-requirement

Relations


Attachment Target Validation

The system shall validate attachment targets and reject invalid attachment references during model validation.

Details

Attachment targets support two types of references:

File Paths:

  • Normalized to git-root-relative paths
  • Validated for file existence during model validation
  • Standard markdown link format where link text equals href

Element Identifiers:

  • Must point to Refinement element types only (constraint, behavior, specification)
  • Normalized like relation targets (resolved to full identifier path)
  • Validation shall reject identifiers pointing to non-Refinement elements
  • Provides clear error message indicating the expected element type

This validation ensures that attachments either reference existing files or valid Refinement elements that provide supplementary documentation.

Metadata

  • type: requirement

Attachments

Relations


GraphRegistry as Primary Registry

The system shall enhance GraphRegistry to serve as the primary structure for relation operations and validation during Pass 2.

Details

The GraphRegistry shall be responsible for:

  1. Graph construction: Building adjacency lists from ElementRegistry
  2. Relation validation: Checking target existence and type compatibility
  3. Opposite generation: Creating missing bidirectional relations
  4. Cycle detection: Identifying circular dependencies
  5. Orphan detection: Finding isolated elements
  6. Impact analysis: Supporting change propagation queries

The GraphRegistry shall be constructed from the ElementRegistry after Pass 1 completes successfully.

Metadata

  • type: requirement

Attachments

Relations


Integrated Validation

The system shall automatically perform validation when any command requires the parsed model, eliminating the need for a separate validate command.

Details

Commands shall be categorized into two groups:

Commands requiring validated model:

  • model-summary: Needs complete element and relation data
  • change-impact: Requires valid relations for impact analysis
  • traces: Needs validated relationships for traceability
  • generate-index: Requires complete element registry
  • coverage-report: Requires complete verification data

Commands operating on raw files:

  • html: Converts markdown to HTML without parsing elements
  • format: Fixes markdown formatting without validation
  • shell: Interactive mode with optional validation

Commands in the first group shall automatically run the two-pass validation and exit if any errors are found. Commands in the second group shall skip validation to allow operation on potentially invalid documents.

Metadata

  • type: requirement

Attachments

Relations


Internal Consistency Validator

The system shall implement a consistency validator that verifies logical coherence within the model, including checking for circular dependencies, orphaned elements, inconsistent relationship patterns, and element name uniqueness, with detailed error reporting.

Details

The consistency validator shall verify:

  • Global Element Name Uniqueness: Element names are globally unique across all files in the model
  • Duplicate Detection: Detect and report when multiple elements in different files share the same name
  • Location Reporting: Report both file locations where duplicate element names occur
  • Clear Error Messages: Error messages clearly indicate that element names must be globally unique
  • Circular Dependencies: Detect and report circular dependency chains in requirements
  • Orphaned Elements: Identify elements without proper traceability connections
  • Inconsistent Patterns: Detect relationship patterns that violate model constraints

Rationale: Element names serve as stable IDs for element identity, independent of file location. Global uniqueness is essential for proper element identification and change tracking across the model.

Metadata

  • type: requirement

Relations


Cross-Section Duplicate Validation

The system shall detect when the same target appears in both the Relations and Attachments subsections of an element, treating this as a validation error.

Details

A constraint defines the detailed rules for cross-section duplicate detection.

This applies to all target types: element identifiers and file paths.

Within-section duplicates (same entry repeated within Relations OR within Attachments) are formatting issues handled by the format operation, not validation errors.

Metadata

  • type: requirement

Relations


Two-Pass Validation Strategy

The system shall execute model validation in two phases: element collection and graph validation.

Details

The system shall define two-pass validation behavior.

Metadata

  • type: requirement

Relations


Validate Markdown Structure

The system shall validate the Markdown structure of system model to ensure compliance with formatting standards.

Metadata

  • type: user-requirement

Relations


Markdown Structure Validator

The system shall implement a markdown structure validator that enforces Reqvire’s requirements for header levels, element structure, relation formatting, and other markdown-specific syntax rules, reporting violations with line numbers and suggested fixes.

Metadata

  • type: requirement

Relations


Validate Relation Types

The system shall validate relation types and allow only supported types.

Metadata

  • type: user-requirement

Attachments

Relations


Relation Element Type Validator

The system shall implement validation that verifies relation endpoints have appropriate element types based on the relation type, following the Element Type Relation Compatibility matrix.

Details

The validator enforces the constraints defined in the Element Type Relation Compatibility specification:

  • For derivedFrom/derive relations, validate that both source and target are requirement types (requirement or user-requirement)
  • For verifiedBy/verify relations, validate that one endpoint is a requirement element and the other is a verification element
  • For satisfiedBy/satisfy relations, validate that one endpoint is a requirement or test-verification element and the other is an implementation element
  • For verification elements with satisfiedBy relations, validate that only test-verification elements may use satisfiedBy (other verification types should not have satisfiedBy relations)
  • trace relations are always allowed for any non-refinement element type
  • Refinement types (constraint, behavior, specification) can only have satisfy relations and cannot have Attachments subsections
  • Warnings should be issued when relation endpoints have incompatible element types

This validation occurs:

  • During model parsing and validation (model.rs, parser.rs)
  • During link operations at CRUD time (graph_registry.rs)

Metadata

  • type: requirement

Relations