Repository navigation
fix(planning): keep plans lightweight while preserving first-delivery quality - #6986
huangruiteng wants to merge 1 commit into
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max
动机
使用 /loopx 或 todo plan 开始任务的 Agent,需要明确下一步及如何验证,而无需先穷尽尚不确定的后续工作。
例如修复一个尚未定位的 API 故障,原提示仅说最小充分规划;新提示明确先安排复现与决定性验证,再依据结果重规划后续修复,同时保留首版交付质量要求。
本次已验证两个入口在普通和细粒度模式送达新指令;质量要求、已有 Todo 复用、读回、配额与权限限制保持原有语义。 本次只判断规划指令修正,不声称模型已减少规划时间或提高任务质量,也不包含新权限、自动执行、评分或基准实验。
改动思路
在已有共享规划 owner 中补全下一步、决定性验证和不确定工作延后重规划三层意思,比新增规划器、配置项或统一强制步数更贴合问题。 当前 PR 保留共享 planner、原首版质量指令和现有准入 owner,仅调整 budget_policy,并以协议说明和两种模式的回归覆盖闭合这项指令修正。
最强的反对理由是原文已经说“最小充分规划”,质量段也允许诊断,再加文字可能只有成本。但原句没有明确下一步与决定性验证的关系,也没有明确把不确定的后续分解留给重规划。此次只补这段关系,保留共享质量段,没有重复整个段落。实际调用链是启动命令或既有任务规划命令,读取现有 Goal、Agent 和 Todo,再附上同一份 planner;任务写入、状态读回、配额与效果仍由原 owner 负责。
因此“先做复现来帮助完成修复”和“复现结果就是任务完成”仍有明确边界。普通模式的开放目标建议与细粒度模式的一次当前检查点规则也继续存在,没有新增一刀切的时间或步骤上限。
具体改动
完整评审 f090a4d8d3d945e4f31562448f42449a61b889b5 的三个文件、+45/-1。独立规范依据是 docs/reference/protocols/loopx-goal-command-v0.md 在 4e6baa51afdc2ad522012c1f691ae166c9d67e7b 的既有内容,先读规范再看 diff;本 PR 新增的说明没有被反过来当作独立验收依据。另核对了最新抓取 main,相关规划 owner、实际调用者与协议相对该基线均未改变。
- Planning Contract:implemented。规划仍先于 Todo 写入;写完后按原步骤逐项读回,规划结果本身不算任务交付。
- clear_bounded_problem:implemented。保留按任务需要决定计划大小和复用已覆盖工作的规则,没有任意数量上限或管理性填充;40项现有任务的完整读取未被一个展示样本替代。
- open_ended_product_direction:implemented。开放目标的2–5条主方向建议与排序保留,未把“轻量”解释成取消必要的方向判断。
- first_delivery_guidance:implemented。完整首版质量段逐字相同,包括可行的最强方案、连贯实现与验证、不可用弱占位交付换反馈、诊断受原验收/反馈/权限限制且不得替代交付物。
- Goal-Start Flow 与 Priority Ordering:implemented。原身份、顺序、读回、启动及配额边界和 P0/P1/P2 顺序保留。没有新增权限、质量判定器或自动准入。
关键代码讲解
goal_planner_contract是唯一运行时修改点:budget_policy从46增长到203个 ASCII 字符,新增“下一步与决定性验证”“避免穷尽分解”“诊断服务交付”“不确定工作留待重规划”。其余字段和完整质量段保留,细粒度分支仍只允许一个当前可运行检查点。build_task_planning_packet未改代码,仍读取已注册身份、完整 Todo 前沿和当前阻塞,并要求调用者在读回后进入配额门。真实 CLI 对照验证了空前沿、40项前沿、未知身份、空白文本和尝试--execute:后3类的完整错误与退出状态均与基线相同,注册信息和主状态文件未写入。build_goal_start_prompt也未改文字;实际start-goal --guided与启动命令包的两种模式都收到新的结构化 policy,同时保留逐字相同的完整启动提示。现有协议的13行说明披露默认指令变化;新增27行测试覆盖普通与细粒度模式的共享指令和原门禁。
已检查既有规划/能力设置入口:这里修正已有 Agent 上下文,没有新增配置项、用户操作或独立功能页;不会要求用户重新提供已有目标、身份或再做一次确认。
对主干的风险
没有发现阻塞性问题。最值得防的是新短规划提示被误读为允许降质或在诊断后提前结束,以及新文字只到达一个入口。为区分这些风险,本次独立跑了233项相关测试、14组真实 CLI 基线/当前情景对照,以及4次公共入口内存突变控制:回退旧 policy 或删除完整质量段,普通和细粒度模式的独立义务检查都会失败;正确 head 全部通过。检查的是送达的完整指令和权限边界,不能证明模型一定遵守。
语义与 CI 对齐
标准预合并的6项直接检查、11项 catalog/risk/公开边界检查通过,Ruff、差异语义建议及完整词汇漂移检查通过。沿用原共享字段,没有新状态词汇、prose 分类器或版本兼容分支。该变化明确作用于默认规划指令,不把它称作默认关闭功能;“may come first”仍受相邻完整质量段和原任务权限约束,也不变成强制外部评测。
同一96行输出负载的基线/head 比较通过:96/96、无新增行、无需要人工批准的增长信号,未改任何预算上限。独立 CLI 对照只观察到预期 policy 与派生字节计量变化,其余完整包保持一致。原直接启动 smoke 曾在默认运行目录的旧写入围栏失败,基线和 head 的内部错误逐字相同且主记录未改动;该失败仍保留。把全部原断言放到新的隔离运行目录后,两边完整 smoke 均通过,各24次 CLI/子进程调用无失败。这是明确的测试环境归因,没有关闭安全门或删除断言。本轮未读取、轮询或等待远端 CI。
我的整体评价
对 f090a4d8d3d945e4f31562448f42449a61b889b5 的完整源码评审结论为 APPROVE。这项规划指令修正达到所述局部目标;长程维度为 preserved,已有任务复用、原验收、当前阻塞、受治理的后续重规划和配额限制都保留;用户体验维度为 preserved,已知意图与授权下没有新增必答问题或确认轮次。指令关系更清楚,但实际规划时间、首版质量和完整成本改善尚未测量。
在已有共享规划 owner 中补全下一步、决定性验证和不确定工作延后重规划三层意思,比新增规划器、配置项或统一强制步数更贴合问题。 当前 PR 保留共享 planner、原首版质量指令和现有准入 owner,仅调整 budget_policy,并以协议说明和两种模式的回归覆盖闭合这项指令修正。 生产变化只落在同一处已有字符串,有限简化已经通过复用共享 owner 实现;没有需要本 PR 再抽象的新模块或平行权限决策。未来若要证明效率或质量收益,应比较真实任务与完整成本;当前通过的文本/CLI 检查不代替那项证据。源码批准、平台正式批准、合并资格、实际合并与本机安装各自保留边界,本次评审不执行合并或升级。
English verdict: APPROVE — f090a4d. The shared minimum-planning guidance reaches both existing entrypoints and modes while preserving complete first-delivery quality and admission obligations.233 focused tests,14 real CLI base/head pairs,4 mutation controls,96/96 output rows and standard premerge passed. Complete startup suites passed in fresh isolated runtimes; the original ambient writer-fence failures remain recorded. Model adoption, planning savings, quality gain, merge and installed behavior are not claimed.
Goal And Delivered Outcome
Make upfront planning sufficient to begin the next useful step while preserving the strongest feasible first-delivery objective. The shared planner already supported concise plans, existing-Todo reuse and diagnostics, but did not clearly connect a diagnostic first step with stronger delivery or defer uncertain downstream decomposition.
This changes only
planner.budget_policy: identify the next step and decisive validation, avoid exhaustive decomposition or fixed-count filler, allow diagnostics/feedback first as a means to strengthen delivery, and replan uncertain later work._FIRST_DELIVERY_GUIDANCEremains byte-for-byte unchanged: a diagnostic result or weak placeholder cannot replace the requested deliverable.main.loopx/control_plane/goals/start_contract.py, consumed by/loopxandtodo planin ordinary and fine-grained modes.Author Declaration
Written by: model_agent; OpenAI Codex.
Implemented against
Maintainer-requested goal/means distinction, with the existing Planning Contract at base
4e6baa51afdc2ad522012c1f691ae166c9d67e7b.goal_planner_contract().budget_policy_FIRST_DELIVERY_GUIDANCESelf-check: read the complete owning planner/Todo-authoring path, reviewed clauses against the existing quality and authority contract, and checked final base/head outputs. This is guidance consumed by the Agent, not a machine-enforced time/step cap.
Scope And Continuation
Complete within this shared planning-guidance scope. The runtime diff changes one existing prose field. It does not weaken first-delivery quality, make diagnostic completion equal Goal completion, impose early external evaluation, or change broad-goal lane suggestions, the fine-grained one-checkpoint rule, authorization, quota or replan admission.
This is independent of the EdgeBench wrapper correction in #6983, so product and adapter revisions can be reviewed and pinned separately. No model or benchmark run was launched. Less model planning effort or better feedback timing remains an empirical question; output checks do not establish those gains.
The bounded refactor pass retained the existing owner and reused its existing Todo-reuse, authority and non-substitution clauses instead of adding another helper or repeating them in the budget field.
Validation
f090a4d8d3.PYTHONPATH=.:tests uv run --extra test python -m pytest tests/control_plane/test_task_planning.py tests/control_plane/test_start_goal_compact_projection.py tests/control_plane/test_cli_output_differential.py -q --tb=short: 233 passeduv run --extra test python examples/control_plane/cli-output-base-head-differential-smoke.py --base-ref origin/main: 96 base / 96 head output rows pass existing budgets and comparison checks; no budget increasebudget_policydiffers in the planner; first-delivery guidance, complete startup prompt and other structured fields match the baseline exactly.examples/bootstrap-command-pack-smoke.pyreaches the display-name fixture and fails withcanonical_authority_required. The same isolated fixture reproduces on unchanged base4e6baa51afdc2ad522012c1f691ae166c9d67e7b; the earlier guided-planning checks and focused CLI tests pass. This existing fixture/migration gap is not fixed here.loopx checkpublic-boundary scanThe final policy adds 157 authored characters. Todo reuse, permission limits and the prohibition on replacing the deliverable remain in their existing clauses; this avoids redundant guidance while retaining their meaning. The complete output matrix passes without changing ceilings. The remaining bootstrap-smoke failure is explicitly disclosed and is not treated as a pass.
Frontend / Visual Evidence
UI impact: none. Existing shared agent planning context and protocol documentation change; no new frontend/Lark operation or first-screen presentation. Preview/visual review: N/A. Source data: none.
Type of Change
LoopX Area
Technical Direction
Bounded clarification of the existing Planning Contract. Shared-authority / TypeScript migration fixture impact: N/A; no state, backend or transport refactor.
Boundary Checklist