---
phase: 9
slug: item-note-crud-wiring
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-12
---

# Phase 9 — Validation Strategy

> Per-phase validation contract for feedback sampling during execution.

---

## Test Infrastructure

| Property | Value |
|----------|-------|
| **Framework** | Rust built-in (`#[test]`) via `cargo test` |
| **Config file** | none — workspace Cargo.toml |
| **Quick run command** | `cargo test -p app -- edit` |
| **Full suite command** | `cargo test --workspace` |
| **Estimated runtime** | ~15 seconds |

---

## Sampling Rate

- **After every task commit:** Run `cargo test -p app -- edit`
- **After every plan wave:** Run `cargo test --workspace`
- **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 |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 09-01-01 | 01 | 1 | ITEM-01 | unit | `cargo test -p app -- edit_dispatcher` | Yes | pending |
| 09-01-02 | 01 | 1 | ITEM-01 | unit | `cargo test -p app -- pending_edit_queue` | No — W0 | pending |
| 09-01-03 | 01 | 1 | ITEM-01 | unit | `cargo test -p service -- add_item` | Yes | pending |
| 09-02-01 | 02 | 1 | ITEM-03 | unit | `cargo test -p app -- edit_dispatcher_routes_save_note` | Yes | pending |
| 09-02-02 | 02 | 1 | ITEM-03 | unit | `cargo test -p service -- save_package_note` | Yes | pending |
| 09-03-01 | 01 | 1 | ITEM-01, ITEM-03 | unit | `cargo test -p app -- optimistic_update` | No — W0 (created in Plan 01 Task 2) | pending |

*Status: pending / green / red / flaky*

---

## Wave 0 Requirements

- [ ] `crates/app/src/dashboard/edit_queue.rs` — stubs for ITEM-01, ITEM-03 pending-edit queue behavior
- [ ] `crates/app/src/dashboard/edit_queue_tests` (or inline `#[cfg(test)]` block) — serialization round-trip, disk persistence, drain behavior
- [ ] `cargo add serde --features derive; cargo add serde_json; cargo add dirs` — if not already in Cargo.toml
- [ ] Optimistic update helper functions + inline `#[cfg(test)]` tests in `main.rs` — created in Plan 01 Task 2 (covers 09-03-01)

*Existing test infrastructure covers most phase requirements. Wave 0 adds pending-edit queue tests and optimistic update tests.*

---

## Manual-Only Verifications

| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Optimistic UI reflects item add/remove immediately | ITEM-01 | Visual feedback timing | 1. Add item via modal 2. Verify card updates before persistence completes |
| Note save reflects on card immediately | ITEM-03 | Visual feedback timing | 1. Edit note text 2. Blur/save 3. Verify card shows updated note |
| Shipment product lookup modal opens and selects | ITEM-01 | Complex UI flow | 1. Click add item 2. Verify modal opens 3. Select product 4. Verify card updates |
| Shopify image auto-fetch on Create New with URL | ITEM-01 | External API integration | 1. Set SHOPIFY_ACCESS_TOKEN + SHOPIFY_SHOP_DOMAIN env vars 2. Click add item 3. Click "Create New" 4. Enter name + Shopify product URL 5. Verify image fetched and shown on card |

---

## Validation Sign-Off

- [ ] All tasks have `<automated>` verify or Wave 0 dependencies
- [ ] Sampling continuity: no 3 consecutive tasks without automated verify
- [ ] Wave 0 covers all MISSING references
- [ ] No watch-mode flags
- [ ] Feedback latency < 15s
- [ ] `nyquist_compliant: true` set in frontmatter

**Approval:** pending
