Skip to content

donna.skills.tools.vault_undo_last

donna.skills.tools.vault_undo_last

vault_undo_last — revert the last N vault commits (slice 12).

Uses git revert (not git reset) so the audit trail is preserved. Default n=1 undoes the most recent write.

logger module-attribute

logger = get_logger()

VaultUndoError

Bases: Exception

Raised when vault_undo_last fails.

vault_undo_last async

vault_undo_last(*, client: Any, n: int = 1) -> dict[str, Any]

Revert the last n commits; return the new revert SHAs.

Source code in src/donna/skills/tools/vault_undo_last.py
async def vault_undo_last(*, client: Any, n: int = 1) -> dict[str, Any]:
    """Revert the last ``n`` commits; return the new revert SHAs."""
    try:
        shas = await client.undo_last(n=n)
    except Exception as exc:
        logger.warning("vault_undo_last_failed", n=n, error=str(exc))
        raise VaultUndoError(f"vault_undo_last: {exc}") from exc
    return {"ok": True, "n": n, "revert_shas": shas}