chore(canary): refresh chat_actions' reviewed module ceiling to unblock main - #4618
Conversation
…ree steward repairs main has been red since #4587: `tests/canary/test_maintainability_ratchet.py` reports `unreviewed finding: module_metric_budget:loopx/chat_actions.py` because the module is 1604 lines against a reviewed ceiling of 1590. The failure reproduces on a clean `origin/main` worktree and on every open PR, so it blocks all merges including the pending steward stack. The growth is deliberate and already merged, not new debt invented here: the file was 1449 lines when the ceiling was set for #4567, then 1520 (#4582), 1575 (#4585) and 1604 (#4587). Those three repairs extended the single Chat action settlement owner with typed lane-level results (`lane_failure`, `lane_settlements`, bounded `details` on `mark_failed`) instead of a second settlement path, so the reviewer-visible decision this ledger records is to accept the module as the owner of that behaviour. It stays a bounded debt rather than a limit change: the default ceiling is 1500 lines, this module keeps its own 1604 entry, and `any_count` keeps its existing 52 headroom (currently 45). Extracting the lane-level settlement code now would rewrite work that three open PRs (#4590, #4600, #4602) are already changing in this module. Validation: `tests/canary -q` reports 21 passed; on `origin/main` before this change the same group fails with the unreviewed finding above. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
@/tmp/review-4618.md
huangruiteng
left a comment
There was a problem hiding this comment.
动机
main 从 #4587 合入起就是红的,而且这个红与任何一条在飞 PR 的改动无关。tests/canary/test_maintainability_ratchet.py::test_current_repository_debt_is_reviewed_without_line_count_pins 报 unreviewed finding: module_metric_budget:loopx/chat_actions.py:模块当前 1604 行,超过 ledger 里已评审的 1590。结果是每条 PR 的 test-shard 都挂在同一个用例上、全部合不了,包括本车道正在等的管家栈和 owner 待决的三条。
我先在干净的 origin/main worktree 上复现,再核对 main 自己的 Python Tests run 35176730888 的 test-shard (2),两处失败文本一致,所以这确实是一个仓库级阻塞,而不是本 PR 自己引入的债务。
改动思路
canary 对模块体积债务给出的处置方式是唯一的:债务在签入的 ledger 里结清,而不是走 reviewed exception——其渲染文本原话就是「refresh the reviewed ceiling in module_metric_baseline.json for the growth this review accepts」,也就是说这次编辑本身就是要评审的判断。因此本 PR 只改这一行,把上限刷新成本次评审接受的 1604,并在 PR 正文里交代增长来源与归属判断。
我没有选择「把增长抽出去」这条更漂亮的路,理由是三处已合并的修复恰好都加在同一个结算宿主上,而现在有三个在飞 PR(#4590、#4600、#4602)正在改这个文件;此刻抽取等于在三条未完成改动下面重写同一段代码,冲突成本高于收益,而且会把 owner 待决的那几条 PR 一起拖住。
具体改动
loopx/canary/module_metric_baseline.json:loopx/chat_actions.py的lines从 1590 改为 1604。any_count保持 52 不动(实测 45,仍有余量),模块继续保留自己的条目,不使用 1500 行的默认上限,债务保持可见、有界、可回退。
对主干的风险
风险面很窄:只动一个被 canary 直接读取的 JSON 数字,不改变任何运行时、前端、权限或评分行为。需要明确的是,这次编辑只判断「增长已经被接受」,它不会阻止再次增长——下次再涨仍会红,仍要重新评审。增长的归属我也写进了提交信息:1449(#4567 设定上限时)→ 1520(#4582)→ 1575(#4585)→ 1604(#4587),三次都是把按 lane 的结算结果加在同一个 Chat action 结算宿主上,而不是新开第二条结算路径,因此判断它属于该模块。
可复现的对照:改动前在干净 origin/main 上该用例失败;改动后 uv run --extra test python -m pytest tests/canary -q 为 21 passed,本 head 的全部必过检查转绿(含四个 test-shard、kernel-static-checks、dashboard-acceptance、merge-gate)。
我的整体评价
这是一次把仓库从红拉回绿的窄修复,判断依据可复现、范围可回退,且没有用「放宽默认上限」来换绿。建议在该 head 的必过检查已全绿的前提下合并。
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Head: bf2b283
English verdict: APPROVE
A PR that grew a module past its reviewed line ceiling, without raising that ceiling in the same diff, previously merged and turned main red until a separate reconciliation PR refreshed the ledger. That split settlement is the structural hole behind loopx-project#4587 -> loopx-project#4618/loopx-project#4619. Add diff_scoped_module_ceiling_violations to the maintainability ratchet and wire it into 'loopx canary premerge' as a direct gate check. The check flags exactly the diff that crossed an inherited ceiling while leaving the head ledger short; growth below the ceiling and in-diff ceiling settlements both stay silent. Signed-off-by: song <liusongstep@gmail.com>
Goal And Delivered Outcome
mainhas been red since fix(manager): make a partial team-plan materialization recoverable #4587.tests/canary/test_maintainability_ratchet.py::test_current_repository_debt_is_reviewed_without_line_count_pinsreportsunreviewed finding: module_metric_budget:loopx/chat_actions.py, so every open PR inherits a failingtest-shardand no PR can merge.origin/main(809f0cf) the ratchet fails withdebt: module_metric_budget=1, unreviewed=1; with this one-line ledger refresh the report isok: True, unreviewed: 0, finding_count: 2 (compatibility_facade), which is exactly what the test asserts.main(809f0cf). No tracking issue; this is the canary's own prescribed remedy.Scope And Continuation
loopx/chat_actions.pyis 1604 lines against a reviewed ceiling of 1590, so the checked-in ledger is refreshed to the reviewed value. The growth itself is not introduced here — it is already merged — and the module keeps its own entry rather than the 1500-line default, so the debt stays visible and bounded.any_countkeeps its existing 52 headroom (currently 45).lane_failure,lane_settlements, boundeddetailsonmark_failed) instead of adding a second settlement path. The alternative remedy — extracting that code — would rewrite work that three open PRs (fix(heartbeat): carry the closeout vision decision in the writeback guidance #4590, feat(manager): name the lanes a confirmed team plan left unstaffed #4600, feat(manager): let a partially applied team plan be finished #4602) are already changing in the same module, so this PR takes the ledger route the canary names instead of forcing a conflicting refactor.Validation
regression_paritypassedorigin/mainworktree fails the ratchet withunreviewed finding: module_metric_budget:loopx/chat_actions.py(also failing on main's ownPython Testsrun 35176730888, jobtest-shard (2)). Passing after: same test green on this head.unitpasseduv run --extra test python -m pytest tests/canary -q→ 21 passedFrontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
loopx/canary/module_metric_baseline.json), whose own report text states that the ledger edit is the reviewer-visible decision whether growth is accepted.Shared-authority RFC fixture impact
Boundary Checklist
noneSigned-off-bytrailer中文摘要
main自 fix(manager): make a partial team-plan materialization recoverable #4587 起就是红的——chat_actions.py现在 1604 行,超过已评审上限 1590,canary 报unreviewed finding: module_metric_budget,所有 PR 的test-shard因此失败,合并不了。any_count不动(现 45,上限 52),债务保持可见且有界。origin/mainworktree 上该测试失败(main 自己的 run 35176730888 同样失败);改动后tests/canary -q21 passed。