Fix intra-doc link warnings; add clawsync-fs README and metadata

Doc fixes (20 warnings → 1 benign name-collision warning):
- clawsync-transport/quic.rs: QuicConfig::with_cert doesn't exist → backtick
- clawsync-onion/iblt.rs: bare `insert` link → backtick
- clawsync-core/lib.rs: simd_cdc is feature-gated → backtick
- clawhdf5-onion/annotation.rs: RevisionEntry/BranchEntry are in external
  clawhdf5-format crate, not re-exported → backtick
- clawhdf5-onion/gc.rs: compact_dead_epoch_revisions is private; flush links
  broken → backtick
- clawhdf5-onion/provenance.rs: RevisionEntry from external crate → backtick
- clawhdf5-onion/reader.rs: reconstruct_revision/revision_pages → Self:: prefix
- clawhdf5-onion/writer.rs: REV_FLAG_SNAPSHOT → crate::format:: path;
  reconstruct_revision → Self:: prefix
Remaining warning is `format` module/macro name collision — not a broken link.

clawsync-fs crate metadata:
- Add readme, keywords, categories to Cargo.toml
- Write README.md (CDC protocol diagram, module overview, usage examples)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
osobh
2026-04-04 20:29:28 -05:00
co-authored by Claude Sonnet 4.6
parent 2e423d2682
commit 3d524e2d63
10 changed files with 126 additions and 16 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
//!
//! Stores revision annotations and branch names as length-prefixed
//! (`u32` LE + UTF-8 bytes) strings. An offset of `0` in a
//! [`RevisionEntry`] or [`BranchEntry`] means "no annotation".
//! `RevisionEntry` or `BranchEntry` means "no annotation".
//!
//! The offset `0` is reserved. The heap always begins with a single
//! null byte so that offset 0 is unambiguously "absent".
@@ -39,8 +39,8 @@ impl AnnotationHeap {
/// Append a UTF-8 string and return its byte offset within the heap.
///
/// The returned offset can be stored in a [`RevisionEntry::annotation_off`]
/// or [`BranchEntry::name_off`].
/// The returned offset can be stored in a `RevisionEntry::annotation_off`
/// or `BranchEntry::name_off`.
pub fn push(&mut self, s: &str) -> u64 {
let offset = self.data.len() as u64;
let len = s.len() as u32;
+4 -4
View File
@@ -24,8 +24,8 @@ pub enum GcPolicy {
/// Computes the dead set using `inner`, marks those entries with
/// [`EPOCH_DEAD`] in their padding bytes, and returns immediately
/// without touching `page_data`. The actual compaction is deferred to
/// the next [`OnionFile::flush`] call, which runs
/// [`OnionFile::compact_dead_epoch_revisions`] before writing.
/// the next `OnionFile::flush` call, which runs
/// `OnionFile::compact_dead_epoch_revisions` before writing.
///
/// Use this when you want GC to be non-blocking: the mark pass is
/// O(revisions) with no I/O; the compaction is amortised into the next
@@ -47,12 +47,12 @@ impl OnionFile {
///
/// For all policies except [`GcPolicy::EpochFlip`]:
/// - The `RevisionIndex` is updated immediately.
/// - Page data is compacted in-memory; call [`flush`] to persist.
/// - Page data is compacted in-memory; call `OnionFile::flush` to persist.
///
/// For [`GcPolicy::EpochFlip`]:
/// - Dead revisions are *marked* with [`EPOCH_DEAD`] in O(revisions).
/// - Page data is **not** touched; compaction is deferred to the next
/// [`flush`] call. This makes the GC call itself non-blocking.
/// `OnionFile::flush` call. This makes the GC call itself non-blocking.
///
/// **Note:** Immediate GC is irreversible. Epoch-flip GC can be
/// cancelled by calling `flush_wal()` without `flush()`, but only
+2 -2
View File
@@ -9,7 +9,7 @@ const RAYON_PAGE_THRESHOLD: usize = 128 * 1024; // 128 KB
/// Compute the BLAKE3 hash over a set of `(h5_offset, page_bytes)` pairs,
/// processed in ascending `h5_offset` order.
///
/// This is the canonical per-revision hash stored in [`RevisionEntry::blake3`].
/// This is the canonical per-revision hash stored in `RevisionEntry::blake3`.
/// For pages ≥ 128 KB each, the page data is hashed using Rayon tree
/// parallelism; the offset bytes always use the single-threaded path.
pub fn hash_pages(pages: &[(u64, &[u8])]) -> [u8; 32] {
@@ -48,7 +48,7 @@ impl SessionId {
Self(*Uuid::now_v7().as_bytes())
}
/// Construct from raw bytes (e.g., loaded from a [`RevisionEntry`]).
/// Construct from raw bytes (e.g., loaded from a `RevisionEntry`).
pub fn from_bytes(bytes: [u8; 16]) -> Self {
Self(bytes)
}
+2 -2
View File
@@ -165,7 +165,7 @@ impl OnionFile {
}
/// Return the decompressed pages that were changed *only in revision `rev`*
/// (not the accumulated file state — use [`reconstruct_revision`] for that).
/// (not the accumulated file state — use [`Self::reconstruct_revision`] for that).
///
/// Each element is `(h5_offset, uncompressed_page_bytes)`.
/// This is used by `clawsync-onion` to build transfer packets.
@@ -196,7 +196,7 @@ impl OnionFile {
/// Return the raw **compressed** page bytes for a revision together with
/// the codec and original (uncompressed) size.
///
/// Compared to [`revision_pages`] this skips the decompression step, so
/// Compared to [`Self::revision_pages`] this skips the decompression step, so
/// callers that intend to send the data over the network can ship the
/// compressed bytes directly and let the receiver decompress.
///
+2 -2
View File
@@ -312,8 +312,8 @@ impl OnionFile {
/// Commit a full-state snapshot revision.
///
/// A snapshot records every page of the current HEAD state (not just the
/// diff) and is flagged with [`REV_FLAG_SNAPSHOT`]. Subsequent calls to
/// [`reconstruct_revision`] will use the nearest snapshot as their starting
/// diff) and is flagged with [`crate::format::REV_FLAG_SNAPSHOT`]. Subsequent calls to
/// [`Self::reconstruct_revision`] will use the nearest snapshot as their starting
/// point, bounding reconstruction depth to `O(N_since_snapshot · P)`.
///
/// `h5_base` is the raw bytes of the base `.h5` file (needed to resolve