Skip to content

fix(periodic-report): preserve UTC work windows when display conversion fails - #9532

Open
hhyykk wants to merge 1 commit into
mainfrom
codex/report-work-window-display-fallback
Open

hhyykk wants to merge 1 commit into
mainfrom
codex/report-work-window-display-fallback

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

periodic-report consume-pending could fail to prepare a report with valid UTC work-window bounds. The derived label required Beijing timezone data and both local conversions to fit the calendar range. Calendar reports also calculated that derived label before substituting their frozen schedule window, so a UTC calendar could fail when the unrelated Beijing timezone was unavailable.

Derived labels now fall back to UTC for both endpoints when the preferred display fails. The recorded endpoints are preserved. Calendar preparation uses its frozen bounds and configured schedule timezone directly.

Author Declaration

  • Written by model_agent, OpenAI Codex (GPT-6 family).
  • Reproduced on main at 509360fb0 through the consume-pending editorial handoff documented in docs/reference/protocols/periodic-report-v0.md.
Criterion Disposition Evidence
Prepare the same work window without the preferred zone data implemented A CLI case simulates a missing Asia/Shanghai database entry and reads back the original UTC endpoints with a UTC label.
Preserve both endpoints if one local conversion overflows implemented A real conversion at the calendar limit overflows on the end only. The repaired CLI displays both bounds in UTC and writes the same instants.
Use the configured schedule zone for the frozen calendar window implemented A UTC schedule admits and prepares its frozen window with the unrelated Beijing zone unavailable.

Validation

Check Result Evidence
Baseline and fixed CLI passed Three targeted regressions fail on main and pass after the fix. The normal Beijing label control passes on both.
Report capability suite 516 passed PYTHONPATH="$PWD" python3 -m pytest -q tests/capabilities/test_periodic_report*.py
Lean 4.22.0 passed lean -DwarningAsError=true regression/PeriodicReportDisplayWindow.lean. The model proves representability and preservation of UTC instants. Replacing the fallback with a mixed-offset pair makes the proof fail.
Local premerge 9 checks passed python3 -m loopx.entrypoint canary premerge --from-git-diff --git-diff-base origin/main --tier quick
Ruff passed Both changed Python files.

The proof starts with valid UTC endpoints and models offsets at each endpoint. The CLI tests exercise lookup failure, conversion overflow, and the editorial artifact itself. All tests use local synthetic inputs.

Scope And Continuation

The fallback applies to the optional display zone for a derived work window. Calendar scheduling and validation still use the configured schedule timezone. Preparation writes the same local artifact shape and performs no external report delivery.

Frontend / Visual Evidence

  • UI impact is none.

Type Of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Capability or extension

Shared-authority RFC fixture impact

N/A.

Boundary Checklist

  • The diff and description use public-safe synthetic data.
  • The change is scoped to report work-window preparation.
  • No paired RFC changed.
  • UI impact is none.
  • The commit includes a DCO Signed-off-by trailer.

…on fails

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-27T16:58:19.075843Z 1a586b0 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

动机 / Motivation

周期报告负责人需要在现有待处理报告中生成可读的时间标签,并继续交给编辑。有效 UTC 工作窗口会因为可选的北京时间数据不可用或日历转换越界而停止准备。UTC 日历报告也会先计算这段不相关的标签。同一轮分别验证缺少 Shanghai 时区、换算后一个端点越界、冻结 UTC 日历和普通北京标签。候选对派生窗口同时用 UTC 显示两个端点以保留原时间,日历窗口直接使用已冻结的时间和配置时区。范围是本地编辑请求的时段标签和窗口读取。日历校验及外部发布仍归现有流程。

改动思路 / Approach

沿用已有 consume-pending 的 editorial owner。日历记录直接取冻结窗口,派生记录继续从工作事实计算 UTC 实际时间。只切换可选的显示路径,保持两端同一时区与原有窗口来源。 在相同隔离 registry 和 runtime 执行真实 consume-pending 的 CLI handler,再从同一次输出读回编辑请求文件。 这使比较覆盖真实 CLI 输出、退出码和当前任务依赖的结构化结果。

具体改动 / Changes

精确提交 1a586b020193c0d5103e5a2be66bb5d2e637ee6c,对照 509360fb0d3e9e6e578ddf5c12db587886016b23。本次有 4 个改动文件,增加 202 行、删除 25 行。

  • docs/reference/protocols/periodic-report-v0.md。说明派生窗口的 UTC 回退和日历的已配置时区。
  • loopx/capabilities/periodic_report/pending_intent.py。区分派生与冻结时段,用两个端点同进同退生成标签。
  • regression/PeriodicReportDisplayWindow.lean。以整数微秒模型证明日期可表示和绝对时间保留。
  • tests/capabilities/test_periodic_report_pending_intent.py。沿真实编辑请求验证缺时区、仅一端超界及 UTC 日历。

关键代码讲解

  • _build_editorial_request。冻结日历直接生成标签,派生路径保留工作事实来源。 源码
  • _actual_work_window。从运行或报告事实推导 UTC 窗口,再生成适合展示的标签。 源码
  • ZoneInfo 展示回退。捕获时区缺失与转换不可表示,将两个端点同时转 UTC。 源码

optional-display-fallback 和 frozen-calendar-zone 用落盘的编辑请求复核。 沿用编辑请求的 actual_work_window 和 frozen_calendar_window 来源。已有报告记录和时间身份原样保留。 基线契约

对主干的风险 / Risks

基线在三种显示故障中均返回 consume-pending 错误,候选三种均成功写出本地编辑请求并回读原端点。正常北京标签在两端一致。516 项报告能力回归、quick premerge 的 6 项直接加 3 项选择检查、Ruff 和 git diff --check 通过。Lean 模型仅审阅源码,环境未安装 Lean。生产时区数据库变化和外部发布没有进入这次实测。

我的整体评价 / Verdict

APPROVE。 修复使有效时段在可选显示失效时仍能继续准备。已用原标签对照确认普通路径保持。其它系统的时区数据组合和外部报告投递未验证。 沿既有请求与发布流程继续。

English verdict: APPROVE at 1a586b0. Four paired native CLI cases preserve UTC instants, fall back together when display fails, and honor the frozen schedule zone.

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