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
- User flag (–cassandra-version) - highest priority
- SSTable metadata (from individual SSTable files)
- Dataset metadata.yml (from test data configuration)
- 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§
- Resolved
Version - Resolved version information with source tracking
- Version
Hint Resolver - Version hint resolution engine
Enums§
- Version
Source - Source of version information in the precedence chain