Repository navigation
fix(testing): complete native semantic replan qualification - #8016
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>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
e726033 to
32fba35
Compare
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 通过真实命令读证据、编写决策并完成原轮结算。原生读取命令换成 Python 模块入口后,旧测试宿主可能先拒绝合法读取;创建后续任务后又提前开启下一轮,导致原轮尚未回写和扣额便被当作完成。现在合法读取由固定解释器执行,Agent 自行编写当前决策;后续任务创建之后,仍须完成原轮真实回写、一次扣额和回读才能通过资格。本次不证明真实模型理解、已安装宿主采用或长程收益,也不授予后续任务在原轮执行的权限。真实模型、安装后采用和长程完整成本仍未资格化;仓库全量静态扩展检查及 exact-scope quality hold 也未据此豁免。
改动思路 / Approach
复用固定 CLI 执行器、当前 capture reader 和现有 OS 隔离 shell;宿主只观察真实 writer 的决策和结算,不代写 Vision、Stride 或 binding。当前 PR 的边界是五个文件内的隔离资格宿主、脚本 oracle 与相应文档;生产语义判定、持久化和结算仍由原有 typed owner 执行。这次有意修正的是资格宿主能否走完已经存在的合法流程,而不是降低真实 writer 的要求。旧版“创建 successor 便看下一轮”遗漏了原轮工作;新版先把创建结果作为观察保存,等当前决策、真实回写和原额度结算均已成立,再检查后续采用。
| 触发 | 原行为 | 当前可观察结果 |
|---|---|---|
| 合法模块 capture reader | 宿主可能拒绝 | 固定解释器读取当前 source/SHA |
| successor 已创建 | 提前读取下一轮 | 原轮回写、扣额、回读后才观察采用 |
| shell 打印 recovery JSON | 不应产生权限 | 只有 bound writer 的真实拒绝能授权精确 recovery |
这是源码和执行结果的对照;没有把命令拼接或测试数量当成真实模型理解。既有 required-Vision 的四十调用路径仍独立,narrow 路径保持七个普通调用加最多三个 native read;恢复读取消耗普通预算。
具体改动 / Changes
关键代码讲解
_module_reader_tokens只把两个模块名下的quota context-read/replan-view规范化。实际执行仍走既有固定解释器;模型提供的 Python 路径不会被执行。QuotaToolContext.read继续核对当前路径、SHA、重复参数和 override,不能借相同内容的另一份文件换 source。_bound_semantic_writeback检查项目内已编写草稿与原 obligation/Turn,再调用真实 writer,并核对历史中的 semantic delta、checkpoint 和 settlement identity。恢复 capture 只能来自该 bound writer 的拒绝;shell 文本不能制造它。host 不补写 Vision 或 Stride 的任何语义字段。_handle_semantic_spend要求完全匹配 writer 返回的原结算命令,随后核对 settled-skip、一次扣额及下一轮原义务不再挂起。新任务创建、status0 或只写了 JSON 都不足以通过。_standalone_cli防止把 shell 前缀丢掉后仅执行 CLI 后缀。组合草稿走既有VisionShellHost,原始输入和 authority store 受 OS 隔离保护,CLI 回调仍只允许原有有界操作。新加入的几个状态字段只是实际 writer、执行和恢复的局部观察,没有建立第二套持久化真相。
规范依据为已验收的 Goal Vision/Replan contract、同轮选择与恢复 和 required-work-context。本 head 对应:ownership-boundary、stride-v2、replan-ack-freshness、current-capture 均 implemented;实时模型、安装后采用及科学收益没有被这些测试覆盖。测试脚本从实际包读取当前引用,独立编写三轴 reason 和 minimum evidence,并验证其真实持久化;未用主实现的默认 decision 代替作者决策。
对主干的风险 / Risks
最危险的路径是把 shell 里的“成功/恢复”文字当成权限,或把 successor 的存在当成原轮结算。实际源码保留 fixed executor、native writer 和 sandbox 三个不同责任边界;反例验证 foreign capture、错误 SHA、外部草稿、缺失或错误 v2 引用/字段、错误 spend Turn、未 spend、伪造 recovery 都不能通过。组合实验变更 basis 时,真实拒绝后重新读取,并把“仍待下一轮执行”的事实写入新决策,原轮只扣一次;没有仅替换 context id 蒙混过关。
独立验证:PASS — 当前 base a01306337232 与 head 32fba35023c3 使用同一完整 head oracle、相同 Python3.14.8 依赖及各自实际生产源码:base 130 passed / 51 failed,head 181 passed / 0 failed / 0 skipped。对早先 e726 的161/7结果单独保留,未拿来证明新 head。PASS — 仓库当前 CI 的 Ruff 命令和 python -m mypy(17配置文件)本地执行通过。PASS — exact-base premerge 退出0,direct/catalog/risk 检查执行完成,但保留一个 gate 标记的 inherited maintainability advisory。UNVERIFIED — 作者报告的全仓122 Ruff及扩展 mypy4706错误未在本轮独立归因,不能说全仓静态检查通过;exact-scope quality hold 也没有被本评审解除。远端 CI 按当前策略未查询。
语义与 CI 对齐
系统指令由“不得创建 Todo/组合命令”改为“OS 隔离下编写决策、执行有界 successor 或直接结果并结算”,属于已披露的 intentional change。它恢复已有原生合同要求的能力,不是压缩文字或扩大生产权限。逐项检查了 actor、触发、先读证据、决策作者、范围、时序、停止和预算;真实反例区分了丢失 spend、伪造 recovery 和合法恢复。现有术语复用,新增 failure/观察名留在本地 qualification owner;diff-scoped semantic 检查通过。Linux bubblewrap、真实模型和安装状态没有从 macOS 脚本结果推断。
我的整体评价 / Verdict
APPROVE:这是范围成立、能独立验收的内部资格增量。long_horizon=improved 指资格工具能检验真实决策与后续采用,user_experience=improved 指维护者得到完整流程和正确失败边界;二者均不代表已量得真实模型或长程净收益。代码增长主要来自原生正反例及独立脚本决策,复用 shell/reader/typed writer 的成本合理;进一步合并不同预算的两个接受器会扩大本次范围。
该结论仅对应 32fba35023c37b164d2d3ebfb038fb450c345c5b,不解除 quality/merge readiness 的单独 hold。由于 GitHub author-owned,发布 COMMENTED 承载完整 approval conclusion,不作形式自批或合并。
English verdict: APPROVE this exact-head qualification repair; quality/readiness holds and live-model adoption remain separate.
Current replan qualification can fail before a valid outcome reaches the real writer: captured readers use a module launcher, typed-only scripted actions omit the required v2 decision, and the host tries successor re-entry before settling the original Turn.
Reuse the trusted CLI/current-capture reader and existing OS-isolated shell for model-authored Vision/stride drafts. The writer still owns semantic acceptance. A linked joint experiment can change the review basis; the actor now reads the exact recovery capture, reassesses the scheduled work and completes the original bound writeback/spend before observing successor adoption. Shell text cannot authorize another capture, and the host supplies no decision fields.
Validation on
32fba35023c37b164d2d3ebfb038fb450c345c5b, rebased onto maina0130633723210a5406dca61ee27aa33fe48b3f3:Standard premerge executed six direct checks, five catalog canaries, eight risk-profile smokes and a public-boundary scan without run failures. It reports one inherited maintainability advisory; the overall gate is
quality_invalid_receipt.The additional whole-repository Ruff invocation still reports 122 errors, and expanded mypy import traversal still reports 4,706 errors in 476 files. These results remain failed without a baseline waiver. The exact-scope quality receipt remains failed; complete repository pytest, remote CI and independent review remain outstanding.
This qualifies scripted behavior through real isolated entrypoints. Live model behavior, installed-host adoption and long-horizon outcome/full-cost benefit remain unqualified. The PR remains open and unmerged.