Skip to content

feat(todos): add an opt-in queue overview - #7581

Open
LIHUA919 wants to merge 3 commits into
loopx-project:mainfrom
LIHUA919:codex/issue5895-queue-summary-20261028
Open

LIHUA919 wants to merge 3 commits into
loopx-project:mainfrom
LIHUA919:codex/issue5895-queue-summary-20261028

Conversation

@LIHUA919

@LIHUA919 LIHUA919 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

todo list offers full records or a two-item-per-role thin view. This adds an explicit --summary queue overview: up to eight items per role, one record array, complete match/display/omission counts, bounded titles and an exact-detail route. Existing default and --thin v0 output keep their contracts.

Design/ownership hold: the scope comment has no maintainer/original-author response yet. This is a completed implementation proposal for review, not a declaration of design acceptance, task takeover or merge readiness.

Author Declaration

  • Written by: model_agent — OpenAI Codex, GPT-6 family.

Implemented against

  • Specification and revision: no accepted written implementation specification; the explicit opt-in scope requested in this PR is the basis. The linked issue's corrected proposal permits a separate versioned projection.
Criterion (spec clause) Disposition Symbol / path Test or command
Preserve default and thin contracts implemented Todo read transport/presentation Existing File/SQLite CLI parity and thin regressions
Versioned, opt-in, eight-per-role overview implemented read_presentation.ts, todo_list.py todo_list_summary_v0; limits, filtering and stable source order
Complete counts, visible title truncation, full-detail recovery implemented read_transaction.ts, Markdown renderer Unicode, exact read and canonical readback after display deletion
Invalid combinations and write commands do not mutate Todos implemented CLI validation/read transport File/SQLite provider revision and display parity
Separate output budget implemented cli_output_budget.py New mode row; existing ceilings retained
Maintainer scope acceptance / original-author ownership agreement not_met #5895 coordination Await response; approval hold

Scope And Continuation

The useful delta is the explicit CLI overview. Role/status/Agent filtering and ordering stay with the current typed read owner; this view does not select runnable work or replace quota, leases or complete requirements. App/Lark callers retain full/exact reads. No provider, capability, storage schema or scheduling owner is added.

The small refactor shares the existing hot-view done omission within the same presentation owner, with parity coverage. Broader automatic caller adoption remains outside this proposal; #5895 stays the existing coordination owner.

Current review fix and validation

The review's --summary --limit 1 counterexample is repaired. The queue formatter now receives unshortened selected titles and applies its own row limit; existing full/thin limit compaction is unchanged. New real File/SQLite regressions compare the same rows with and without a limit, require the truncation notice in Markdown, recover complete requirements by exact ID, and verify unchanged provider revisions, full/thin records and display bytes. A short-title control remains untruncated.

Current head: cdca02aa6fc21e354d79925ad2b5dcff09120038, integrating target main at 225698b313f3bcd5c967220013b4a2254c586792. The update preserves the original branch history and adds a signed integration commit plus a signed focused fix.

  • Before the fix, the new regression fails on both File and SQLite: the limited row incorrectly reports title_truncated=false.
  • Final source: 40 Python tests passed, 22 TypeScript tests passed, full control-plane typecheck and focused Ruff passed.
  • Standard premerge: passed; four diff/RFC checks plus changed-Python compilation, ten catalog canaries, eight risk smokes and the public-boundary check; zero failures, warnings or manual holds. The output-budget regression now passes on this integrated source. The older budget failure in the historical record below remains historical evidence.
  • Diff-scoped semantic advisory: no supported new vocabulary carriers; existing todo_list_summary_v0 remains a derived read view. The advisory's dynamic-form limitations remain.
  • Bounded refactor: keep the existing full-source selection and one queue formatter; no new metadata field or second truncation owner.
  • Source validation only. Remote CI, independent review, design/ownership coordination and merge readiness remain separate; no merge, installation or long-horizon cost benefit is claimed.

Original submission validation (historical)

  • Tested revision: eee7df7bb84d2e7935f0c8f997a67abae16d2e8f for the final-head CLI/typecheck/premerge checks below.
  • Run state: finished for local validation. The full TypeScript suite, focused CLI, typecheck and premerge results below all refer to the tested head; CI and maintainer review remain separate.
  • Input classes: synthetic, public_fixture.
  • Environment: Python 3.12.13 / Node 24.22.1; disposable File/SQLite data and isolated managed runtime namespaces.
Check kind Result Evidence / limitation
static passed Full control-plane typecheck; focused Ruff; whitespace and bilingual check; 13-file public-boundary scan
real_entrypoint / real_backend passed Original head: 24 Todo list tests over real File/SQLite CLI paths, including existing thin/default behavior
integration passed Nine summary/complete-explicit-mode-budget cases; empty, mixed states, Agent scope, limits, UTF-8, exact recovery and zero-write errors
unit passed Original-head full TypeScript suite: 5,621 passed, 75 skipped, 0 failed
regression_parity passed Existing default/thin structures and authority revisions preserved around summary reads; thin retains two per role
static passed Diff-scoped semantic advisory found no supported new carriers; the new wire view is explicitly owned/documented under Todo reads. Tests are outside the advisory's supported production root
manual not_run CI, packaged/installed App acceptance and real PostgreSQL qualification are not claimed
integration failed Standard premerge's sole failure is the existing quota_should_run/multi_agent/json budget: 25,836 characters against 25,500. The same test/value failed on a clean f5e9be367 baseline. All direct checks and other selected smokes passed; the quota ceiling was retained

The broader Python run produced 74 passed, one skipped and that one budget failure. The new summary's small/crowded/multi-Agent JSON and Markdown budget samples pass. This PR does not claim a latency, model-cost or long-horizon outcome improvement from output size alone.

Frontend / Visual Evidence

  • UI impact: none in App/Lark/web/desktop or documentation chrome; the changed presentation is CLI JSON/Markdown.
  • Before: existing full and thin modes retained.
  • After: loopx todo list --goal-id <goal-id> --summary.
  • First viewport / preview: N/A for graphical UI. Source-only synthetic CLI output was inspected; no packaged or installed UI claim.
  • Attention review: one queue array, bounded rows, explicit omission counts, source lineage and one full-detail route.
  • Source data: synthetic.

Type of Change

  • New feature
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

Shared-authority RFC fixture impact

N/A. This is not provider promotion, runtime routing or migration qualification.

Boundary Checklist

Signed-off-by: Lihua <1017343802@qq.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

精确 head:eee7df7bb84d2e7935f0c8f997a67abae16d2e8f;不可变基点:53dcb03082985bf894b1fca8813ab9f6e92503c5。完整审查13文件、+369/-8,结论 REQUEST_CHANGES。

[P2] --limit 会丢失标题截断事实。 实际 File/SQLite 同一316字符标题,不传 limit 的 summary 返回 title_truncated=true,加 --limit 1 却返回 false;两者展示标题都是同一180字符,后者 Markdown 也没有截断说明。上游 selectTodoReadFields 先走旧 compactTodoReadSummary,再由新 formatter 量已经截过的长度。请从原始选中行计算或保留截断事实,补 limit/no-limit、JSON/Markdown 与 exact 原文回读,不改旧 full/thin 契约。

动机 / Motivation

每轮查看 Todo 队列的 Agent 和操作者,需要快速定位要进一步检查的任务。

例如 Agent 想从长队列找下一项待查工作,原来必须读完整要求;新概览可先看标题和真实数量,再按 ID 读取原文,但当前加 --limit 1 后会错误声称长标题未截断。

真实 File/SQLite 已提供有界概览、完整数量和原文读取;当前 limit 下的截断标记不可信,仍须修复后才能作为可靠摘要交付。

本 PR 不改变无参数输出、既有 thin、执行准入、调度、权限或写入,也不证明模型 token 净收益、正式安装采用或长期效果。

原 #5895 的默认改为摘要方案已被兼容性讨论纠正。此次没有把那个过期方案当成授权,也不把作者询问设计/ownership 的留言当成维护者已经接受;沿原 issue 的协调仍保留。当前有用增量是一个可明确选择的概览,原始要求仍按现有 ID 读取,不需用户重填任务或增加确认轮次。

limit与标题截断事实冲突;原issue设计/ownership尚待维护者协调;required premerge仍有同基线quota预算失败。

改动思路 / Approach

概览应留在既有 TypeScript Todo 读取/展示 owner,由完整规范记录派生,不能建立新的可执行任务选择或状态真相。

当前 PR 的可用边界是显式选择的队列概览与原 full/thin/exact 读回;先修复 limit 下截断事实,保留独立设计/ownership协调和合并门。

保持默认不变比强迫所有旧消费者增加 escape-hatch 更小;保留原 thin 的两项上限也避免静默改变其契约。Python 只传递选项、拒绝互斥组合并渲染 Markdown,过滤、顺序和规范读取仍在既有 typed owner。数量来自完整匹配集合,显示上限来自本次选项,两者应清楚区分。

同一规范标题 展示长度 截断标记 实际观察
summary,不传 limit 180字符 应为 true true
summary,limit=1 180字符 应为 true false
exact ID 读取 316字符 完整原文 原文保持

表格是本次两种真实后端的文字观察对照;没有用图表或字节预算代替实际来源和语义核验。

具体改动 / Changes

接受依据:https://github.com/loopx-project/loopx/issues/5895#issuecomment-6075026876,spec_revision:issuecomment-6075026876。先读完整原 issue、该 MEMBER 的纠正及当前作者协调留言,再检查实现;新写的 status contract 不自行认证新行为。

  • existing-no-flag-contract:implemented。无参数旧 JSON 保持;实际同输入 base/head 的 full/thin 读回对照另有原始来源留存。
  • explicit-compact-projection:implemented。新增显式 --summary 与 todo_list_summary_v0;保留旧 thin,错误组合拒绝,概览不决定工作可执行性。
  • discoverable-real-summary:not_met。help 和文档可发现,但真实 limit 分支错误披露截断,需首段有界修复。
  • separate-mode-budget:implemented。新模式有单独预算和测试,没有把旧默认阈值改成新摘要阈值。完整预算检查的既有 quota 失败仍保留。

关键代码讲解

  1. todoListPayload 先完成原规范读、过滤和选择,再在132行选 summary formatter;旧 full/thin 的分支仍在。这个顺序使 --limit 的既有文本压缩进入新模式,是此次 finding 的前置条件。
  2. compactTodoQueueSummary 将每 role 至多8项放入单一数组,派生完整/返回/省略数和精简来源。135行只量传入 row 的标题,不能知道那段文字已经被旧 formatter 裁剪。
  3. _render_queue_summary 通过 flag 添加截断标记和原文读取提示;JSON 中的错误 false 因而继续传到人的表格阅读。
  4. list_goal_todos 沿现有 read transport 传递 summary;与 thin 或 exact ID 同时使用会明确拒绝,不新增状态 writer、能力配置或权限判断。

独立执行三个 Python 模块24通过、五个 typed read 模块53通过;新增的只读 CLI 反例在两种真实后端都失败,未把这些绿测当成缺陷不存在。Ruff、配置指定17文件 mypy、完整 control-plane TypeScript typecheck、差分和唯一 commit 的 DCO 均通过。

对主干的风险 / Risks

最强反例不是超长文本本身,而是只改变显示数量上限,就把同一截断标题的真实性说反。现有测试在一般长标题和 limit 数量上分别通过,不能证明二者组合。实际读取没有损坏原任务,也没有误准入或扣额;受影响的是新 summary 的可信度及据此选择后续原文检查的流程。修复应复用未缩短的规范行或既有明确元信息,不增加手工同步字段,也不能删除截断声明来隐藏问题。

关闭态以相同18项混合队列比较不可变 base 与当前 full/thin,原规范字段、任务正文、顺序、数量和诊断保持。初版探针把路径、投影时钟与 authority_read 整体排除;补充版本保留完整 raw 来源并逐项核验权限/来源标志,仅允许独立临时目录、provider incarnation/观察时间变化,不裁掉语义字段。新模式的 title/flag/count/status 均未归一化。

标准 premerge 实际为6项直接检查通过、19项选中检查中1项失败、0人工 hold。失败是 quota_should_run/multi_agent/json 的25836字符超过25500;相同命令在不可变 53dcb03 也同身份、同数值失败。新 summary 未改那条 quota producer,独立新模式及旧输出验证另列;该失败可归为无关基线问题,但 required gate/CQR 仍失败,不能宣称整体绿或抬阈值。未读取、轮询或等待远端 CI。

语义与 CI 对齐

新 todo_list_summary_v0 是派生读协议,复用已有 typed 状态、role 和选择规则;不是新的 runnable selector,也不因标题含某词改变义务。来源不可用仍是不可用,display omission 不作规范任务不存在的证据。新 help 只公开可选能力,默认、自动化指导、scheduler/quota/lease 没有新增执行义务。当前违反的是这个新读协议的真实截断披露,不能用合法布尔类型或较小预算认证语义。

我的整体评价 / Verdict

long_horizon:preserved,限于已有任务与结算不被这个只读投影改写;未测试模型长期效果或完整 token 成本。user_experience:regression,可靠概览的有用增量已可见,但 limit 组合会隐去原文还有内容的事实。先修正首段派生与联合回归,再按新精确 head 复审。

概览应留在既有 TypeScript Todo 读取/展示 owner,由完整规范记录派生,不能建立新的可执行任务选择或状态真相。 当前 PR 的可用边界是显式选择的队列概览与原 full/thin/exact 读回;先修复 limit 下截断事实,保留独立设计/ownership协调和合并门。

已检查现有 CLI JSON/Markdown、Todo read 与既有产品消费者;本差异没有渲染页面或布局变更,视觉评审不适用。 视觉未验证范围:none。实际安装、模型理解、长期费用和独立设计/ownership 接受均未由本次源码评审认证;普通 CLI 读回可用不等于这些资格已完成。无需为这处有界修复制造额外产品页面、手工配置或全局确认流程。

English verdict: REQUEST_CHANGES — eee7df7. Real File/SQLite CLI reads reproduce a false title_truncated value only with --summary --limit 1; the same 316-character title is visibly shortened in both variants. Preserve truncation evidence before shared limit compaction. 24 Python/53 typed tests and static checks pass; the separate required quota budget failure also reproduces unchanged on the immutable base and remains red.

const full = stripPythonWhitespace(String(row.title || row.text || ""));
todos.push({todo_id: row.todo_id, role, title: compactText(full), status: row.status,
priority: row.priority ?? null, claimed_by: row.claimed_by ?? null,
title_truncated: Array.from(full).length > 180});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 在截断前保存 summary 的标题截断事实

--limit 会先走旧 compactTodoReadSummary,把316字符标题裁为180字符;随后这里只量已裁后的行,title_truncated 变成 false。真实File/SQLite均观察到不传limit为true、传 --limit 1为false,展示标题相同,Markdown缺失截断说明。这会把不完整要求冒充完整标题。请在截断前计算/保留该事实,并补同记录limit/no-limit及exact回读,维持既有full/thin契约。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 cdca02aa6fc21e354d79925ad2b5dcff09120038 修复,并整合当前目标 main 225698b313f3bcd5c967220013b4a2254c586792,原分支历史保留。

新回归先在真实 File/SQLite 上复现 title_truncated=false 与不限量行的 true 冲突,再验证修复:summary 让既有选择 owner 保留未缩短标题,由唯一 queue formatter 同时派生 180 字符展示、截断事实和数量限制;旧 full/thin 的 limit 分支保持不变。测试同时比较同记录 limit/no-limit、Markdown 截断提示、exact 完整原文、provider revision、旧 full/thin 和显示文件字节;短标题仍返回 false。

最终 40 项 Python、22 项 TypeScript、完整 control-plane typecheck、Ruff 和标准 premerge 全部通过。原先 quota 输出预算的历史失败保留;本次整合后的同一标准 budget smoke 已通过。完整证据和源码边界已更新在 PR 描述。设计/ownership 协调、独立新 head 评审、远端 CI 和合并门仍分别保留。

Signed-off-by: Lihua <1017343802@qq.com>
Signed-off-by: Lihua <1017343802@qq.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max

APPROVE,无当前阻断 finding。 本轮审查完整 cdca02aa6fc21e354d79925ad2b5dcff09120038,merge base 225698b313f3bcd5c967220013b4a2254c586792,13文件+395/-9;并未只检查最后一处 fix。上轮 --limit 丢失截断事实已由本轮独立真实对照确认修复。原设计/ownership协调保留为独立合并边界,不把作者的留言当作维护者接受。

动机 / Motivation

需要从长 Todo 队列中找到待查任务的 Agent 和 CLI 操作者。

同一个长标题加 --summary --limit 1 后,旧提案错误声称未截断;当前版本保持同一展示标题并明确标记截断,随后按原 ID 读回完整要求。

本轮真实 File/SQLite 读回证明限行前后同一行一致、完整文本可恢复,且原 provider revision、默认/薄视图与展示文件保持。

本 PR 不改变执行准入、调度、权限或存储,也不认证安装采用、长期效果与完整费用。

原 issue 的设计/ownership 协调和正式消费者采用仍由既有 owner 接续;本次源码批准不代替这些决定或合并门。

改动思路 / Approach

概览留在原 TypeScript Todo read/presentation owner,从规范记录派生;Python 只运输选项和渲染 Markdown,避免第二个筛选、状态或执行 authority。

当前 PR 的边界是显式 CLI 概览及 full/thin/exact 的兼容读回;既有 issue 的设计协调、安装采用与合并决定继续独立保留。

当前默认输出和 thin v0 已有真实消费者。保留两者,再新增一个明确选择的展示模式,比强改默认、扩写 thin 或加入手工同步的截断字段更合适。数量来自完整匹配来源;行数和标题长度只限制展示。概览不因某条任务可见,就判断其可以执行。

本轮用同一物理规范来源让不可变基点和当前源码分别实际读取:每个后端10种完整 JSON 对照及3种 Markdown 对照,共20组 JSON、6组 Markdown。没有整体删除 authority_read、路径或 envelope;只移除经时区校验的 observed_at、served_at、source last_read_at 及 typed resume evaluated_at。其余字段和字节都参与比较。76次实际 console 调用也验证 summary 的正确性和错误恢复。

同一长标题,limit=1 旧 eee7 提案 当前 cdca02
展示标题 同一180码点标题 相同
title_truncated false,错误 true
原完整要求 仍在规范来源 exact ID 可逐字读回

该旧缺陷对照另执行4次真实 File/SQLite console 调用;它证明回归 oracle 能区分坏版本,未把旧提案描述成通过。

具体改动 / Changes

接受依据为原 issue 的兼容性纠正,spec_revision issuecomment-6075026876;还读了当前协调留言和上轮完整评审。原 issue 的“默认改摘要”已被纠正;当前新 status 文档是实现披露,不能自证接受。

criterion_id 当前完整 head 的处置
existing-no-flag-contract implemented:full/thin/exact 及过滤、限行、缺失 ID 的完整 base/head 读回一致
explicit-compact-projection implemented:显式 --summary,版本 todo_list_summary_v0,每role至多8条,不改 thin v0 两条上限
discoverable-real-summary implemented:help/文档可发现,JSON/Markdown 明示截断,exact ID 恢复完整文本,limit/no-limit 同一行一致
separate-mode-budget implemented:独立模式预算;旧默认预算保留,当前 standard budget/semantic 检查通过

关键代码讲解

  • todoListPayload 在原 canonical query 完成后选择展示分支。summary 给选择器 limit=null,保留尚未压缩的标题;其自己的 formatter 再限行。旧 full/thin 仍走既有 compaction。
  • compactTodoQueueSummary 从同一选中行派生一个数组、完整匹配/返回/省略数量、码点安全的标题及截断标记。source/provider/cursor事实继续可读,没有新状态 writer 或 runnable selector。
  • _render_queue_summary 转义表格分隔符、标识被裁标题,并给出原 exact-read 路线;它不把概览文字冒充完整要求或执行准入。
  • list_goal_todos 只在明确选中模式时传 summary,拒绝 thin/exact 混用;Chat、Lark、manager等原 full/exact 调用方仍沿同一规范读 owner。

完整行数分类为生产8路径+123/-8、测试4路径+238/-1、文档1路径+34。改动没有新增依赖、provider、持久schema或配置owner。原 hot-view done omission 抽为同一局部 helper,是已应用的有界整理;进一步抽象无必要。

对主干的风险 / Risks

最强风险是 formatter 再次拿到已经压缩的输入,或概览读取改变默认/权限/来源事实。当前对照保留完整字段,验证显示来源被删后仍从真实 canonical state 读取;18项匹配显示16项、明确省略2项。summary读取、错误组合及完成后的原 full/thin 回读均不改变 provider revision 或展示文件。不存在用显示上限推断规范队列不存在的路径。

独立执行37项 Python、39项 TypeScript,全部通过、无跳过;9个改动 Python 路径 Ruff、配置指定17文件 mypy、完整 control-plane typecheck、差分语义 advisory 和 whitespace 全通过。标准 premerge为6个直接检查、10个catalog、8个risk及1个公共边界检查通过,19项选择检查零失败、零warning、零manual hold。严格 CQR cqr_7bb99b59cd2168f3af02 已按最终范围记录并验证有效。

上轮源版本的 quota 预算失败继续保留在原记录中;本次没有抬高旧预算,也没有把历史失败重新命名为本头通过。未查询、轮询或等待远端 CI。

语义与 CI 对齐

todo_list_summary_v0 是显式派生读协议,复用 canonical role/status/Agent范围与查询次序;不是新的生命周期、授权或调度状态。新 help 宣告可选模式的存在,不代表默认启用。普通自动读取与控制面义务没有变化。错误组合是参数约束;“按ID读完整要求”不被称为新的强制业务义务。实际默认/薄视图配对承担关闭态验证,绿预算或字段存在本身不证明语义。

我的整体评价 / Verdict

long_horizon=preserved,限于原任务/来源和执行结算不被只读视图改写;user_experience=improved,限于可信的有界队列阅读、可见的截断与完整要求恢复。没有据此推断模型理解、安装采用、长期效果或费用节省。

概览留在原 TypeScript Todo read/presentation owner,从规范记录派生;Python 只运输选项和渲染 Markdown,避免第二个筛选、状态或执行 authority。 当前 PR 的边界是显式 CLI 概览及 full/thin/exact 的兼容读回;既有 issue 的设计协调、安装采用与合并决定继续独立保留。

已检查 CLI JSON/Markdown、Todo read 和原 App/Lark 调用方;没有渲染页面或布局变化,视觉评审不适用。 视觉未验证范围:none;实际安装和模型理解未由本次源码评审认证。

当前源码可批准;原 #5895 设计/ownership 对话、正式采用和 merge-readiness 继续由既有 owner 与维护者处理。本次没有代领原任务、dismiss他人评审或合并。

English verdict: APPROVE — cdca02a. The former limit/truncation defect is independently reproduced at eee7 and fixed here on real File/SQLite. Complete default/thin JSON and Markdown comparisons preserve authority, source and requirements;37Python/39typed cases and standard6direct+19selected checks pass. Design/ownership coordination, installed adoption and merge authority remain separate.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants