Implement the in-process structured entry editor

Closes #21
This commit is contained in:
Hermes Agent
2026-08-10 07:22:55 +00:00
parent cf7a6216ac
commit b503de8b2e
14 changed files with 1547 additions and 37 deletions

View File

@@ -337,6 +337,20 @@ impl<'a> VaultWriter<'a> {
editor_name: &str,
signing: Option<&SigningPolicy>,
committer: &mut impl EntryCommitter,
) -> Result<WriteOutcome, WriteError> {
self.finish_edit_recoverable(&session, replacement, editor_name, signing, committer)
}
/// Finish an edit while retaining the session when validation, encryption,
/// conflict detection, or commit orchestration fails.
#[allow(clippy::too_many_arguments)]
pub fn finish_edit_recoverable(
&self,
session: &EditSession,
replacement: SecretBytes,
editor_name: &str,
signing: Option<&SigningPolicy>,
committer: &mut impl EntryCommitter,
) -> Result<WriteOutcome, WriteError> {
if replacement.expose() == session.plaintext.expose() {
return Err(WriteError::Unchanged);
@@ -375,7 +389,7 @@ impl<'a> VaultWriter<'a> {
return Err(WriteError::Commit(error));
}
Ok(WriteOutcome {
path: session.path,
path: session.path.clone(),
action: EntryAction::Edit,
})
}