| name | goal-manager |
| description | 在当前 Nexus round 中创建、读取、明确纠正、审计、完成或阻塞 durable Goal。只处理用户或系统明确的跨轮目标生命周期;普通任务、提醒和执行图责任分别使用直接执行、Automation 或 Execution。 |
Goal Manager
Goal 是跨物理 round 持续追求的服务端目标,不是普通聊天、Task、WorkGraph 或 Automation 的别名。Objective 说明最终要实现什么;Execution 另行记录责任如何交付。
入口与命令协议
-
先通过 nexus.command 读取当前 Goal:
{"domain":"goal","action":"inspect"}
不要探测命令路径、临时文件或环境变量,不要使用其他管理入口或 /goal 文本代替 command。
-
读取最新 Goal/objective revision 与 completion criteria 后选择 operation;mutation 前读取 fresh exact contract:
{"domain":"goal","action":"contract","operation":"<operation>"}
完整遵守返回的 contract。
-
业务输入是 additionalProperties=false 的 closed object,直接放在工具的 input 字段中,只写 fresh schema 暴露的业务字段。不要提交 Goal/owner/Agent/Session/Room/round identity、authority、revision、receipt 或其他隐藏字段。
-
相同语义重试复用 request ID;operation、目标或输入变化时生成新 ID。只有顶层 is_error=false 且 data.outcome=applied 表示状态已改变;nextAction 只给 domain-qualified 恢复方向,不携带新 authority,继续前仍读取目标 domain 的 current state 与 exact contract。
按当前动作读取参考
只读取当前动作需要的参考;operation 字段、枚举和长度始终以 fresh exact contract 为准。
暂停与恢复
当 current Goal 为 paused 时,恢复动作由用户执行。请明确告知用户:在当前对话输入框上方的 Goal 状态栏中,点击右侧的 ▶「继续」按钮。
用户点击「继续」后,Nexus 会自动重新调度该 Goal,无需再发一条消息。新的 Goal continuation 负责继续审计和收尾,并在满足完成条件后标记 Goal 完成。
不变量
- 创建前 objective 必须完整、具体、execution-ready;仍缺少会实质改变结果的信息时先取得最少必要输入,不创建占位 Goal。
- current Goal 存在时不创建第二个。用户明确纠正 objective 时 retarget 同一 Goal,保留 identity 与累计用量。
token_budget 只在用户明确给出正数预算时设置;暂停、恢复、预算和用量限制属于用户或系统控制面。
- Plan Mode 中 Goal mutation 只做 validation,不改变 Goal、Execution、Plan 或 cancellation state;需要持久化时离开 Plan Mode,重新读取 current state 与 exact contract 后再 invoke。
update_goal 只标记 complete|blocked,不创建、retarget、暂停或改预算。complete 只在 objective 真实满足且没有 required work 时使用;blocked 必须满足连续三次同一 blocker 的模型行为门槛。
- 提醒、定时与周期任务使用 Automation;WorkGraph 责任使用
execution-orchestrator。
goal/audit_objective_alignment 是 confirmed Goal+WorkGraph 的完成审计;execution/audit_execution_alignment 只是非终态 Execution Gate,不能互换。