--- phase: 22 slug: agent-streaming status: draft nyquist_compliant: false wave_0_complete: false created: 2026-04-01 --- # Phase 22 — Validation Strategy > Per-phase validation contract for feedback sampling during execution. --- ## Test Infrastructure | Property | Value | |----------|-------| | **Framework** | vitest ^3.0.5 | | **Config file** | `ui/vitest.config.ts` | | **Quick run command** | `pnpm --filter @paperclipai/ui vitest run --reporter=verbose` | | **Full suite command** | `pnpm vitest run` (root, all workspaces) | | **Estimated runtime** | ~20 seconds | **Environment note:** `ui/vitest.config.ts` sets `environment: "node"`. Tests needing DOM use `// @vitest-environment jsdom` file-level annotation. --- ## Sampling Rate - **After every task commit:** Run relevant test file(s) per task verify command - **After every plan wave:** Run `pnpm vitest run` - **Before `/gsd:verify-work`:** Full suite must be green - **Max feedback latency:** 20 seconds --- ## Per-Task Verification Map | Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status | |---------|------|------|-------------|-----------|-------------------|-------------|--------| | 22-00-01 | 00 | 0 | (scaffolds) | stub | `pnpm --filter @paperclipai/ui vitest run` | Created in W0 | pending | | 22-01-01 | 01 | 1 | CHAT-01, CHAT-12 | unit | `pnpm --filter @paperclipai/ui vitest run src/hooks/useStreamingChat.test.ts` | Wave 0 | pending | | 22-02-01 | 02 | 1 | AGENT-04, THEME-03 | unit | `pnpm --filter @paperclipai/ui vitest run src/components/ChatMessageIdentityBar.test.tsx` | Wave 0 | pending | | 22-03-01 | 03 | 2 | CHAT-08 | unit | `pnpm --filter @paperclipai/ui vitest run src/components/ChatAgentSelector.test.tsx` | Wave 0 | pending | | 22-04-01 | 04 | 2 | CHAT-10, CHAT-11 | unit | `pnpm --filter @paperclipai/ui vitest run src/components/ChatMessage.test.tsx` | Wave 0 | pending | | 22-05-01 | 05 | 2 | INPUT-05, INPUT-06 | unit | `pnpm --filter @paperclipai/ui vitest run src/components/ChatSlashCommandPopover.test.tsx` | Wave 0 | pending | | 22-06-01 | 06 | 3 | PERF-02, PERF-03 | unit+manual | `pnpm --filter @paperclipai/ui vitest run src/components/ChatMessageList.test.tsx` | Wave 0 | pending | *Status: pending / green / red / flaky* --- ## Wave 0 Requirements - [ ] `ui/src/hooks/useStreamingChat.test.ts` — covers CHAT-01, CHAT-12 streaming hook - [ ] `ui/src/components/ChatAgentSelector.test.tsx` — covers CHAT-08 agent selection - [ ] `ui/src/components/ChatMessage.test.tsx` — covers CHAT-10, CHAT-11 edit/retry - [ ] `ui/src/components/ChatSlashCommandPopover.test.tsx` — covers INPUT-05 slash commands - [ ] `ui/src/components/ChatMentionPopover.test.tsx` — covers INPUT-06 @mention - [ ] `ui/src/components/ChatMessageIdentityBar.test.tsx` — covers AGENT-04 identity - [ ] `ui/src/lib/agent-role-colors.test.ts` — covers THEME-03 agent colors - [ ] `ui/src/components/ChatMessageList.test.tsx` — covers PERF-03 virtualization --- ## Manual-Only Verifications | Behavior | Requirement | Why Manual | Test Instructions | |----------|-------------|------------|-------------------| | First token under 500ms | PERF-02 | Timing depends on LLM response | Open chat, send message, measure time to first token appearance | | Agent colors distinguishable across themes | THEME-03 | Visual distinction | Switch between all 3 themes, verify agent name colors are readable | | 1,000+ messages scroll without jank | PERF-03 | Performance testing | Load a conversation with 1,000+ messages, scroll rapidly | --- ## Validation Sign-Off - [ ] All tasks have `` 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 < 20s - [ ] `nyquist_compliant: true` set in frontmatter **Approval:** pending