operations capa

operations-drive-identity

Drive identity: aliases, evidence groups, and fingerprint matching for hard drives across controller / SMART / OCR sources

Drive identity: aliases, evidence groups, and fingerprint matching for hard drives across controller / SMART / OCR sources

Tieroperations
Roleunclassified (baselined)
Pathcrates/operations/drive-identity
Edition2021
Targetsoperations_drive_identity
Public items23 across 0 modules
Tests79

What it is for

Drive Identity Library crates

Alias-graph matcher for identifying a physical hard drive from noisy, multi-source observations. A single drive can carry many "identities" — hpacucli-reported serial, smartctl serial, VPD 0x80 / 0x83 descriptors, OCR-scanned label text, pedigree traces, WWNs, and vendor part numbers. Reducing those to one canonical column loses information; this crate instead represents each drive as a DriveFingerprint carrying a bag of DriveAliases.

Matching is performed by score_fingerprint, a pure function that evaluates a candidate fingerprint against a slice of known fingerprints and returns one MatchResult per candidate. The scoring rules are tuned for SCSI / SATA / NVMe inventory and are deliberately conservative: model+capacity agreement alone is never enough to auto-assign.

This crate is orthogonal to operations-drive-health: health describes what a drive IS DOING, identity describes WHICH drive it is. The two compose at the application layer (e.g. DriveInspection { identity, health }) but do not depend on each other.

Capabilities

crate root

Drive Identity Library crates

Item
pub const NORM_VERSION: u32
fn normalize_value(s : & str,) ->(String, String, Option <String>, Option <String>, Option <String>,)
fn seagate_pedigree_split(s : & str) -> Option <(String, Option <String>)>
pub const VENDOR_SERIAL_PREFIXES: & & str
fn strip_vendor_prefix(serial : & str) -> & str
fn strip_hitachi_date_prefix(serial : & str) -> & str
fn normalization_variants(token : & str) -> Vec <String>
fn score_fingerprint(fp : & DriveFingerprint, candidates : & & DriveFingerprint,) -> Vec <MatchResult>

AliasSource

Drive Identity Library crates

Item
pub enum AliasSource

DriveAlias

Drive Identity Library crates

Item
pub struct DriveAlias
DriveAlias :: fn new(source : AliasSource, group : EvidenceGroup, raw : impl Into <String>) -> Self

DriveFingerprint

Drive Identity Library crates

Item
pub struct DriveFingerprint
DriveFingerprint :: fn empty() -> Self

EvidenceGroup

Drive Identity Library crates

Item
pub enum EvidenceGroup

MatchDecision

Drive Identity Library crates

Item
pub enum MatchDecision

MatchReason

Drive Identity Library crates

Item
pub enum MatchReason

MatchResult

Drive Identity Library crates

Item
pub struct MatchResult

OcrSerial

Drive Identity Library crates

Item
pub struct OcrSerial<'a>
fn extract_serial_candidates(input : & OcrSerial <'_>) -> Vec <String>

OcrSerial<'a>

Drive Identity Library crates

Item
OcrSerial<'a> :: fn new(serial : Option <& 'a str>, alt_serial : Option <& 'a str>, conflicting_fields : & 'a Option <& 'a str>,) -> Self

OcrText

Drive Identity Library crates

Item
pub struct OcrText<'a>
fn extract_identifier_candidates(input : & OcrText <'_>) -> Vec <String>

OcrText<'a>

Drive Identity Library crates

Item
OcrText<'a> :: fn new(raw : Option <& 'a str>, unmapped_lines : & 'a & 'a str) -> Self

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub const NORM_VERSION: u32Current normalization version
pub enum AliasSourceSource of a drive alias observation
pub enum EvidenceGroupGroups of correlated observations
pub struct DriveAliasOne (source, raw_value) identity observation plus derived normalization keys
DriveAlias :: fn new(source : AliasSource, group : EvidenceGroup, raw : impl Into <String>) -> SelfBuild a fully-normalized alias from a raw observation
pub struct DriveFingerprintThe complete identity footprint of one drive from the matcher's POV
DriveFingerprint :: fn empty() -> SelfEmpty fingerprint — no aliases and no attributes
pub enum MatchDecisionTop-level matcher verdict for one (bay, candidate) pair.
pub enum MatchReasonStructured reason for a match score
pub struct MatchResultOne matcher result for a (fingerprint, candidatei) pair.
fn normalize_value(s : & str,) ->(String, String, Option <String>, Option <String>, Option <String>,)Normalize a raw alias value into its derived keys
fn seagate_pedigree_split(s : & str) -> Option <(String, Option <String>)>Seagate 3JA dual-form detection
pub const VENDOR_SERIAL_PREFIXES: & & strSMART-reported vendor prefixes that printed labels omit
fn strip_vendor_prefix(serial : & str) -> & strStrip a known vendor prefix (see VENDOR_SERIAL_PREFIXES) from a SMART-reported serial
fn strip_hitachi_date_prefix(serial : & str) -> & strStrip a YYMMDD Hitachi/HGST date prefix from a label serial
fn normalization_variants(token : & str) -> Vec <String>Canonical normalization variants of a single token
pub struct OcrText<'a>Input to extract_identifier_candidates
OcrText<'a> :: fn new(raw : Option <& 'a str>, unmapped_lines : & 'a & 'a str) -> SelfConstruct an OcrText from primary fields.
pub struct OcrSerial<'a>Input to extract_serial_candidates
OcrSerial<'a> :: fn new(serial : Option <& 'a str>, alt_serial : Option <& 'a str>, conflicting_fields : & 'a Option <& 'a str>,) -> SelfConstruct an OcrSerial from primary fields.
fn extract_identifier_candidates(input : & OcrText <'_>) -> Vec <String>Extract plausible drive-identifier candidates from free-form OCR text
fn extract_serial_candidates(input : & OcrSerial <'_>) -> Vec <String>
fn score_fingerprint(fp : & DriveFingerprint, candidates : & & DriveFingerprint,) -> Vec <MatchResult>Score one fingerprint against each candidate in candidates

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)operations
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/operations/drive-identity
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
serde^1derivenoalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde_json^1noalways

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_drive_identity["application-drive-identity"] -->|uses| SELF
  SELF["operations-drive-identity"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
liboperations_drive_identity`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

1 workspace crate depends on this one: application-drive-identity.

Verification

KindCount
Unit tests79
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root1900

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc2223
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 22
    "No rustdoc detected" : 1

Metrics

MetricValue
Rust source files1
Source lines2252
Code lines1656
Public API items23
Public modules0
Tests79
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "constant" : 2
    "enum" : 4
    "function" : 8
    "method" : 4
    "struct" : 5
pie showData
    title Rust source composition
    "Code" : 1656
    "Blank or comment" : 596

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las operations · Manual