Skip to main content

Module version_hints

Module version_hints 

Source
Expand description

Version hint resolution with strict precedence chain

This module implements the version hint precedence system defined in Issue #130. It provides authoritative version detection with explicit source tracking for diagnostic purposes.

§Precedence Chain

  1. User flag (–cassandra-version) - highest priority
  2. SSTable metadata (from individual SSTable files)
  3. Dataset metadata.yml (from test data configuration)
  4. Unknown - fallback when no sources provide version information

§No Heuristics Mandate (Issue #28)

This module follows the no-heuristics mandate strictly:

  • Version information is only extracted from authoritative metadata sources
  • No guessing or inference based on file formats or structures
  • Missing version information results in “Unknown” status, not a guess

§Usage

use cqlite_core::version_hints::{VersionHintResolver, VersionSource};
use std::path::Path;
use std::sync::Arc;
use cqlite_core::{Config, Platform};

let config = Config::default();
let platform = Arc::new(Platform::new(&config).await.unwrap());

// Resolve version with user override
let resolved = VersionHintResolver::resolve(
    Some("5.0".to_string()),
    Path::new("/path/to/sstable"),
    platform.clone(),
).await.unwrap();

assert_eq!(resolved.source, VersionSource::UserFlag);
assert_eq!(resolved.version, Some("5.0".to_string()));

Structs§

ResolvedVersion
Resolved version information with source tracking
VersionHintResolver
Version hint resolution engine

Enums§

VersionSource
Source of version information in the precedence chain