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>
架构实施
文档定位: 架构演进、技术改造、工程实践
适用范围: 技术架构师、技术负责人
📋 目录结构
09-架构实施/
├── 02-数据库连接配置.md # ✅ Schema隔离的数据库配置
├── migration-scripts/ # ⏳ Schema迁移SQL脚本(Week 1创建)
├── 01-Monorepo架构设计/ # ⏳ Monorepo转换方案
├── 02-产品打包方案/ # ⏳ 独立产品打包流程
└── 03-微服务拆分/ # ⏳ 微服务拆分策略
🎯 核心内容
1. Monorepo架构设计
- Monorepo总体设计
- 包管理策略(pnpm workspaces)
- 代码共享与复用
- 构建和部署
2. 产品打包方案
- 独立产品打包流程
- 依赖管理
- 构建脚本
- 版本管理
3. 微服务拆分
- 拆分策略和时机
- 服务间通信
- API网关配置
- 数据迁移
📅 实施计划
阶段一:模块化单体(当前)
- 严格代码隔离
- Schema隔离(逻辑)
- 模块化设计
阶段二:首次拆分(6-18个月)
- Monorepo转换
- Schema物理隔离
- 拆分独立系统(RVW)
- 引入API网关
阶段三:全面微服务(18个月+)
- 所有模块独立部署
- K8s编排
- 服务网格
📚 快速导航
当前实施中(Week 1)
未来实施
- Monorepo架构设计 - ⏳ 待规划
- 产品打包方案 - ⏳ 待规划
- 微服务拆分 - ⏳ 待规划
🔗 相关文档
最后更新: 2025-11-06
维护人: 技术架构师