|
| 1 | +[TA-P15-004] platform architecture check run |
| 2 | +generated_at=2026-03-03T15:32:06Z |
| 3 | +doc=docs/implementation/phase-15/ta-p15-004-webapp-multi-platform-architecture-2026-03-03.md |
| 4 | + |
| 5 | +[check] section headers |
| 6 | +8:## 1. 目标 |
| 7 | +12:## 2. 范围与约束 |
| 8 | +20:## 3. 目标平台矩阵(冻结版) |
| 9 | +29:## 4. 分层架构(Shared Core First) |
| 10 | +31:## 4.1 分层定义 |
| 11 | +40:## 4.2 依赖方向(必须遵守) |
| 12 | +50:## 4.3 推荐包结构(目录冻结建议) |
| 13 | +58:## 5. 平台适配边界(Adapter Contract) |
| 14 | +60:## 5.1 必需适配接口 |
| 15 | +71:## 5.2 能力降级规则 |
| 16 | +77:## 6. API 与错误契约统一策略 |
| 17 | +87:## 7. 身份与安全一致性 |
| 18 | +94:## 8. 运行时与发布拓扑 |
| 19 | +96:## 8.1 运行时策略 |
| 20 | +102:## 8.2 发布策略 |
| 21 | +108:## 9. 从当前 Web 的迁移路径 |
| 22 | +116:## 10. TA-P15-004 验收清单 |
| 23 | +125:## 11. 证据 |
| 24 | +133:## 12. 结论 |
| 25 | + |
| 26 | +[check] constraints and architecture keywords |
| 27 | +1:# TA-P15-004 Web App 多平台架构与共享核心层冻结(2026-03-03) |
| 28 | +10:冻结 TelAgent 客户端在 Web/PWA/Desktop/Mobile 四端的统一架构,明确共享核心层职责、平台适配边界、依赖方向和演进路径,为 `TA-P15-005`(离线同步与冲突策略)提供稳定骨架。 |
| 29 | +14:1. 范围覆盖:Web、PWA、Desktop、Mobile 的架构划分与能力矩阵。 |
| 30 | +15:2. 协议边界:客户端仅消费 `/api/v1/*`。 |
| 31 | +16:3. 身份边界:仅支持 `did:claw:*`;DID hash 统一 `keccak256(utf8(did))`(复用共享协议工具实现)。 |
| 32 | +17:4. 错误边界:统一 RFC7807(`application/problem+json`)解析模型。 |
| 33 | +24:| Web | 主交付端 | 会话/消息/群组/身份/设置全链路 | 浏览器环境、最低部署成本 | |
| 34 | +25:| PWA | Web 增强端 | 基于 Web 增量启用 | 安装、缓存、通知、弱网可用 | |
| 35 | +26:| Desktop | 重度用户端 | 在 Web 主流程之上增强本地能力 | 本地文件、托盘、后台常驻 | |
| 36 | +27:| Mobile | 移动触达端 | 功能等价优先,交互适配其次 | 推送、前后台切换、弱网恢复 | |
| 37 | +36:4. `core-sdk`(API client + DTO + 错误模型) |
| 38 | +37:5. `sync-engine`(离线队列、重放、冲突解决,下一任务细化) |
| 39 | +38:6. `platform-adapter`(Web/PWA/Desktop/Mobile 差异封装) |
| 40 | +42:`app-shell -> ui-kit -> domain -> core-sdk -> platform-adapter` |
| 41 | +48:3. 平台特有能力必须通过 `platform-adapter` 接口注入。 |
| 42 | +52:1. `packages/web`:Web 壳层与页面编排。 |
| 43 | +53:2. `packages/client-core`:`core-sdk + domain + shared types`。 |
| 44 | +64:| `StorageAdapter` | 键值与对象存储读写 | Web=IndexedDB, Desktop=local db, Mobile=secure storage | |
| 45 | +66:| `NotificationAdapter` | 本地通知与权限状态 | Web Notification / Desktop / Mobile Push | |
| 46 | +79:1. API base 路径只允许 `/api/v1/*`。 |
| 47 | +80:2. `core-sdk` 统一实现: |
| 48 | +83: - RFC7807 错误解码(`type/title/status/detail/code/instance`)。 |
| 49 | +89:1. DID 输入校验统一为 `did:claw:*`(共享校验器)。 |
| 50 | +90:2. DID hash 统一通过共享函数计算:`keccak256(utf8(did))`。 |
| 51 | +98:1. Web/PWA 共用主代码线,通过构建标识启用 Service Worker 与离线能力。 |
| 52 | +99:2. Desktop 通过宿主桥接 `platform-adapter`,禁止业务层直连宿主 API。 |
| 53 | +100:3. Mobile 保持 domain/core 同构,交互层按移动端范式单独适配。 |
| 54 | +105:2. 版本相容规则:`platform shell` 只能依赖当前或向后兼容的 `core-sdk`。 |
| 55 | +108:## 9. 从当前 Web 的迁移路径 |
| 56 | +111:2. 将 API 调用与错误处理下沉到 `core-sdk`。 |
| 57 | +113:4. 在不改变现有用户路径前提下引入 `platform-adapter` 抽象。 |
| 58 | +114:5. 为 `TA-P15-005` 预留 `sync-engine` 接口(队列、幂等、冲突回调)。 |
| 59 | +118:- [x] Web/PWA/Desktop/Mobile 目标矩阵冻结。 |
| 60 | +120:- [x] API、DID、DID hash、RFC7807 约束写入架构层。 |
| 61 | +122:- [x] Web build/test 任务级证据归档。 |
| 62 | +128:- Web 构建日志:`docs/implementation/phase-15/logs/2026-03-03-p15-web-build-ta-p15-004.txt` |
| 63 | +129:- Web 测试日志:`docs/implementation/phase-15/logs/2026-03-03-p15-web-test-ta-p15-004.txt` |
| 64 | + |
| 65 | +[check] web build/test outputs |
| 66 | + |
| 67 | +> @telagent/web@0.1.0 build /Users/xiasenhai/Workspace/OpenClaw/telagent/packages/web |
| 68 | +> node scripts/build.mjs |
| 69 | + |
| 70 | +web assets copied to dist |
| 71 | +--- |
| 72 | + |
| 73 | +> @telagent/web@0.1.0 test /Users/xiasenhai/Workspace/OpenClaw/telagent/packages/web |
| 74 | +> echo 'no tests for web package' |
| 75 | + |
| 76 | +no tests for web package |
| 77 | + |
| 78 | +[check] tracker rows |
| 79 | +docs/implementation/telagent-v1-iteration-board.md:231:- 下一批 Ready:执行 `TA-P15-005`(离线同步、冲突策略与性能预算)。 |
| 80 | +docs/implementation/telagent-v1-iteration-board.md:430:- `TA-P15-004`:DONE(多平台架构与共享核心层冻结,见 `docs/implementation/phase-15/ta-p15-004-webapp-multi-platform-architecture-2026-03-03.md` 与 `docs/implementation/phase-15/manifests/2026-03-03-p15-platform-architecture-check.json`)。 |
| 81 | +docs/implementation/telagent-v1-iteration-board.md:431:- `TA-P15-005` ~ `TA-P15-007`:TODO(进入离线同步、质量门禁与 Gate 收口阶段)。 |
| 82 | +docs/implementation/telagent-v1-iteration-board.md:432:- 阶段状态:Phase 15 执行中(IN_PROGRESS),下一任务 `TA-P15-005`。 |
| 83 | +docs/implementation/telagent-v1-task-breakdown.md:10:- **状态字段**:`TODO | IN_PROGRESS | BLOCKED | DONE`。 |
| 84 | +docs/implementation/telagent-v1-task-breakdown.md:157:| TA-P15-004 | Phase 15 | 多平台架构(Web/PWA/Desktop/Mobile) | FE + DX + BE | 2 | TA-P15-001 | platform architecture doc | 共享核心层与平台适配边界冻结 | DONE | |
| 85 | +docs/implementation/telagent-v1-task-breakdown.md:158:| TA-P15-005 | Phase 15 | 离线同步与冲突解决策略 | FE + BE + QA | 2 | TA-P15-004 | offline-sync strategy + test plan | 离线队列、重放、冲突策略可验证 | TODO | |
| 86 | +docs/implementation/telagent-v1-task-breakdown.md:159:| TA-P15-006 | Phase 15 | 客户端质量体系与发布门禁 | QA + FE + SRE | 1.5 | TA-P15-002, TA-P15-003, TA-P15-004, TA-P15-005 | quality gates + release checklist | 单测/E2E/性能/崩溃门禁成体系 | TODO | |
| 87 | +docs/implementation/telagent-v1-task-breakdown.md:370:| TA-P15-003 | DONE | `docs/implementation/phase-15/ta-p15-003-webapp-design-system-and-component-spec-2026-03-03.md`, `docs/implementation/phase-15/README.md`, `docs/implementation/phase-15/logs/2026-03-03-p15-web-build.txt`, `docs/implementation/phase-15/logs/2026-03-03-p15-web-test.txt`, `docs/implementation/phase-15/logs/2026-03-03-p15-design-system-check-run.txt`, `docs/implementation/phase-15/manifests/2026-03-03-p15-design-system-check.json` | 无 | 进入 `TA-P15-004`(多平台架构与共享核心层设计) | |
| 88 | +docs/implementation/telagent-v1-task-breakdown.md:371:| TA-P15-004 | DONE | `docs/implementation/phase-15/ta-p15-004-webapp-multi-platform-architecture-2026-03-03.md`, `docs/implementation/phase-15/README.md`, `docs/implementation/phase-15/logs/2026-03-03-p15-web-build-ta-p15-004.txt`, `docs/implementation/phase-15/logs/2026-03-03-p15-web-test-ta-p15-004.txt`, `docs/implementation/phase-15/logs/2026-03-03-p15-platform-architecture-check-run.txt`, `docs/implementation/phase-15/manifests/2026-03-03-p15-platform-architecture-check.json` | 无 | 进入 `TA-P15-005`(离线同步、冲突策略与性能预算) | |
| 89 | +docs/implementation/telagent-v1-task-breakdown.md:372:| TA-P15-005 | TODO | `docs/implementation/phase-15/README.md` | 无 | 冻结离线同步、冲突解决与性能预算 | |
| 90 | +docs/implementation/phase-15/README.md:4:- 状态:IN_PROGRESS(`TA-P15-004` 已完成,推进 `TA-P15-005`) |
| 91 | +docs/implementation/phase-15/README.md:22:| TA-P15-004 | DONE | 多平台架构与共享核心层设计 | |
| 92 | +docs/implementation/phase-15/README.md:23:| TA-P15-005 | TODO | 离线同步、冲突策略与性能预算 | |
| 93 | + |
| 94 | +[result] PASS |
0 commit comments