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:
BatchOperation::CreateNote- Create a new noteBatchOperation::WriteNote- Write or overwrite a noteBatchOperation::DeleteNote- Delete a noteBatchOperation::MoveNote- Move or rename a noteBatchOperation::UpdateLinks- Update link referencesBatchOperation::EditNote/BatchOperation::UpdateFrontmatter/BatchOperation::ManageTags/BatchOperation::CreateFromTemplate- the link-aware / metadata / template ops (translated via the domain tools’compute_*helpers, per design §5.4)
§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§
- Batch
Result - Result of batch execution
- Operation
Record - Record of a single executed operation
Enums§
- Batch
Operation - Individual batch operation to execute