---
phase: 4
slug: snapshot-management
status: complete
nyquist_compliant: true
wave_0_complete: true
created: 2026-03-24
---

# Phase 4 — Validation Strategy

> Per-phase validation contract for feedback sampling during execution.

---

## Test Infrastructure

| Property | Value |
|----------|-------|
| **Framework** | pytest 8.x (with pytest-asyncio) |
| **Config file** | pyproject.toml |
| **Quick run command** | `.venv/bin/pytest tests/test_snapshot_create.py tests/test_snapshot_list.py tests/test_snapshot_revert.py tests/test_snapshot_delete.py -x -q` |
| **Full suite command** | `.venv/bin/pytest tests/ -q` |
| **Estimated runtime** | ~10 seconds |

---

## Sampling Rate

- **After every task commit:** Run `.venv/bin/pytest tests/test_snapshot_create.py tests/test_snapshot_list.py tests/test_snapshot_revert.py tests/test_snapshot_delete.py -x -q`
- **After every plan wave:** Run `.venv/bin/pytest tests/ -q`
- **Before `/gsd:verify-work`:** Full suite must be green
- **Max feedback latency:** 15 seconds

---

## Per-Task Verification Map

| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 04-01-01 | 01 | 1 | SNAP-01 | unit | `.venv/bin/pytest tests/test_snapshot_create.py -x -q` | ✅ | ✅ green |
| 04-01-02 | 01 | 1 | SNAP-03 | unit | `.venv/bin/pytest tests/test_snapshot_list.py -x -q` | ✅ | ✅ green |
| 04-02-01 | 02 | 1 | SNAP-02 | unit | `.venv/bin/pytest tests/test_snapshot_revert.py -x -q` | ✅ | ✅ green |
| 04-02-02 | 02 | 1 | SNAP-04 | unit | `.venv/bin/pytest tests/test_snapshot_delete.py -x -q` | ✅ | ✅ green |

*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*

---

## Wave 0 Requirements

Existing infrastructure covers all phase requirements.

---

## Manual-Only Verifications

All phase behaviors have automated verification.

---

## Requirement Coverage

| Requirement | Description | Covered By | Test Names |
|-------------|-------------|------------|------------|
| SNAP-01 | Create named disk snapshot for all nodes simultaneously; appears in snapshot_list | tests/test_snapshot_create.py, tests/test_snapshot_list.py | `test_snapshot_create_returns_snapshot_info`, `test_snapshot_create_creates_directory`, `test_snapshot_create_uses_libvirt_disk_only_flag`, `test_snapshot_create_concurrent_for_all_nodes`, `test_snapshot_create_returns_failure_when_node_fails`, `test_snapshot_create_tool_returns_snapshot_info`, `test_snapshot_list_returns_snapshot_info_for_single_snapshot` |
| SNAP-02 | Revert all nodes to named snapshot atomically; optionally restart and wait for SSH; failure on any node returns success=False | tests/test_snapshot_revert.py | `test_revert_destroys_all_nodes_before_any_revert`, `test_revert_calls_revert_to_snapshot_for_each_node`, `test_revert_restart_after_true_starts_all_domains`, `test_revert_restart_after_false_does_not_start_domains`, `test_revert_wait_for_ssh_calls_wait_per_node`, `test_revert_ssh_timeout_returns_failure`, `test_revert_nonexistent_snapshot_returns_error`, `test_revert_returns_cluster_status_with_per_node_entries` |
| SNAP-03 | List all snapshots for a cluster with creation time and per-node disk size | tests/test_snapshot_list.py | `test_snapshot_list_returns_empty_when_no_snapshots`, `test_snapshot_list_returns_snapshot_info_for_single_snapshot`, `test_snapshot_list_parses_creation_time_from_xml`, `test_snapshot_list_reports_per_node_disk_sizes`, `test_snapshot_list_missing_file_size_returns_zero`, `test_snapshot_list_groups_by_name_across_nodes`, `test_snapshot_list_multiple_distinct_snapshots`, `test_snapshot_list_tool_returns_tool_result` |
| SNAP-04 | Delete named snapshot from all nodes; return per-node confirmation | tests/test_snapshot_delete.py | `test_delete_calls_client_delete_snapshot_once_per_node`, `test_delete_returns_per_node_confirmation`, `test_delete_continues_on_individual_node_failure`, `test_delete_active_backing_guard_refuses_deletion`, `test_delete_nonexistent_snapshot_returns_per_node_error`, `test_delete_removes_overlay_file`, `test_delete_file_not_found_is_not_an_error` |

---

## Validation Sign-Off

- [x] All tasks have `<automated>` verify or Wave 0 dependencies
- [x] Sampling continuity: no 3 consecutive tasks without automated verify
- [x] Wave 0 covers all MISSING references
- [x] No watch-mode flags
- [x] Feedback latency < 15s
- [x] `nyquist_compliant: true` set in frontmatter

**Approval:** approved 2026-03-24
