Skip to main content

Module sync

Module sync 

Source
Expand description

Sync engine for pulling agent sessions from remote sources.

This module provides the core sync functionality using rsync over SSH for efficient delta transfers, with progress reporting and error recovery.

§Safety

IMPORTANT: The sync engine uses rsync WITHOUT the --delete flag to ensure safe additive syncs. This prevents accidental data loss if a remote is misconfigured or temporarily empty.

§Example

use coding_agent_search::sources::sync::SyncEngine;
use coding_agent_search::sources::config::SourcesConfig;

let config = SourcesConfig::load()?;
let engine = SyncEngine::new(&data_dir);

for source in config.remote_sources() {
    let report = engine.sync_source(source)?;
    println!("Synced {}: {} files", source.name, report.total_files());
}

Structs§

PathSyncResult
Result of syncing a single path.
SourceSyncDecision
Evidence-backed scheduling decision for one source.
SourceSyncInfo
Sync information for a single source.
SyncEngine
Sync engine for pulling sessions from remote sources.
SyncReport
Report from syncing an entire source.
SyncStatus
Persistent sync status for all sources.

Enums§

SourceHealthKind
Health class used by the adaptive source scheduler.
SourceSyncAction
Scheduler action for a remote source.
SyncError
Errors that can occur during sync operations.
SyncMethod
Method used for syncing files from remote.
SyncResult
Result of a sync operation for a source.

Functions§

path_to_safe_dirname
Convert a remote path to a safe directory name.