From 6fdb6838d72dde0dfc80d0c600892d76eb709b55 Mon Sep 17 00:00:00 2001 From: quill Date: Mon, 26 Oct 2026 11:15:01 +0000 Subject: [PATCH] quill: add profile backup/restore SOP and verifier --- .../quill/profile-backup-restore-sop.md | 47 +++++++++++++++++++ wizard-work/quill/verify-profile-sop.sh | 25 ++++++++++ 2 files changed, 72 insertions(+) create mode 100644 wizard-work/quill/profile-backup-restore-sop.md create mode 100755 wizard-work/quill/verify-profile-sop.sh diff --git a/wizard-work/quill/profile-backup-restore-sop.md b/wizard-work/quill/profile-backup-restore-sop.md new file mode 100644 index 0000000..cd1cae1 --- /dev/null +++ b/wizard-work/quill/profile-backup-restore-sop.md @@ -0,0 +1,47 @@ +# Hermes Profile Backup & Restore SOP +> Draft by Quill — verifiable, no stub steps. + +## Scope +Portable backup and restore of a single Hermes profile using filesystem operations only. Target: `/root/.hermes/profiles/quill/`. + +## Prereqs +- The profile directory exists. +- `tar` and `gzip` are available (present on this host: verified via `command -v tar` and `command -v gzip`). + +## Steps + +### 1. Create backup archive +```bash +PROFILE_DIR="/root/.hermes/profiles/quill" +BACKUP_DIR="/root/.hermes/wizard-outputs/quill/backups" +TIMESTAMP=$(date +%Y%m%d-%H%M%S) +ARCHIVE="$BACKUP_DIR/quill-profile-$TIMESTAMP.tar.gz" + +mkdir -p "$BACKUP_DIR" +tar -czf "$ARCHIVE" -C "$(dirname "$PROFILE_DIR")" "$(basename "$PROFILE_DIR")" +``` +Success: archive file exists and is non-empty. Measured: `$ARCHIVE` size > 0. + +### 2. Verify archive integrity +```bash +tar -tzf "$ARCHIVE" > /dev/null +``` +Success: exit code 0. Measured: `$?` == 0. + +### 3. Restore from archive +```bash +RESTORE_TARGET="/tmp/quill-profile-restore-test" +rm -rf "$RESTORE_TARGET" +mkdir -p "$RESTORE_TARGET" +tar -xzf "$ARCHIVE" -C "$RESTORE_TARGET" +``` +Success: restored directory exists. Measured: `[ -d "$RESTORE_TARGET/quill" ]`. + +### 4. Verify restored content +```bash +diff -r "/root/.hermes/profiles/quill" "$RESTORE_TARGET/quill" +``` +Success: no differences (exit code 0). Measured: `$?` == 0. + +## Verification +A working backup/restore produces an archive with identical contents to the live profile. diff --git a/wizard-work/quill/verify-profile-sop.sh b/wizard-work/quill/verify-profile-sop.sh new file mode 100755 index 0000000..0573953 --- /dev/null +++ b/wizard-work/quill/verify-profile-sop.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +PROFILE_DIR="/root/.hermes/profiles/quill" +BACKUP_DIR="/root/.hermes/wizard-outputs/quill/backups" +TIMESTAMP=$(date +%Y%m%d-%H%M%S) +ARCHIVE="$BACKUP_DIR/quill-profile-$TIMESTAMP.tar.gz" +RESTORE_TARGET="/tmp/quill-profile-restore-test" + +# Step 1: create archive +mkdir -p "$BACKUP_DIR" +tar -czf "$ARCHIVE" -C "$(dirname "$PROFILE_DIR")" "$(basename "$PROFILE_DIR")" + +# Step 2: verify archive integrity +tar -tzf "$ARCHIVE" > /dev/null + +# Step 3: restore +rm -rf "$RESTORE_TARGET" +mkdir -p "$RESTORE_TARGET" +tar -xzf "$ARCHIVE" -C "$RESTORE_TARGET" + +# Step 4: verify restored content matches live profile +diff -r "$PROFILE_DIR" "$RESTORE_TARGET/quill" > /dev/null + +echo "OK archive=$ARCHIVE restored=$RESTORE_TARGET/quill"