Skip to content

fix(periodic-report): preserve distinct cadence admissions - #9525

Merged
huangruiteng merged 1 commit into
mainfrom
codex/report-cadence-admission-history
Nov 28, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/report-cadence-admission-history

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Changing a report route from A to B to A to B within one unprepared window blocked the fourth admission. The registry accepted B, while the cadence journal stayed on A. Retrying one week later hit the same archive conflict. Sequences that kept the same route or used four distinct routes worked.

The writer now keys the predecessor archive by the complete admission record. Repeated configurations can reuse the same report window ID and retain distinct historical admissions. The reader checks that a new archive matches its reference and continues to read earlier window-ID references.

Author Declaration

  • Written by model_agent, OpenAI Codex (GPT-6 family).
  • Implemented against the cadence admission and restart contract in docs/reference/protocols/periodic-report-v0.md, reproduced on main at 2302e42d9.
Criterion Disposition Evidence
Admit repeated route changes in one unprepared window implemented Normal configuration writes and the Turn-start hook accept all four admissions at the same instant and retain three distinct predecessor records. Restoring the old key reproduces the failure.
Recover an interruption between archive and replacement implemented The existing file-write fault test verifies one predecessor archive and one replacement after retry.
Read legacy history and protect new archives implemented The missed-window tests traverse new and mixed-format chains and reject a modified new archive.

Validation

Check Result Evidence
Baseline and candidate passed Three route sequences on isolated registries. Only the baseline A→B→A→B hit a conflict. The repaired sequence also succeeds on a later wake.
Upgrade recovery passed On the same isolated journal that failed on main, the fixed reader and writer recover the pending route. Two legacy archives remain byte-identical, the replacement adds one archive, and a replay leaves all files identical.
Focused regression 48 passed Cadence, pending intent, and native report recovery tests.
Expanded report regression 611 passed before stopping All 514 report capability tests passed. The broader native run had 116 cases that did not complete. The focused run covers the changed native scenarios.
Lean 4.22.0 passed lean -DwarningAsError=true regression/PeriodicReportCadenceArchive.lean. The checker rejects a model that overwrites a conflicting archive.
Local premerge 10 checks passed python3 -m loopx.entrypoint canary premerge --from-git-diff --git-diff-base origin/main --tier quick
Ruff passed The five changed Python files.

Lean covers serialized admission, archive preservation, conflict rejection, and retry after the archive write. Admission succeeds when the retained records have distinct keys. The model assumes atomic file replacement. All runtime evidence uses local synthetic fixtures.

Scope And Continuation

This PR changes journal archive references. The report window ID and publication cursor keep their existing contracts. Journals containing the new references require an updated reader. The new reader supports old and mixed-format history without migrating it.

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 the cadence admission defect.
  • No paired RFC changed.
  • UI impact is none.
  • The commit includes a DCO Signed-off-by trailer.

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:11:03.271420Z 9fccff6 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

在定时报表开始准备之前调整交付配置的 Goal 负责人,会在下一次唤醒看到新配置生效。 同一窗口内,路线从 A 改到 B、改回 A,再改到 B。旧档案按窗口 ID 命名,第四次准入遇到同名旧档,配置已变更但日志仍停在 A。 档案按完整准入记录标识,重复路线可以保留不同的历史记录,原窗口 ID 和发布游标继续使用。 交付范围是报表准入日志及其读回。

改动思路 / Approach

沿用报表准入日志的锁和原子写入。只更换前序档案的身份,发布确认继续由原游标拥有。 交付范围是报表准入日志及其读回。 继续使用已经验证的报告来源和本地准入边界。把行为收进现有入口,可以直接拿原例与现头对照,下一次读回也沿原来的凭证。受理到原路线时窗口 ID 仍可相同。新的档案名称来自前序活动记录及其历史引用。

具体改动 / Changes

本次复核精确提交 9fccff6580732390dc06e81153a4d6bc5147a776,相对主干基线 2302e42d9cad35a8a4150e24496ffecfbfdce8cb。七个文件 +225/-12。改动含现有协议、准入日志、四个回归文件和抽象文件顺序模型。 repeat-admission 已通过同一未准备窗口回到既有路线时仍能准入。archive-recovery 已通过在保留历史的情况下完成途中失败的替换。mixed-history 已通过读取旧档并验证新档案的引用。 周期报告协议

关键代码讲解

对主干的风险 / Risks

真实配置和启动钩子在基线第四次返回 producer_failed,现头四次成功,保留三个不同的前序文件。现头接续同一份旧失败日志,两份旧档逐字节保持,只新增一份。重试后的文件字节一致,发布保持空。旧版读回新引用时会报错,文件保持原样。 基线的真实往返配置回归失败。现头接受旧链和混合链,并拒绝正好读到的摘要不符档案。 现头运行报告测试的结果为 74 passed in 41.52s,Ruff 与 Git diff 检查通过。两份证据独立。Lean 4.22.0 检查抽象模型通过,篡改冲突拒绝分支后证明失败。实际行为由隔离运行时重验。 两份提案在同一基线可合成,改动落在不同的报告阶段。合成配置和本地真实日志覆盖准入、升级、重试及混合格式。含新引用的日志需使用更新的读取器。线上账号、外部发表和托管 CI 未运行。

我的整体评价 / Verdict

APPROVE。让同一未准备的日历窗口可以反复调整路线,并在中断后恢复。 既有入口和已验证来源持续作为报表的依据。当前范围内没有发现阻塞项。合成配置和本地真实日志覆盖准入、升级、重试及混合格式。含新引用的日志需使用更新的读取器。线上账号、外部发表和托管 CI 未运行。

English verdict: APPROVE at 9fccff6. Independent tests confirm the native admission hook retains three predecessor records across four route switches and safely resumes legacy archives.

@huangruiteng
huangruiteng merged commit 68c4639 into main Nov 28, 2026
28 of 31 checks passed
@huangruiteng
huangruiteng deleted the codex/report-cadence-admission-history branch November 28, 2026 02:11
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.

3 participants