Repository navigation
fix(collaboration): preserve outstanding results across request corrections - #7947
Conversation
…ions Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.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
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
在更正委派请求后继续核对旧、新结果的请求者及接收 Agent。
请求从 revision1 更正为 revision2 后,只消费新结果,完整 Inbox 仍提供旧结果,但每 Turn 待办摘要却显示已无欠交事项,容易遗忘原承诺。
摘要保留原版本未送达或未消费结果,并明确各 return 的 request_revision;当前请求目的和评估仍属于新版,消费旧结果也不会关闭另一独立请求。
不新增生命周期、领取、调度、发布或执行权;不将旧结果当新版验收,不认证安装 Host/模型采用或完整 R3 长程收益。
改动思路 / Approach
从现有不可变结果与消费/送达收据推导摘要;只扩展已有 TypeScript 投影过滤,不增第二状态、补写 ACK 或重跑已经完成的工作。
当前 PR 完成原 Inbox/Turn 摘要在请求修订后的遗漏修复;现有 return store、受众授权、取消与发布 reservation owner 继续负责各自边界。
更正的是工作要求,不能顺便确认另一份已提交结果。完整 Inbox 已能提供那份原结果,最小修复是在现有摘要中保留相同事实并显示原 revision。增加手工 pending 标记或由读取补写消费回执都会制造第二状态。这里保留两个独立答案:当前请求还要求什么,以及哪份原结果仍欠消费/送达。
具体改动 / Changes
精确 head b35aee08d19d8af6eedcce45742b47ef7d598fe5,实际 merge base 107e9e32e8f3df29f63b94524250f4044cc01a80;完整4文件 +89/-3:生产8行增加/2行删除,README +7,既有 Python/TS 回归 +74/-1。
预先读取的规范 docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md,spec_revision 107e9e32e8f3df29f63b94524250f4044cc01a80,§5.10 的 Result delivery 要求 result、delivery、consumption 和 acceptance 独立;Request identity and result routing across a team 要求更正不重建请求,也不抹掉原结果。两项在本读模型修复中为 implemented,manager-context README 的现有未完成议程条款补充了实际入口。RFC 仍将更宽的跨 Host M2/M3 验收列为 proposed;本结论不把它们宣布完成。
关键代码讲解
- projectDelegationTurnItem 沿已有 current request/control receipt 决定当前工作步骤;保留 current revision,另纳入尚未送达或 peer 尚未消费的历史结果。取消和 publication reservation 的判断仍先发生,旧结果不能重新授权执行。
- 结果过滤与投影 复用 delivery 状态和 consumed 布尔值,不通过 purpose 文本猜状态;returns[] 增加的 request_revision 从结果收据推导,顶层仍是当前 brief/revision。计数及最后3条/20请求/10KB等既有可见性边界保留。
- agendaResults 在未改的 native owner 中读取、验证完整结果身份与消费收据,再交给投影;没有新 IO、配置或第二份生命周期。只有 conclusion 进入该数据源,superseded 的中间 decision 不会被这个过滤器误当历史 conclusion。
- collectReturns 仍提供原不可变文本并按确切 result_key 消费。完整 reader 与紧凑 agenda 的差别是显示多少,不是“读取就消费”或“最新版覆盖全部历史”。
独立完整3个 owning Python 模块167 PASS/3个既有条件跳过,7个 typed agenda 测试 PASS。自行构造真实 File/SQLite ×0/4个额外当前结果的4条 native CLI 路径:revision1提交原结果 → 更正revision2并提交新结果 → 只消费当前结果 → 两次独立 CLI 仍提供旧 body,并保留当前目的/revision2及1份待消费。收据文件在这两次读取间逐字节不变,未重交付或补写 ACK。
额外当前结果超过3条显示上限时,紧凑列表可以省略旧条目,但 additional_return_count=3、unconsumed_return_count=1,完整 reader 仍提供原文本;没有从裁剪列表推断它已消费。再创建同 Goal 的独立请求,消费旧结果只移除原请求,独立请求仍 await_peer_result;明确取消后才移除那项工作。相同4条路径在不可变基线均 FAIL:完整 reader 有原 body,agenda 却 outgoing_count=0。另一个较小的2场景对照同样敏感;未把重叠运行相加宣称更多独立案例。
对主干的风险 / Risks
最强风险是纠正遗漏时反而让旧结果结清新版工作、绕过受众或无休止重开历史。当前 receipt 判断优先、原结果 revision/key 保留,以及 exact consume 后只剩独立新请求的对照,分别覆盖这几种相反方向。取消/保留中的 reservation、错误来源、未知证据与 bounded overflow 仍走现有 owner;现有完整集成同时覆盖这些拒绝,不修改真实活动 Goal、租约、provider 或 Host。没有新增调度器、待办前置条件、主动派发或结果重放。
配置17根 mypy 仍 FAIL786 errors/125 files:与不可变基线及另一个评审头的完整119,338B诊断逐字相同;全部125报错文件和 tracked config Git 对象未变。digest-owner 模块16 PASS/1 FAIL,在基线和两头产生同一未改 delegation.ts 的未使用 ENVELOPED_SHA256_PATTERN 断言,完整819B失败块仅归一化 checkout 前缀。这些是本轮独立观察,不是作者的全5908项 TS 数字或77跳过资格。
标准 premerge 仍 FAIL:5 direct PASS、15 selected 中 lifecycle 失败,并保留一个 raw ratchet advisory FAIL。通过原生 runner 在 base/head 重新观察,完整511B错误只替换 checkout 前缀后相同:真实 gate mutation 已完成,旧 Markdown reader 随后读取缺失 evidence 字段抛 KeyError;相关测试、parser 与状态投影源码未由本 PR 修改。ratchet完整393B输出也相同。最初直接脚本调用只得到子进程失败,不能冒称同一个断言;采用原生 runner 后才取得上述可比证据。两项 FAIL 保留,严格 CQR 亦保持 FAIL,没有基线豁免。
完整声明的 TS typecheck、CI Ruff roots、diff/双语/编译、完整语义和四路径公开边界 PASS。未查询、轮询或等待远端 CI;未重跑作者打包/安装验证、完整 repository Python 或全量 TS。无效 python -m loopx 的两次启动失败未执行 premerge,已保留;真正报告来自该源码环境的正常 console 入口。
我的整体评价 / Verdict
APPROVE 这项现有读模型修复。 它恢复已有独立结果义务,当前请求与其它请求仍各自成立;在真实连续读回、消费和取消之间没有制造新效果。long_horizon=improved、user_experience=improved 指保住这项已有承诺并消除假空队列,不代表已测出模型行为、总成本或长期净收益。
从现有不可变结果与消费/送达收据推导摘要;只扩展已有 TypeScript 投影过滤,不增第二状态、补写 ACK 或重跑已经完成的工作。 当前 PR 完成原 Inbox/Turn 摘要在请求修订后的遗漏修复;现有 return store、受众授权、取消与发布 reservation owner 继续负责各自边界。
已检查 CLI、现有设置/请求读取消费者;没有渲染组件、布局或首屏变化,视觉评审不适用。 安装态 App/Lark、真实模型采用与其他平台未验;本次为源码真实 CLI/后端验证。 上级 R3/M2/M3、原对话返回、安装态采用和完整成本仍有自己的验收。所有 required mypy/digest/premerge 失败保持,质量、讨论/readiness 与合并授权独立;作者同账号以 COMMENTED 承载代码批准,不冒称 formal APPROVED 或可合并。
English verdict: APPROVE b35aee08d19d8af6eedcce45742b47ef7d598fe5 for the scoped correction/read-model repair. Four native File/SQLite controls retain the original return after consuming revised results, including bounded omissions and independent new work; all four fail on base.167 integration tests and7 typed cases pass with3 conditional skips. Existing required quality failures remain FAIL; this COMMENTED conclusion grants no merge or host-adoption authority.
Goal and delivered outcome
Correcting a delegated request must not acknowledge an earlier result. The native Inbox could still offer an unconsumed revision-1 result, while the per-Turn agenda showed no outstanding request after the revision-2 result was consumed. The agenda filtered every result to the current request revision.
Keep unresolved delivery and peer-consumption observations at their original revision in the existing TypeScript projection. Each compact return now includes its
request_revision; the request's purpose, assessment and revision still describe the current brief. Resolved historical returns leave the compact view and remain available through the full reader. Explicit cancellation, publication reservations, audience checks and bounded output retain their existing owners.Written by: model_agent / OpenAI Codex, GPT-6 family.
Implemented against
Specification: the collaboration result/return contract in
docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md§5.10 and the manager-context README, at baseline107e9e32e8f3df29f63b94524250f4044cc01a80; R3 is the owning roadmap stream.Scope and continuation
Complete within this read-model repair. Reuse
manager-contextand the existing collaboration receipts; no new capability/provider, writable lifecycle, Todo prerequisite, scheduler, configuration or permission.request_revisionreuses the existing result vocabulary. The projection remains linear with the same request/return and byte limits; it adds no source IO or RPC by code inspection. Model cost, comprehension and long-horizon benefit are unmeasured.The wider R3/M2/M3 fulfillment, installed-host adoption and original-conversation acceptance remain separate. Related #7926 retains explicitly partial work and is not a dependency of this fix. This PR neither closes that program nor qualifies its current head. No RFC maturity boundary changes. Bounded refactoring review found the direct existing owner sufficient; no new wrapper or parallel Python decision was needed.
Validation
Tested production revision:
b35aee08d19d8af6eedcce45742b47ef7d598fe5. Run state: finished. Inputs: synthetic, public_fixture. Local Node 24.21.0 / SQLite 3.53.4, disposable File and SQLite stores.content_digest_single_ownerrejects an unusedENVELOPED_SHA256_PATTERNimport in unchangedcollaboration/delegation.ts. No waiver.KeyError: evidence; maintainability ratchet still rejects unchanged Todo-section renderer debt (selector classifies inherited advisory). Both failures remain disclosed.The attempted source-session quota-guard fixture was rejected by the current generic registry reader; it is not counted as a passing guard. The corrected-request regression uses the supported native Inbox path. An initial normal wheel build correctly rejected copied stale frontend assets; the final wheel used a normal fresh build.
Exact-scope change-quality receipt
cqr_1eb39320a9dee4e18b50is recorded as FAIL, verificationinvalid_receipt, for the required failures/skipped full Python suite. One permitted safe-fix pass updated the stale characterization oracle; the entire final diff was re-reviewed. Approval, required CI and exact-head readiness remain outstanding. No merge, installation or release is requested by this evidence.Frontend / visual evidence
UI impact: none. This repairs the Agent-facing Inbox/Turn agenda; no viewport, layout or App/Lark interaction changed. Existing request/detail surfaces retain their own acceptance. Visual evidence: N/A; packaged CLI readback above is not an installed UI claim.
Boundary checklist