Skip to main content

Crate turbovault_batch

Crate turbovault_batch 

Source
Expand description

§Batch Operation Types

Serde/schema types + intra-batch validation for a batch of vault file operations. write-substrate-layering M4e (design §6.9): this crate SHRANK to types + validation only — it no longer executes anything. BatchOperations are translated into one turbovault_core::ChangePlan and applied through VaultManager::apply_changes (see turbovault_tools::BatchTools, the crate that owns that translation + the manager-routed execution).

§Core Types

§BatchOperation

Individual operations describable in a batch:

§BatchResult

BatchResult describes an execution outcome:

  • Overall success/failure status
  • Count of executed operations
  • First failure point (if any)
  • List of changes made
  • List of errors encountered
  • Individual operation records
  • Unique transaction ID
  • Execution duration

§Conflict Detection

BatchOperation::conflicts_with flags operations whose affected files overlap:

  • Write + Delete on same file = conflict
  • Move + Write on same file = conflict
  • Multiple reads (UpdateLinks) = allowed

Example:

use turbovault_batch::BatchOperation;

let write = BatchOperation::WriteNote {
    path: "file.md".to_string(),
    content: "content".to_string(),
    expected_hash: None,
};

let delete = BatchOperation::DeleteNote {
    path: "file.md".to_string(),
    expected_hash: None,
    on_backlinks: None,
};

assert!(write.conflicts_with(&delete));

Structs§

BatchResult
Result of batch execution
OperationRecord
Record of a single executed operation

Enums§

BatchOperation
Individual batch operation to execute