Lime AgentRuntime Profile 路线图
状态:implementation-audited 更新时间:2026-05-17 目标:把 Lime 已有的运行时、任务、模型路由、权限、证据、GUI read model 与 AgentRuntime 标准收敛成一条可执行、可测试、可回放的 current 主链。 上游标准草案:
/Users/coso/Documents/dev/ai/limecloud/agentruntime,当前对齐Agent Runtime v0.4.0与Lime AgentRuntime Profile。
依赖文档:
internal/aiprompts/query-loop.mdinternal/aiprompts/task-agent-taxonomy.mdinternal/aiprompts/state-history-telemetry.mdinternal/aiprompts/harness-engine-governance.mdinternal/roadmap/task/README.mdinternal/roadmap/agentui/README.mdinternal/roadmap/reliability/README.md
配套文档:
- ./prd.md:背景、目标、收益、用户故事、范围、验收口径
- ./architecture.md:分层、事实源、接口与 profile 映射
- ./adjacent-protocols.md:
agentcontext、agentevidence、agentpolicy、agentui的 owner 边界与连接合同 - ../plugin/README.md:Codex 标准与原生格式、共享插件 owner 与旧私有 runtime 删除边界
- ./agent-unfinished-session-recovery-plan.md:未完成 Agent 会话自动检测、首页恢复与侧栏 / 输入框异步状态计划
- ./diagrams.md:架构图、流程图、时序图
- ./implementation-plan.md:分阶段落地计划、风险和测试策略
- ./test-cases.md:结构测试、契约测试、回放测试、证据一致性和 GUI smoke 用例
- ./completion-audit.md:实现完成度、证据路径、弱项和后续收口口径
1. 这套路线图回答什么
Lime 当前最大问题不是功能不足,而是功能已经很多,却缺少统一运行事实源,导致:
- 任务、会话、子代理、自动化 job、模型路由、证据导出各自有局部真相。
- GUI、review、analysis、dashboard 会二次拼状态。
- 测试只能验证局部函数,难以证明一次 agent turn 从提交到证据导出的完整闭环。
- 标准协议很多,但没有一条强制绑定 Lime current 主链的 profile。
本路线图回答:
Lime 如何用 AgentRuntime Profile 把 Objective / Session / Thread / Turn / Task / Tool / Action / Evidence 收敛成一条主链,并让 GUI、review、replay、analysis 只消费这条主链。
2. 固定结论
-
AgentRuntime 是运行事实主链,不是第十个平行协议。
agentcontext、agentpolicy、agentevidence、agentui、agentartifact、agenttool都是相邻 owner;AgentRuntime 负责把它们串成可恢复、可审计的执行事实,边界见 ./adjacent-protocols.md。 -
Lime 先实现 Lime Profile,不直接追完整公开标准。 公开 AgentRuntime 保持跨产品通用;Lime Profile 收紧 required ids、event families、snapshot、fixtures 和验收场景。
-
GUI 只能投影 runtime facts。 Workspace、Harness、review、analysis、dashboard 不再重新判断 task status、routing state、permission state、known gaps 或 evidence summary。
-
Evidence pack 是运行事实导出,不是后处理报表。 replay、review、analysis handoff 与 UI diagnostics 必须和 evidence pack 消费同一组 runtime facts。
-
落地顺序先主链,再扩展面。 先保证 submit turn -> runtime events -> thread read -> evidence pack -> UI projection 的闭环,再扩展子代理、job、remote channel、历史修复等高级能力。
-
全球本地化不进入运行事实源。
type/status/taskKind/source/failureCategory/reasonCode等 profile 字段必须是稳定协议值,不能按语言环境变化;用户可见标题、说明、错误提示、按钮和空态只能在 AgentUI / GUI projection 层通过 key-based i18n 渲染。Runtime 可以携带message作为诊断事实,但不能把中文或英文展示文案当成状态机、测试断言或跨模块 join 条件。 -
Chat、Claw、Plugin、Automation 都只是 runtime surface。 完整 AI 能力只能向 RuntimeCore、Skills、MCP、Tools 与 canonical Item 主链收敛。Plugin 通过 Codex 支持的标准/原生包和组件快照 进入这些 current owner;旧
lime.agent/lime.workflow私有 facade 与plugin_runtime_*不得恢复,详见 ../plugin/README.md。 -
能力复用必须回到 current catalog。 Chat、Plugin 与 Automation 只能消费 Skills、MCP、Tool Runtime 和 App Server 投影,不为单一 surface 复制工具实现、权限系统或私有 capability catalog。
3. 固定主链
后续所有实现必须收敛到下面这条链:
Objective / User Input
-> Session
-> Thread
-> Turn
-> Step / Item
-> ToolCall / Action / Process / Subagent
-> RuntimeEvent
-> Snapshot / ThreadReadModel / TaskSnapshot
-> EvidencePack / Replay / Review / UI projection
这条链意味着:
Session / Thread / Turn负责执行上下文。Task / Run / Attempt负责目标工作与重试历史。Step / Item负责有序运行项。ToolCall / Action / Process / Subagent负责可审计副作用与等待点。RuntimeEvent是 canonical event stream。Snapshot / ThreadReadModel是 GUI 和恢复入口。EvidencePack是 replay / review / analysis 的共同事实源。
4. current / compat / deprecated / dead 分类
current
后续继续强化的主路径:
agent_runtime_submit_turn -> runtime_turn -> runtime_queue -> stream_reply_once。AgentRuntimeThreadReadModel与 current runtime event 链。agent_runtime_export_evidence_pack及其 replay / analysis / review 派生物。TaskProfile / RoutingDecision / LimitState已接入的模型路由事实。- Workspace / Harness GUI 对 runtime read model 的只读投影。
- Plugin Runtime Surface 作为新调用面,委托 AgentRuntime 主链执行 App-scoped task;
PluginRuntimePage的 Host Bridgelime.agent已接入plugin_runtime_*facade,并支持 App 内响应 ask / elicitation / tool confirmation。Host Bridge 已支持 task subscription first-cut,通过capability:subscribe / capability:event把 Host 侧getTask轮询结果推回 App iframe;订阅时也会监听plugin_runtime:{appId}:{taskId}Tauri / DevBridge runtime event,把后端 runtime event 直接转发给 App。AgentRuntime profile event 生成处现在会在同名 event bus 主动追加plugin_runtime:profileProjectionpayload,把turn.* / tool.* / action.* / routing.* / model.*转成 App canonicaltaskEvents;高价值RuntimeAgentEvent也会追加plugin_runtime:runtimeEventProjection,其中 artifact 事件可直接携带workspacePatch / contentFactoryWorkspacePatch,runtime event / timeline metadata 中显式存在的evidenceRefs / verificationOutcomes也会被主动投影为evidence:recorded / evidence:verified;Evidence Pack / analysis / review / save review 导出成功后也会按 Plugin scope 主动 emitplugin_runtime:harnessExportProjection,把导出 root、制品和 completion audit completed 事实投影为 App task events;成功终态如果暂未带 workspace patch,则继续短轮询 replay 最终 artifact。AgentRuntimeCapabilityHost也会从threadRead.artifacts补投artifact:createdpayload。Host dispatcher 已补 high-level manifest capability gate,未声明lime.agent等 Host capability 会被拒绝;Claw capability hint 还会校验 manifesttoolRefs[].capabilitiesallowlist,避免 App 只声明一个 catalog key 后任意启动 Claw 能力。内容工厂实际 App 已把主生产结果和确认链结果写回lime.storage / lime.artifacts / lime.evidence;AgentRuntime 原生FileArtifact已投影为artifact:created,runtime task state 也已通过 Plugin storage 做跨刷新恢复第一刀;内容工厂 task 已在 runtime message 与harness.plugin_runtime_output_contract写明contentFactoryWorkspacePatch / workspacePatchproducer contract,真实宿主 iframe 已验证最终 patch 可物化到 App 页面;多个 capability hint 会被投影到harness.plugin_runtime_capability_workflow,复合 output contract 任务保持metadata_only,不强行启动单一 Claw Skill。 - Claw Capability Catalog 作为已实现
@能力的复用索引,后续供 Chat、Plugin、Automation 共用。
compat
允许短期存在但只能委托的路径:
- 旧字段映射为 AgentRuntime profile ids。
- 旧 GUI 状态卡读取新 read model 后继续展示。
- 旧 evidence/replay 命令通过
agent_runtime_export_*导出。 plugin_cmd.rs继续负责 package / installed state / UI runtime / scoped model env 注入,但不能扩展为完整 AgentRuntime owner。- 前端
CapabilityHost/WorkflowRuntimeHost可暂时作为 mock 或 adapter,但生产 AI 任务必须迁向后端 Plugin Runtime Surface。
退出条件:一旦调用方能直接读取 profile read model 或 evidence pack,就删除 compat 映射。
deprecated
禁止继续扩展的方向:
- GUI 自己拼 task status / route status / known gaps。
- analysis/review 各自重建 observability summary。
- 子代理、automation job、task center 各自维护完成真相。
- 只靠文本消息推断 tool success、permission denial 或 completion。
- Plugin 直接使用模型 token / OpenAI-compatible API 完成主流程。
- Plugin 通过嵌入通用 Chat 让用户手动复制结果。
- 为内容工厂等垂直 App 增加专用 Agent Tauri command。
dead
可以直接否定的方向:
agentruntime_ui_state作为 UI 专用事实源。objective_runtime作为第四类 runtime taxonomy。evidence_summary_builder_v2作为 evidence pack 平行导出链。- 没有
session/thread/turn关联键的 request telemetry 被当作会话级证据。 - 新建第二套
plugin_agent_runtime执行事实源。 - 为 Plugin 复制 Claw
*_skill_launch.rs或单独工具权限系统。
5. 先读顺序
- ./prd.md
- ./architecture.md
- ./diagrams.md
- ./adjacent-protocols.md
- ../plugin/README.md
- ./implementation-plan.md
- ./test-cases.md
internal/aiprompts/harness-engine-governance.mdinternal/roadmap/task/README.md
6. 完成判定
本路线图完成时,Lime 至少应该能做到:
- 任意 agent turn 都能导出符合 Lime AgentRuntime Profile 的核心事件和 thread read snapshot。
- GUI、evidence、review、replay、analysis 读取同一组 runtime facts。
- tool approval、model routing、task retry、evidence export 都有 fixture 或结构测试覆盖。
- 旧旁路状态源被分类为
compat / deprecated / dead,并有退出条件。 - 主路径 GUI 冒烟能证明用户真实看到的是 profile read model 投影。
当前完成审计见 ./completion-audit.md。审计口径是 current MVP 工程闭环完成;Evidence service 已完成 request telemetry、profile projection、completion audit、modality contract、auxiliary runtime、verification / artifact validator、observability / signal coverage、known gaps 与 pack output renderer 拆分。Evidence summary.md 已支持 zh-CN / zh-TW / en-US / ja-JP / ko-KR,Replay / Analysis / Review Markdown 已接入 locale-aware presentation copy。完整产品化仍需继续补细粒度正文 copy 与更强 GUI E2E。