Repository navigation
Bind Explore execution evidence to the finding once - #8268
loopx-agent wants to merge 1 commit into
Conversation
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)
没有阻塞发现。独立核对覆盖了关闭 Explore 时的原路径、错误结果归属、旧捕获恢复,以及更正后只结算一次。
动机 / Motivation
启用 Explore 的协调 Agent 在关闭已验证的 Todo 时,需要把实测输入版本和证据写进可供后续轮次复用的发现。原来,同一版本与证据要同时填在发现和执行观察里,复制不一致会让写回在入账前拒绝。现在,调用者在同一发现内显式选择执行证据,LoopX 复用已声明的输入版本。有效提交在原 Turn 结算,后续读回完整执行记录,拒绝后更正也只扣一次额度。验证范围是源码 CLI 结算和读回,真实模型采用及 benchmark 收益尚未测量。
改动思路 / Approach
继续接受两份独立填写的声明可以维持严格校验,却会保留同一来源被重复填写的机会。自动取整份发现的证据会抹去一项必要判断,因为发现里的某条证据可能属于另一次执行。这里把可机械取得的输入版本留在发现里,把全量复用或精确子集的选择留给填写者。
简写只在原 Explore 附件所有者内展开,完整记录与执行归属仍由原校验器负责。当前 PR 边界是同一发现的填写、既有捕获中的示例及规范记录的读回。模式、认领、租约与原 Turn 结算仍由已有控制面验证。quota 两处修改只决定何时展示可选示例,原始捕获保留全文,恢复按原捕获读取。
具体改动 / Changes
按 00a8393ac41e6555d2b4008e3e1823de11cb23e4 的 docs/reference/protocols/explore-result-from-path-delta-v0.md 和当时的 Explore 执行观察契约评审。这里是对既有约束的逐项核验。 固定版本的路径增量契约 固定版本的执行证据契约
- CAPTURE_SCOPE。附件显式绑定同一 vision 的顶层路径增量及当前认领的 Todo。关闭模式时普通结算照常,显式附件在写回前被拒绝。
- EVIDENCE_SUBSET。先确定发现的合法引用,再从中选择执行引用。CLI 反例把发布结果留在发现里,却从执行子集排除该结果,提交被拒绝且没有入账。
- CANONICAL_ATTRIBUTION。执行观察读回仍携带完整输入版本、候选 SHA-256 及证据。已发布结果必须同时属于实际候选和此次执行的引用集。
- RECOVERY_READBACK。新 CLI 读取旧捕获时返回原计划,在同一 Turn 以完整 v0 提交并重放。独立 SQLite 夹具只扣一次。
关键代码讲解
normalizeAttachedExecution只识别明确的简写版本,拒绝同时提供嵌套版本。普通 v0 仍直接进入原 codec,路径增量附件先把证据范围限定在该发现。 附件展开normalizeExploreExecutionObservation检查完整字段、候选摘要、有限测量和引用。简写通过同一分支得到规范记录,standalone 调用仍只接受完整版本。 完整记录校验resultWritebackFields把同一个示例投影到 Explore turn-context。仅当捕获里的原字段与当前已识别的投影精确相符,才用原有详情读取指针替代重复正文。 字段所有者和读取路径initialContextReadPointers与freshPaths都只延后明确可选的 Explore 示例。入口仍保留实际读取和填写路径,必读字段与其他能力的同名控制照常交付。旧捕获可按原计划读回。 渐进入口 增量路径
11 个文件增加 212 行、删除 15 行,其中 121 行增加在三处测试。协议和 capability README 记录可选写法,self-repair 参考表在遇到明确的执行证据不匹配时提供恢复建议。它由症状查询读入,检查所及的关闭模式入口没有新增 Explore 指令。
对主干的风险 / Risks
- PASS。源码 CLI 的 File 关闭模式用例在基线和此提交得到相同的规范化结果,均无附件示例。有效旧格式附件仍被拒且零扣费,随后不带附件的普通写回在原 Turn 完成。Explore 开启的 SQLite 反例在发布结果未进入执行证据子集时零写入、零扣费。只修正所选证据后,发现保留两条引用,执行记录只保留实际结果引用。
- PASS。旧 CLI 读取原 SQLite 捕获后仍拒绝未知简写。新 CLI 读取同一份捕获,原参考文件和计划摘要匹配,完整 v0 写回及精确重放合计扣费一次。File 与 SQLite 的现有真实调用测试也覆盖了完整 v0 输入版本不匹配、简写更正、规范读回和重放。
- PASS。独立运行 54 项 TypeScript 上下文与附件测试,复核 6 项真实 CLI 定向用例。TypeScript typecheck、仓库要求范围的 Ruff、双语 RFC 检查、语义词汇和 diff 检查通过。按本次评审策略未查询 CI。
语义与 CI 对齐
explore_execution_from_finding_v0 是 Explore 附件的局部输入变体。finding 是显式证据选择。耐久记录沿用完整的 v0 执行观察、原候选归属和结算身份。简写未扩大执行权限,单独存在的能力配置或附件示例也不会触发写回。
我的整体评价 / Verdict
批准提交 36f5dc97f564409c10e40051c6bd5e48cace3283 的源码变更。后续继续工作的依据是原 Turn 能在拒绝后修正并结算,重放只读回已落盘的结果。填写体验少了一份已知输入版本,执行证据范围仍由填写者决定。作者的匹配回放显示可选详情增加 846 字节,这项开销出现在选择读取处。实际采用频率与长期净成本仍需另测。
此 PR 修改 CLI 的捕获、写回及读取契约,现有前端继续消费完整执行观察,视觉审阅不适用。GitHub 发布为同账号的 COMMENTED 结论。
English verdict: APPROVE — At 36f5dc9, the attachment shorthand preserves canonical attribution, disabled-path parity and recovery on the original capture.
Problem
Explore closeout asks the caller to copy the same tested input revision and evidence references into both the finding and its execution observation. A mismatched copy rejects the settlement before writeback, requiring another submission on the same Turn.
Change
Both Explore attachment forms accept the explicit authoring-only
explore_execution_from_finding_v0form. It takes the required input revision from the same finding. The caller explicitly selectsevidence_refs: "finding"when all validated finding refs describe that execution, or supplies its exact opaque subset. The owner expands the attachment through the existing complete execution codec and attribution checks. Candidate and released-result evidence stay explicit. Canonical records, readback, and standalone findings use the complete v0 observation.The captured settlement affordance shows the example alongside the existing scope and evidence guidance. Progressive entry keeps the optional detail reachable through the existing reader. Warm delta reuse inherits the example only from an exact base. The existing Explore activation and authorization gates apply.
Verification
uv run --extra test python -m pytest -q tests/control_plane/test_refresh_settle_turn.py -k execution_evidence_uses_explicit_finding_bindingon the head. The independent oracle uses real File and SQLite authority, opens the captured writeback plan, retains the original rejection with zero debit, settles the same identity, reads the complete evidence back, and verifies one debit after replay. Apply the test alone to the base to reproduce the unsupported compact observation.3b3f9536d1487bf46d5b0dca7f936a771e117befb1a32f81d9fc1dba8c13a5c4). The rejected response was 528 stdout bytes. The full optional affordance grew by 846 bytes in the selected read and its example was absent from progressive entry.The built-in Explore capability remains the owner. The authoring form is expanded at the attachment boundary, with no persisted vocabulary or provider change. These synthetic replays qualify transport and settlement behavior. Live adoption and native outcome effects remain unmeasured.