Repository navigation
fix(todos): default new work to P1 and preserve successor priority intent - #6539
Conversation
…tent Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
…reation Signed-off-by: huangruiteng <huangrt01@163.com>
…efault-20261015 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; runtime_reported; reasoning_effort=max
精确评审:6539@1c48e52d413aa2e931bb2d122e351e5d3c38a183;实际差异基线 2abf983157f71153b7bc910a67aa8f7753fe9d9b。
动机
用户和 Agent 通过 CLI、工作台或监控发现任务时,需要明确的调度优先级。
以前未填写优先级的新任务保持未排序,排在 P4 之后;例行遗漏字段会使本应继续的工作沉到队尾。现在普通新任务默认 P1,显式 P0/P2 等声明仍优先;旧未排序任务、清空后的编辑和原操作重放保持原意。
已验证真实 CLI 的默认 P1、显式优先级和拒绝冲突;监控独立发现按各自声明生成,打包页面失败重试仅创建一次并由独立 CLI 读回 P1。本 PR 不重排已有未排序任务,不调整资格、认领、配额或权限,也不证明调度公平性和长期自然采用。真实长期队列中的采用与公平性仍需独立观察;本轮未执行全量 TypeScript 套件,作者披露的既往 host_process_group EPERM 失败不能据此宣称修复。
改动思路
继续由 todos/priority.ts 统一解释意图;Python 只传参,legacy/canonical 创建共用规则,旧回执先于默认值处理,监控的新鲜计划才物化默认。当前边界是新建优先级的同一 TypeScript 语义 owner,以及既有创建、直接延续和监控发现路径。
生产15路径共+106/-21;一个创建策略和薄参数传输足以覆盖三入口。只改CLI argparse会漏Chat/canonical,提前填默认会破坏旧receipt身份。 状态、政策、provider IO 与界面投影仍各归原 owner;未因页面可用或 P1 字段自动取得执行权。
新鲜创建:遗漏→P1,显式值→原值;直接完成/替代的延续→前项意图;独立监控发现→自己的声明或P1。旧receipt重放先返回原结果,不能因升级自动产生第二条或修改优先级。
CLI一次已授权创建不新增交互轮次;GUI沿用“输入任务并预览→确认写入”两步,确认提供这次实际写入授权,未新增priority选择或技术配置。以既有Goal上下文准备任务即可;不把预览界面本身当原始工作目标,也未声称此PR修复整个App的交互轮次。
具体改动
全量28路径,+354/-58,含15生产路径、2文档和11验证路径。CLI两种后继priority参数、Python传输、legacy/canonical创建、monitor计划及receipt校验同步;新建响应也读回有效priority。当前合入主干后28个PR变更文件blob均等同旧ceb56版本,但已重跑当前组合。
关键代码讲解
planTodoCreationPriority:新建才用P1基值,参数/前缀/clear仍由原planTodoPriority解析。createCandidate / executeCoordinationTodoCreate:先原操作回执,后新建默认;结果写入同一CAS/read-model。monitorSuccessorPriorities:按Agent/User分别声明;历史身份保持字段缺省,新鲜provider计划物化默认。requireProviderSuccessorPriority:检查生成记录与回执优先级,不把新默认套到旧原始计划。
规范:docs/project-agent-todo-contract.md,固定版本 2abf983157f71153b7bc910a67aa8f7753fe9d9b。
- Priority intent:implemented;优先级是声明意图;显式值/legacy前缀/清空/编辑/原回执含义保持。当前源码及真实入口证据覆盖此有界要求。
- Write Contract:implemented;同一原生authoring、provider/CAS和已审阅动作创建。当前源码及真实入口证据覆盖此有界要求。
- Lifecycle Contract:implemented;直接延续与独立监控发现分别保留继承/新建语义。当前源码及真实入口证据覆盖此有界要求。
对主干的风险
显式P0/P2、冲突拒绝且字节不变、清空后编辑、旧创建/监控回执重放、同身份变更冲突、provider伪造priority与过期CAS均受原边界约束;直接延续仍用原successor derivation,不调用独立发现默认。
当前头 123 项 Python、47 项类型层和真实隔离 PostgreSQL16.2 的354项通过;当前同一15项CLI oracle基线3fail/12pass、候选15pass;当前构建页面连真实File/HTTP并独立CLI读回一次P1。
当前构建/TSC、配置内19文件mypy、Ruff、四提交DCO、advisory→全树semantic均通过。canary5个直接检查及19个产品检查通过,另有本地quality_receipt_missing策略门。 产品检查没有失败;质量回执门保持,未借用作者的本地回执或把整体canary写成绿色。CI未查询、轮询或等待。
旧ceb56的123/43/354和页面记录保持原版本;新1c48的当前验证单独记录,未把旧结果改名为新结果。此前全量TS的host_process_group失效快照属作者历史披露,本轮未复现或归因,不以一次单文件绿色解除长期不稳定性;当前改变的优先级不依赖该错误路径。
作者补充的新头批次为60通过/1失败:blocked-cache、timed-out、idle组合超过退出期限。本轮按同一原测试在固定基线与当前头各跑12种组合,均通过;测试、runtime客户端、server、IO、cache和handler六条源码blob完全相同。该fixture直接调用turn_journal.write/ping/shutdown,不经过新建priority owner;这是独立的既有runtime退出路径,没有本PR改变的因果分支。此对照不证明间歇性现象消失或根因已修复,原runtime调查继续保留。
语义与 CI 对齐
复用已注册P0–P4 vocabulary与typed owner;新默认是机器执行规则,文档已明确“旧缺省未排序→新建P1”,并重命名原默认测试。可选的两个CLI声明不绕过对应Todo/冲突检查,不新增Python决策源。
我的整体评价
APPROVE。交付判断为 justified_increment;long_horizon=improved,user_experience=improved,限定在上述已验证旅程。继续由 todos/priority.ts 统一解释意图;Python 只传参,legacy/canonical 创建共用规则,旧回执先于默认值处理,监控的新鲜计划才物化默认。当前边界是新建优先级的同一 TypeScript 语义 owner,以及既有创建、直接延续和监控发现路径。 面向下一次修改的有界重构检查:已把遗漏默认集中在原priority owner,并区分持久receipt缺省与新计划物化;现阶段不再增加新的priority模型或策略开关。 真实长期队列中的采用与公平性仍需独立观察;本轮未执行全量 TypeScript 套件,作者披露的既往 host_process_group EPERM 失败不能据此宣称修复。 代码批准与质量回执、原生readiness及维护者合并授权分别判断。
English verdict: APPROVE - 1c48e52; creation defaults and explicit/replay/continuation intent verified on the current merged composition with real CLI, File/SQLite/PostgreSQL and packaged recovery; priority grants no authority.
Previously, new Todos with omitted priority remained unranked and sorted below P4. This change gives fresh CLI, Chat and canonical creations a shared P1 default; explicit priorities and legacy prefixes still win, and conflicting declarations reject before mutation.
Direct completion/supersession continuations retain their predecessor priority. Independent monitor discoveries default to P1 and support separate
--next-agent-priority/--next-user-prioritydeclarations. Creation responses and successor receipts expose the effective priority.The default applies after original receipt lookup. Existing unranked tasks, explicit clears, old operation identities and historical replay retain their previous meaning. Priority does not grant eligibility, claims, quota or permission.
Validation on the original priority head
ceb56fb85:host_process_groupEPERM test observed an invalid live process snapshot; its entire four-test file passed unchanged in an isolated rerun. This is disclosed separately from the passing priority coverage.Updated source
1c48e52dincorporates main through2abf98315, including #6517. The previous Windows CI failure was an exclusive lock-creationEPERM, matching that upstream repair. The priority owner is unchanged by this merge; native Windows qualification on the new head is pending.The implementation reuses the existing typed priority owner; the Python boundary only transports intent. No separate priority model or scheduler override is introduced.