docs(asl): Upgrade Tool 3 architecture from Fan-out to Scatter+Aggregator (v2.0)

Architecture transformation:
- Replace Fan-out (Manager->Child->Last Child Wins) with Scatter+Aggregator pattern
- API layer directly dispatches N independent jobs (no Manager)
- Worker only writes its own Result row, never touches Task table (zero row-lock)
- Aggregator polls groupBy for completion + zombie cleanup (replaces Sweeper)
- Reduce red lines from 13 to 9, eliminate distributed complexity

Documents updated (10 files):
- 08-Tool3 main architecture doc: v2.0 rewrite (schema, Task 2.3/2.4, red lines, risks)
- 08d-Code patterns: rewrite sections 4.1-4.6 (API dispatch, SingleWorker, Aggregator)
- 08a-M1 sprint: rewrite M1-3 core (Worker+Aggregator), red lines, acceptance criteria
- 08b-M2 sprint: simplify SSE (NOTIFY/LISTEN downgraded to P2 optional)
- 08c-M3 sprint: milestone table wording update
- New: Scatter+Polling Aggregator pattern guide v1.1 (Level 2 cookbook)
- New: V2.0 architecture deep review and gap-fix report
- Updated: ASL module status, system status, capability layer index

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-24 22:11:09 +08:00
parent 85fda830c2
commit 371fa53956
13 changed files with 1163 additions and 597 deletions

View File

@@ -31,6 +31,7 @@
| **日志服务** | `common/logging/` | ✅ | 结构化日志Pino |
| **缓存服务** | `common/cache/` | ✅ | 缓存抽象层(内存/Redis/Postgres |
| **异步任务** | `common/jobs/` | ✅ | 队列服务Memory/PgBoss |
| **🆕批量任务模式** | 设计模式指南 | ✅ | 散装派发 + 轮询收口Level 2 |
| **LLM网关** | `common/llm/` | ✅ | 统一LLM适配器5个模型 |
| **流式响应** | `common/streaming/` | ✅ 🆕 | OpenAI Compatible流式输出 |
| **🎉RAG引擎** | `common/rag/` | ✅ 🆕 | **完整实现pgvector+DeepSeek+Rerank** |