---
phase: 3
slug: ssh-execution
status: complete
nyquist_compliant: true
wave_0_complete: true
created: 2026-03-24
---

# Phase 3 — 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_ssh_client.py tests/test_node_exec.py tests/test_node_exec_all.py -x -q` |
| **Full suite command** | `.venv/bin/pytest tests/ -q` |
| **Estimated runtime** | ~6 seconds |

---

## Sampling Rate

- **After every task commit:** Run `.venv/bin/pytest tests/test_ssh_client.py tests/test_node_exec.py tests/test_node_exec_all.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:** 10 seconds

---

## Per-Task Verification Map

| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 03-01-01 | 01 | 1 | EXEC-01 | unit | `.venv/bin/pytest tests/test_ssh_client.py -x -q` | ✅ | ✅ green |
| 03-01-02 | 01 | 1 | EXEC-03 | unit | `.venv/bin/pytest tests/test_ssh_client.py::test_execute_reconnects_on_stale_connection -x -q` | ✅ | ✅ green |
| 03-02-01 | 02 | 1 | EXEC-01 | unit | `.venv/bin/pytest tests/test_node_exec.py -x -q` | ✅ | ✅ green |
| 03-03-01 | 03 | 1 | EXEC-02 | unit | `.venv/bin/pytest tests/test_node_exec_all.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 |
|-------------|-------------|------------|------------|
| EXEC-01 | Run shell command on single node — structured output with exit code, stdout, stderr, duration | tests/test_ssh_client.py, tests/test_node_exec.py | `test_execute_fresh_connection_returns_exec_result`, `test_execute_nonzero_exit_code`, `test_execute_timeout_returns_timed_out`; `test_node_exec_valid_node_returns_success`, `test_node_exec_nonzero_exit_code_is_success`, `test_node_exec_timeout_returns_timed_out`, `test_node_exec_ssh_exception_returns_failure` |
| EXEC-02 | Run same command across all/subset nodes in parallel — per-node results with all_succeeded and failed_nodes | tests/test_node_exec_all.py | `test_node_exec_all_success_all_nodes`, `test_node_exec_all_partial_failure_require_all_true`, `test_node_exec_all_partial_failure_require_all_false`, `test_node_exec_all_subset_of_nodes`, `test_node_exec_all_empty_nodes_targets_all`, `test_node_exec_all_timed_out_node_in_failed_nodes`, `test_node_exec_all_uses_asyncio_gather` |
| EXEC-03 | SSH connections reestablished automatically after node reboot | tests/test_ssh_client.py | `test_execute_reconnects_on_stale_connection`, `test_execute_returns_error_on_double_failure`, `test_invalidate_removes_cached_connection`, `test_close_all_closes_all_connections` |

---

## 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 < 10s
- [x] `nyquist_compliant: true` set in frontmatter

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