Skip to content

fix(steward): normalize, order and link exact-head review evidence - #9546

Open
hhyykk wants to merge 4 commits into
mainfrom
codex/steward-review-evidence-timestamp-parity
Open

hhyykk wants to merge 4 commits into
mainfrom
codex/steward-review-evidence-timestamp-parity

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Steward could drop lowercase UTC replies, abort on dates outside the UTC calendar range, or misorder exact-head reviews with numeric offsets. Review URL correlation could also lose a unique link or attach an ambiguous one. The REST reader only saw the first page, so an exact node ID on a later page remained unresolved.

Fix

Normalize timestamps for comparison while retaining the original evidence. Compare chronologically when review times are usable and retain the legacy order for unreadable actionable times. Keep original links and exact node IDs. Use the REST response's next-page relation to read up to three pages within the existing ten-second budget. Later requests stay on the original review endpoint. The signature fallback requires a verified terminal page and a unique compatible candidate on each side. GitHub REST pagination

Verification

  • Synthetic REST cases recover a later node ID, detect ambiguity across pages, and retain exact links while withholding fallback on timeout, budget exhaustion, malformed headers and body-only responses.
  • 47 Python review and history tests and 20 Core tests passed. Provider operations use local substitutes.
  • Four Lean 4.22.0 proofs check reply evidence, review ordering, link correlation and pagination. The pagination model proves the request bound, requires a terminal page for completeness, and keeps earlier evidence after an unavailable page.
  • All nine local premerge checks passed on the submitted commit.

Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T19:57:35.435066Z 3497a45 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

loopx-agent
loopx-agent previously approved these changes Nov 27, 2026

@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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

依靠 Steward 判断哪个 PR 等待维护者回复的操作者需要读到当前回复角色与覆盖。旧观察会忽略小写 z 评论,遗漏作者回复或保留已被维护者回复的等待状态。UTC 归一跨出 datetime 范围也会中断整个观测。 同一隔离入口上,基线在无效后缀评论抛 OverflowError,较新的小写 z 维护者评论被忽略。新增的八个汇总用例中五个在基线失败。 候选跳过不可读评论,并按现有授权读取上一页,找到晚一微秒的作者回复。较新的小写 z 维护者评论会清除旧的作者回复状态,原小写锚点按原文返回。 GitHub 传输使用本地合成响应。Lean 模型仅核对源码,本次未复跑;远端 CI 按当前策略未查询。 现行监控约定

改动思路 / Approach

复用 runtime.time.parse_timestamp 统一评审、提交和评论时间解释。保留原 raw 锚点文本,结果类型、角色判断和回填条件沿用现有汇总路径。 GitHub evidence owner 汇总 exact-head review、当前 commit 和评论。runtime.time 负责解析并规范化 UTC,原 Steward 只消费现有汇总。

具体改动 / Changes

精确提交 0bf143873150f3232d96847fd1ae30718d8db791 对照 509360fb0d3e9e6e578ddf5c12db587886016b23。3 个文件,增加 125 行,删除 13 行。生产差异是一个 Python 解析调用点,其余是时间矩阵测试与 Lean 抽象模型。 utc-review-evidence 和 comment-coverage-and-opt-in 的原生读取对照均通过。

关键代码讲解

  • _parse_iso_timestamp。合成 UTC 时刻与留存时间字符串。复用共享 codec,继续保留原锚点文本。 源码
  • parse_timestamp。按平台稳定规则读 ISO 时间。接受小写 z,UTC 边界转换失败返回 None。 源码
  • _summarize_request_changes_stall。归并候选评审、提交与回复证据。候选跳过不可读评论,并按现有授权读取上一页,找到晚一微秒的作者回复。较新的小写 z 维护者评论会清除旧的作者回复状态,原小写锚点按原文返回。 源码
  • _backfill_pr_comments_if_needed。按已有游标查阅缺失评论范围。只有原路径需要回填才读下一页。不可读时间不会凭空关闭覆盖缺口。 源码
  • observe_github_repository_prs。执行有界只读 PR 观测。等价时区偏移且恰好等于锚点的评论不会被计作稍后的回复。只有坏评论且默认关闭回填时,不读早页并保持覆盖不全。启用回填时沿原游标补证据。 源码

对主干的风险 / Risks

等价时区偏移且恰好等于锚点的评论不会被计作稍后的回复。只有坏评论且默认关闭回填时,不读早页并保持覆盖不全。启用回填时沿原游标补证据。 18 个评审信号测试与 55 个时间 owner 和顺序测试通过。独立从原 GitHub 观测入口复跑四组合成 GraphQL 对照,基线两组错误,候选四组通过。双方的默认关闭回填对照一致。与 #9545 的 Git 三方试合干净。 原采集范围仍由 Steward 控制,发布和合并权限没有进入这次时间解析。

我的整体评价 / Verdict

APPROVE。 当前提交可以通过评审。复用共享 UTC 时间规则后,原只读观测能处理可读的作者和维护者回复,也能继续执行既有评论覆盖判断。实际采集入口对照了默认关闭、后补页和等时刻边界。

English verdict: APPROVE at 0bf1438. The real collector with fixture transport now preserves valid lowercase UTC replies and comment coverage while ignoring out-of-range timestamps.

Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
@hhyykk hhyykk changed the title fix(steward): share UTC parser for review evidence timestamps fix(steward): normalize and order exact-head review timestamps Nov 27, 2026
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
@hhyykk hhyykk changed the title fix(steward): normalize and order exact-head review timestamps fix(steward): normalize, order and link exact-head review evidence Nov 27, 2026
loopx-agent
loopx-agent previously approved these changes Nov 27, 2026

@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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

使用 Steward 判断 PR 是否待维护者回复、查看评审链接或预览合并的操作者需要读到当前回复角色与覆盖。旧逻辑可能忽略小写 z、在 UTC 边界时间上中断、按文本误选同提交评审,或给有多个候选的评审附错链接。 基线使用相同读回夹具,预览选中了较早的批准 ID,且未拒绝后来明确求改的对照;24 个解析、排序和链接用例中 16 个失败。 当前头在同一预览入口冻结实际最新批准,较晚的求改与平台当前求改都保持拒绝。小写 UTC 回复、原锚点和边界时间恢复通过;等价 UTC 的可证明唯一候选可获得链接。 本次使用合成 GitHub 读响应,未执行合并。Lean 模型核对源码,未单独复跑。队列设置未查询远端 CI。 现行监控约定

改动思路 / Approach

复用 parse_timestamp 与 chronology_key 校对观测。优先 exact node ID;只有双方没有竞争、REST 单页可确认完整、没有两个明示 IDs 相冲突时才按 UTC 签名补链接。 runtime.time 规范化 UTC,GitHub evidence owner 关联并汇总同提交评审,现有 Core 监控与保护合并预览消费该汇总。

具体改动 / Changes

精确提交 ebb363183cd98f5fddea47f594f4e3db6a4ec928 对照 509360fb0d3e9e6e578ddf5c12db587886016b23。5 个文件,增加 419 行,删除 45 行。变动集中在 GitHub 证据 owner、同入口回归和三个 Lean 抽象模型。未增加权限路径。 utc-review-evidence、bounded-review-link-correlation 与 read-only-preview-exact-order 的原生读取对照均通过。

关键代码讲解

  • _parse_iso_timestamp。生成 UTC 时刻并保留原留存文本。复用共享 codec,跳过不可读时间。 源码
  • summarize_github_pr_signal。按事实 UTC 解析精确提交评审和同人替代关系。当前头在同一预览入口冻结实际最新批准,较晚的求改与平台当前求改都保持拒绝。小写 UTC 回复、原锚点和边界时间恢复通过;等价 UTC 的可证明唯一候选可获得链接。 源码
  • _review_link_signature。构造候选人的登录、状态、精确提交与 UTC 时刻签名。签名有缺失便保持无候选。 源码
  • _enrich_review_urls。关联唯一 exact identity 的已发布链接。等时刻继续按原文本和 ID 打破平局;缺失可用时间的 actionable 证据继续旧排序。已有链接保留。多候选、已知 ID 冲突、不可读及满页 REST 的非 ID 匹配保持无链接。默认关闭评论回填时不读早页。 源码
  • pr_merge_preview。读取 GitHub 汇总并冻结当前合格 review ID。选择最新同提交批准,平台求改与当前较晚求改均保留原拒绝。 源码

对主干的风险 / Risks

等时刻继续按原文本和 ID 打破平局;缺失可用时间的 actionable 证据继续旧排序。已有链接保留。多候选、已知 ID 冲突、不可读及满页 REST 的非 ID 匹配保持无链接。默认关闭评论回填时不读早页。 89 个 Python 信号、时间 owner 和顺序测试及 19 个 Core Steward 测试通过。由同一模拟 GitHub 传输进入原只读合并预览的六项对照、四组原始回复采集对照均通过。基线的预览冻结 ID 与较晚求改两项出现错误。 原采集范围仍由 Steward 控制,发布和合并权限没有进入这次证据修复。

我的整体评价 / Verdict

APPROVE。 当前提交可以通过评审。共享 UTC 时间规则、预览冻结 ID 和唯一链接的本地对照均符合现有约定。未确认的链接保留空值。平台当前求改继续决定预览拒绝,较晚的已知评审也能取得正确顺序。

English verdict: APPROVE at ebb3631. UTC chronology now preserves the latest exact-head review in read-only previews. The collector retains reply coverage and only attaches uniquely correlated review links.

Signed-off-by: aihop <4408344+hhyykk@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.2-sol · OpenAI · runtime_reported · xhigh

APPROVE

通过本次精确提交评审。

动机 / Motivation

Steward 依据同一提交的评审结论、来源链接和后续回复判定下一次观测。 旧头只查看第一张 REST 页。大于一页时,即使所需节点可在下一页确定,摘要仍可能缺少评审链接。 首张数据页之后仍有原节点匹配,或后页有与第一页候选同一签名的另一条评审。 可靠的后页节点和完整范围内的唯一匹配会补齐链接,部分读取和不唯一仅保留已确定的节点链接。 GitHub 单 PR 证据的只读观测。保留当前提供方合并门禁、现有权限和原不可判时序后备。

改动思路 / Approach

在同一 reviews 端点内按需递增页码,最多三次并共用十秒。验证末页后才允许签名回退。现有链接与唯一节点规则继续生效。 Python 取得并核对 GitHub 证据,Core 继续消费原映射与调度判定。 在有界 REST 读取中保留评审身份、时间、结论和 URL 归属。 证据链接补充不会改变产生评审、清除门禁或合并的权限。

具体改动 / Changes

精确提交 3497a45。目标基线 509360f,复审对照 ebb3631。6 个文件,增加 654 行、删除 58 行。评审条件 exact-head-chronology、review-link-origin、provider-decision。 原始契约

关键代码讲解

  • inspect_github_pull_request。读取 PR 详情并把可靠的链接补到现有评审摘要。 源码
  • _read_rest_review_pages。同一 REST 端点顺序读取,最多三页,并按剩余时间给每次请求分配超时。 源码
  • _rest_review_page。解析实际响应头和 JSON,能确认末页才允许按签名补链接。 源码
  • _enrich_review_urls。保留已有链接,汇总所有已读页面的节点和候选签名。 源码
  • summarize_github_pr_signal。保持同头 UTC 顺序、有效结论和 GitHub 提供方门禁。 源码

对主干的风险 / Risks

真实 GitHub CLI 读出两页 HTTP/2.0 响应头,交给精确头真实入口重放,两条节点链接均恢复,上一头只恢复一条。独立合成三页验证唯一 UTC 匹配和共享预算 10、6、3 秒。 41 项 Python 评审与门禁回归通过。独立覆盖实际 GitHub CLI 双页响应和合成三页分支,UTC 顺序探针及 git diff --check 通过。

语义与 CI 对齐

跨页同签名包括无链接重复时拒绝回退。节点链接相冲时保留空链接。页数上限、非零退出、超时、共享预算耗尽和不可解析的 Link 都保留已读取的精确节点与原始结论。 真实 GitHub 响应使用每页 1 条采集并在候选入口重放,100 条页边界和故障为独立合成输入。未独立运行 Lean、活跃 Steward 或等待 CI。

我的整体评价 / Verdict

APPROVE。 后页链接可回到原评审,部分读取和歧义仍不生成后备归属。现有时间顺序和门禁验证通过,未发现阻断项。 沿用同一端点和原有链接关联规则,有明确末页才证明签名唯一。 同一脚本对照前一头和当前头的节点链接、跨页候选、预算、返回的结论及原时间。

English verdict: APPROVE at 3497a45. Bounded REST pagination recovers later exact review links, and incomplete or ambiguous evidence still cannot supply a fallback link.

This branch has not been deployed

No deployments
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