Expand description
Workspace edit transaction substrate.
Internal API. apply_full_write_with_evidence and
WorkspaceEditTransaction::apply are the lowest-level disk-write
primitives in CodeLens. They produce ApplyEvidence and an
optional rollback report but do not enforce ADR-0009 role
gates, write audit rows, or invalidate engine caches — those
guarantees are layered on top by codelens-mcp dispatch. Direct
callers from outside the workspace silently bypass the trust
substrate. See the crate-level docs in lib.rs.
Provides a reusable domain object for multi-file mutations with pre-apply hash capture, post-apply hash verification, and rollback evidence. Used by LSP rename, safe_delete_apply, and future engine mutation primitives.
Rollback model: transactional best-effort with rollback evidence. In-memory backups + restore-on-error. TOCTOU re-check is a light same-function two-read window; disk-snapshot/lock guarantees are deferred to Phase 2.
Structs§
Enums§
Functions§
- apply_
full_ write_ with_ evidence - Apply a full-content rewrite to a single file with hash-based evidence
and rollback on write failure. Used by single-file mutation primitives
(
create_text_file,delete_lines,replace_lines, etc.) that already performed an in-memory transform and need to commit the result with the same TOCTOU + rollback guarantees asWorkspaceEditTransaction. - apply_
full_ writes_ with_ evidence - G7b — multi-file full-write substrate.