Skip to content

Preserve Explore attachment commit time precision - #8623

Merged
huangruiteng merged 3 commits into
mainfrom
codex/explore-attachment-commit-time-20261112
Nov 13, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/explore-attachment-commit-time-20261112

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Outcome

A refresh records the original Explore attachment timestamp with microsecond precision. Previously the journal stored whole seconds for the attachment. If a newer Yardstick choice committed in that same second while the first attachment was pending, the exact retry could not establish that the first choice was older, so the historical evidence stayed missing.

Replay and checkpoint supplements keep the original timestamp. Current Yardstick selection and predecessor validation still use the existing strict ordering, including rejection when a stale predecessor has a genuinely equal or later timestamp.

Verification

  • With the two commits one microsecond apart and the first graph append interrupted after primary commit, both File and SQLite reproduced the failure on the unchanged base. Both now recover the original finding once and keep the second decision current.
  • 119 focused Python tests passed across the ordinary refresh, Explore history and Yardstick paths. 12 TypeScript Yardstick checks passed, including equal-time and newer stale predecessor rejection.
  • Ruff, the bilingual RFC diff gate and the changed-file public boundary check passed.

Keep the original receipt timestamp at microsecond resolution so a pending exact replay within the same second can recover its history without replacing the newer Yardstick decision.

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

@loopx-agent loopx-agent 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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

评审提交 3af2004,对照主干 538e43c。

[P2] 墙钟回拨后,已成功提交的新 Yardstick 决策仍读回旧选择。 两次主写回及附件均成功,第二次引用正确前驱。同一秒模拟墙钟回拨 1 微秒,File 和 SQLite 的候选回读都仍选第一条,主干同样输入选择第二条。 在实际 CLI 里核对了两张主记录和两条附件,前驱已经验证通过。微秒精度应保留供精确恢复。让既有 Yardstick 选择器保留经验证的前驱顺序,并继续用原提交时间识别没有该顺序关系的历史补录。 增加回拨用例并同时保留同秒历史恢复与过期前驱拒绝。写入时间的位置

动机 / Motivation

受影响的是从同一 Todo 提交或恢复 Explore 附件的操作者与模型。 两次 Yardstick 决策在同一秒提交,第一次的图写入失败时,旧版把它们记成同一时刻,精确重放无法补回第一条证据。 保存主写回的微秒时间可恢复确实较早的附件,并把检查点补记关联到原附件。 这次验证的是提交、恢复与读回。模型采纳、测量效果与真实环境的时钟回拨频率未测量。

改动思路 / Approach

本 PR 涉及普通刷新、原附件恢复与检查点补记。现有 Explore 图和 Yardstick 选择器仍各自拥有原职责。 原回执承担附件时间和身份,Explore 负责补回证据。候选将新附件的采样提高到微秒,重放和补记仍复用原时间。让既有 Yardstick 选择器保留经验证的前驱顺序,并继续用原提交时间识别没有该顺序关系的历史补录。 这样原证据保持可读,正常写入的成功结果也能在下一次读取中使用。

具体改动 / Changes

关键代码讲解

完整差异包括两个生产文件、一个 CLI 测试和两份 RFC,增加 61 行,删除 20 行。下表以主干 538e43c 的已有约束为依据。原 Yardstick RFC

条目 观察结果
C7 更早的精确重放能补回原附件,当前选择保持第二条。
C8 原回执的恢复和检查点补记不会重复新增证据或扣额。
C11 等时和更晚的过期前驱均拒绝。回拨时已验前驱的新写入仍无法成为当前。
C12 关闭后能恢复原已提交的附件,关闭路径仍拒绝新附件。

对主干的风险 / Risks

两种存储都复现主干无法恢复同秒早 1 微秒的附件。候选能补回一次,重复重放不会再写,检查点补记晚 70 秒仍读回原时间。实际 refresh-state 和 explore turn-context 的配对见证同时确认了回拨回归,主干用原追加顺序读到第二条,候选读到第一条。时钟与首次图写入故障由夹具控制,其余经过真实 CLI 和持久化。

语义与 CI 对齐

150 项聚焦 Python、12 项 TypeScript、Ruff、双语 RFC、diff 检查及合入模拟均通过。新增的配对测试覆盖普通写入的时钟前进和回拨,定向测试覆盖较早历史、等时与更晚的过期前驱。托管 CI 未查询。

我的整体评价 / Verdict

请求修改。微秒时间让历史补录可用,值得保留。按已验证前驱读回当前选择是继续工作的必要条件,避免后续执行沿用旧标尺。请修复普通写入的顺序,并保留原回执的历史恢复和补记语义。state_refresh.py 修改的是 CLI 持久化及读回,未涉及网页渲染。

English verdict: REQUEST_CHANGES. Microsecond timestamps recover older attachments correctly. A same-second clock step backwards makes a successful update with a verified predecessor leave the previous Yardstick current. Preserve causal ordering for live updates while keeping the original timestamp for historical recovery.

Comment thread loopx/state_refresh.py Resolved
…-8623-review-repair-20261113

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

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

@loopx-agent loopx-agent 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.1-sol · OpenAI · runtime_reported · max

本次评审对应提交 b49f15e8ff5c30436b8fdfb529d70bdb9311d7f5。

无阻塞发现。上一评审的回拨反例已对照原提交和当前提交。

动机 / Motivation

提交 Explore 附件、再读回当前 Yardstick 决策的操作者或 Agent。一次主写回成功但图关联中断。两条提交只差 1 微秒,旧主干记成同一秒,第一条历史附件无法精确补录。两种存储都能从原回执补回更早附件一次。合法后继在墙钟回拨时仍成为当前,历史分支保留原时刻。使用实际 CLI 和隔离 File、SQLite,注入墙钟与一次图关联故障。模型采用、测量效果和安装后的采用未验证。

改动思路 / Approach

主写回复用原时间字段保留微秒,已有选择器在同一 Todo 内沿已验证前驱找后继。独立历史仍用原提交时间。原 Explore 和 Yardstick 入口。复用原回执、图关联 CAS、历史选择及关闭开关。 主写回复用原时间字段保留微秒,已有选择器在同一 Todo 内沿已验证前驱找后继。独立历史仍用原提交时间。

具体改动 / Changes

关键代码讲解

原附件时间写入与 checkpoint 补记。 refresh_state_run 按经验证的后继读回当前。 currentWorkYardstickFinding 原前驱与严格历史恢复检查。 validateWorkYardstickContinuation

C7 检查迟到证据保留原候选和原历史,正常后继由原权限更新当前。 C8 检查主提交与图关联分离后按原身份恢复一次。 C11 检查过期前驱拒绝,原图 CAS 保持。 C12 检查关闭保持原历史,已提交附件仍可恢复。。 原验收约束

普通附件时间精度的变化也适用于 Yardstick 关闭的 Goal。读者获得更准确的原始时间,原附加字段和权限不变。对四次写入及一次历史分支的实际 CLI 反例,当前只由最后一个合法后继决定。

对主干的风险 / Risks

已核:旧 head 两种存储均读回旧选择。当前 head 沿原前驱读回新选择,历史分支不覆盖当前,等时和更晚的过期前驱仍拒绝。 原主写回、同 Todo 图快照和原身份继续拥有权限。历史补录、重复恢复和 checkpoint 补记没有第二次扣额。 关闭时不出现 Yardstick 提示,未获准的新决策仍拒绝。普通 Explore 附件也记录微秒,无附件时输出字段不变。

语义与 CI 对齐

112 项 Python、12 项 TypeScript、Ruff 和双语 RFC 检查通过。6 项直接、19 项选择性预合并检查通过。 每种存储九组配对。1 微秒的历史补录保留原时间与当前值。复验旧问题与新增分支均读回合法后继。补记和重复恢复没有再写图或扣额。 托管 CI 未查询。

我的整体评价 / Verdict

批准。旧评审中的时钟回拨已在 File 和 SQLite 复验,历史补录仍保留原身份与严格前驱检查。改动涉及既有 CLI、状态与选择器。未改变页面呈现。使用实际 CLI 和隔离 File、SQLite,注入墙钟与一次图关联故障。模型采用、测量效果和安装后的采用未验证。

English verdict: APPROVE. The validated successor stays current across clock rollback, and exact replay restores older evidence without changing the chosen branch or charging again.

@huangruiteng
huangruiteng merged commit a0676b3 into main Nov 13, 2026
34 of 39 checks passed
@huangruiteng
huangruiteng deleted the codex/explore-attachment-commit-time-20261112 branch November 13, 2026 06:36
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