Skip to content

refactor(heartbeat): move heartbeat prompt builder into bounded module - #2980

Merged
huangruiteng merged 2 commits into
mainfrom
codex/m6-q5-heartbeat-builder-20260809
Aug 9, 2026
Merged

refactor(heartbeat): move heartbeat prompt builder into bounded module#2980
huangruiteng merged 2 commits into
mainfrom
codex/m6-q5-heartbeat-builder-20260809

Conversation

@huangruiteng

Copy link
Copy Markdown
Owner

Change

Q5 second heartbeat-prompt extraction slice: build_heartbeat_prompt and build_heartbeat_prompt_error_payload move from loopx/heartbeat_prompt.py into loopx/control_plane/heartbeat/builder.py.

loopx/heartbeat_prompt.py keeps thin compatibility wrappers and drops from 878 lines to 481 lines.

Surfaces

  • loopx/control_plane/heartbeat/builder.py
  • loopx/heartbeat_prompt.py

Validation

  • Full pytest: 2306 passed, 2 skipped.
  • Focused heartbeat/host/agent/import-boundary/maintainability: 109 passed.
  • Ruff: All checks passed.
  • loopx canary premerge --from-git-diff: passed, selected=15 failures=0, self_merge_allowed=true.

No failures or skips beyond the pre-existing suite skips. No manual holds.

Routing

Route: codex-side-bypass; not assigned to codex-quality-qualification.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: APPROVED

head 8b2fb0f6b。这是对 PR #2980 的完整 owner review。该 PR 是 M6 Q5 的第二片真实替换:heartbeat prompt builder 迁入 loopx/control_plane/heartbeat/builder.pyloopx/heartbeat_prompt.py 降到 481 行并保留薄兼容壳;同时将 task body renderer 选择抽成 _select_task_body_renderer,让迁移后的函数回到维护性棘轮阈值内(90 statements / 60 decision points)。

验证

  • 聚焦 heartbeat/host/import-boundary/maintainability:138 passed
  • maintainability ratchet:clean(无 oversized_decision_function)
  • ruff:通过
  • loopx canary premerge --from-git-diffselected=15 failures=0self_merge_allowed=true
  • GitHub checks:dependency-review / pytest / build 全部通过

结论

无 blocker。heartbeat prompt builder 现在位于 bounded heartbeat context,公共 facade 行为保持。按仓库 merge policy 路由合并。

@huangruiteng
huangruiteng merged commit ad47b78 into main Aug 9, 2026
5 checks passed
@huangruiteng
huangruiteng deleted the codex/m6-q5-heartbeat-builder-20260809 branch August 9, 2026 02:50
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.

1 participant