From 5fc7000ef73dc1395ec3422e3a425e8373eb0884 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Mon, 16 Mar 2026 23:47:46 +0800 Subject: [PATCH] docs(06): add research and validation strategy --- .../06-code-consolidation/06-VALIDATION.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .planning/phases/06-code-consolidation/06-VALIDATION.md diff --git a/.planning/phases/06-code-consolidation/06-VALIDATION.md b/.planning/phases/06-code-consolidation/06-VALIDATION.md new file mode 100644 index 0000000..eccd191 --- /dev/null +++ b/.planning/phases/06-code-consolidation/06-VALIDATION.md @@ -0,0 +1,81 @@ +--- +phase: 6 +slug: code-consolidation +status: draft +nyquist_compliant: false +wave_0_complete: false +created: 2026-03-16 +--- + +# Phase 6 — Validation Strategy + +> Per-phase validation contract for feedback sampling during execution. + +--- + +## Test Infrastructure + +| Property | Value | +|----------|-------| +| **Framework** | pytest | +| **Config file** | pytest.ini (pythonpath = ., testpaths = tests) | +| **Quick run command** | `pytest tests/ -v --tb=short -x` | +| **Full suite command** | `pytest tests/ -v` | +| **Estimated runtime** | ~30 seconds | + +--- + +## Sampling Rate + +- **After every task commit:** Run `pytest tests/ -v --tb=short -x` +- **After every plan wave:** Run `pytest tests/ -v` +- **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 | +|---------|------|------|-------------|-----------|-------------------|-------------|--------| +| 06-01-01 | 01 | 1 | MET-01 | import | `python -c "from kb_workflow.metadata.bilibili_extractor import BilibiliExtractor"` | ❌ W0 | ⬜ pending | +| 06-01-02 | 01 | 1 | MET-02 | import | `python -c "from kb_workflow.metadata.zhihu_extractor import ZhihuPlaywrightExtractor"` | ❌ W0 | ⬜ pending | +| 06-01-03 | 01 | 1 | MET-05 | unit | `pytest tests/ -v --tb=short -x` | ✅ exists | ⬜ pending | +| 06-02-01 | 02 | 2 | PIP-01 | import | `python -c "from kb_workflow.pipeline import Pipeline"` | ❌ W0 | ⬜ pending | +| 06-02-02 | 02 | 2 | PIP-02 | unit | `pytest tests/test_pipeline/ tests/test_processors/ -v` | ✅ exists | ⬜ pending | +| 06-02-03 | 02 | 2 | PIP-04 | integration | `python kb-workflow/kb_workflow.py --help` | N/A | ⬜ pending | + +*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky* + +--- + +## Wave 0 Requirements + +- [ ] `tests/test_imports.py` — stubs for MET-01, MET-02, PIP-01 import verification +- [ ] Import test cases: + - `test_import_metadata_bilibili()`: 验证 bilibili_extractor 可导入 + - `test_import_metadata_zhihu()`: 验证 zhihu_extractor 可导入 + - `test_import_pipeline_core()`: 验证 pipeline 核心模块可导入 + - `test_import_pipeline_processors()`: 验证所有 processors 可导入 + - `test_import_pipeline_platforms()`: 验证所有 platforms 可导入 + +--- + +## Manual-Only Verifications + +| Behavior | Requirement | Why Manual | Test Instructions | +|----------|-------------|------------|-------------------| +| CLI 完整功能测试 | PIP-04 | 需要 B站/知乎 Cookie 环境 | `python kb-workflow/kb_workflow.py process "https://www.bilibili.com/video/BVxxx"` | + +--- + +## 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 < 30s +- [ ] `nyquist_compliant: true` set in frontmatter + +**Approval:** pending