---
phase: 34
slug: core-clickhouse-writer
status: draft
nyquist_compliant: true
wave_0_complete: false
created: 2026-03-28
---

# Phase 34 — Validation Strategy

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

---

## Test Infrastructure

| Property               | Value                                                                        |
| ---------------------- | ---------------------------------------------------------------------------- |
| **Framework**          | cargo nextest + wiremock 0.6                                                 |
| **Config file**        | `.config/nextest.toml` (if exists) or default                                |
| **Quick run command**  | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink` |
| **Full suite command** | `cargo nextest run --workspace --exclude opendeviationbar-py`                |
| **Estimated runtime**  | ~30 seconds                                                                  |

---

## Sampling Rate

- **After every task commit:** Run `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink`
- **After every plan wave:** Run `cargo nextest run --workspace --exclude opendeviationbar-py`
- **Before `/gsd:verify-work`:** Full suite must be green
- **Max feedback latency:** 30 seconds

---

## Per-Task Verification Map

| Task ID  | Plan | Wave | Requirement | Test Type   | Automated Command                                                                                        | File Exists | Status  |
| -------- | ---- | ---- | ----------- | ----------- | -------------------------------------------------------------------------------------------------------- | ----------- | ------- |
| 34-01-01 | 01   | 1    | WRITER-02   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(row_conversion)'`   | Wave 0      | pending |
| 34-01-01 | 01   | 1    | WRITER-04   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(dedup_parity)'`     | Wave 0      | pending |
| 34-01-01 | 01   | 1    | WRITER-08   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(omit_computed)'`    | Wave 0      | pending |
| 34-01-02 | 01   | 1    | WRITER-07   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(summary)'`          | Wave 0      | pending |
| 34-02-01 | 02   | 2    | WRITER-03   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(batch_flush)'`      | Wave 0      | pending |
| 34-02-01 | 02   | 2    | WRITER-05   | integration | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(retry)'`            | Wave 0      | pending |
| 34-02-02 | 02   | 2    | WRITER-01   | unit        | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(sink_clickhouse)'`  | Wave 0      | pending |
| 34-02-02 | 02   | 2    | WRITER-06   | integration | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(flush_thread)'`     | Wave 0      | pending |
| 34-02-02 | 02   | 2    | WRITER-09   | integration | `cargo nextest run -p opendeviationbar-streaming --features clickhouse-sink -E 'test(plugin_discovery)'` | Wave 0      | pending |

_Status: pending / green / red / flaky_

---

## Wave 0 Requirements

- [ ] All test files are new (sink_clickhouse module does not exist yet)
- [ ] `wiremock = "0.6"` needs to be added to opendeviationbar-streaming dev-dependencies
- [ ] `clickhouse-sink` feature needs to be defined in Cargo.toml
- [ ] `tokio` test runtime needed for async wiremock tests

---

## Manual-Only Verifications

_All phase behaviors have automated verification._

---

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

**Approval:** approved 2026-03-28
