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 6c93988fc728d1f8["šŸ“ requirements/Functional/Core/Verifications"] subgraph 46a9d0ceb9db210e["šŸ“„ ValidationVerifications.md"] f0aeb8d3ad027b6e["Cross-Section Duplicate Validation Test"]; class f0aeb8d3ad027b6e verification; click f0aeb8d3ad027b6e "ValidationVerifications.html#cross-section-duplicate-validation-test"; 40f8f3dcc6a4e8bd["Default Element Type Assignment Test"]; class 40f8f3dcc6a4e8bd verification; click 40f8f3dcc6a4e8bd "ValidationVerifications.html#default-element-type-assignment-test"; 4bbdeefb4231596e["Element Type Relation Compatibility Test"]; class 4bbdeefb4231596e verification; click 4bbdeefb4231596e "ValidationVerifications.html#element-type-relation-compatibility-test"; f8b4586a036406cd["File Exclusion Test"]; class f8b4586a036406cd verification; click f8b4586a036406cd "ValidationVerifications.html#file-exclusion-test"; 83d989f6ea529f74["Invalid Header Structure Test"]; class 83d989f6ea529f74 verification; click 83d989f6ea529f74 "ValidationVerifications.html#invalid-header-structure-test"; ad323c8d4c0751e["Invalid Relations Test"]; class ad323c8d4c0751e verification; click ad323c8d4c0751e "ValidationVerifications.html#invalid-relations-test"; cd31aec9ae0c3ed3["Requirements Files Search and Detection Test"]; class cd31aec9ae0c3ed3 verification; click cd31aec9ae0c3ed3 "ValidationVerifications.html#requirements-files-search-and-detection-test"; 5352180257d54fb2["Same-File Fragment Relations Test"]; class 5352180257d54fb2 verification; click 5352180257d54fb2 "ValidationVerifications.html#same-file-fragment-relations-test"; c40e17e0f8f2b5ec["Subdirectory Processing Verification"]; class c40e17e0f8f2b5ec verification; click c40e17e0f8f2b5ec "ValidationVerifications.html#subdirectory-processing-verification"; 776101677ee97029["Type Validation Errors Test
šŸ“Ž requirements/Functional/Core/Behaviors.md#type-validation-error-behavior"]; class 776101677ee97029 verification; click 776101677ee97029 "ValidationVerifications.html#type-validation-errors-test"; 2d8c79b0a3233f70["Unstructured Documents Test"]; class 2d8c79b0a3233f70 verification; click 2d8c79b0a3233f70 "ValidationVerifications.html#unstructured-documents-test"; end end 4179509ffe0be04b["test.sh"]; class 4179509ffe0be04b default; click 4179509ffe0be04b "../../../../tests/test-duplicate-detection/test.sh"; f0aeb8d3ad027b6e -->|satisfiedBy| 4179509ffe0be04b; f63a7acfc08bf665["test.sh"]; class f63a7acfc08bf665 default; click f63a7acfc08bf665 "../../../../tests/test-default-type-assignment/test.sh"; 40f8f3dcc6a4e8bd -->|satisfiedBy| f63a7acfc08bf665; 845fe9ccbc0f0550["test.sh"]; class 845fe9ccbc0f0550 default; click 845fe9ccbc0f0550 "../../../../tests/test-element-type-relation-compatibility/test.sh"; 4bbdeefb4231596e -->|satisfiedBy| 845fe9ccbc0f0550; 94d34e73992ff9ac["test.sh"]; class 94d34e73992ff9ac default; click 94d34e73992ff9ac "../../../../tests/test-gitignore-integration/test.sh"; f8b4586a036406cd -->|satisfiedBy| 94d34e73992ff9ac; 5150ae05d0a88a84["test.sh"]; class 5150ae05d0a88a84 default; click 5150ae05d0a88a84 "../../../../tests/test-invalid-relations/test.sh"; 83d989f6ea529f74 -->|satisfiedBy| 5150ae05d0a88a84; ad323c8d4c0751e -->|satisfiedBy| 5150ae05d0a88a84; b3573dfcbb8f5f40["test.sh"]; class b3573dfcbb8f5f40 default; click b3573dfcbb8f5f40 "../../../../tests/test-excluded-patterns/test.sh"; cd31aec9ae0c3ed3 -->|satisfiedBy| b3573dfcbb8f5f40; f0923d0189e77f4c["test.sh"]; class f0923d0189e77f4c default; click f0923d0189e77f4c "../../../../tests/test-fragment-relations/test.sh"; 5352180257d54fb2 -->|satisfiedBy| f0923d0189e77f4c; 661275cf7a337c0e["test.sh"]; class 661275cf7a337c0e default; click 661275cf7a337c0e "../../../../tests/test-subdirectory-functionality/test.sh"; c40e17e0f8f2b5ec -->|satisfiedBy| 661275cf7a337c0e; ddd4d40b5d6bdcc9["test.sh"]; class ddd4d40b5d6bdcc9 default; click ddd4d40b5d6bdcc9 "../../../../tests/test-type-validation-errors/test.sh"; 776101677ee97029 -->|satisfiedBy| ddd4d40b5d6bdcc9; 3ee9a5ae2313e6b0["test.sh"]; class 3ee9a5ae2313e6b0 default; click 3ee9a5ae2313e6b0 "../../../../tests/test-valid-relations/test.sh"; 2d8c79b0a3233f70 -->|satisfiedBy| 3ee9a5ae2313e6b0;

Cross-Section Duplicate Validation Test

Test verifies that validation detects and reports cross-section duplicates.

Details

Test cases:

  1. Element with same target in both Relations (as satisfiedBy) and Attachments
  2. Run reqvire validate
  3. Verify validation fails with error mentioning ā€œcross-section duplicateā€ or similar
  4. Verify error identifies the element and the duplicate target

Metadata

  • type: test-verification

Relations


Default Element Type Assignment Test

This test verifies that the system assigns the default type ā€˜requirement’ to all elements without explicit type metadata, regardless of their file location within the repository.

Details

Acceptance Criteria

Location-Independent Default Type:

  • System shall assign type ā€˜requirement’ to elements without explicit type metadata
  • Default type assignment shall be location-independent (same behavior for all directories)
  • System shall NOT use file location to determine element type

Explicit Type Metadata Overrides:

  • System shall allow explicit type specification via Metadata subsection
  • System shall respect explicit type metadata when present
  • System shall support all standard element types: requirement, user-requirement, verification, test-verification, analysis-verification, inspection-verification, demonstration-verification, other
Test Criteria
  1. Default type assignment verification:

    • Create test elements in various directories without type metadata
    • Run reqvire summary –json to extract element types
    • Verify all elements without type metadata have type ā€˜requirement’
    • Test elements in root specifications folder
    • Test elements in nested subdirectories
    • Test elements in various file locations
  2. Explicit type metadata verification:

    • Create elements with explicit type metadata (user-requirement, verification, etc.)
    • Run reqvire summary –json
    • Verify elements have the explicitly specified types
    • Verify explicit types override default behavior
  3. Location independence verification:

    • Create identical elements in different directories
    • None have explicit type metadata
    • Run reqvire summary –json
    • Verify all elements have type ā€˜requirement’ regardless of location

Metadata

  • type: test-verification

Relations


Element Type Relation Compatibility Test

This test verifies that the system correctly validates relation types based on element type constraints defined in the Element Type Relation Compatibility matrix.

Details

Acceptance Criteria

derivedFrom/derive Validation:

  • System shall allow derivedFrom relations only between requirement types (requirement, user-requirement)
  • System shall reject derivedFrom relations where source is a verification element
  • System shall reject derivedFrom relations where target is a verification element
  • System shall reject derivedFrom relations where source is other type
  • System shall provide clear error message indicating element type incompatibility

satisfiedBy/satisfy Validation:

  • System shall allow satisfiedBy relations from requirement types to implementation files
  • System shall allow satisfiedBy relations from test-verification to test implementation files
  • System shall reject satisfiedBy relations from analysis-verification, inspection-verification, demonstration-verification elements
  • System shall provide clear error message for non-test-verification elements using satisfiedBy

verifiedBy/verify Validation:

  • System shall allow verifiedBy relations from requirement types to any verification type
  • System shall allow verify relations from any verification type to requirement types
  • System shall reject verifiedBy relations from verification elements
  • System shall reject verify relations to non-requirement elements

Refinement Type Validation:

  • System shall allow satisfy relations on constraint type elements pointing to requirements
  • System shall allow satisfy relations on behavior type elements pointing to requirements
  • System shall allow satisfy relations on specification type elements pointing to requirements
  • System shall reject all other relation types on refinement elements (derivedFrom, verifiedBy, trace, satisfiedBy)
  • System shall provide clear error message indicating refinement types can only have satisfy relations

trace Relation Validation:

  • System shall allow trace relations for any non-refinement element type
  • System shall allow trace relations to any target type
Test Criteria
  1. derivedFrom type constraint tests:

    • Create requirement with derivedFrom to another requirement - PASS
    • Create verification with derivedFrom to requirement - FAIL with type error
    • Create requirement with derivedFrom to verification - FAIL with type error
    • Verify error message includes element types and constraint explanation
  2. satisfiedBy type constraint tests:

    • Create requirement with satisfiedBy to implementation file - PASS
    • Create test-verification with satisfiedBy to test file - PASS
    • Create analysis-verification with satisfiedBy to file - FAIL with type error
    • Verify error message indicates only test-verification can use satisfiedBy
  3. Refinement type relation tests:

    • Create constraint element with satisfy relation to requirement - PASS
    • Create behavior element with satisfy relation to requirement - PASS
    • Create specification element with satisfy relation to requirement - PASS
    • Create constraint element with trace relation - FAIL with error
    • Create behavior element with derivedFrom relation - FAIL with error
    • Create specification element with satisfiedBy relation - FAIL with error
    • Verify error messages indicate refinement types can only have satisfy relations
    • Create constraint element with Attachments subsection - FAIL with error
    • Verify error message indicates refinement types cannot have attachments
  4. trace relation permissiveness tests:

    • Create requirement with trace to verification - PASS
    • Create verification with trace to requirement - PASS
    • Create verification with trace to other verification - PASS
    • Verify trace relations do not trigger type compatibility errors

Metadata

  • type: test-verification

Relations


File Exclusion Test

This test verifies that Reqvire correctly reads and applies exclusion patterns from the repository root .gitignore file, .reqvireignore file, and reserved filenames.

Details

Acceptance Criteria
  • System shall read exclusion patterns from root .gitignore file
  • System shall read exclusion patterns from root .reqvireignore file
  • System shall automatically exclude reserved repository documentation files
  • System shall combine patterns from .gitignore, .reqvireignore, and reserved filenames
  • Files matching patterns from any source shall be excluded from processing
  • System shall use ONLY root .gitignore file, not nested .gitignore files
  • System shall use ONLY root .reqvireignore file, not nested .reqvireignore files
  • System shall correctly process files when .gitignore is absent
  • System shall correctly process files when .reqvireignore is absent
  • Exclusion shall work across all commands (validate, summary, format, traces, etc.)
Test Criteria
  1. Gitignore pattern exclusion:

    • Create test environment with root .gitignore containing patterns (e.g., ā€œ/build/ā€, ā€œtemp-*.mdā€)
    • Create files matching those patterns in specifications folder
    • Run reqvire summary command
    • Verify files matching .gitignore patterns are NOT processed
    • Verify files NOT matching patterns ARE processed
  2. Reqvireignore pattern exclusion:

    • Create test environment with root .reqvireignore containing patterns (e.g., ā€œ/draft-*.mdā€, ā€œexamples/ā€)
    • Create files matching those patterns in specifications folder (files that ARE in Git)
    • Run reqvire summary command
    • Verify files matching .reqvireignore patterns are NOT processed
    • Verify files NOT matching patterns ARE processed
  3. Reserved filenames exclusion:

    • Create reserved documentation files (e.g., README.md, LICENSE.md, CONTRIBUTING.md) with structured markdown content
    • Run reqvire summary command
    • Verify reserved files are NOT processed as structured markdown
    • Verify reserved files can still be referenced in relations
    • Verify files NOT matching reserved patterns ARE processed
  4. Combined exclusion patterns:

    • Add patterns to .gitignore (e.g., ā€œ/build/ā€)
    • Add different patterns to .reqvireignore (e.g., ā€œ**/DRAFT*.mdā€)
    • Create reserved files (e.g., README.md)
    • Create files matching all pattern sets
    • Verify files matching patterns from ANY source are excluded
    • Verify only non-matching files are processed
  5. Missing .gitignore handling:

    • Run reqvire in environment without .gitignore file but with .reqvireignore
    • Verify command succeeds without errors
    • Verify only .reqvireignore exclusions and reserved filenames are applied
  6. Missing .reqvireignore handling:

    • Run reqvire in environment without .reqvireignore file but with .gitignore
    • Verify command succeeds without errors
    • Verify only .gitignore exclusions and reserved filenames are applied
  7. Both files missing handling:

    • Run reqvire in environment without .gitignore or .reqvireignore files
    • Verify command succeeds without errors
    • Verify only reserved filename exclusions are applied
  8. Nested files ignored:

    • Create nested .gitignore in subdirectory with different patterns
    • Create nested .reqvireignore in subdirectory with different patterns
    • Verify patterns from nested files are NOT applied
    • Verify only root file patterns are used

Metadata

  • type: test-verification

Relations


Invalid Header Structure Test

This test verifies that Reqvire correctly detects and reports invalid header structures in elements, specifically level 5+ headers appearing outside of Details subsections.

Details

Acceptance Criteria
  • System SHALL detect level 5+ headers (#####) appearing before reserved subsections (#### Metadata, #### Relations, #### Details)
  • System SHALL allow level 5+ headers only within #### Details subsection
  • System SHALL provide clear error messages indicating the invalid header structure with file and line number
  • Error message SHALL specify that level 5+ headers can only appear inside Details subsection
  • Validation SHALL fail when invalid header structure is detected
Test Criteria
  • Command exits with non-zero error code when invalid header structure is found
  • Error output contains specific error message about invalid header level
  • Error message includes element name, file path, and line number
  • Valid elements with level 5+ headers inside Details subsection pass validation
  • Elements with level 5+ headers before reserved subsections fail validation

Metadata

  • type: test-verification

Relations


Invalid Relations Test

This verification test checks that Reqvire correctly identifies and reports invalid relations using the two-pass validation architecture, separating parsing errors (Pass 1) from relation validation errors (Pass 2). The test also verifies the validate command functionality.

Details

  • Pass 1 test: Command exits with non-zero error code and outputs expected parsing/format validation errors
  • Pass 2 test: Command exits with non-zero error code and outputs expected relation validation errors
  • Error output contains specific error messages for each type of validation error in the appropriate pass
  • Validate command test: Verify the validate command executes validation and reports issues correctly
Acceptance Criteria

Validate Command Requirements:

  • System should provide a validate command that executes model validation
  • Validate command should output ā€œNo validation issues foundā€ when the model is valid
  • Validate command should report all validation errors when the model has issues
  • Validate command should support –json flag for JSON formatted output
  • Validate command should not modify any files during validation
  • Validate command should use the same validation logic as other commands that load the model

Pass 1 Validation Errors (Element Collection and Local Validation):

  • System should detect and report duplicate elements in the same document
  • System should detect and report duplicate element names across different files (global uniqueness violation)
  • System should report both file locations where duplicate element names occur
  • Error message should clearly indicate element names must be globally unique
  • System should detect and report invalid metadata subsection format
  • System should detect and report invalid relation format syntax
  • System should detect and report invalid relation types (typos, etc.)
  • System should detect and report duplicate subsections within elements
  • Pass 1 errors should prevent Pass 2 from executing

Pass 2 Validation Errors (Graph Construction and Relation Validation):

  • System should detect and report relations to non-existent targets
  • System should detect and report requirement elements with satisfiedBy relations pointing to non-existing local files
  • System should detect and report verification elements with satisfiedBy relations pointing to non-existing local files
  • System should detect and report requirement elements with verifiedBy relations pointing to non-existing verification elements
  • System should detect and report requirement elements with satisfiedBy relations pointing to other requirement elements (incompatible types)
  • System should detect and report verification elements with satisfiedBy relations pointing to other verification elements (incompatible types)
  • System should detect and report non-test-verification elements with satisfiedBy relations (only test-verification may use satisfiedBy, trace is always allowed)
  • System should detect and report if system requirement is missing parent relation
  • System should detect and report if there is circular dependency in requirements
  • Pass 2 validation should only execute when Pass 1 completes without errors

General Requirements:

  • System should allow requirement elements with satisfiedBy relations pointing to existing implementation files
  • System should allow test-verification elements with satisfiedBy relations pointing to existing test scripts
  • System should report clear error messages with details about the invalid format
  • Two separate test scenarios should validate Pass 1 and Pass 2 errors independently

Metadata

  • type: test-verification

Relations


Requirements Files Search and Detection Test

This test verifies that the system correctly searches for and detects structured document files according to specified patterns.

Details

Acceptance Criteria
  • System shall find all structured document files in project structure
  • System shall respect excluded file patterns defined in .gitignore and .reqvireignore files
  • System shall handle nested directory structures correctly
  • System shall correctly identify and categorize different file types
Test Criteria
  • All expected requirements files are identified
  • Files matching exclusion patterns are skipped
  • Nested directories are correctly traversed
  • Non-markdown files are handled appropriately

Metadata

  • type: test-verification

Relations


Same-File Fragment Relations Test

This test verifies that Reqvire correctly handles and validates relations to fragments within the same file.

Details

Acceptance Criteria
  • System should correctly validate relations to fragments within the same file
  • System should not report errors for valid fragment references
  • System should handle both fragment-only references like ā€œ#fragment-idā€ and proper element IDs
Test Criteria
  • Command exits with success (zero) return code
  • No error output about missing relation targets when using #fragment references
  • Successful validation message is displayed

Metadata

  • type: test-verification

Relations


Subdirectory Processing Verification

This test verifies that the system correctly processes only files within the current directory when run from a subfolder of a git repository and generates missing relation target errors for references to parent directories.

Details

Acceptance Criteria
  • System shall process only files within the current directory when run from a subfolder
  • System shall handle identifier normalization correctly within subdirectory context
  • System shall generate missing relation target errors for references to elements or files outside the current subdirectory scope
  • System shall work with model, export, format, traces, and CRUD commands (validation is automatic)
  • System shall ignore files outside the current directory scope
  • System shall provide meaningful missing relation target error messages for parent directory references
  • CRUD commands (add, rm, mv, mv-file) shall resolve paths relative to current working directory
Test Criteria
  • Commands run from subdirectory process only files within that subdirectory
  • Files outside the current directory are not included in processing or output
  • Identifier normalization works correctly for paths within subdirectory
  • References to parent directories generate missing relation target errors with clear error messages
  • Missing relation target errors specifically identify the unreachable parent directory reference
  • All major commands (model, export, format, traces) work from subdirectories with automatic validation
  • CRUD commands (add, rm, mv, mv-file) resolve file paths relative to current working directory
  • CRUD mv command successfully moves elements within subdirectory scope
  • CRUD mv-file command successfully moves entire files within subdirectory scope
  • Commands exit with validation error code when parent directory references cannot be resolved
  • Error messages clearly explain the missing relation target due to parent directory reference

Metadata

  • type: test-verification

Relations


Type Validation Errors Test

Test verifies that type validation errors include helpful type lists.

Details

  1. Test invalid element type in –filter-type:

    • Use invalid type like ā€œinvalid-typeā€
    • Verify error includes list of valid element types
    • Verify error includes ā€œother-TYPENAMEā€ pattern hint
  2. Test invalid relation type in metadata:

    • Create element with invalid relation type like ā€œinvalidRelationā€
    • Verify error includes list of valid relation types
  3. Test custom type pattern acceptance:

    • Verify ā€œother-interfaceā€ is accepted as valid type
    • Verify ā€œother-ā€ alone is rejected
    • Verify ā€œotherā€ alone is accepted

Metadata

  • type: test-verification

Attachments

Relations


Unstructured Documents Test

This test verifies that the system correctly validates relations to excluded files.

Details

Acceptance Criteria
  • System shall allow referencing unstructured documents (text files, code files)
  • System shall not attempt to parse unstructured documents as requirements
  • System shall validate that referenced unstructured documents exist
  • System shall not report validation errors for valid references to unstructured documents
Test Criteria
  • Relations referencing unstructured documents are treated as valid
  • No attempt is made to extract elements from unstructured documents
  • Validation succeeds when referenced unstructured documents exist
  • Validation fails when referenced unstructured documents don’t exist

Metadata

  • type: test-verification

Relations