Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2.3 KiB
2.3 KiB
H0 Ownership Matrix 与架构决策
1. 目标
先把 Hermes-first 的 ownership matrix、边界和成功标准写清楚,防止后续开发过程中又回到“先写 adapter,最后发现架构中心没变”。
2. 核心判断
这轮改造的目标不是:
- 给 Jarvis 再挂一个更强的 runtime adapter
而是:
- 让 Hermes 成为默认 execution core
- 让 Jarvis 退回 product shell
3. Ownership Matrix
3.1 Hermes Core
Hermes 应负责:
- session lifecycle
- runtime resume / recovery
- execution loop
- chunk streaming
- runtime-internal tool orchestration
- runtime health / restart metadata
3.2 Jarvis Product Shell
Jarvis 应负责:
- conversation / message 持久化
- user / auth / permission 边界
- memory context assembly
- retrospective / knowledge 注入
- skill shortlist
- task graph / parallel worthiness 分析
- product continuity
- SSE contract
- observability / attachments / metrics
- rollout / fallback / rollback policy
3.3 Shared Contracts
需要显式建模的共享边界:
- runtime prepared context
- runtime event model
- continuity envelope
- session health metadata
- rollout policy metadata
4. 关键边界原则
- 不把 Hermes session id 直接当成完整 continuity。
- 不让前端直接依赖 Hermes-native event。
- 不把 memory / skill / task graph 直接挪进 Hermes 黑盒。
- 不让
AgentService继续充当 runtime 本体。 - 不把 runtime 选择长期暴露为普通用户负担。
5. 目标文件锚点
Backend
backend/app/services/agent_service.pybackend/app/services/agent_runtime/base.pybackend/app/services/agent_runtime/hermes_runtime.pybackend/app/services/agent_runtime/hermes_session_manager.pybackend/app/models/conversation.py
Frontend
frontend/src/api/conversation.tsfrontend/src/pages/chat/composables/useChatView.tsfrontend/src/stores/conversation.ts
6. 成功标准
- Hermes-first 的 ownership matrix 被写清楚
- 保留 Jarvis product shell 的范围被写清楚
- fallback / rollback 必须存在这一点被写清楚
- 后续 phase 的顺序依赖被写清楚
7. 本阶段结论
只有先把 ownership 定义清楚,后面 H1-H7 才不会演变成“代码改了很多,但架构中心没有变”。