refactor(heartbeat): move heartbeat prompt builder into bounded module - #2980
Merged
Conversation
huangruiteng
commented
Aug 9, 2026
huangruiteng
left a comment
Owner
Author
There was a problem hiding this comment.
Review: APPROVED
head 8b2fb0f6b。这是对 PR #2980 的完整 owner review。该 PR 是 M6 Q5 的第二片真实替换:heartbeat prompt builder 迁入 loopx/control_plane/heartbeat/builder.py,loopx/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-diff:selected=15 failures=0,self_merge_allowed=true- GitHub checks:dependency-review / pytest / build 全部通过
结论
无 blocker。heartbeat prompt builder 现在位于 bounded heartbeat context,公共 facade 行为保持。按仓库 merge policy 路由合并。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Q5 second heartbeat-prompt extraction slice:
build_heartbeat_promptandbuild_heartbeat_prompt_error_payloadmove fromloopx/heartbeat_prompt.pyintoloopx/control_plane/heartbeat/builder.py.loopx/heartbeat_prompt.pykeeps thin compatibility wrappers and drops from 878 lines to 481 lines.Surfaces
loopx/control_plane/heartbeat/builder.pyloopx/heartbeat_prompt.pyValidation
2306 passed, 2 skipped.109 passed.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 tocodex-quality-qualification.