Repository navigation
fix(quota): bound mixed diagnostic summaries without losing unfamiliar records - #7587
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
8cb4676 to
b4714ae
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
APPROVE — b4714ae5c2dad6ae1d77a899898dae7888604d7e 未发现阻塞问题。结论限定诊断展示修复,验证不授予 merge 或安装权限。
动机
读取 quota 诊断摘要、并需要完整候选来决定下一步工作的 Agent。
一个任务带结构化恢复条件时,旧版会把同组所有已知诊断记录重新展开;同一批正文跨多个诊断组重复,增加输入而不增加选择事实。
未知记录仍完整保留,已知同组记录恢复原有显示上限,完整候选与详情保持原文。
本次不证明模型费用或长程收益,也不交付整体 C1/C2、活跃安装升级或科学实验。
重复复杂记录、较大的冷输入及真实模型完整成本仍未解决;该切片不结清整体效率要求。
改动思路
在现有 TypeScript 诊断投影内逐条判定已登记记录,Python 仍只应用无损展示 edits;没有第二个选择或授权 owner。
本 PR 只修复既有默认诊断视图和冗余计数,候选选择、原始来源、准入及结算均沿用原 owner。
最强的不发理由是:摘要更小并不能证明后续工作更有效,未知记录本身仍然重复。对照真实 CLI 后,继续整组展开会保留已复现的冗余;删除候选或恢复条件又会损失必要要求。局部替换原 predicate 已能交付有用增量,无须另建选择器、缓存或配置。原始输入在完整规划之后才进入展示投影,所以下游不能从摘要中没有某条记录推断权威队列里也没有它。显式详情仍走原入口,不增加用户重新输入或确认的轮次。
具体改动
完整四文件 +161/-13、两提交已审阅。规范依据是修改前的 docs/quota-allocation.md,spec_revision 0d4bf99a4aa6080f2774f3c4477fb4adc1b5ac46;criterion_id CLI Surface。Disposition 为 implemented:完整规划先于显示,计数、排序、health 与详情保留。此次新增说明只是披露逐条 fallback,不能替代原合同或缩小完整候选要求。
关键代码讲解
knownItem:沿用 canonical read 字段和 schema/value shape;结构化条件、未来字段、未来 schema 或标量不被当成可隐藏的已知记录。compactSummary:原显示范围内的记录与范围外的未知记录一起保留,保持相对顺序;nested claim/warning 也只移除已知记录。上游计数只有在整条 lane 已移除、schema/字段已知且 shown/total 与来源一致时才折叠,未知或不一致信息继续存在。projectQuotaDiagnostics:继续整批一次调用,候选、portfolio、未知列表与完整详情不进入本次裁剪。Python 的原值引用 adapter 未改,没有把大整数经 JS 数值往返重写。
对主干的风险
主要反例是“已知同组变小,但未知停止条件或完整候选也被裁掉”。冻结同一公共 CLI 用例,File/SQLite × App/generic 四项在不可变 base 都在重复诊断行断言失败,head 四项通过;完整条件、八个 runnable candidates、末尾约束和独立 todo detail 保持,源文件不变、spend 为零。175 项 Python 覆盖 Agent/User、未知字段/schema/标量、边界前后位置、嵌套组、大整数、精确来源引用、幂等与 full detail;typecheck、5 direct/14 selected premerge 全过,无失败或 manual hold。
独立合成混合记录经过生产投影,未知恢复记录完整,候选等值,得到以下 UTF-8 JSON 结果;这与作者 4.1% 的工作样本不同,没有复现或外推该数字:
| 同一合成输入 | base | head |
|---|---|---|
| 摘要输出 bytes | 42,575 | 10,331 |
| 整包输出 bytes | 74,513 | 42,269 |
| first / backlog / nested 可见条数 | 8 / 8 / 8 | 4 / 1 / 1 |
语义与 CI 对齐
96 组默认 CLI matched observations 无预算或语义回归。crowded/multi_agent 两项有已审阅形状差异,分别少 305/353 bytes,均只折叠已隐藏 lane 的 source_projection 计数;continuation、authoring、语义键与 action signature 保持。该行为作用于既有默认诊断路径,不能称为 default-off 隔离;显式 agent/user detail 仍完整绕过投影。未知或不一致上游计数的反向用例通过。未查询、轮询或等待 CI。
初次 wheel 因本地 Chat bundle 陈旧被正确拒绝;依既有依赖与 asset build 流程重建后,重新构建的 wheel 核心源码与本 head 逐字相同。隔离安装四条 File/SQLite × App/generic 路径通过,parent/subprocess 都核对 site-packages 来源。初次隔离 harness 缺 tests namespace 的失败也保留,只修 fixture 导入,未改产品或断言;没有升级活跃运行时。
我的整体评价
APPROVE,属于 justified_increment。原承诺与后续恢复保持,用户在现有请求中得到更清楚的诊断,未增加必需交互。复用既有 typed vocabulary 与单一 owner 的边界合适;逐条 predicate 是本域内的有界简化,没有需要当前再建抽象的理由。完整输入成本和模型采用仍由既有工作资格化。
视觉检查不适用:审阅了实际 CLI JSON、原生 transport 及对应调用方,本 PR 没有改动渲染页面。真实模型理解/保留、token、时延、费用、活跃安装采用及完整长程净益未验证。
English verdict: APPROVE b4714ae5c2dad6ae1d77a899898dae7888604d7e for the bounded mixed-diagnostic repair; complete unknown records, candidates, detail recovery and real File/SQLite paths are verified. Model and complete-cost gains remain unqualified.
A single unfamiliar Todo record, such as a task carrying a structured recovery condition, currently disables summary compaction for every sibling in its diagnostic lane. The same known records then reappear across several lanes. Scope this conservative fallback to the unfamiliar record: preserve it verbatim and in relative order, while applying the existing bounded view to known siblings. Candidate collections, complete work context, authority, selection obligations and explicit detail views remain unchanged.
Also fold an upstream diagnostic count only when its entire lane has been removed and its known counters exactly match the displayed source. Retained lanes, unfamiliar schemas/fields and inconsistent counters keep their original evidence. Omission counts now reflect only removed records. This uses the existing TypeScript presentation owner and Python lossless edit adapter; it adds no state schema, selector, admission rule or configuration.
Validation at
b4714ae5con main0d4bf99:In one frozen required-view replay, summary JSON decreases from 35,254 to 25,398 bytes and the whole serialized input from 239,861 to 230,005 bytes (9,856 bytes, 4.1%). All nine structured-condition copies and the complete candidate/work-context values remain unchanged. These are matched offline serialization results, not token, billing, latency or accepted-outcome gains. The remaining large cold input, repeated complex records and decision-stage delivery still require further qualification.
Scope-fit: isolate fallback in the existing row predicate and reuse the shipped CLI/native tests. No broad permission to omit nested data is introduced. Unknown-summary schemas retain full fallback. Public fixtures and metrics are synthetic/generalized; operating captures remain private. This is a bounded diagnostic repair, not completion of the progressive-context efficiency goal.