Skip to content

fix(periodic-report): honor canonical stopped Goals - #6078

Merged
huangruiteng merged 1 commit into
loopx-project:mainfrom
mikamikasuki:codex/periodic-report-canonical-stop
Oct 21, 2026
Merged

huangruiteng merged 1 commit into
loopx-project:mainfrom
mikamikasuki:codex/periodic-report-canonical-stop

Conversation

@mikamikasuki

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Reproduced bug report #6076.
  • Goal/source and gap: Periodic-report cadence admission and delivery authority checked only the legacy Goal status field, while the canonical activation owner records owner stops in activation.state.
  • Observable before -> after: A Goal with status=active and canonical activation.state=stopped invoked the cadence hook and wrote a cadence window; it now registers no hook, writes no window, and resolves no delivery subscription. The regression test failed before the fix and passes on this branch.
  • Issue/task and intended base: Closes [Bug]: Periodic reports are admitted for canonically stopped Goals #6076; base main.

Author Declaration

  • Written by: model_agent, OpenAI Codex (GPT-6).

Implemented against

Criterion (spec clause) Disposition Symbol / path Test or command
A stopped Goal projects automatic Turns as paused implemented periodic_report_cadence_hooks; _active_delivery_subscription test_canonically_stopped_goal_does_not_admit_periodic_report_window
  • Self-check before submission: Read the canonical activation predicate and writer, periodic-report cadence and delivery paths, activation contract, issue template, and related PR fix(collaboration): honor canonical stopped goals #5742. The diff is limited to these admission guards and one regression test.

Scope And Continuation

  • Completed scope and remaining work: Periodic-report cadence admission and standing delivery authority honor canonical Goal stops. Complete within this scope.
  • Slice boundary / successor: N/A.

Validation

  • Tested revision: 1af1368
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
regression_parity passed The added stopped-activation regression failed on upstream 07eb7a1 (hook invocation count was 1); it passes on this revision.
unit passed uv run pytest -q tests/capabilities/test_periodic_report_pending_intent.py tests/cli_commands/test_periodic_report_intent_capability_chain.py — 45 passed.
static passed Ruff passed for the two changed modules and regression test; git diff --check passed.
  • Coverage and gaps: The regression verifies no hook invocation, cadence journal mutation, or standing delivery subscription for a canonical stopped Goal. Existing legacy stopped, paused, and archived cases remain covered by the focused periodic-report suite.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

  • Direction / acceptance reference, when applicable: Shared Goal Authority.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: Reuses the existing canonical Goal activation predicate; no vocabulary or schema changed.
  • Provider conformance arms run: N/A
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

@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.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.

@mergify

mergify Bot commented Oct 16, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @mikamikasuki.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Oct 16, 2026
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
@mikamikasuki
mikamikasuki force-pushed the codex/periodic-report-canonical-stop branch from 1af1368 to b05a86c Compare October 21, 2026 06:34
@mikamikasuki
mikamikasuki requested a review from songoow as a code owner October 21, 2026 06:34
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Oct 21, 2026

@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.1-sol | OpenAI | runtime_reported | effort=max

无当前阻塞发现。Exact reviewed head: 6078@b05a86cde3dd74d5201b907e2f063e5897656098;实际 base 5706ef0552d5c22af805f264ae891556a0f819cf。这是重新评审完整当前差异,未继承旧结论。

动机

需要停止 Goal 自动报告的操作者,以及维护报告准入逻辑的开发者。

原问题是正式停止状态已经写入,旧的 active 字段却仍让报告被安排;主干现在已修复共享准入,本补丁补上从一开始就停止时的回归断言,防止以后重新安排报告。

当前完整差异只有一个 26 行测试:停止时 hook 不执行、窗口不写入、投递订阅为空;在真实当前 owner 上通过,绕过正式停止检查时立即失败。

这是已交付停止语义的覆盖增量,没有新增运行时行为、报告投递、权限、界面或安装操作。

改动思路

停止事实继续由既有 typed activation 与共享订阅 resolver 决定;cadence 初始化、执行前重读和 pending delivery 都消费该 owner。当前生产代码与 base 相同,适当边界是补充一项初始停止的真实调用测试,避免重新添加旧分散 guard。

相比不改,新测试能同时发现错误的 hook 执行、窗口写入和 standing authority;相比独立 smoke 或新 helper,复用原测试文件与 _calendar_fixture 成本更小。已有测试主要覆盖注册后停止、已有窗口停止;它们与本项的“未曾安排任何窗口”前态不同。没有新增用户准备、导航或确认轮次。

具体改动

完整差异只有 tests/capabilities/test_periodic_report_pending_intent.py +26/-0;生产、schema、CLI、权限及状态词汇均未修改。旧 1af 三文件提案和旧 manifest 阻塞不能当成当前差异。独立规格 #6076,快照 issue-6076-body-sha256:a1164122c136622b14779b070fe38ad1a842285a3e8f5006e15dcc7eb858fef2,条款 Expected behavior:implemented。同时先读固定 07eb7a1288e8a33995493f9d50475f2664fcbf2e 的 docs/book/en/chapters/core-state-machines.md:stopped 应暂停自动 Turn。

关键内容讲解

  • 新增测试 保留 legacy active、写入 canonical stopped,再调用真实 cadence composition,以 (0, None, None) 同时检查执行次数、实际 journal 与订阅。
  • 既有共享 resolver 在任何报告安排前检查正式停止状态。它和 cadence/pending 两个生产调用文件均与 base 逐字相同。

独立在 base 和 head 各执行 11 个真实本地场景:active、正式及投影 stop、三种 legacy inactive、关闭、非注册 Agent、坏 activation、注册后 stop、已有窗口 stop/resume。新测试本身在两版本均通过;只在内存中绕过共享 owner 的 canonical stop 检查时,原样新增断言立即失败。没有改写仓库源码。

对主干的风险

当前主要风险是测试是否只是重复或冻结旧实现。覆盖扫描确认旧测试在已注册或已安排窗口后停止,本项补无窗口冷启动并同时读 standing subscription;实际 owner mutation 证明它能发现真实回归。完整同作者六个 OPEN 提案涉及不同已核边界,没有据作者或测试数量推断价值,也未发现本项同形重复。

84 项相关测试、Ruff、完整 semantic-vocabulary 检查、原生 premerge 5 项 direct 均通过;该 test-only diff 原生选择 0 项 catalog smoke,不能写成跑了额外 suite。旧三处 registry IO metadata 失败不适用于当前不改生产的版本,完整当前 semantic 检查已通过。首次人工附加命令用了不存在的旧目录,按 catalog 中真实路径重跑成功,旧 exit2 保留为调用错误。所有 PR 提交有 DCO;没有查询或等待 CI。

真实本地 registry/journal 验证停止后不生成新工作,恢复后原窗口完全相同;没有发送报告、执行模型或改动活跃 Goal。PR 正文仍描述旧三文件修复和旧测试版本,建议更新为当前 coverage-only 范围,这是非阻塞的呈现修正。

我的整体评价

APPROVE。named slice 的持久回归覆盖已达成,long_horizon 与 user_experience 均 preserved:运行时行为不变,停止/恢复的既有语义有更直接的未来保护;不宣称新增功能或长期效益。代码量与维护收益相称,复用原 owner、fixture 和 typed 词汇,无需新架构或迁移。当前批准不撤销旧评审,也不授予合并或安装权限;旧阻塞评审及原生 readiness 另行读回。

English verdict: APPROVE — 6078@b05a86cde3dd74d5201b907e2f063e5897656098. The complete current diff is one durable cold-stop regression, not a new runtime fix. It passes against current base/head and detects a bypass in the shared production owner;11 real local stop/recovery scenarios,84 tests and required local validation pass. Refresh stale PR description;old-review reconciliation and merge readiness remain separate. CI was not consulted.

@huangruiteng
huangruiteng merged commit d988045 into loopx-project:main Oct 21, 2026
26 of 55 checks passed
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.

[Bug]: Periodic reports are admitted for canonically stopped Goals

3 participants