Skip to content

desktop/src-tauri/crates/core/src/identity.rs

Comment 1, line 1

desktop/src-tauri/crates/core/src/identity.rs:1

//! Identity and deduplication: event_id namespaces source instance/record key; content hashes

Comment 2, line 2

desktop/src-tauri/crates/core/src/identity.rs:2

//! detect changes; revision/lifecycle comparisons select streamed, final or corrected records.

Comment 3, line 3

desktop/src-tauri/crates/core/src/identity.rs:3

//!

Comment 4, line 4

desktop/src-tauri/crates/core/src/identity.rs:4

//! Compare both source revisions when present; otherwise partial < final < corrected.

Comment 5, line 5

desktop/src-tauri/crates/core/src/identity.rs:5

//! Unordered differing content retains the existing record with conflict diagnostics, never MAX.

Comment 6, line 10

desktop/src-tauri/crates/core/src/identity.rs:10

/// event_id joins source instance and record key. The composite unique constraint

Comment 7, line 11

desktop/src-tauri/crates/core/src/identity.rs:11

/// (source_instance_id, source_record_key) identifies the record; this string supports logs/references.

Comment 8, line 21

desktop/src-tauri/crates/core/src/identity.rs:21

/// Observation time changes on rescanning without changing source content.

Comment 9, line 22

desktop/src-tauri/crates/core/src/identity.rs:22

/// parse_basis records known_version/latest_fallback. Registry verification upgrades

Comment 10, line 23

desktop/src-tauri/crates/core/src/identity.rs:23

/// do not change source content, so this field is also excluded from the content hash.

Comment 11, line 31

desktop/src-tauri/crates/core/src/identity.rs:31

/// FNV-1a 64-bit content hash detects changes; it cannot identify an event independently.

Comment 12, line 42

desktop/src-tauri/crates/core/src/identity.rs:42

/// Existing metadata used to compare incoming records.

Comment 13, line 50

desktop/src-tauri/crates/core/src/identity.rs:50

/// Outcome of comparing a record with existing content.

Comment 14, line 53

desktop/src-tauri/crates/core/src/identity.rs:53

/// No existing record: insert.

Comment 15, line 55

desktop/src-tauri/crates/core/src/identity.rs:55

/// A higher revision/lifecycle replaces the old contribution with the new values.

Comment 16, line 57

desktop/src-tauri/crates/core/src/identity.rs:57

/// Keep the higher existing revision/lifecycle or identical content without duplicate usage.

Comment 17, line 59

desktop/src-tauri/crates/core/src/identity.rs:59

/// Unordered different content: retain the existing record, mark conflict and diagnose.

Comment 18, line 63

desktop/src-tauri/crates/core/src/identity.rs:63

/// Compare source revisions before lifecycle; equal precedence with different content is conflict.

Comment 19, line 85

desktop/src-tauri/crates/core/src/identity.rs:85

// Missing revision on either side uses lifecycle; equal lifecycle/content keeps, differing content conflicts.

Comment 20, line 153

desktop/src-tauri/crates/core/src/identity.rs:153

// A higher source revision replaces even with a lower lifecycle.

Comment 21, line 158

desktop/src-tauri/crates/core/src/identity.rs:158

// A lower source revision retains the existing record.

Comment 22, line 163

desktop/src-tauri/crates/core/src/identity.rs:163

// Equal revision and content adds no usage.

Comment 23, line 168

desktop/src-tauri/crates/core/src/identity.rs:168

// Equal revision with different content is conflict.