Repository navigation
feat(explore): reuse verified comparison context for measured findings - #7105
Conversation
…rements 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=xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
记录连续候选分数的 Explore 使用者需要复用已经核实的比较条件。以前每次都重填三项条件,容易把单次提交编号写成比较键;现在可复用同一份条件,候选和结果凭据仍逐次独立记录。已验证普通写回会展开为原有完整记录,下一轮能保留最佳候选并显示回退。本次不自动认证可比性,不改变评分、权限或正在运行的任务。原生结果生产端自动采用以及模型实际收益仍未交付。 原有说明已经要求区分评测条件与候选编号,这次解决重复填写的输入成本,不把建议文字当成系统能够自动判断可比性的证据。
改动思路
继续使用现有 TypeScript 测量规则,Python 和 CLI 只传输或读取输入;不增加第二套分组或持久化上下文。当前 PR 交付可直接使用的输入复用和原有历史读回;后续生产端采用需单独验证,不能把这次输入便利称为效果提升。 两条入口先校验输入,再调用同一个完整测量校验器。上下文不进入日志或结果身份,因此后续更换条件文件不能改写历史。与另建条件注册表相比,这个边界没有同步、迁移或权限扩散;与再加一段提示相比,它提供了可直接调用的行为,而不只是新增说明。
具体改动
依据已存在的 loopx/capabilities/explore/README.md,规范版本为 e4246649719654213d52802b909e612d0afd13d6。comparison_scope 条件相同才比较,evidence_ref 必须绑定结论来源,null 表示未测量;三项均已实现并由反例验证。并未重写既有条件以适配新实现。
关键代码讲解
loopx/control_plane/capabilities/explore_measurements.ts:24的normalizeExploreMeasurements接受恰好三个共享字段,拒绝观测重复填写,再复用原有九字段校验。原有零分、负数、未知值、重复指标和不合法来源检查保留。loopx/cli_commands/explore.py:574读取可选条件文件,要求同时提供观测文件,通过 Python 适配层到现有 TypeScript 规则。普通完整输入继续可用;错误在追加前返回,条件文件不会被改写。loopx/control_plane/capabilities/explore_result_writeback.ts:142的normalizeAttachment同时覆盖普通与 path-delta 附件,在展开后继续检查 input_revision 与 finding 的 evidence_refs。等价内联与文件附件合并为相同身份,重放不追加。中英说明明确了改变条件需要另选上下文。
验证通过 28 项相关 TypeScript 测试、完整控制面类型检查、Ruff,以及新增真实 CLI 用例。另用隔离 File/SQLite 跑两次普通 refresh/hook/spend,读回 best=8、latest=6、delta=-2;旧版读取器及真实历史 HTTP 接口均可消费同一完整记录,原 Todo 仍保持打开。
对主干的风险
最强风险是共享条件覆盖观测或错误复用上下文。前者在写前拒绝,包括重复且相等的字段;后者的事实真实性仍由调用者核实,系统没有宣称自动认证。条件缺失、多余字段、来源不匹配及评测器变化均有反例;改变评测器保持独立分组,不通过模糊匹配补齐。Explore 关闭的真实 CLI 语义输出在主干与此提交一致(仅隔离路径派生的四个摘要不同,各自来源绑定正确),不写日志;启用状态增加一条可选用法说明,旧完整输入与持久化字段不变。
标准 premerge 准备依赖后仍为失败:19 项所选 canary 中 Explore configure 触发 KeyError: status_health_ok,同一检查在未修改的 e4246649719654213d52802b909e612d0afd13d6 上同样失败。五文件 Python 边界套件为41通过62失败,基线38通过及相同62失败;逐项失败标识与渲染错误只归一化测试路径、对象地址后相同,pytest 省略内容不能当完整 payload 一致性。首次缺 TypeScript 依赖的失败保留,安装后两边语义检查均通过;没有删检查或放宽限额。这里区分评审结论与合并验证门,失败仍需保留。PostgreSQL、安装版 App 和模型采用尚未验证,当前实现不改这些存储或界面路径。
语义与 CI 对齐
复用已有测量词汇和 TypeScript 决策所有者,只增加临时输入形式;没有新增状态枚举。差分语义建议未发现支持识别的新载体,这不等于自动证明所有动态语义。完整语义 smoke 在准备依赖后通过,公开边界及双语检查通过。未查询或等待远端 CI。
我的整体评价
APPROVE,边界为有价值的增量:连续两轮的记录、历史和恢复语义 preserved;输入复用的 CLI 用户体验 improved,但没有据此声称模型收益。此次只改变 CLI 与输入解析;检查了原有历史 HTTP 消费路径,没有修改渲染代码,因此不要求新增视觉截图。 未验证范围是安装版 App、模型采用和自动原生生产端,本次没有渲染改动。继续使用现有 TypeScript 测量规则,Python 和 CLI 只传输或读取输入;不增加第二套分组或持久化上下文。当前 PR 交付可直接使用的输入复用和原有历史读回;后续生产端采用需单独验证,不能把这次输入便利称为效果提升。 没有发现需要先修复的本次实现问题,既有红色验证和明确 maintainer 合并授权仍单独约束合并,不因作者自审而豁免。此结论仅覆盖 eb6a8ddf49b7e3658a4af7162cf389cb17316e2c。
English verdict: APPROVE — eb6a8ddf49b7e3658a4af7162cf389cb17316e2c. Explicit context reuse expands to existing complete measurements and preserves provenance, replay, changed-condition isolation and old readers. Focused TypeScript, typecheck and real File/SQLite CLI/history checks pass. Existing base-matched Python/configure failures remain red; model benefit, automatic ingestion and installed App behavior are unqualified. Review approval is not merge authority.
Recording successive measured candidates currently requires callers to repeat the comparison scope, input revision and evaluator version in every observation. Reauthoring these conditions can accidentally separate comparable results and hide a regression. Add an explicit reusable input while keeping the existing measurement storage and comparison rules.
explore finding --measurement-context-json conditions.jsonsupplies exactlycomparison_scope,input_revisionandevaluation_ref;--measurements-jsonsupplies each candidate, result receipt, metric, value, unit and direction.measurement_context. The existing TypeScript owner expands it into complete nine-field measurements before identity and persistence. Missing/extra context fields and observation overrides (including equal duplicates) reject.This is an authoring improvement. It does not establish automatic native-provider ingestion, model adoption, lower total cost or improved benchmark scores. Future producer integration must verify the conditions it reuses. The existing artifact/history presentation consumes unchanged records; no UI layout changed.
Validation on the proposed source:
e4246649719654213d52802b909e612d0afd13d6. All 62 failed test IDs and rendered error details match after only synthetic path/address normalization; rendered pytest details may abbreviate payloads. These failures remain failures.KeyError: status_health_okon both base and head. Dependency preparation makes the full semantic smoke pass on both. Prepared exact-commit standard premerge still fails one of 19 selected canaries: the same base-reproduced Explore configure error. All direct, compile, full semantic, risk-profile and public-boundary checks pass. Full control-plane TypeScript typecheck passes. No blanket green-check claim.Remaining qualification: real PostgreSQL, installed App interaction, automatic provider production and actual model adoption are untested. Broader native-provider wiring remains outside this bounded proposal. Merge requires the repository's validation, exact-head review/readiness and explicit maintainer authorization.