Skip to content

Commit fef98b2

Browse files
agent-trace-dwh-replica: Implement Turso Sync replica boundary
The DWH adapter lacked a single-owner connection boundary for bootstrapping and synchronizing repository replicas. Add lock-before-open Turso Sync ownership, non-provisioning schema readiness checks, pull and push operations, credential-safe diagnostics, and a shared connection/runtime seam. Cover bootstrap, contention, bidirectional synchronization, reconstruction, and incompatible-schema behavior with unit and local sync-server integration tests. Document the resulting operating constraints. Plan: agent-trace-dwh-turso-sync-replica (T02) Record the accepted single-owner, disposable replica decision and make the implemented boundary discoverable from the architecture and context map. Mark the plan acceptance criteria and T03 complete, capture validation evidence and residual risk, and remove the standalone unreachable-remote redaction test while retaining direct redaction coverage. Plan: agent-trace-dwh-turso-sync-replica (T03) Co-authored-by: SCE <sce@crocoder.dev>
1 parent 042045b commit fef98b2

14 files changed

Lines changed: 990 additions & 58 deletions

cli/Cargo.lock

Lines changed: 72 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ path = "src/main.rs"
2929
anyhow = "1"
3030
chrono = "0.4"
3131
clap = { version = "4", features = ["derive"] }
32-
turso = { version = "0.7.0" }
32+
turso = { version = "0.7.0", features = ["sync"] }
3333
clap_complete = "4"
3434
dirs = "6"
3535
fs4 = "0.13.1"

cli/src/services/agent_trace_dwh_replica/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
//!
33
//! This module owns the canonical repository-scoped bridge lock proving
44
//! exactly one process owns the local `agent-trace-sync.db` Turso Sync
5-
//! replica at a time. It never touches the multiprocess-WAL source capture
6-
//! database (`crate::services::agent_trace_db`) and does not itself open a
7-
//! Turso Sync connection: that is a later boundary built on top of the lock
8-
//! established here.
5+
//! replica at a time, and the [`AgentTraceDwhReplica`] type that is the sole
6+
//! owner of a Turso Sync builder for that replica. It never touches the
7+
//! multiprocess-WAL source capture database
8+
//! (`crate::services::agent_trace_db`), never enables that database's
9+
//! `experimental_multiprocess_wal` flag, and never provisions the DWH schema
10+
//! locally: it only verifies the schema an already-bootstrapped replica
11+
//! reports.
912
1013
mod lock;
14+
mod replica;
1115

1216
#[allow(unused_imports)]
1317
pub use lock::{BridgeLock, BridgeLockError};
18+
#[allow(unused_imports)]
19+
pub use replica::{AgentTraceDwhReplica, AgentTraceDwhReplicaConfig, AgentTraceDwhReplicaError};

0 commit comments

Comments
 (0)