Skip to content

fix(steward): retain microsecond precision in PR stalled age - #9545

Open
hhyykk wants to merge 1 commit into
mainfrom
codex/steward-pr-stalled-age-microseconds
Open

hhyykk wants to merge 1 commit into
mainfrom
codex/steward-pr-stalled-age-microseconds

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

The scoped Steward PR monitor truncated the observation and stall anchor to milliseconds. It could include a PR one microsecond before the configured age cutoff and promote the age bucket one microsecond early.

Fix

Parse both instants with the shared UTC microsecond codec and compare integer ages. Convert the configured decimal hours to the first whole microsecond that meets that duration. The author-reply condition, comment coverage check, and scope filters retain their existing decision paths.

Verification

  • The previous code includes an early item and promotes the 24-, 72- and 168-hour buckets too early in synthetic observations. The new regression checks each bucket immediately before and exactly at its boundary. It covers equivalent offsets, a fractional setting of 0.1 hours, and the smallest and largest positive finite settings.
  • All 32 linked Core tests and Core type checking passed. Existing cases cover author replies, incomplete comment coverage, and scope filtering.
  • Lean 4.22.0 checks the integer cutoff against its exact fractional equivalent, verifies that a reply still needs scope and coverage, and proves the exact bucket boundaries. The model starts after parsing and decimal conversion. Moving the modeled 24-hour boundary one microsecond earlier breaks the bucket theorem.
  • Three linked Python integration tests and seven local premerge checks passed. A local merge-tree check combines this patch with PR fix(steward): preserve microseconds in Core monitor recovery cooldown #9544.

All observations use synthetic data. No GitHub signals were fetched or sent during these checks.

@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:19:57.219596Z 1bb581a PR opened
ℹ️ 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 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 监控停滞 PR 的操作者依赖现有小时门槛和变化分段决定何时回看。 停滞锚点与观测时间原先按毫秒截断,造成部分候选提前入选或进入下一年龄段。 一个 PR 恰差一微秒到 24 小时,另一个持续一微秒但跨整毫秒,小数门槛为 3.6 微秒。 两条情况都继续等待,到真实边界才进入既有分段。 范围是已启用 min_stalled_hours 的作用域监控。原作者回复、评论覆盖、作用域和默认关闭路径继续由现有规则负责。

改动思路 / Approach

Core 复用共享 UTC 微秒编解码,并把十进制配置换成第一可到期的整数微秒。 采集器保留既有 GitHub 时间字段,Core 拥有同一作用域选择、材料哈希和转移。 原生作用域监控的年龄边界与无变化哈希。 现有选入、评论覆盖和材料哈希对候选保持对应。

具体改动 / Changes

精确提交 1bb581a。目标基线 509360f,复审对照 509360f。3 个文件,增加 112 行、删除 16 行。评审条件 scoped-stalled-age、author-reply-and-coverage。 原始契约

关键代码讲解

  • observeStewardSignalMonitor。拼装有作用域的仓库信号,维持材料变化的哈希和已知不完整回退。 源码
  • filterScopedRepositoryItems。使用被保留的停滞锚点、当前观测和作者回复挑选已有 PR。 源码
  • stalledAgeThresholdMicros。按配置的小数小时换算出首个到期的整数微秒。 源码
  • classifyStalledBucket。按已到的 24、72、168 小时分段,并保留等待维护者回复的专用状态。 源码

对主干的风险 / Risks

Core 的 20 项测试通过。独立从 Python 经过实际 Effect 调用核对 24h、负偏移同一时刻、跨整毫秒的 3.6 微秒门槛和作者回复。另有两个 Python 采集测试通过。 Git diff --check 通过。与 #9544 的合成 Git 合并也通过。

语义与 CI 对齐

相同原生调用在目标基线两处提前选中。候选只在满足截止时间时选中,原评论覆盖缺失保留上一次哈希。 GitHub 项目事实使用合成输入,未调用线上采集器或 Lean。与 #9544 的组合仅核对 Git 合并。

我的整体评价 / Verdict

APPROVE。 两个提前选中的反例已关闭,原观察和权限边界得到保留。 继续使用已有 UTC 微秒解析和作用域判断确定下一观测。 用真实 Core Effect 路由执行相同观测,核对两处早选反例和原作用域拒绝。

English verdict: APPROVE at 1bb581a. Scoped PR stall eligibility and bucket boundaries now retain microsecond precision without changing author and coverage rules.

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