Skip to content

Name the highest spec_version Borea implements, and expose the comparison #40

Description

@Maximilian-Nesslauer

ModMetadata and ModVersionMetadata validate spec_version only at the bottom: both throw below 1 and accept anything above.
The storage mappers additionally reject 0 as the pre-model shape.
Nothing compares the value to a ceiling, so a document stamped spec_version = 7 constructs cleanly and flows through search, storage and CompositeModRepository as if fully understood.

RFC 0031: "Metadata a client cannot interpret, including a spec_version newer than it implements, renders as an entry in an unknown state; it is never silently dropped."

  • One constant in Borea.Core naming the highest spec version Borea implements, which is 1.
  • A non-throwing way for a caller to ask whether a document is above it. Follow MetadataEnumMapper, where every parse falls through to an Unknown member rather than throwing. Do not follow ModMetadataMapper.FromDto, which throws for the missing-spec-version case and is the opposite of what is wanted here.
  • Replace the two hardcoded specVersion: 1 literals in SpaceDockModRepository with the constant.
  • Tests for below, equal and above. The existing tests only ever pass 1 and never assert the below-1 throw, so that is new coverage too.

Related: #31 adds spec_version to ModPackMetadata, which carries none today. Whichever lands second consumes the same constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions