Weave Core
Filesystem Runtime
Filesystem Runtime in Weave Core. Facade over filesystem, network, storage, identity, crypto, and model crates.
Purpose
Facade over filesystem, network, storage, identity, crypto, and model crates.
This page follows the real source shape for Weave Core and explains the workflow a developer is likely to use first.
Storage contract
Document persistence format, integrity checks, read/write ordering, idempotency, compaction or repair behavior, and how callers recover from partial failures. This section should answer what data is durable and what can be reconstructed.
Primary types to know
AgentFs— libs/weave-core/src/filesystem/agentfs.rsAgentFsConfig— libs/weave-core/src/filesystem/agentfs.rsAgentFsEntry— libs/weave-core/src/filesystem/agentfs.rsContentAnnouncement— libs/weave-core/src/network/dht.rsDht— libs/weave-core/src/network/dht.rsDhtBehaviour— libs/weave-core/src/network/dht.rsDhtConfig— libs/weave-core/src/network/dht.rsDhtStats— libs/weave-core/src/network/dht.rsDid— libs/weave-core/src/identity/mod.rsDiff— libs/weave-core/src/filesystem/diff.rsDiffEntry— libs/weave-core/src/filesystem/diff.rsDiffSummary— libs/weave-core/src/filesystem/diff.rs
Example shape
use weave_core::Mirror;
use weave_core::filesystem::mirror::MirrorConfig;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Mirror is the weave-core filesystem replicator. MirrorConfig wires the
// refresh interval, conflict policy, and content-vs-metadata comparison.
let mirror = Mirror::new(
"/tmp/source".to_string(),
"/tmp/replica".to_string(),
MirrorConfig {
sync_interval_secs: 30,
atomic_writes: true,
preserve_permissions: true,
..MirrorConfig::default()
},
);
let status = mirror.status();
println!(
"mirror_source={} target={} synced_at={:?}",
status.source, status.target, status.last_sync,
);
Ok(())
}