bankai/sync_peer
Signed TCP replication of Bankai’s authoritative immutable task history.
The transport moves a signed snapshot payload. Mnesia remains the only receiver-side task authority: envelope verification happens before the transactional import boundary, and a verified conflict is recorded rather than silently choosing a remote head.
Types
pub type ConflictRecord {
ConflictRecord(
id: String,
timestamp: Int,
author: String,
detail: String,
)
}
Constructors
-
ConflictRecord( id: String, timestamp: Int, author: String, detail: String, )
pub type Snapshot {
Snapshot(
versions: List(types.Task),
heads: List(types.Task),
author: String,
)
}
Constructors
-
Snapshot( versions: List(types.Task), heads: List(types.Task), author: String, )
Values
pub fn adversarial_envelope_checks_for_test() -> Result(
Nil,
String,
)
pub fn clear_conflicts(workspace: String) -> Result(Nil, String)
pub fn decode_signed_snapshot_for_test(
workspace: String,
line: String,
) -> Result(Snapshot, String)
Test and diagnostic seam. Production callers use fetch; this exposes the
same verifier so trust/revocation/replay assertions do not need a socket.
pub const default_port: Int
pub fn list_conflicts(
workspace: String,
) -> Result(List(ConflictRecord), String)
pub fn parse_port(args: List(String), default: Int) -> Int
pub fn public_key(workspace: String) -> Result(String, String)
pub fn record_conflict(
workspace: String,
author: String,
detail: String,
) -> Result(Nil, String)
Domain conflicts are never silently imported. The conflict record is a durable audit artifact outside the task-head tables, so causal evidence is preserved even when the current materialization cannot advance.
pub fn reset_identity_for_test(
workspace: String,
) -> Result(Nil, String)
pub fn resolve_conflict(
workspace: String,
conflict_id: String,
) -> Result(Nil, String)
pub fn revoke_peer(
workspace: String,
public_key: String,
) -> Result(Nil, String)
pub fn signed_snapshot_for_test(
workspace: String,
) -> Result(String, String)
Test and local tooling seam: produce the exact signed envelope that
sync-serve sends, without starting a TCP listener.
pub fn trust_peer(
workspace: String,
public_key: String,
) -> Result(Nil, String)
Trust provisioning is explicit. Receiving an unknown signer never creates a trust entry as a side effect of replication.