Weave documentation
Rust referenceweave-loom

weave-loom · manifest

Source declarations, signatures and documentation for manifest.

Source: sigil/weave/tools/loom/src/manifest.rs. SHA-256: c51a5d6681ec0b71b90671c6b887adf1995416bde649a77d59caee2520ed0926.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

manifest::FileMode

Permission bits stored alongside each blob in a tree manifest. We keep the representation explicit (rather than a raw u32) so it survives cross-platform replication.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum FileMode {
    /// Regular file with read-only permissions.
    Regular,
    /// Regular file marked executable.
    Executable,
    /// Symbolic link.
    Symlink,
}

Source line: 21.

manifest::FileMode::as_git_octal

Render as the same octal codes git uses on the wire.

pub fn as_git_octal(self) -> &'static str;

Source line: 32.

manifest::ManifestEntry

A single entry in a tree manifest. The path is repo-relative and uses forward slashes regardless of platform.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ManifestEntry {
/// Repo-relative path (forward-slash form).

pub path: String,
/// Hex-encoded BLAKE3 hash of the blob content.

pub blob: String,
/// File mode.

pub mode: FileMode,
/// File size in bytes (informational; the blob hash is canonical).

pub size: u64
}

Source line: 44.

manifest::TreeManifest

A tree manifest — the ordered list of all tracked files at a snapshot.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TreeManifest {
/// Sorted lexicographically by `path` so the canonical encoding is stable.

pub entries: Vec<ManifestEntry>
}

Source line: 57.

manifest::TreeManifest::from_entries

Construct a manifest from an iterator of entries; sorts in-place.

pub fn from_entries(mut entries: Vec<ManifestEntry>) -> Self;

Source line: 64.

manifest::TreeManifest::canonical_json

Canonical JSON encoding (used for hashing and storage).

pub fn canonical_json(&self) -> Result<Vec<u8>, serde_json::Error>;

Source line: 70.

manifest::TreeManifest::id

BLAKE3 hash of the canonical encoding, hex-encoded. Doubles as the "tree id" in commit objects.

pub fn id(&self) -> Result<String, serde_json::Error>;

Source line: 76.

manifest::TreeManifest::validate

Validate the canonical, portable, materialization-safe tree profile.

pub fn validate(&self) -> Result<(), String>;

Source line: 82.

manifest::CommitSeq

Sequence number on the commits strand — analogous to git's commit hash, but monotonic per branch tip rather than content-addressed. The pair (writer_pk, seq) is globally unique; the BLAKE3 of the commit's signed header is the cross-strand identifier.

pub type CommitSeq = u64;

Source line: 138.

manifest::CommitParentRef

Cross-strand parent pointer for multi-writer commit DAGs.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CommitParentRef {
/// Commit strand name.

pub strand: String,
/// Sequence number within `strand`.

pub seq: CommitSeq
}

Source line: 142.

manifest::CommitBlob

Blob bytes carried directly by a commit. The payload is plaintext for public repos and repo-key ciphertext for private repos, encoded as base64 so commit JSON remains portable.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CommitBlob {
/// Hex-encoded BLAKE3 hash of the plaintext blob.

pub hash: String,
/// Base64 encoded blob payload.

pub data: String
}

Source line: 153.

manifest::Commit

A commit object stored on the strand.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Commit {
/// Schema version for forward compatibility.

pub version: u32,
/// Branch that this commit advanced. Legacy commits did not record a

/// branch; local refs remain the source of truth for those.

#[serde(default)]
pub branch: Option<String>,
/// Inline tree manifest (small repos).

pub tree: TreeManifest,
/// BLAKE3 of the canonical tree manifest — recorded so we can detach the

/// tree without re-hashing.

pub tree_id: String,
/// Parent commit sequence numbers. Empty for the root commit; one entry

/// for normal commits; two or more for merges.

pub parents: Vec<CommitSeq>,
/// Cross-strand parent refs. Empty on legacy commits and single-writer

/// commits; populated when a private member strand points at another

/// writer's strand.

#[serde(default)]
pub parent_refs: Vec<CommitParentRef>,
/// Sparse blob payloads needed to materialize this commit's changed

/// content without trusting a separate multi-writer Locus drive.

#[serde(default)]
pub blobs: Vec<CommitBlob>,
/// Author DID (e.g. `did:oas:l1fe:agent:abc...`).

pub author: String,
/// UNIX millis when the commit was created.

pub timestamp_ms: u64,
/// Commit message.

pub message: String
}

Source line: 162.

manifest::Commit::id

Hex-encoded canonical commit id (BLAKE3 of canonical JSON). This is the "loom commit hash" surfaced to users — comparable to a git sha.

pub fn id(&self) -> Result<String, serde_json::Error>;

Source line: 197.

manifest::Commit::validate

Validate a commit before it influences history or materialization.

pub fn validate(&self) -> Result<(), String>;

Source line: 203.

manifest::ManifestEntry::validate_blob_bytes

Verify plaintext materialization bytes against the signed tree entry.

pub fn validate_blob_bytes(&self, bytes: &[u8]) -> Result<(), String>;

Source line: 258.

On this page