Repository navigation
fix(periodic-report): honor canonical stopped Goals - #6078
mikamikasuki wants to merge 1 commit into
Conversation
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; xhigh
Exact head: 1af1368f2935ab0539dab92340f992f681543b84; immutable base: 07eb7a1288e8a33995493f9d50475f2664fcbf2e. 全部3文件 +43/-3 已完整复核。
动机
已经停止 Goal、希望定期报告也停止的操作者。 停止动作写入正式 activation 状态,但旧 status 仍为 active;旧版仍安排报告窗口,下一轮还要求准备报告。当前补丁使该 Goal 的自动报告立即停止,恢复后继续原窗口。 隔离真实文件后端和公共 quota CLI 证实:两种正式 stopped 表达都返回 paused,报告 hook、窗口和 pending intent 不再产生;注册后停止及已有窗口停止也不再推进,恢复保留原窗口。 范围是既有定期报告的停止准入和待办解析;没有新增能力开关、前端操作、消息发送或安装升级,不宣称修复所有 Goal 消费者。
独立验收依据 [Bug]: Periodic reports are admitted for canonically stopped Goals,spec_revision issue-6076-body-sha256:a1164122c136622b14779b070fe38ad1a842285a3e8f5006e15dcc7eb858fef2。条款标识(原 issue 无编号,按其原文分句命名):no_automatic_report;no_hook_window_intent;no_standing_authority。逐条实现与当前源码/真实调用对应;不从测试数、作者完成声明或旧评审继承结论。 正式 activation 的契约另以 07eb7a1288e8a33995493f9d50475f2664fcbf2e 的 docs/book/en/chapters/core-state-machines.md 停止自动 Turn 条款核对;已合并 #5742 明确把 periodic-report 留给独立消费者后续。
改动思路
停止约束是已有 Goal activation 正确性规则,三个消费者复用同一 owner;只在初始化检查会遗漏注册后的停止,因此执行前重读与待报告解析都必须保留。 本 PR 只补既有 periodic-report 的三个停止检查和一个回归测试;合并前还须更新三个已移动的 registry I/O 清单行号。
复用现有 owner,既有能力设置与停止入口没有新页面/确认/重填步骤;CLI 的观察仍消费真实状态。当前 private rehearsal 只用合成隔离 registry/runtime,不修改在线 Goal,不执行付费模型/消息发送。对相邻边界做未来维护检查:不为三处检查再新建 helper/枚举;现有 typed owner 就是最小一致性来源。
具体改动
cadence_runtime.py 在构造 hook 时先读正式 activation,在 journal 准入回调里再次读取当前 Goal,防止 hook 注册后才发生 stop。pending_intent.py::_active_delivery_subscription 同样消费既有 goal_is_stopped,使已安排窗口在停止后也不能继续自动生成。旧 stopped/paused/archived status 兼容检查仍保留。test_periodic_report_pending_intent.py 加26行测试,覆盖正式 stopped 下 dispatch=0、journal=None、subscription=None,没有引入新状态、CLI、写入权或第二状态 owner。
正路径:owner activation -> quota should-run -> cadence registration/admission -> pending report; stop -> no new report; resume -> original pending window。负路径:construct hook -> change canonical authority to stopped -> dispatch -> resolve_current_subscription -> no journal mutation/no pending; explicit resume -> same frozen window。同 registry 的另一个活动 Goal 与停止后新建的活动 Goal 仍独立获得窗口;并未把一 Goal 的停止扩为全局禁用。正式 activation/state 缺失按旧 active 兼容、坏版本仍拒绝,不靠文案判断。
对主干的风险
当前5组 focused tests 101 passed。独立同输入 base/head 12场景:活动正例,正式/投影停止,legacy三态,能力关闭,非注册 reporter,坏 activation,同 registry 既有/新 Goal,两种停止时序;head全部通过,base暴露6个场景的不变量失败。公共 quota should-run 对 active/两种 stopped/关闭均 exit0;停止时 paused/skip、无 periodic-report hook/intent/journal,保留的 manager-context 空 hook 不等于报告被触发。停止已有窗口后 consume 返回 no_pending_intent,恢复不换 window_id、不重写窗口。能力关闭时三个生产消费者的完整返回值与 base 相同;正例及公共决策条款只归一化隔离 fixture 路径。
当前必需 premerge 的5项选择中4项通过,direct5项通过;semantic 一项实际失败。准备 root TypeScript 依赖后,失败已收敛为三个 committed registry I/O 位置:cadence 初始读27→28、执行回调52→57、pending authority232→233。290 site 的身份没有新增;immutable base 同一个完整 semantic 检查通过,head明确报三处 metadata changed。因此不是依赖缺失造成的剩余误报。[P2] 运行默认 uv run python scripts/generate_project_registry_io_manifest.py,保留既有分类并提交三处行号更新,再跑 semantic-vocabulary-drift-smoke 和原生 canary。 当前 regression101 passed 不替代这个仓库要求。
首次 reviewer 用了没有入口的 python -m loopx,修正到项目实际 loopx.entrypoint 后重跑全部对照;本批报告 fixture 原先少 domain/adapter 导致全局健康失败,补合法通用 fixture 字段并显式 generic_cli 后公共调用成功。额外外部路径 manifest 输出探针写出文件后因相对路径打印失败,不能当成清单合格;当前结论来自基线/头同一个完整检查与 committed 元数据三处差异。
按 changed risk 执行足够有界反例;没有请求每个平台/付费交付/长期 soak。已读召回的恢复/RFC经验,但这里有原始 issue 和真实消费者,所以不套用旧 verdict,也不把“读到经验”记为因果学习收益。未读取、轮询或等待 GitHub CI。
我的整体评价
当前一个 P2 阻塞:必须同步清单。停止行为本身已用真实调用证明修复;不把基线可工作的必需检查变红归为环境噪声。 长程方向在本切片是正向:停止后不再重复安排报告、消耗注意力;恢复还能接回原窗口,减少遗漏/重复。效率收益是避免本来不该发生的工作,没有测量吞吐、跨领域多 agent 持续收益。 范围是既有定期报告的停止准入和待办解析;没有新增能力开关、前端操作、消息发送或安装升级,不宣称修复所有 Goal 消费者。 批准/修复意见与安装、合并资格独立;本轮未合并或升级。
English verdict: REQUEST_CHANGES - 1af1368. Canonical stop is now honored at registration, fresh admission and pending authority;101 tests and12 independent source scenarios pass, with stop/resume and scoped/off controls. The required full semantic check still fails for3 stale registry-I/O line metadata entries while the immutable base passes. Regenerate the existing classified manifest and rerun semantic/premerge; runtime correctness alone cannot waive this gate.
Goal And Delivered Outcome
Author Declaration
Implemented against
Scope And Continuation
Validation
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist