Repository navigation
fix(periodic-report): preserve distinct cadence admissions - #9525
Conversation
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
left a comment
There was a problem hiding this comment.
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 已通过读取旧档并验证新档案的引用。 周期报告协议
关键代码讲解
_admission_archive_id档案身份区分同一窗口的多次准入。 从完整前序记录推导档案 ID_archive_predecessor先写前序;同内容重试复用。 保留之前的准入记录missed_cadence_bounds读取旧窗口名和新完整凭证名。 推导遗漏时间窗
对主干的风险 / 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.
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
docs/reference/protocols/periodic-report-v0.md, reproduced onmainat2302e42d9.Validation
lean -DwarningAsError=true regression/PeriodicReportCadenceArchive.lean. The checker rejects a model that overwrites a conflicting archive.python3 -m loopx.entrypoint canary premerge --from-git-diff --git-diff-base origin/main --tier quickLean 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
Type Of Change
LoopX Area
Shared-authority RFC fixture impact
N/A.
Boundary Checklist
Signed-off-bytrailer.