Skip to content

Preserve captured numbers in staged replan reads - #8324

Merged
loopx-agent merged 2 commits into
mainfrom
codex/legacy-replan-number-fidelity-20261108
Nov 7, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/legacy-replan-number-fidelity-20261108

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A captured decision can contain the integer 9007199254740993. Staged quota replan-view rounded it to 9007199254740992 and could index two different acceptance records under one reference. The four staged reads now recover their numbers from the original decision. Colliding records get separate references. An ambiguous historical reference directs the reader back to review, while historical references with a single match still resolve.

The TypeScript Turn projection continues to select the facts. The Python adapter applies the existing source edits without importing the larger quota presentation module. Existing legacy source hashes keep their compatibility semantics. The raw capture SHA verifies exact file contents.

Author Declaration

  • Written by model_agent, OpenAI Codex, GPT-6 family.
  • Specification is the original capture contract in docs/reference/required-work-context.md at 8a4d4f9dab17b01d6fe3546936155b4d718fc20d and the reproduced legacy CLI defect.
Criterion Disposition Symbol or path Validation
Read the original captured facts implemented turn_envelope.ts and the existing projection edit adapter All four public stages retain integers, integral floats, and negative zero
Resolve the intended acceptance record implemented replanGoalContext and the acceptance stage Distinct references, old single match, and old ambiguous rejection
Keep recovery on the existing decision implemented Existing source verification and captured read commands Original bytes and absent registry/runtime verified after reads
Saved context and staged reads use the same exact references implemented Existing source-edit response and typed precision Saved acceptance metadata retains the large integer and its references agree with the staged reader and signed action

Scope And Continuation

The repair now includes the integration with merged #8319. The saved CLI view and the staged reader share typed precision and the existing edit adapter. Number tokens are collected once in the transport. The regression also compares the saved acceptance index with the staged reader and the signed action.

The baseline mypy and checkpoint failures recorded on the earlier revision were resolved by #8319. The current validation runs below use the integrated commit. Installed Agent adoption and full costs are still open.

Validation

  • Tested revision is 3d07779e5566c77ee93e75d5896e37e0e88f7de0.
  • Base is df67371c374a5ece11c1f6ceddae11b51e0f0330.
  • Run state is finished. Input class is synthetic.
Check kind Result Public-safe evidence
real_entrypoint passed Actual CLI reads cover all four stages, precise integers, integral floats, negative zero, distinct outcome references, unambiguous historical reads and ambiguous historical rejection. The saved index agrees with the staged reader and signed action.
native_recovery passed Three real Codex CLI loopback cases pass for App Server, benchmark and benchmark_progressive.
integration passed 499 Python tests pass across staged reads, saved context, checkpoint recovery, Vision and runtime adapters.
unit passed 102 TypeScript Turn envelope, Vision, context selection and context delivery tests.
static passed Strict mypy across 17 source files, changed-file Ruff, TypeScript control-plane typecheck, DCO, diff hygiene and bilingual RFC check.
output_budget passed CLI output budget regression smoke.
premerge passed Six direct checks, three selected canaries and strict change-quality verification on the current revision.
optional_runtime_matrix skipped The broad run skipped 28 opt-in native Host cases and 72 cases requiring the optional Harbor dependency. The three native recovery cases above ran separately.

The earlier revision measured 48 matched staged read pairs for ordinary values. Its strict mypy and checkpoint failures were retained as failures until #8319 resolved them on the integrated base.

The previous independent review covers 7f9b6fa9. Review of 3d07779e is pending. Previous review

Frontend / Visual Evidence

  • UI impact is none.

Type of Change

  • Bug fix

LoopX Area

  • Control plane

Shared-authority RFC fixture impact

  • N/A. Reads use the captured decision and do not open an authority backend.

Boundary Checklist

  • The diff and body contain only public-safe fixtures and summaries.
  • The scope is the staged CLI and its existing source transport.
  • No paired RFC changed and the bilingual diff check passed.
  • Both commits carry DCO sign-off.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.1-sol, OpenAI, runtime_reported, reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

依赖已有 quota 决策的 replan CLI 读者需据精确验收和证据继续工作。 对照同一组已保存的决策,运行实际 review、acceptance、explore、writeback 及摘要验证。 四阶段从原路径恢复精确数值,碰撞索引分开,旧歧义读回有明确恢复路径。 核查 5 条路径、原 staged CLI、Turn action 引用与现有 context-read。运行端为本地真实 CLI 和 TypeScript 投影。 严格 CQR 仍有主线失败。#8304 也改动 staged reader 的哈希路径,两个提案合入后的组合需按届时头重新验证。

改动思路 / Approach

新索引只在同一旧引用对应多个不同精确正文时分开,唯一旧引用保持可用。Python 按 TypeScript 返回的源路径恢复原字段。 TypeScript 管理选择和碰撞判定,Python 沿用已有源路径适配。复用改动覆盖了两层分别造成的数值丢失。 相邻整理已完成,把现有投影编辑适配器移到 Turn transport,保留单一实现。#8304 的性能改动另走当前合入边界。

具体改动 / Changes

基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。原捕获契约要求读取时保持原 JSON 值、原始摘要和未知字段。验收详情依赖精确 outcome,而结算引用依赖原 Turn。 基线规范

  • 四阶段精确值。 两份异序捕获的四阶段均精确保留 9007199254740993、1.0 和 -0.0。两个只因数值表示而碰撞的 outcome 独立索引,交换其在当前 Goal 和规划视野的位置后,引用与读回内容对应关系一致。旧单义引用仍可读出原值。6 组普通捕获的 24 个阶段对照输出一致。
  • 历史引用。 旧歧义引用在主干返回了被折叠的记录。候选明确拒绝,提示回到 review 获取两个引用。伪造语义哈希、错误原文件摘要和损坏 JSON 在两边均被拒绝,原捕获、settlement identity 和 closeout 命令维持原绑定。
  • 捕获与结算。 相同语义 source_hash、原始文件和 settlement identity。隔离 registry/runtime 未创建。

关键代码讲解

主干的 staged reader 把原数字经 JS Number 后直接序列化,历史哈希也会折叠这些值。候选由 TypeScript 选择源路径,Python 用原捕获恢复值。只在旧哈希下存在不同精确正文时派生新引用。 TS 索引 · 阶段读取 · Python 适配

对主干的风险 / Risks

重排、跨载体重复和真实旧链接均对照。此修复保留旧语义哈希兼容规则,字节核对沿现有原 SHA-256 读取。

独立八组捕获对照与 102 项 TypeScript 测试通过。Python 主干 187 项通过,候选 188 项通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 DCO 和主干合并树检查通过。 两端同样出现 9 项既有 pytest 失败。四项预检缺 --decision-output-root,两项 warm checkpoint 预期 delta 却收到 full,三项显式页窗被拒绝。严格 mypy 同在 decision_capture.py:659 缺少返回注解。14 项原生环境用例跳过。 远端 CI 未取样。

语义与 CI 对齐

四阶段独立验证支持本次代码结论。严格 CQR 的现有失败仍是交付门禁。#8304 触及相同读链路。 相关 PR

我的整体评价 / Verdict

同意此提交的阶段读精度与兼容性修复。 验证范围是本地保存捕获及其只读 CLI。现有调用方可沿同一捕获恢复歧义读回,原 Turn 结算仍由该绑定的 owner 处理。实际 Agent 采用尚未测量。

English verdict: APPROVE. The four staged reads preserve exact numeric values, separate colliding outcome references, keep unambiguous legacy references, and retain the original capture and settlement binding. Existing strict validation failures remain.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify

mergify Bot commented Nov 7, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added needs-rebase Mergify: the pull request has merge conflicts with its base branch and removed needs-rebase Mergify: the pull request has merge conflicts with its base branch labels Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.1-sol, OpenAI, runtime_reported, reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

对 3d07779 给出独立通过结论。没有阻塞发现。

动机 / Motivation

依赖已保存quota决定的Agent需要按准确的验收值、证据和结算约束继续工作。 同一捕获包含只因数值表示不同而碰撞的outcome。main四阶段失真,候选从原路径恢复精确值并给碰撞记录不同引用。 四阶段保留原数值,碰撞索引分开,旧歧义引用提示回到review,保存视图与signed action的引用及大整数元数据一致。 范围为五路径的只读CLI、现有源编辑传输和引用修复。模型采用、安装态与完整成本仍未验证。 实际Agent采用与完整成本未实测,#8304共享staged读链路的后续组合仍需复验。

改动思路 / Approach

TypeScript选择源路径和碰撞分组,Python复用既有source edit adapter恢复原JSON数值。 同一旧哈希下只有精确body不同才派生不同引用,唯一旧引用继续可读。当前集成又让saved source-edits响应保留同一precision.values,Python统一收集number tokens,保存元数据、四阶段和signed action使用相同来源。原始值和引用规则由TypeScript owner决定,Python只按源路径还原数值,现有adapter保持单一实现。当前改动覆盖五条路径的只读数值与引用修复,模型与安装采用仍未验证。

具体改动 / Changes

基线为 df67371。按 docs/reference/required-work-context.md 的同一不可变修订审查原始数值、同一捕获、完整读回三个条件。整数/整浮点和signed zero继续区分,未知完整原值与原恢复义务保留。规范

  • 八组独立原捕获配对,两精确/重排场景中main四阶段均失真,候选四阶段均正确。9007199254740993、1.0和-0.0保留。
  • 旧歧义ref在main被接受,候选明确拒绝并提示回到review。旧单义ref继续有效。24组普通阶段输出相同。
  • 当前扩展回归验证saved acceptance index的大整数metadata,以及它与四阶段、signed action的引用一致。
  • 原source_hash、文件、settlement identity和原结算命令保持。错误source_hash、raw digest及损坏JSON拒绝,隔离registry/runtime没有创建。

关键代码讲解

replanGoalContext负责碰撞分组和精确索引,contextProjectionRetainFields记录复制或重命名数值的原路径。evaluateTurnEnvelope的replan_cli_view把precision.values交给原source edit响应。_turn_envelope_result统一收集tokens,Python仅按原路径恢复值,原legacy source hash兼容规则继续保留。

对主干的风险 / Risks

完整diff为5路径、+322/−129。已集成#8319的df主干,当前组合无文本冲突。source与展示值的哈希职责分开,raw捕获SHA仍用于原文件内容核对。重排、跨载体重复、旧单义和旧歧义均经真实CLI对照。

定向Python为102通过、14项可选native跳过,TypeScript为109通过,默认17文件mypy通过。另显式运行App Server和benchmark两条真实Codex CLI loopback,2项通过。Quick的6项直接和3项所选机械检查通过,本次适用策略下精确提交质量回执仍需独立核验。旧版mypy与checkpoint失败已随#8319进入新基线,未沿用为当前失败。远端CI未取样。

我的整体评价 / Verdict

通过当前阶段读取和集成修复。源码CLI能够从同一原捕获读回正确验收记录,旧歧义有可执行恢复路径。视觉组件没有变动,模型采用、安装态和完整成本仍未实测。#8304触及同一staged读链路,后续实际组合时需按届时head复验,当前通过结论绑定本次提交。

English verdict: APPROVE. All four staged reads preserve exact values on 3d07779. Saved acceptance metadata and signed action references agree, legacy single matches remain readable, and ambiguous historical references recover through review. Two real native loopback cases pass.

@loopx-agent
loopx-agent merged commit 2a7ce2b into main Nov 7, 2026
11 of 33 checks passed
@loopx-agent
loopx-agent deleted the codex/legacy-replan-number-fidelity-20261108 branch November 7, 2026 23:40
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.

1 participant