This repository has been archived on 2026-08-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kb-skills/.planning/phases/01-foundation/01-VALIDATION.md
T
starmen1265 4ccb2be1ad fix(01): align validation paths with plans
Update VALIDATION.md test file paths to use tests/test_pipeline/
instead of tests/unit/ to match PLAN.md definitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:54:27 +08:00

82 lines
3.0 KiB
Markdown

---
phase: 01
slug: foundation
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-03-13
---
# Phase 1 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | pytest 7.x |
| **Config file** | pyproject.toml (Wave 0 creates) |
| **Quick run command** | `pytest tests/test_pipeline/ -q` |
| **Full suite command** | `pytest tests/ -v --cov=src` |
| **Estimated runtime** | ~15 seconds |
---
## Sampling Rate
- **After every task commit:** Run `pytest tests/test_pipeline/ -q`
- **After every plan wave:** Run `pytest tests/ -v --cov=src`
- **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 |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 01-01-01 | 01 | 1 | PIPE-02, REL-01 | unit | `pytest tests/test_pipeline/test_state.py -v` | ❌ W0 | ⬜ pending |
| 01-01-02 | 01 | 1 | REL-02 | unit | `pytest tests/test_pipeline/test_state.py::test_atomic_write -v` | ❌ W0 | ⬜ pending |
| 01-02-01 | 02 | 1 | PIPE-03, VAL-01 | unit | `pytest tests/test_pipeline/test_schemas.py -v` | ❌ W0 | ⬜ pending |
| 01-02-02 | 02 | 1 | PIPE-01 | unit | `pytest tests/test_pipeline/test_schemas.py::test_step_input_output -v` | ❌ W0 | ⬜ pending |
| 01-03-01 | 03 | 1 | REL-03, MNT-03 | unit | `pytest tests/test_pipeline/test_errors.py -v` | ❌ W0 | ⬜ pending |
| 01-03-02 | 03 | 1 | MNT-02 | unit | `pytest tests/test_pipeline/test_config.py -v` | ❌ W0 | ⬜ pending |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
---
## Wave 0 Requirements
- [ ] `tests/test_pipeline/test_state.py` — stubs for PIPE-02, REL-01, REL-02
- [ ] `tests/test_pipeline/test_schemas.py` — stubs for PIPE-01, PIPE-03, VAL-01
- [ ] `tests/test_pipeline/test_errors.py` — stubs for REL-03, MNT-03
- [ ] `tests/test_pipeline/test_config.py` — stubs for MNT-02
- [ ] `tests/test_pipeline/conftest.py` — shared fixtures (temp dirs, mock env)
- [ ] `pytest` + `pytest-cov` — if no framework detected
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| ~/.kb_env 验证失败时退出 | MNT-02 | 需要模拟真实环境 | 1. 移除必需变量 2. 运行 kb --help 3. 确认非零退出码和错误提示 |
| 原子写入崩溃恢复 | REL-02 | 需要模拟进程终止 | 1. 在写入中途 kill 2. 检查 .bak 文件存在 3. 确认可恢复 |
---
## 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