Skip to main content

record_drive_mutation

Function record_drive_mutation 

Source
pub fn record_drive_mutation(outcome: DriveMutationOutcome)
Expand description

Appends one kind: "drivemutation" record from the active context.

Best effort and exit-code-safe: it goes through record, which swallows every error, so a logging failure can never change the underlying rename/move result.

Deliberately called from inside src/drive/rename.rs/ src/drive/file_move.rs themselves rather than the CLI layer — unlike record_worktree, which is safe to call from src/cli/git/worktree.rs only because git worktree has no MCP surface at all. Drive move/rename may grow an MCP caller later, and “every move/rename must be logged” is a hard invariant that needs to hold for every current and future caller. This is also additive to (not redundant with) the automatic per-request kind: "http" records crate::drive::client::DriveClient already writes for every call it makes: a Blocked outcome makes no files.update call at all, so without this record the single most security-relevant event — “we refused this because visibility would change, here’s exactly why” — would never appear in the log.