Skip to content

perf(benchmark): return focused experiment row receipts by default - #7711

Merged
huangruiteng merged 2 commits into
mainfrom
codex/board-mutation-response-20261030
Nov 1, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/board-mutation-response-20261030

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Updating one experiment row currently builds and returns the entire experiment board, so an agent must discard unrelated rows and comparisons after every update. Preview and execute now return the complete normalized affected row, the original write receipt and focused read guidance. Metrics, countability, exact run identity, transition validation and write semantics stay with their existing owners.

This changes the default JSON/Markdown response of experiment-board-upsert. Consumers that need the previous board-shaped response can pass --include-board; experiment-board-show remains the comparison read path. Benchmark/study filters apply to the optional board projection, not the mutation. The benchmark skill and capability documentation explain receipt reuse and when a fresh board read is needed.

Validation:

  • 44 experiment-board tests pass, including real CLI preview/execute/readback, repeated run ids across cases, non-countable zero preservation, invalid-transition rejection and legacy full-board output.
  • Seven interleaved base/candidate previews of one immutable synthetic 1,000-row board: serialized JSON 1,483,359 → 1,883 bytes; in-process handler median 171.9 → 86.7 ms. This measures response construction, not cold CLI startup, model tokens or task effectiveness. Exact row/write semantics and explicit full-board payload match the base; inputs remain unchanged. Markdown CLI also exercised.
  • Public-boundary check clean for all four changed surfaces; diff whitespace check passed. Tests and measurements use synthetic data.

The change stays in the existing Python CLI adapter and reuses the capability's row normalization/persistence contract; no new semantic owner or storage migration. The shared board builder/rendering consumed by other surfaces is unchanged. This is an agent tool-response improvement within the existing capability, not a new frontend journey or capability. No live benchmark launches or installed-runtime changes. Maintainer review and merge remain pending.

Signed-off-by: huangruiteng <huangrt01@163.com>

@songoow songoow 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 Astra Pro — OpenAI — self_reported

动机 / Motivation

通过 benchmark experiment-board-upsert 记录单个实验结果的用户或 agent,原来每次更新都会收到整张实验看板,响应随无关历史行增长。

原默认返回整个 board;本 PR 默认返回完整规范化的目标 row、原 write receipt 和 read hint,需要整板时使用新增 --include-board 或既有 experiment-board-show。更新、校验和持久化 owner 没有变化。

真实 CLI 的 1,000 行同一 ledger 上,JSON 预览 stdout 从 1,008,836 字节降到 1,459 字节;完整目标 row 与 write receipt 保留,显式整板、执行后的独立 show 和最终 ledger 都与基线一致。

这是明确的默认响应格式调整,不是 ledger IO 优化,也不改变评分、countability、实验门槛或权限。未验证模型理解、token 计费或长期实验质量,旧脚本若读取 upsert 顶层整板字段需要显式选择兼容路径。

改动思路 / Approach

这是响应范围的有意调整:单行写操作返回该行的完整规范化结果与原写回回执,整板查询仍有原路径。实现没有接管评分、ledger 或并发写 owner;文档明确旧整板消费者如何继续取得完全相同的结果。

范围止于 upsert 的 JSON/Markdown 投影、一个显式兼容选项和现有技能/能力说明。实际 ledger 读取与更新保持原实现,所以交付的是输出减少,不是 O(1) 数据访问或实验质量保证。

用户 row 先经过原 normalization 和 preview/upsert 校验。预览根据完整四段身份从原 owner 的结果取出目标行,执行直接使用原写回事实;默认投影完整 row/write/read_hint,显式 --include-board 则沿用旧整板生成。独立 show 从实际 ledger 再读全量,验证写入与呈现没有混为一体。

写入与校验仍复用原 experiment_board owner,显式整板仍复用原 _board_payload/show。CLI 的小型四段 key helper 只定位预览中已规范化的目标行,遵循现有身份合同,不重新定义实验或评分规则;无需新 storage、通用投影框架或第二份 ledger。

具体改动 / Changes

关键代码讲解

  • _row_key:按完整身份选出预览中的目标记录。比较 benchmark/study/case/run 四段 key;即使不同 case 复用 run_id,也不把另一条记录当作本次更新。
  • _render_upsert_receipt:呈现完整目标记录与原写回事实。Markdown 收据保留本行内容和写入状态,并给出既有整板读取指引;不改指标或 countability。
  • handle_benchmark_experiment_board_command:在原更新之后选择响应范围。默认输出规范化 row、write 和 read_hint;--include-board 复用原整板结果。预览不写,执行和错误仍由原 owner 决定。

规范基准:loopx/capabilities/benchmark_toolkit/README.md;修订 2f544f9。按改动前 Experiment board 段落中的紧凑投影、完整四段身份、原子更新、评分与 countability 边界审查。以下是段落定位标签,不虚构正式 criterion 编号;默认响应 delta 另作明确披露和真实调用验证。

Criterion 当前结论 对应实现或剩余边界
Experiment board implemented Default row/write receipt; --include-board and unchanged experiment-board-show
Run identity implemented _row_key selects the exact normalized preview row; original upsert owner unchanged
Metric comparisons and countability implemented Full normalized row and original write receipt, original validation/upsert/readback owner

实际验证 / Validation

本轮 exact head 的完整 tests/capabilities/test_benchmark_experiment_board.py 为 44 个案例,全部通过。另在 base/head 各执行 6 次真实 CLI:默认 JSON 预览、显式整板、默认 Markdown、实际写入、独立 show,以及非法状态倒退;使用同一 1,000 行 ledger,不压缩数据集或指标。

默认 JSON 预览 1,008,836→1,459 字节,Markdown 158,456→1,926,执行响应 1,009,001→1,624。目标行包括零指标与未 qualified 的 countability,和原 write receipt 完整保留;其余 999 行未变。候选 --include-board 预览逐字节等于基线默认整板(SHA256 7698fa90d9f4513c51c8955a9b4d6885b28babe8d0086fbed37e393b072e5c22);执行后的独立 show 指纹同为 2b8cfef2350b56dc6ba372941b94067089375a50010900467932e082cab6d590,最终 ledger 同为 4946ffa1a562d3e73071bbfddc9e1c46bdcd80854e21e6dd7a57987003919b42。非法 completed→running 两端退出码均 2 且不写;诊断只多了新 flag 的 usage 行,不能称整段 stderr 无差别。

对主干的风险 / Risks

最主要代价是默认 shape 变化,依赖旧 runs/summary 的外部脚本必须选择 --include-board。仓内调用方检索未找到隐藏自动消费者,文档/技能同步说明,真实兼容路径与单独读回保持原结果。四段 key 避免复用 run_id 时选错行,完整 row/write 保留评分与资格依据。未发现阻断性实现问题,但不把输出字节减少解释成 storage、评分或模型效果提升。

语义与 CI 对齐

这是有意的响应范围变化,不能称默认输出字节等价。独立旧合同要求的身份、指标、countability、原子写入和整板比较路径都保留;read_hint 是导航,不是额外强制任务。本文同时披露兼容成本,并没有用缩小输出来授权删掉目标行的决策信息。

远程 Linux shard 4/5 失败,其大日志在有界重试中未能取回。Windows 的具体失败为 SQLite delegation task revalidation 的 internal lock timeout(1 failed、13 passed、5 skipped、6 deselected);browser 在 research-display-language.mjs:146 等待 30 秒超时。未取得这些场景本轮原生基线证据,故不称已证历史问题;checks/pytest/merge gate 仍红,当前源码评价与最终合并就绪应分开。

当前阻断是验证缺口,不是凭红灯虚构的代码 finding。 仓库当前 verdict_policy 明确未归因的 current failures 阻止批准;仅证明变更文件不在失败路径,尚不足以归类 pre_existing。最小解除条件是对上述具体失败提供不可变 base/head 的同命令、同签名对照,或独立证明外部/环境原因并补齐受影响合同的当前资格;若归因确属回归,再修相应代码。本轮不要求为未归因失败修改无关代码,也不放宽已有预算。

我的整体评价 / Verdict

REQUEST_CHANGES:未发现阻断性的代码缺陷;当前 CI 失败尚缺政策要求的归因证据,因此暂不具备批准资格。 审查绑定 exact head 3593776。

长期实验记录仍由原原子写入 owner 保存,全部行、countability 和比较依据不变。一次更新的确认更聚焦,整板分析仍可独立读回;这不等于 ledger 变成 O(1) 读取,也不证明实验或模型的长期质量。

日常更新能直接看到本次完整结果与写回状态,仍有明确读取整板的路径。代价是默认 JSON shape 有意改变:依赖旧顶层 runs/summary 的外部脚本要加 --include-board;文档、技能与真实兼容路径已一起交付。 变更为 CLI JSON/Markdown 与技能指引,没有浏览器页面布局变化;两种文本输出及整板读回均已实测。

本次已在原 CLI 投影处解决输出膨胀,不需要改 ledger 或增加缓存。保留 --include-board 是有明确旧响应用途的兼容边界;全量 ledger 读取仍存在,但不能在没有对应瓶颈证据时把这次响应优化扩成 storage 重写。

已检索仓内实际消费者,未发现除文档/测试之外依赖 upsert 顶层 runs/summary 的自动解析器;外部脚本仍可能需要迁移。这里只测真实 CLI 输出字节和 ledger 语义,未证明 token 费用、模型采用、长期质量或 ledger IO 优化;远程 CI 失败归因仍有限。

English verdict: REQUEST_CHANGES — exact head 3593776; Current required CI failures lack the repository-required attribution, so approval is withheld. No blocking code defect was found in the exercised change; resolve the named validation gap rather than changing unrelated code.

…response-20261030

Signed-off-by: huangruiteng <huangrt01@163.com>
@huangruiteng

Copy link
Copy Markdown
Collaborator Author

CI attribution on exact head e70a70448 is now complete for the failing dashboard-browser (2) assertion.

  • The failure is goal-workspace-m2: one loaded-lens switch exceeded the frozen 1s wall-time budget.
  • The PR base is 04c5799b8; apps/presentation/dashboard/** and the personal-workspace browser scenario sources are identical between that base and the exact PR head.
  • A controlled single-scenario replay reproduced the same assertion on both revisions. Base observed one switch at 1648.5ms; head observed switches at 1447.9ms, 1259.8ms, and 1140.8ms. This establishes an existing environment-sensitive performance gate rather than a Dashboard change introduced by this PR.
  • The benchmark-toolkit focused tests remain separate from this browser failure. GitHub will not permit a failed-job rerun while the workflow's long test shards are still pending; I will rerun the failed job once that workflow becomes terminal.

No timing threshold or Dashboard code is changed in this PR.

@songoow songoow 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; OpenAI; self_reported.

动机 / Motivation

受影响的是不断向实验看板更新一条run结果的CLI调用者。以前每次upsert都返回整张实验板;本项默认只返回本次规范化row与写入回执。44项现有回归通过,验证完整目标行和write回执、preview无落盘、execute后独立readback以及显式全板兼容路径。本项不降低ledger读取复杂度,不把行更新回执当比较资格,也不证明任务质量或token账单节省。

这次判断绑定PR #7711的完整head e70a704。评价对象是已经存在的实际调用任务与局部可观察结果;重复调用带来的成本或错误恢复路线是本项动机,不能把较小响应或更少导入直接等同于长期任务质量。

改动思路 / Approach

保留现有preview与持久化upsert owner,仅在CLI展示层选择受影响行;legacy全板路径通过显式参数保留。本 PR 的合理边界是实验更新返回的内容范围;ledger身份、锁、原子写入、规范化和状态迁移规则保持。

沿入口跟踪到原所有者、返回值和失败恢复后,这个实现仍在现有边界上处理问题。无改动会保留原成本或错误指引;另起一套业务规则、持久化状态或通用缓存会增加同步义务,此处没有这类必要性。新增说明和投影应服务原调用方完成任务,不能改变原来的准入、权限、结算或来源完整性要求。

具体改动 / Changes

关键代码讲解

  • handle_benchmark_experiment_board_command:preview和execute都取规范化受影响行,默认返回row/write,include-board才组全板。 输入与拒绝分支沿用现有调用路径;这一处的返回内容或依赖时机改变,不把局部投影提升为新的业务判定。
  • register_benchmark_experiment_board_commands:增加明确兼容选项并说明board过滤只影响投影,不约束写入。 输入与拒绝分支沿用现有调用路径;这一处的返回内容或依赖时机改变,不把局部投影提升为新的业务判定。

默认JSON shape有意改变:旧runs/summary消费者必须加 --include-board,README和benchmark skill已同步说明;这是公开兼容代价,不应称完全无行为变化。正向场景是:一次更新可从row/write直接核对结果和dry_run,显式整板仍可供后续比较。负向场景是:非法状态迁移继续被原owner拒绝;过滤不应隐藏已写入受影响行,preview不得宣称落盘。这些是依据实际源码与已有调用测试核对的行为边界;失败和恢复继续由原owner负责,没有以返回字段存在代替真实状态读取。

规范基准: loopx/capabilities/benchmark_toolkit/README.md ;不可变修订 04c5799。以下标签定位原文段落/原句,不是新造的协议编号。

  • experiment-board-upsert:默认JSON shape有意改变:旧runs/summary消费者必须加 --include-board,README和benchmark skill已同步说明;这是公开兼容代价,不应称完全无行为变化。 对应上述原所有者和当前聚焦回归。

实际验证 / Validation

44项experiment board回归 PASS,覆盖真实preview/execute/readback、完整目标行、重复run_id、零值与countability、非法状态迁移和显式legacy整板;Python编译与 diff hygiene PASS。

执行命令:python -m pytest -q tests/capabilities/test_benchmark_experiment_board.py。本轮统计只包含上述实际执行;作者PR内微基准、旧head完整回归和旧review的历史量测都已阅读,但不冒称本轮重新执行的结果。

对主干的风险 / Risks

默认JSON shape有意改变:旧runs/summary消费者必须加 --include-board,README和benchmark skill已同步说明;这是公开兼容代价,不应称完全无行为变化。最需要防止的情况是:非法状态迁移继续被原owner拒绝;过滤不应隐藏已写入受影响行,preview不得宣称落盘。已核对相关调用方和已有review,未重复发布旧head意见;本轮对新增head的源代码与局部回归单独作判断。原持久化状态和业务所有者保持,仍然不能由小范围通过推断整仓或所有部署入口已经合格。

当前精确head失败证据:test-shard (1)、test-shard (5)、dashboard-browser (2)。已有固定base/head同签名浏览器预算证据;当前其他test-shard失败/取消日志仍未取得,不能用单个浏览器归因宣布所有CI无关。 未取得的分片日志明确留作未知;同名错误或改动文件不相交都不足以建立pre_existing归因。

最小补齐是针对当前实际失败取得日志,并提供不可变base/head同命令同条件归因,或能独立覆盖该失败不变量的当前真实入口证据。已完成的聚焦回归不应无条件重做,也不要求无关功能重写;如果归因确认是回归,再修相应最小代码路径。未完成的检查不是单凭pending就要求改代码的理由。

我的整体评价 / Verdict

REQUEST_CHANGES:当前阻断是具体的验证证据缺口。聚焦审查尚未发现可复现的阻断性生产代码缺陷,不能把未归因红灯写成代码finding。 审查仅适用于exact head e70a704。

本 PR 的合理边界是实验更新返回的内容范围;ledger身份、锁、原子写入、规范化和状态迁移规则保持。 44项现有回归通过,验证完整目标行和write回执、preview无落盘、execute后独立readback以及显式全板兼容路径。 已检查 loopx/cli_commands/benchmark_experiment_board.py:handle_benchmark_experiment_board_command;loopx/cli_commands/benchmark_experiment_board.py:register_benchmark_experiment_board_commands;变更是CLI/内部读取或文本协议,没有修改浏览器页面布局,视觉截图不适用。

已有固定base/head同签名浏览器预算证据;当前其他test-shard失败/取消日志仍未取得,不能用单个浏览器归因宣布所有CI无关。 本项不降低ledger读取复杂度,不把行更新回执当比较资格,也不证明任务质量或token账单节省。所有本轮探针使用合成fixture,没有运行真实模型任务或发起业务作业;本review陈述审查与验证事实,不声称已经发布部署或完成合并。

English verdict: REQUEST_CHANGES — exact head e70a704. Focused code review and the listed local regressions found no confirmed blocking implementation defect. Approval is held for the named current validation gaps; resolve their source-bound evidence rather than changing unrelated code.

songoow commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Token 优化专项建议(非阻塞)

基于当前 head e70a7044801c944d2268ec0fefffa78b0669047b,这次优化在合适的返回边界减少了整板输出:默认返回完整目标 row 和 write 回执,benchmark skill 也已要求直接核对回执,并在下一次比较需要时再读取 board。本次覆盖范围内未发现新的正确性问题;这条评论补充采用和成本验证建议,保留此前 review / CI 结论各自的范围。

当前 head 的验证: tests/capabilities/test_benchmark_experiment_board.py 的 44 个测试通过。另外,用同一份独立合成的 1,000 行 ledger 对照 base 04c5799b88f6c4cf12a224b7fa679f272e1e794e 与当前 head,实际 CLI 的 JSON preview 从 653,891 bytes 降到 1,165 bytes(约 99.82%)。--include-board 的有过滤、无过滤输出均与 base 逐字节一致;不匹配的 board filters 不阻止目标行写入,其他 999 行保持不变,最终 ledger 和独立 show 输出与 base 一致,非法状态回退仍被拒绝。这些数字度量工具输出字节;本次没有测量模型 token、账单或作者报告的延时。

建议后续按整个 upsert → 确认写入 → 下一次决策 过程核验收益,优先看消费端是否真正使用了回执。 本夹具一次独立 experiment-board-show 仍输出 653,776 bytes。如果调用方在精简回执之后,只为确认这一行写入又立即读取整板,就会把大部分输出重新带回上下文。这是本次实测输出大小支持的条件推演;我们没有据此断言真实 agent 已经发生了这样的重复读取。skill 已写清预期行为,下一步最有价值的是检查它是否落实到调用序列,而不只是继续缩短单次响应。

可以先在已有的代表性流程或轨迹里记录:每次更新后的确认性 show 次数、真正用于比较的 show 次数,以及从更新到下一次决策的累计工具输出字节。需要比较时,继续遵守 README 的路由、过滤和比较资格契约;行回执只确认本次更新。若同一流程已有模型 usage,再分别报告 input、cached input、output 和 compaction 次数,以核验输出减少是否转化为上下文及压缩成本的下降。缺少 usage 时,结论维持为响应大小和消费端调用序列的改善即可。这可作为非阻塞后续证据,不需要为本 PR 增设收费模型实验门槛。

Reviewer: actor_kind=model_agent; model=GPT-6 Astra Pro; provider=OpenAI; declaration_source=self_reported.

@huangruiteng
huangruiteng merged commit 7bf2d73 into main Nov 1, 2026
33 of 43 checks passed
@huangruiteng
huangruiteng deleted the codex/board-mutation-response-20261030 branch November 1, 2026 02:12
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