---
phase: 1
slug: foundation
status: complete
nyquist_compliant: true
wave_0_complete: true
created: 2026-03-24
---

# Phase 1 — Validation Strategy

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

---

## Test Infrastructure

| Property | Value |
|----------|-------|
| **Framework** | pytest 8.x |
| **Config file** | pyproject.toml |
| **Quick run command** | `.venv/bin/pytest tests/test_config.py tests/test_models.py tests/test_server.py tests/test_topology.py -x -q` |
| **Full suite command** | `.venv/bin/pytest tests/ -q` |
| **Estimated runtime** | ~5 seconds |

---

## Sampling Rate

- **After every task commit:** Run `.venv/bin/pytest tests/test_config.py tests/test_models.py tests/test_server.py tests/test_topology.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 |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 01-01-01 | 01 | 1 | FOUND-01 | unit | `.venv/bin/pytest tests/test_server.py -x -q` | ✅ | ✅ green |
| 01-02-01 | 02 | 1 | FOUND-02 | unit | `.venv/bin/pytest tests/test_models.py tests/test_server.py -x -q` | ✅ | ✅ green |
| 01-02-02 | 02 | 1 | FOUND-02 | unit | `.venv/bin/pytest tests/test_server.py::TestStructuredToolHandler -x -q` | ✅ | ✅ green |
| 01-03-01 | 03 | 1 | FOUND-03 | unit | `.venv/bin/pytest tests/test_config.py -x -q` | ✅ | ✅ green |
| 01-03-02 | 03 | 1 | FOUND-04 | unit | `.venv/bin/pytest tests/test_topology.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 |
|-------------|-------------|------------|------------|
| FOUND-01 | Server starts via `python -m vmcluster_mcp.server` and accepts MCP stdio connections | tests/test_server.py | `TestStructuredToolHandler::test_catches_value_error`, `test_catches_runtime_error`, `test_passthrough_normal_return`, `test_preserves_functools_wraps`, `test_error_node_is_none` |
| FOUND-02 | All tool results returned as `ToolResult[T]` — no raw exceptions reach agent | tests/test_models.py, tests/test_server.py | `TestToolResult::test_success_with_string`, `test_failure_with_error_detail`, `test_serialization_round_trip`; `TestStructuredToolHandler::test_catches_value_error`, `test_catches_runtime_error` |
| FOUND-03 | Config loadable from `/etc/vmcluster/config.yaml` or env vars | tests/test_config.py | `test_defaults_no_file_no_env`, `test_env_var_overrides_default`, `test_env_var_overrides_file`, `test_loads_from_yaml_file`, `test_vmcluster_config_env_specifies_path`, `test_empty_file_returns_defaults` |
| FOUND-04 | Topology YAML parsed and validated with clear schema errors | tests/test_topology.py | `test_full_topology_validates`, `test_rejects_missing_cluster_name`, `test_rejects_missing_nodes`, `test_rejects_node_missing_ip`, `test_rejects_invalid_memory_mb_type`, `test_loads_valid_yaml`, `test_file_not_found`, `test_invalid_field_raises_value_error`, `test_wrong_type_raises_value_error`, `test_non_dict_yaml_raises_value_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 < 10s
- [x] `nyquist_compliant: true` set in frontmatter

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