wsb 0.258.6441

Workspace tools for every project under $PRJ: git across submodules, template stamping, GitHub, and the workbench
Documentation
//! Peer workspace continuity: the same unfinished working tree on more than
//! one machine.
//!
//! Git carries history between machines. This carries what git deliberately
//! does not: the half-finished edit, the file not worth a commit, the state a
//! person is in the middle of. Stop typing on one machine, open another, and
//! the tree is there — without a WIP commit, a stash, a patch or a copy.
//!
//! # What this is not
//!
//! It is not a git operation and it never performs one. Continuity never
//! pulls, pushes, merges, rebases, resets, commits or changes a branch to make
//! synchronisation possible. When git state diverges it BLOCKS and says so;
//! the operator reconciles with the ordinary fleet commands, and continuity
//! resumes by itself once both sides agree again.
//!
//! It is also not `wsb sync`, which is the fleet's git operation and keeps its
//! name. These two share a word in English and nothing else, so they share no
//! module, no type and no code path.
//!
//! # The shape of it
//!
//! * [`model`] — the closed vocabulary: identities, states, blocked reasons.
//! * [`identity`] — a machine's ed25519 identity, its fingerprint, and pairing.
//! * [`compatibility`] — the git guard: same repository, same named branch,
//!   same HEAD, nothing in progress, expressed as an epoch a transfer is
//!   validated against at both ends.
//! * [`scan`] — what belongs to the continuity set, and what may never enter it.
//! * [`converge`] — three-way convergence against the last agreed baseline,
//!   which is what makes this bidirectional rather than a copy.
//! * [`protocol`] — the messages two daemons exchange.
//! * [`transport`] — the authenticated, encrypted channel they exchange them on.
//!
//! The daemon owns the long-lived half — connections, watchers, sessions — in
//! `wsb-daemon`'s own `peer` module. Everything a decision depends on lives
//! here, where it can be tested without a network.

pub mod compatibility;
pub mod converge;
pub mod identity;
pub mod model;

/// The daemon's routes for peers, under its workbench API.
pub mod route {
    /// Every paired machine.
    pub const PEERS: &str = "/api/v1/peers";

    /// The services with one peer, and their switches.
    pub fn services(peer: impl std::fmt::Display) -> String {
        format!("{PEERS}/{peer}/services")
    }
}
pub mod protocol;
pub mod scan;
pub mod seed;
pub mod transport;

/// Where peers dial unless the operator says otherwise.
///
/// Fixed rather than floating: a peer is reached at an address a person typed
/// once, and a port that moved with every restart would have to be typed
/// again. The workbench's port may float; this one may not.
pub const DEFAULT_PEER_PORT: u16 = 7420;

/// Where a workspace declares its continuity policy, relative to its root.
pub const POLICY_FILE: &str = ".wsb/peer.json";

pub use compatibility::{Epoch, GitState, RepositoryFacts};
pub use converge::{Action, Baseline, Convergence, Entry, EntryKind};
pub use identity::{Fingerprint, MachineIdentity, PairingCode};
pub use model::{
    Blocked, Desired, Observed, PeerId, PeerState, RepositoryId, RepositoryStatus, WorkspaceId,
    WorkspacePresence,
};