Update STATUS.md with search module results and lessons learned

Added V4 validation results, search architecture diagram,
trafilatura timeout and SO 403 pitfalls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Val-sss
2026-04-26 19:56:30 +08:00
parent 6489c1c8f7
commit e8fb2c853e

View File

@@ -6,10 +6,9 @@
---
## 当前状态:MVP 流水线验证通过
## 当前状态:搜索模块已完成
端到端流水线 Gate→Locator→Generator→Verifier→Memory 已跑通。
gemma3:4b 用 5.7s 修复了测试项目的除零 bug5/5 测试通过,记录写入 KAIWU.md。
MVP 流水线 + 6 步搜索增强全部跑通。
---
@@ -20,7 +19,21 @@ gemma3:4b 用 5.7s 修复了测试项目的除零 bug5/5 测试通过,记
| V1 Gate JSON稳定性 | 100% 解析成功率67% 类型准确率 | gemma3:4b不需要 grammar 约束 |
| V2 OpenHands集成 | 跳过,走 FLEX-1 自实现 | ToolExecutor 5个工具已完成 |
| V3 Locator精度 | 文件级 90%,函数级 20% | 函数级已加 few-shot 优化,待更大模型验证 |
| E2E 端到端 | 通过 | gemma3:4b5.7s5/5 测试 |
| V4 搜索模块 | 意图4/4, DDG 4/4, Fetch 3/4, 压缩4/4 | trafilatura+bs4, 耗时略超15s(LLM瓶颈) |
---
## 搜索模块架构2026-04-26 追加)
```
SearchAugmentorExpert.search(ctx)
① IntentClassifier — 纯关键词毫秒级github/arxiv/pypi/bug/general
② QueryGenerator — 一次LLM调用2-3条英文query
③ DuckDuckGoSearcher — bs4解析HTML零API key
④ QualityFilter — 域名黑白名单最多3个URL
⑤ ContentFetcher — trafilatura(降级httpx)每页≤800字
⑥ ContextCompressor — 一次LLM调用≤400字摘要
```
---
@@ -63,8 +76,15 @@ kaiwu/
│ ├── locator.py # 文件→函数 两阶段定位
│ ├── generator.py # 从文件读originalLLM只生成modified
│ ├── verifier.py # 语法检查 + pytest 验证
│ ├── search_augmentor.py # DuckDuckGo搜索 + LLM摘要
│ ├── search_augmentor.py # 6步搜索流水线编排
│ └── office_handler.py # MVP stub
├── search/
│ ├── intent_classifier.py # 纯关键词意图分类
│ ├── query_generator.py # LLM生成英文query
│ ├── duckduckgo.py # DDG HTML scraper (bs4)
│ ├── quality_filter.py # 域名黑白名单
│ ├── content_fetcher.py # trafilatura/httpx正文提取
│ └── context_compressor.py# LLM压缩摘要
├── llm/llama_backend.py # llama.cpp + Ollama 双后端
├── memory/kaiwu_md.py # KAIWU.md 项目记忆
├── tools/executor.py # read/write/bash/list/git 工具层
@@ -125,14 +145,29 @@ kaiwu/
**影响**:不影响 MVPoffice 是 stub但换更大模型后需要重新验证。
**教训**Gate 的分类准确率直接依赖模型能力小模型适合粗粒度分类3-4 类),细粒度需要更大模型。
### 8. trafilatura.fetch_url 没有超时控制
**现象**V4 验证每个 case 耗时 30-120s远超 15s 红线。
**根因**`trafilatura.fetch_url(url)` 内部用 urllib默认无超时遇到慢站点会阻塞很久。
**修复**:不用 `trafilatura.fetch_url`,改为 `httpx.get(url, timeout=5.0)` 自己下载 HTML再传给 `trafilatura.extract()` 做正文提取。
**教训**:第三方库的网络请求一定要自己控制超时,不要信任库的默认值。
### 9. StackOverflow 403 拒绝爬虫
**现象**V4 验证 bug 类 case fetch 全部失败。
**根因**StackOverflow 对非浏览器 User-Agent 返回 403。
**影响**MVP 可接受snippet 兜底),后续可加 cloudscraper 或更真实的 UA。
**教训**高质量源不一定能爬到QualityFilter 的白名单排序不等于能 fetch 成功。
---
## 下一步计划
- [x] git init + 首次提交
- [x] 搜索模块 6 步流水线
- [ ] 拉 qwen3-8b 跑完整验证,确认更大模型的提升幅度
- [ ] 函数级定位准确率优化AST 辅助提取 + 更好的 prompt
- [ ] CLI 交互式模式(类似 CC 的 REPL
- [ ] 多文件修改的端到端验证
- [ ] codegen 流水线验证(纯新代码生成)
- [ ] Windows 兼容性完善(路径分隔符、编码等)
- [ ] git init + 首次提交