Repository navigation
fix(todos): default blocking work to P0 - #6604
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
Exact head: f25af99952bd61a3f8d02d27538b0a05ce86f51d
动机
通过现有 Todo 创建命令或 monitor 后继,把明确阻塞项加入工作队列的维护者和 Agent。
原有创建入口在省略优先级时统一产生 P1,结构化阻塞项也与普通任务同级。提案有意把新建 user_gate、blocker 或 status=blocked 的默认值改成 P0,同时保留显式优先级、旧前缀、清空及历史回执的原有含义。
同一组隔离 File、SQLite 调用在 base 新建阻塞项为 P1,当前源码和普通 wheel、sdist 安装后均为 P0;普通任务与仅在正文提及 P0 的任务仍为 P1。显式 P2、前缀 P3、清空和重放都保持原意,另一 Agent 的 gate 不会阻止本 Agent 的独立任务。
本次只改变新建项的默认排序意图,不授予执行、领取、预算或跨 Agent 管理权限,不批量迁移历史记录,也不增加新前端配置;浏览器交互和 PostgreSQL 集成没有在本次执行。
独立判定依据:https://github.com/loopx-project/loopx/blob/de41d2d310ccb9d259200d81d6182a32824ca556/docs/project-agent-todo-contract.md;revision de41d2d310ccb9d259200d81d6182a32824ca556。按 Priority intent 的排序意图、显式声明、普通编辑、独立后继与默认值条款,以及 Default change and compatibility 的旧回执与清空条款核对。
改动思路
新规则是创建意图的局部扩展,应复用已有 priority planner。现有 task_class/status 已是类型化值,不能从正文猜阻塞;monitor 必须按每个新后继自身的角色和分类计算,而不是继承父 monitor 的排序。
当前 PR 交付同一 TypeScript 创建规则在 canonical Todo、monitor 后继与回执校验中的一致默认值及兼容验证;普通编辑、执行资格、历史迁移和 UI 配置保持各自已有维护边界,不为默认排序新增第二套策略源。
具体改动
planTodoCreationPriority() 留在现有 TypeScript todos/priority.ts:仅按已注册的 task_class=user_gate|blocker 或 status=blocked 选择创建默认值,再调用原 planTodoPriority() 处理显式参数、前缀、冲突和清空。新增常量复用已有 TodoPriority 的 P0 值,不增加状态词表,不从文本包含“阻塞”或 P0 推断紧急程度。
createCandidate() 接收规范化后的分类和状态;canonical create 在构造新候选前仍先查询旧 operation receipt。monitorSuccessorPriorities() 按每个后继自身的角色、task_class 和显式参数计算,普通后继不继承父 monitor 的 P0。validateSuccessorReceipts() 复用同一创建规则核对新后继,保留旧回执的兼容顺序。Python 两处改动仅更新既有 CLI help;两份文档明确披露默认值变化。四份测试覆盖 priority planner、monitor batch 与 File/SQLite 的公开命令路径。
独立 source 验证:四组 Python 文件 head 32/base 28 项通过,四组 TypeScript 文件两侧各 15 项通过。普通构建 Chat assets 后生成 wheel、sdist,分别装入新环境,核对六个变更产品文件与 source/archive/install 字节相同。base、head、wheel、sdist 各完成 42 次真实 CLI 调用,覆盖两种 provider,且普通 Chat preview/apply 继续产生 P1。base 三种结构化阻塞新项为 P1,head 和两个安装包为 P0;普通正文出现 P0 不改变 P1,显式 P2 与前缀 P3 均保留,冲突拒绝且状态文件未变,清空后无优先级。
再将 base 创建过的 P1 gate 回执交给 head、wheel、sdist 重放,已编辑为 P4 或明确清空的当前记录都保留;这一跨版本对照和 blocked P0 的执行资格拒绝共完成 28 次真实 CLI 调用。Agent-b gate 出现后 Agent-a 的独立普通任务仍可运行。typecheck、语义 advisory 后完整语义检查通过;premerge 5 项 direct、19 项 selected,无 blocking failure。
对主干的风险
这是常开行为变化:调用方省略优先级时,新的结构化阻塞项会更靠前;它不能被描述成单纯文案修订。旧版文档确实写所有新项默认 P1,本评审独立判断该改动,并没有用改后的文档反过来证明旧规范要求 P0。Priority intent 中的原有资格、能力、claim、quota 和 gate 边界仍须遵守;实测 blocked P0 拒绝、其他 Agent gate 不扩大阻塞范围。
没有历史批量升优先级或 provider promotion,旧 receipt 查找及显式清空仍决定重放结果。现有 Chat 创建只作者普通任务,继续 P1;现有 reviewed priority 编辑仍是用户显式操作入口。这里验证了打包后的真实 Chat service 与 canonical 命令读回,没有把它说成浏览器交互验收,也未声称本机共享安装已升级。PostgreSQL 存储未变,本次未跑其集成。实际两侧 ratchet 只有相同 DSH 既有 oversized function,失败全文和因果文件字节一致,保留为 inherited advisory。
我的整体评价
APPROVE。默认紧急程度来自既有结构化 owner,相关创建与回执验证复用同一 TypeScript 规则;显式意图、历史操作和执行权限没有被默认排序覆盖。当前 slice 的源码、普通安装包、实际 provider 及负例均有独立证据,未发现阻断问题。
未来改动可维护性复核:本提案已以小型共享创建函数减少多个 caller 的默认值重复,进一步迁移或抽象无需扩大本 PR。评审结论不授予合并、部署或共享 CLI 升级权限。
English verdict: APPROVE - f25af99952bd61a3f8d02d27538b0a05ce86f51d; fresh structured blockers default to P0 through one typed owner; explicit intent and historic replay survive real File/SQLite source and wheel/sdist checks, with blocked eligibility retained.
Goal And Delivered Outcome
user_gate,blocker, andstatus=blockedcreations become P0; ordinary work remains P1. Focused authoring and monitor-successor rows below cover the behavior.main.Author Declaration
Implemented against
docs/project-agent-todo-contract.md, Priority intent and monitor-successor rules atde41d2d310ccb9d259200d81d6182a32824ca556.planTodoCreationPrioritypython3 -m pytest -q tests/control_plane/test_todo_priority_authoring.pyplanTodoCreationPrioritynode --test tests/control_plane_ts/todo_priority.test.tsmonitorSuccessorPriorities,requireProviderSuccessorPriorityScope And Continuation
Validation
f25af9995unitpassedintegrationpasseduser_gate,blocker, andstatus=blocked.integrationpassedregression_paritypassedstaticpassednpm run typecheck:control-plane;git diff --check.staticpassedloopx check: 0 errors; public-boundary scan passed. Six unrelated pre-existing Goal projection warnings remained.2 !== 1assertion onde41d2d31, and the Python workflow also hits the shared storage/result-smoke regressions tracked by #6607 and the focused browser repair #6609. This PR changes no dashboard, storage, browser-smoke, packaging, or workflow files; keep those repairs independent and rebase after the shared fix lands.See validation disclosure guidance.
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).