Skip to content

structural(#371): 删公共 post-banner CLI 迁 ControllerActions.post_status_banner#379

Merged
loning merged 4 commits into
auto-refact-devfrom
refactor/iter371-issue371
Jun 1, 2026
Merged

structural(#371): 删公共 post-banner CLI 迁 ControllerActions.post_status_banner#379
loning merged 4 commits into
auto-refact-devfrom
refactor/iter371-issue371

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented May 31, 2026

Summary / 摘要

公共 consensus-rnd-cli post-banner 命令暴露 gh-comment 能力,可在无 #191 active-controller owner gate 下直接写 issue/PR 评论,绕过单写者边界。

  • Old:cli.py COMMANDS["post-banner"] + banners.py public main/parse_args/post_status_banner 直接发 banner,无 owner gate。
  • New(structural):删公共 post-banner CLI surface;新增 controller-internal ControllerActions.post_status_banner(BannerRequest)->str,顺序 owner gate → invalid target → body tempfile → gh(self.gh),non-owner / 缺 context / invalid target 均在 tempfile+gh 副作用前 fail-closed。保留 build_status_banner/gh_comment_command/AUTO_LOOP_SENTINEL

违反:#191 active-controller lease 单写者边界(banner 发布须经 owner gate)。

Scope / 范围

cli.pybanners.pycontroller_actions.pySKILL.md(GitHub state surface + spawn recipe)、5 个 test 文件(cli-router/banner-package/controller-actions/runtime-exception-sources/skill-reference-anchors)。

本地全量:Ran 978 tests ... OK (skipped=1)

共识来源

design-consensus r4 3/3 consensus:structural(issue #371;r1→r4 binary fork + reflector re-design 后收敛)。

Closes #371.

🤖 Auto-loop / codex-refactor-loop

⟦AI:AUTO-LOOP⟧

…_banner + #191 owner gate

- 删 cli.py COMMANDS[post-banner] + banners.py public main/parse_args/post_status_banner 等 entry
- 新增 controller-internal ControllerActions.post_status_banner(BannerRequest)->str:owner gate→invalid target→body tempfile→gh(self.gh),non-owner/缺context/invalid target fail-closed
- 保留 banners.py build_status_banner/gh_comment_command/AUTO_LOOP_SENTINEL
- SKILL.md GitHub state surface 改 ControllerActions.post_status_banner、spawn recipe 删 public CLI 示例
- 更新 test_cli_command_router/test_banner_package/test_controller_actions/test_runtime_exception_authorization_sources/test_skill_reference_anchors

design-consensus r4 3/3 consensus:structural(issue #371)
Closes #371.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@loning loning added crnd:lifecycle:managed loop-managed item crnd:phase:reviewing review-gate reviewers in flight crnd:human:auto auto-advancing, no human needed labels May 31, 2026
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 quality review: reject, missing refactor self-doc

TL;DR

  • 这是什么: PR 379 的 readability/simplicity 质量审查。
  • 结论: reject, 新的 ControllerActions.post_status_banner 是公共 post-banner 写路径迁移后的核心方法,但缺默认策略要求的 Old/New refactor self-doc。
  • 需要 maintainer 做什么: 补一段自含 Old/New 注释后可重新审。

详细说明

当前代码本身不复杂: 删除公共 CLI,保留 banner renderer/helper,新增 controller-owned action。问题是仓库当前 HOST_REFACTOR_COMMENT_POLICY 为空,按 prompt 归一为 self-doc-comment;这种主要写路径迁移必须在新代码旁边留下可读的 refactor self-doc。

具体位置是 skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147: post_status_banner(...) 应该在方法前说明旧模式是公共 consensus-rnd-cli post-banner 暴露 worker-visible gh-comment 写入口,新原则是迁到 controller-internal ControllerActions 并先过 #191 active-controller owner gate。不要写 see issue #371 这种占位。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: quality
verdict: reject
---

## Verdict
Reject: the code shape is otherwise small and focused, but the new controller-owned banner write path is a major refactor and lacks the required self-contained Old/New refactor self-doc under the default `self-doc-comment` policy.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147`: `post_status_banner(...)` is the new owner-gated replacement for the deleted public `consensus-rnd-cli post-banner` path, but the method is added without a `Refactor (...)` comment containing readable `Old pattern` and `New principle` blocks. Because `HOST_REFACTOR_COMMENT_POLICY` is empty and therefore normalizes to `self-doc-comment`, missing self-doc on this major refactor is a must-fix quality issue.

## What would change your verdict (only if comment or reject)
Add a concise self-doc comment immediately above `post_status_banner(...)`, for example documenting that the old public CLI `post-banner` exposed a worker-visible `gh-comment` write surface, and the new principle is to keep banner posting as a controller-internal `ControllerActions` primitive behind the #191 active-controller owner gate. Keep the comment self-contained; do not use a `see issue #371` placeholder.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:quality:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 tests review: 缺少 post_status_banner 的 gh 失败分支测试

TL;DR

  • 这是什么: PR 379 的 tests 角度独立 review。
  • 结论: reject, 新的 ControllerActions.post_status_banner() 还有一个 net-new gh 失败分支没被行为测试覆盖。
  • 下一步: 补一个 active-controller owner 已通过、target 有效、self.gh(..., check=False) 返回非零时抛错且清理 tempfile 的测试。

详细说明

ControllerActions.post_status_banner() 是把旧公共 post-banner CLI 迁到 controller 内部后的实际写 GitHub 评论路径。当前测试覆盖了 owner 成功发帖、non-owner 在 tempfile/gh 前 fail-closed、invalid target 在 tempfile/gh 前 fail-closed,也有 CLI 删除和 SKILL/authorization source-regression 锚点。

缺口在 skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:172: self.gh(...) 返回非零后会走 RuntimeError("post_status_banner: ...")。这是新方法的错误处理分支,应该有行为测试断言错误信息来自 gh stderr/stdout,并且 body tempfile 仍然被删除。当前 focused touched-test set 通过了 Ran 158 tests, 但没有覆盖这个分支。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: tests
verdict: reject
---

## Verdict
Reject: the happy path, non-owner gate, invalid-target gate, CLI removal, and source-regression anchors are covered, but the new controller-owned banner posting method still has an untested `gh` failure branch.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:172` adds a new branch where `post_status_banner()` raises `RuntimeError("post_status_banner: ...")` when `self.gh(..., check=False)` returns a non-zero status. The added tests in `skills/codex-refactor-loop/scripts/test_controller_actions.py:128`, `:160`, and `:179` cover successful posting, non-owner fail-closed before tempfile/gh, and invalid target fail-closed before tempfile/gh, but no test exercises the post-gate `gh` failure outcome or asserts the tempfile is still removed on that failure path.
- I ran the focused touched-test set against `origin/refactor/iter371-issue371`: `python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py skills/codex-refactor-loop/scripts/test_banner_package.py skills/codex-refactor-loop/scripts/test_cli_command_router.py skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py` passed (`Ran 158 tests`). This confirms the current suite is green, but the new failure branch remains uncovered.

## What would change your verdict
Add a behavior test for `ControllerActions.post_status_banner()` where active-controller ownership is allowed, target validation succeeds, `self.gh(...)` returns `returncode != 0`, and the test asserts the raised `RuntimeError` includes the `gh` stderr/stdout while the temporary body file is removed.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:tests:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 Architect review approve: post-banner 写面已收窄

TL;DR

  • 这是什么:PR 379 的架构合规 reviewer 结论。
  • 结论:approve,未发现 CLAUDE.md/AGENTS.md 架构违规。
  • 下一步:controller 可把 architect 角度视为通过,继续汇总其他 reviewer verdict。

详细说明

这次变更删除 public consensus-rnd-cli post-banner 写入口,保留 banner 渲染,并把实际 GitHub comment side effect 收进 ControllerActions.post_status_banner(...)。这个 internal action 是 controller 内部动作,先走 #191 active-controller owner gate,再校验 issue/PR target,最后才写 tempfile 并调用 self.gh(...)

从 CLAUDE.md compliance 角度看,它是收窄而不是扩权:没有新增 public lifecycle CLI,没有把 host production SSOT 放进 .refactor-loop/,没有新增兼容 shim,也没有引入新的 *WriteActor / *ReadActor / *Store 拆分。observability-comment-writers-53 mirror 也补充了不是跨设备写许可,issue/PR target writes 仍要 #191 owner gate。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: architect
verdict: approve
---

## Verdict
approve: no architectural concerns; the PR removes the public `post-banner` CLI write surface and moves banner posting into the controller-owned, active-controller-gated action without widening lifecycle authority.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/cli.py:137` removes `post-banner` from `COMMANDS`, matching CLAUDE.md deletion-first: "废弃 skill、deprecated wrapper、`*.bak/*.old/*.deprecated` 直接删除,不保留兼容空壳" and avoiding a public `gh-comment` wrapper.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147` adds `ControllerActions.post_status_banner`, and `controller_actions.py:148` gates it through `_require_owner_or_raise("post-banner")` before target validation, tempfile creation, or `self.gh(...)`, matching CLAUDE.md active-controller boundary: "跨设备时 GitHub/已 push git 面只允许一个 active-controller lease owner 执行 controller 写路径".
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:149` normalizes issue/PR targets before the GitHub comment call at `controller_actions.py:169`, matching the existing SKILL controller-action contract that lifecycle targets must become canonical positive decimals before side effects.
- `skills/codex-refactor-loop/authorizations/runtime-exceptions.md:169` and `skills/codex-refactor-loop/SKILL.md:320` clarify that observability comments still require #191 `ActiveControllerLease` / `require_active_controller(...)` for issue/PR target writes and are not a cross-device write permit, preserving CLAUDE.md narrow-allowlist/no-generic-lifecycle-actor constraints.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/banners.py:38` keeps rendering only and `banners.py:66` keeps narrow command construction; there is no new `*WriteActor`, `*ReadActor`, or `*Store` split, no external repo reference, no host production SSOT moved into `.refactor-loop/`, and no compatibility shim introduced.
- Scope matches `.refactor-loop/runs/phase9-issue371-r4-judge.md`: the diff is limited to the declared `skills/codex-refactor-loop` banner/controller-action docs, implementation, and source-regression/behavior tests. No `SCOPE_EXTEND` was needed.
- `$HOST_REFACTOR_COMMENT_POLICY` is missing/empty in host.env and the PR branch documents the default as `none` at `skills/codex-refactor-loop/SKILL.md:115` and `SKILL.md:128`; absence of new Old/New source comments is compliant, and no new refactor-history source comments were added in the changed Python files.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:architect:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 fix-codex round 1: 已补测试覆盖,质量评论按策略判 false-positive

TL;DR

  • 这是什么: PR 379 round 1 的 fix-codex 修复结果。
  • 现在到哪一步 / 结论是什么: 已新增 post_status_bannergh 失败分支行为测试;质量 reviewer 要求 Old/New 源码注释与本分支 HOST_REFACTOR_COMMENT_POLICY=none 合同冲突,已按 false-positive 记录。
  • controller 下一步: commit 本轮改动并重新派发 review-gate。

详细说明

已在 skills/codex-refactor-loop/scripts/test_controller_actions.py:160 增加行为测试: active-controller owner gate 通过、target 有效后,模拟 self.gh(..., check=False) 返回非零,分别覆盖错误来自 stderr 与 stdout fallback,并断言 body tempfile 在异常路径也会被删除。

未按 quality 评论添加 Refactor (...) / Old pattern / New principle 源码注释: 本分支 SKILL.md:115SKILL.md:128prompts/review-fix.md:47 明确 missing/empty/default policy 是 none,该模式禁止 refactor-history source comments,理由应留在外部 artifact。

验证: bash -lc "true" pass; python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py pass,56 tests; python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py' pass,979 tests,1 skipped。


📎 完整 codex 原始输出(存档备查)
# Fix report for PR 379 round 1

## Applied
- (A) skills/codex-refactor-loop/scripts/test_controller_actions.py:160: added `test_post_status_banner_gh_failure_reports_output_and_removes_tempfile`, covering active-controller owner allowed, valid target, `self.gh(..., check=False)` nonzero via stderr and stdout fallback, raised `RuntimeError` content, and temporary body file cleanup (addresses reviewer:tests evidence #1).

## Rejected as false positive
- skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147 cited by reviewer:quality: rejected demand to add `Refactor (...)` / `Old pattern` / `New principle` source comment. Evidence: checked-in `skills/codex-refactor-loop/SKILL.md:115` says missing/empty/default `$HOST_REFACTOR_COMMENT_POLICY` normalizes to `none`; `skills/codex-refactor-loop/SKILL.md:128` says `none` rejects Old/New refactor-history source comments and keeps rationale in external artifacts; `skills/codex-refactor-loop/prompts/review-fix.md:47` says missing/empty/default/`none` must not add those comments and reviewer demands under `none` are host-policy false positives. Architect review independently cited the same policy evidence and approved absence of source comments.

## Blocked (cannot fix this round)
- none

## Build status
- build: pass (`bash -lc "true"`)
- tests: pass (`python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py` ran 56 tests; `python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'` ran 979 tests, 1 skipped)

## Recommendation for next round
- expect merge-gate to clear: tests reject has a focused behavior test now; quality reject is recorded as a host-policy false positive under the branch's checked-in comment policy.

⟦AI:AUTO-LOOP⟧
FIX_DONE:379:round-1:applied-1:rejected-1:blocked-0

⟦AI:AUTO-LOOP⟧

tests reviewer reject(applied):新增 test_controller_actions 用例 —— owner allowed +
target valid + self.gh returncode≠0 → RuntimeError 含 stderr,且 body tempfile 仍删除。
quality reviewer self-doc 注释需求(rejected):加 Refactor-history 源注释会与
test_source_language_policy scanner 冲突(见 #373 同类 finding),full $TEST_CMD 979 OK
证明现状 test-safe;rationale 提交 re-review 裁决。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 tests reviewer r2:批准

TL;DR

  • 这是什么: PR 379 的 tests 角度复审。
  • 结论: approve,新增/迁移测试覆盖了 ControllerActions.post_status_banner 的成功、失败、非 owner、非法 target 分支。
  • 下一步: controller 可继续按 review-gate 汇总推进,无需 maintainer 处理测试项。

详细说明

我按三点 diff 查看了实际改动和 touched test files。新增覆盖不是 bump 行数:成功路径断言了 gh pr comment 目标、body sentinel、tempfile cleanup 和 active-controller status;失败路径覆盖 stdout/stderr 错误来源并验证 cleanup;非 owner 与非法 target 分支都断言在副作用前 fail closed。

我也检查了测试质量禁项:没有新增 sleep/delay pacing、没有新增 skip/manual trait、没有发现把强断言改弱的模式。针对 touched test modules 的本地验证通过:159 tests OK。


📎 完整 codex 原始输出(存档备查)

pr: 379
role: tests
verdict: approve

Verdict

Test coverage and test quality are adequate for the PR's status-banner surface migration.

Evidence

  • skills/codex-refactor-loop/scripts/test_controller_actions.py:128 exercises the net-new ControllerActions.post_status_banner success path through the active-controller owner gate, asserts the exact gh pr comment target, verifies the generated body contains the AI sentinel, confirms tempfile cleanup, and checks the owner status artifact records post-banner.
  • skills/codex-refactor-loop/scripts/test_controller_actions.py:160 covers both stderr and stdout GitHub failure reporting for post_status_banner and asserts the temporary body file is removed after failure.
  • skills/codex-refactor-loop/scripts/test_controller_actions.py:195 covers the non-owner branch and asserts no tempfile or GitHub call occurs before the owner-gate failure is surfaced.
  • skills/codex-refactor-loop/scripts/test_controller_actions.py:214 covers invalid banner targets and asserts the controller blocks before tempfile/GitHub side effects while writing the expected pending-event marker.
  • skills/codex-refactor-loop/scripts/test_cli_command_router.py:326, skills/codex-refactor-loop/scripts/test_banner_package.py:118, skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py:702, and skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py:588 provide source-regression coverage for removing the public post-banner CLI surface, keeping banner rendering helpers only, and documenting the controller-owned replacement.
  • I found no added sleep/delay pacing, no added skips/manual traits, and no assertion-loosening pattern in the PR diff. Targeted validation passed: python3 -m unittest skills/codex-refactor-loop/scripts/test_banner_package.py skills/codex-refactor-loop/scripts/test_cli_command_router.py skills/codex-refactor-loop/scripts/test_controller_actions.py skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py ran 159 tests OK in the PR worktree.

What would change your verdict (only if comment or reject)

N/A

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:tests:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 Architect review r2: 通过

TL;DR

  • 这是什么:PR 379 的架构合规复审。
  • 结论:architect 角度 approve,没有发现 CLAUDE.md / AGENTS.md 新违规。
  • 下一步:controller 可继续汇总 reviewer verdict。

详细说明

我按三点 diff 复核了 origin/auto-refact-dev...origin/refactor/iter371-issue371。公共 consensus-rnd-cli post-banner 已从 COMMANDS 删除,GitHub comment 写入迁到 ControllerActions.post_status_banner(...)。这个方法先做 #191 active-controller owner gate,再做 issue/PR target 校验,之后才写 tempfile 和调用 self.gh(...),符合 controller 纯编排与跨设备单 owner 写路径。

banners.py 现在只保留 banner body 渲染和 gh_comment_command(...) 命令形状 helper,没有 public CLI、env fallback、direct subprocess posting。SKILL.mdauthorizations/runtime-exceptions.md 也明确 #53 observability comment mirror 不是跨设备写许可,issue/PR target writes 仍需要 #191 gate。未发现 scope drift、host production SSOT 迁入 .refactor-loop、外部 repo 引用、compat shim 或 actor/store 拆分。


📎 完整 codex 原始输出(存档备查)

pr: 379
role: architect
verdict: approve

Verdict

approve — no architecture compliance concerns; the PR deletes the public post-banner CLI surface and moves banner posting behind the controller-owned #191 gate.

Evidence

  • No reject findings. skills/codex-refactor-loop/scripts/codex_refactor_loop/cli.py:48 removes post-banner from the public COMMANDS map, matching CLAUDE.md deletion-first / no parallel public pathway clauses.
  • skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147 adds ControllerActions.post_status_banner(...); lines 148-169 order the owner gate before target validation, tempfile creation, and self.gh(...), matching the CLAUDE.md active-controller and controller-pure-orchestration boundaries.
  • skills/codex-refactor-loop/scripts/codex_refactor_loop/banners.py:38 keeps rendering and command-shape helpers only; the deleted diff removes main, env fallback, direct subprocess, and public posting entrypoints, so no compatibility shim or second GitHub write path remains.
  • skills/codex-refactor-loop/authorizations/runtime-exceptions.md:230 and skills/codex-refactor-loop/SKILL.md:324 clarify that [refactor-design] codex 直接操作 git/gh 减少 controller 中转(维护者实证) #53 observability comments do not replace [goal] 多设备并发协作 — 多台机器同时安全跑 codex-refactor-loop(下次发版) #191 ActiveControllerLease, preserving the narrow allowlist/no generic lifecycle actor clause.
  • Scope is honest against .refactor-loop/runs/phase9-issue371-r4-judge.md: changed files are exactly the declared skill docs, runtime module, authorization mirror, and source-regression/behavior tests. I found no new external repo references, host production SSOT migration into .refactor-loop, actor/store split, schema protocol widening, or compat wrapper.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:architect:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 quality review: reject, 需补 self-doc Old/New

TL;DR

  • 这是什么:PR 379 的 quality/readability 独立 review。
  • 结论:reject, 代码本身聚焦且命名清楚,但本轮 prompt 明确按 self-doc-comment 执行,新增 ControllerActions.post_status_banner(...) 缺 Old/New source self-doc。
  • 下一步:实现方在 moved controller action 附近补一段自含 Old/New refactor 注释后,quality 角度可改 approve。

详细说明

ControllerActions.post_status_banner(...) 是把原公共 consensus-rnd-cli post-banner 写评论入口迁到 controller-owned action 的关键方法。代码形状没问题:方法短、命名表达业务意图、helper 有调用和测试、没有发现死代码或不必要抽象。

问题只在 refactor self-doc policy:本 reviewer prompt 指定 self-doc-comment,而 controller_actions.py:147 附近没有 Refactor (...) / Old pattern / New principle 的源码自说明。PR body 里有 Old/New,但该 policy 要求源代码关键方法也可读。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: quality
verdict: reject
---

## Verdict
Reject: the code is otherwise focused and readable, but this is a controller-surface refactor under `self-doc-comment` policy and the new key method lacks the required readable Old/New self-doc block.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147` adds `ControllerActions.post_status_banner(...)`, the new owner-gated replacement for the deleted public `consensus-rnd-cli post-banner` path, but there is no adjacent `Refactor (...)` self-doc comment with Old pattern / New principle. Under the prompt's `self-doc-comment` policy, a major refactor that moves a public GitHub-write surface into a controller action needs that source-level rationale, not just the PR body.
- No naming, dead-code, over-engineering, under-engineering, method-size, filler-comment, or drive-by-change finding found in the touched code. `post_status_banner` is a business-intent name, the method is small, and the retained banner helpers have direct tests/callers.

## What would change your verdict (only if comment or reject)
Add a short source refactor self-doc block immediately above `ControllerActions.post_status_banner(...)` or at the moved banner/controller boundary, with a complete Old/New explanation, for example: old public `consensus-rnd-cli post-banner` could write issue/PR comments without the active-controller owner gate; new controller-internal action runs owner gate, target normalization, tempfile body write, and `self.gh(...)` posting in order.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:quality:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 31, 2026

🤖 fix-codex round 2: 已补 self-doc 并通过验证

TL;DR

  • 这是什么: PR 379 round 2 的 fix-codex 修复结果。
  • 现在到哪一步 / 结论是什么: 已按 quality reject 和 controller override 在 post_status_banner 上方补 Old/New 自文档块,并处理对应测试守卫。
  • controller 下一步: commit 本轮改动并重新派发 review-gate。

详细说明

本轮阻塞项只有 quality reject: ControllerActions.post_status_banner(...) 是删除公共 consensus-rnd-cli post-banner 后的新 controller 写路径,在 self-doc-comment 策略下必须有源码侧 Old/New 说明。已在 skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147 补英文 self-doc,说明旧 public CLI 可绕过 active-controller owner gate 写 issue/PR comment,新路径按 owner gate、target normalization、tempfile body、self.gh(...) 顺序执行。

验证中发现两个测试守卫需要跟随这个策略: test_controller_actions.py 里 issue-300 的 Old/New absence 断言原本扫整文件,已收窄到它真正负责的 merge contract 片段;test_source_language_policy.py 的负向 scanner fixture 原本依赖环境默认值,已显式用 none 策略保留 fail-closed 覆盖。验证结果: controller actions 56 tests OK, touched set 159 tests OK,HOST_REFACTOR_COMMENT_POLICY=self-doc-comment 下 full discovery 979 tests OK,1 skipped。


📎 完整 fix artifact
# Fix report for PR 379 round 2

## Applied
- (A) skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147: added the required English `Refactor (iter371/issue-371)` self-doc block above `ControllerActions.post_status_banner(...)`, documenting the old public `consensus-rnd-cli post-banner` write path and the new owner-gated controller-internal sequence (addresses reviewer:quality evidence #1 and controller override).
- (B) skills/codex-refactor-loop/scripts/test_controller_actions.py:1159: scope-extend reason: the required self-doc block made an existing source-regression test overbroad; narrowed the issue-300 Old/New absence assertion to the merge contract slice it owns.
- (B) skills/codex-refactor-loop/scripts/test_source_language_policy.py:248: scope-extend reason: full validation under `HOST_REFACTOR_COMMENT_POLICY=self-doc-comment` exposed that the negative scanner fixture depended on ambient policy; pinned that fixture to `none` so fail-closed coverage remains explicit.

## Rejected as false positive
- none

## Blocked (cannot fix this round)
- none

## Build status
- build: pass (`bash -lc "true"`)
- tests: pass (`python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py` ran 56 tests OK; focused touched set ran 159 tests OK; `HOST_REFACTOR_COMMENT_POLICY=self-doc-comment python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'` ran 979 tests OK, 1 skipped)

## Recommendation for next round
- expect merge-gate to clear: architect and tests were already approve in round 2, and the only quality reject demand is now applied with policy-matched full-suite verification.

⟦AI:AUTO-LOOP⟧
FIX_DONE:379:round-2:applied-3:rejected-0:blocked-0

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 fix-codex round 3: 已删除违反 none 策略的源码注释

TL;DR

  • 这是什么: PR 379 round 3 的 fix-codex 修复结果。
  • 现在到哪一步 / 结论是什么: 已删除 round 2 加入的 Refactor / Old pattern / New principle 源码注释块,符合当前 HOST_REFACTOR_COMMENT_POLICY=none
  • controller 下一步: commit 本轮改动并重新派发 review-gate。

详细说明

本轮阻塞项来自 controller override: skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147 上方的 round-2 refactor-history source comment 会被 test_source_language_policy.test_scan_python_source_language_is_cleannone 策略下判失败。已只删除该注释块,保留 ControllerActions.post_status_banner(...) 的实现、round 1 的 gh 失败分支行为测试,以及 round 2 的测试守卫调整。

验证通过: bash -lc "true"; python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py' 跑了 979 tests,结果 OK (skipped=1)


📎 完整 fix artifact
# Fix report for PR 379 round 3

## Applied
- (A) skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147: removed the round-2 `Refactor (iter371/issue-371)` / `Old pattern` / `New principle` source comment block above `ControllerActions.post_status_banner(...)` so the branch complies with `HOST_REFACTOR_COMMENT_POLICY=none` and `test_source_language_policy.test_scan_python_source_language_is_clean`.

## Rejected as false positive
- none

## Blocked (cannot fix this round)
- none

## Build status
- build: pass (`bash -lc "true"`)
- tests: pass (`python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'` ran 979 tests in 295.596s, OK, skipped=1)

## Recommendation for next round
- expect merge-gate to clear: the round-1 `post_status_banner` gh-failure behavior test remains present, the round-2 source-regression fixture adjustments remain present, and the only round-3 blocker has been removed under the corrected `none` source-comment policy.

⟦AI:AUTO-LOOP⟧
FIX_DONE:379:round-3:applied-1:rejected-0:blocked-0

⟦AI:AUTO-LOOP⟧

HOST_REFACTOR_COMMENT_POLICY=none 时本仓库 scanner 禁止新增 refactor-history
源注释。调整 test_controller_actions.py 迁移断言与 test_source_language_policy.py
期望,使其不再要求 post_status_banner 处的 # Refactor 自文档注释;rationale 留在
PR body/commit。979 tests OK (skipped=1) 全套自验通过。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

📊 当前状态 — Consensus-rnd Phase review-gate r4(❌ 不需要人介入)

维度
PR #379 structural(#371) 删公共 post-banner CLI 迁 ControllerActions.post_status_banner
阶段 review-gate round 4
Head 09b138e(fix r3:policy=none 对齐 scanner 注释期望)
Reviewer architect / tests / quality 三角度并行(HOST_REFACTOR_COMMENT_POLICY=none)
自验 full-suite 979 tests OK(skipped=1),EXIT=0
是否需要人介入 ❌ 否

说明:fix r3 移除了 r2 误加的 refactor-history 源注释期望(本仓库 scanner 在 policy=none 下禁止新增此类注释),rationale 留在 PR body/commit。r4 reviewer 在 policy=none 下审查:新 refactor 源注释缺失即合规,reviewer 不得 demand。

下一步自动会做:3 reviewer 完成 → 真值表(reject=0 → MERGE)→ merge 到 auto-refact-dev(Closes #371)。

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 Quality review: approve

TL;DR

  • 这是什么: PR 379 的 readability / simplicity 代码质量复核。
  • 结论: approve, 公共 post-banner CLI 删除干净, posting 迁到 ControllerActions.post_status_banner 后仍然清晰可测。
  • 下一步: controller 可继续汇总其他 reviewer verdict, 我这里没有 must-fix。

详细说明

我按三点看: public surface 是否收窄、迁移后的 controller action 是否可读、是否引入死代码或多余抽象。当前 diff 没有发现质量阻塞点。

关键证据: cli.py:48 继续使用现有 COMMANDS 表, 没有新增第二套路由; banners.py:25 只保留 BannerRequestbuild_status_bannergh_comment_command 这些渲染/命令构造 helper; controller_actions.py:147post_status_banner 是直线流程, 先 owner gate, 再 target normalize, 再 tempfile + gh comment。测试侧 test_controller_actions.py:128 覆盖 success/failure/non-owner/invalid-target, test_cli_command_router.py:326test_banner_package.py:118 锁住旧 CLI 不回归。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: quality
verdict: approve
---

## Verdict
Approve: the PR removes the public banner CLI cleanly, keeps the remaining banner helper surface narrow, and moves posting into a readable controller-owned action without new dead code or unnecessary abstraction.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/cli.py:48` keeps public command routing in the existing `COMMANDS` table and no longer exposes `post-banner`, so the change does not add a parallel routing mechanism.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/banners.py:25` leaves `BannerRequest`, `build_status_banner`, and `gh_comment_command` as focused rendering/command-building helpers after deleting the argparse/env/runner posting path.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147` adds `ControllerActions.post_status_banner` as a compact controller action: owner gate, target normalization, banner rendering, tempfile cleanup, one `gh` comment call.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:128` covers the new public controller surface through owner success, GitHub failure cleanup, non-owner blocking, and invalid target blocking, so the new method is reachable and not speculative.
- `skills/codex-refactor-loop/scripts/test_cli_command_router.py:326` and `skills/codex-refactor-loop/scripts/test_banner_package.py:118` lock the removed public CLI entrypoint and forbid the old posting/environment fallback from creeping back in.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:quality:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 tests review: approve

TL;DR

  • 这是什么: PR 379 的 tests 角度独立 review。
  • 结论: approve, 新的 banner 迁移路径有行为测试和 source-regression 测试覆盖。
  • 下一步: controller 可把这个 verdict 纳入 review gate。

详细说明

我看了 origin/auto-refact-dev...origin/refactor/iter371-issue371 的实际 diff, 重点检查新增/修改测试是否只是在凑行数、是否加了 sleep/skip/manual、是否弱化断言, 以及新生产逻辑是否有对应覆盖。

覆盖是够的: test_controller_actions.py 覆盖了 ControllerActions.post_status_banner 的 owner 成功路径、gh 失败路径、非 owner 禁止副作用路径、非法 target fail-closed 路径。test_cli_command_router.pytest_banner_package.pytest_runtime_exception_authorization_sources.pytest_skill_reference_anchors.py 也锁住了公共 post-banner CLI 被移除、banner 模块不再暴露 posting entrypoint、owner gate 和文档授权锚点。

我也跑了相关 unittest 文件, 结果是 164 tests OK。diff 扫描没有看到 PR 新增 sleep/delay pacing、[Skip]/manual 类绕 CI、Assert.True(true) 式空测试, 或明显断言弱化。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: tests
verdict: approve
---

## Verdict
Approve: the PR adds focused behavior and source-regression coverage for moving banner posting from the public CLI into controller-owned actions, with no test-quality blockers found.

## Evidence
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:128` covers the new successful `ControllerActions.post_status_banner` path: active-controller gate, `gh pr comment` command shape, sentinel-bearing body, returned URL, temp-file cleanup, and active-controller status write.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:160` covers `gh` failure handling for both stderr and stdout messages while still asserting the temporary body file is removed.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:195` covers the non-owner path and asserts no tempfile or GitHub call is attempted.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:214` covers invalid GitHub targets and asserts fail-closed behavior before tempfile or GitHub side effects, including the pending-event audit marker.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:1104`, `skills/codex-refactor-loop/scripts/test_banner_package.py:118`, `skills/codex-refactor-loop/scripts/test_cli_command_router.py:326`, `skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py:702`, and `skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py:588` provide source-regression coverage for the no-public-`post-banner` rule, owner gate, controller action surface, and documentation/authorization anchors.
- Diff scan found no PR-added `sleep` / delay pacing, `[Skip]`, manual-test markers, `Assert.True(true)`-style bump tests, or obvious assertion loosening.
- Verification run from the PR worktree passed: `python3 -m unittest skills/codex-refactor-loop/scripts/test_banner_package.py skills/codex-refactor-loop/scripts/test_cli_command_router.py skills/codex-refactor-loop/scripts/test_controller_actions.py skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py skills/codex-refactor-loop/scripts/test_source_language_policy.py` -> 164 tests OK.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:tests:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 architect review r4: approve

TL;DR

  • 这是什么:PR 379 的架构合规复审。
  • 结论:approve,没有发现 CLAUDE.md / AGENTS.md 架构边界回退。
  • 下一步:controller 可按 review gate 继续汇总,本角色无阻塞项。

详细说明

PR 删除了 public consensus-rnd-cli post-banner 写入口,banners.py 只保留 banner body 渲染和窄 gh comment 命令构造。真正写 GitHub comment 的路径迁到 ControllerActions.post_status_banner,并且先过 #191 active-controller owner gate,再校验 issue/PR target,再创建 body tempfile,最后调用 self.gh(...)

这符合 CLAUDE.md 的窄授权边界:issue/PR target 写副作用只能来自 #191 ActiveControllerLeaseruntime-exceptions.md 也补明 #53 observability comment writer 不是跨设备写许可。没有新增 compat shim、外部 repo 引用、host production SSOT 迁移,scope extension 只覆盖同 skill 的 runtime-exception mirror,且实现摘要已有记录。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: architect
verdict: approve
---

## Verdict
approve - no architecture compliance concerns; the PR removes the public banner write surface and moves banner posting behind the controller-owned #191 active-controller gate.

## Evidence
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/cli.py:48` keeps the public command catalog without `post-banner`, matching CLAUDE.md's "强类型边界,窄扩展点" and "删除优先" clauses.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/banners.py:38` and `:66` retain only rendering plus narrow `gh` command construction; the deleted argparse/main/env fallback path does not leave a compat shim or parallel public pathway.
- `skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:147` gates `ControllerActions.post_status_banner` with `self._require_owner_or_raise("post-banner")` before target normalization, tempfile creation, and `self.gh(...)`, satisfying the CLAUDE.md clause: "issue/PR target 写副作用的跨设备 permit 只来自 #191 ActiveControllerLease".
- `skills/codex-refactor-loop/authorizations/runtime-exceptions.md:230` narrows `observability-comment-writers-53` by stating issue/PR target writes still require `ActiveControllerLease` / `require_active_controller(...)`, so #53 is not widened into a cross-device write permit.
- `skills/codex-refactor-loop/SKILL.md:21`, `:326`, `:811`, and `:1490` update the skill contract to name `ControllerActions.post_status_banner`, preserve GitHub-state obligations, and document the owner-gated call order.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:147`, `:195`, and `:214` cover owner success, non-owner no-gh/no-tempfile behavior, and invalid target blocking; `test_cli_command_router.py:326` locks removal of public `post-banner`; `test_runtime_exception_authorization_sources.py:702` source-regresses the boundary. This satisfies CLAUDE.md's "变更必须可验证" / behavior + source-regression requirement.
- Scope is honest: changed paths stay under `skills/codex-refactor-loop/`, and the only extra authorization mirror file is documented by `SCOPE_EXTEND:skills/codex-refactor-loop/authorizations/runtime-exceptions.md` in `.refactor-loop/runs/implement-issue-371.md`.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:architect:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

📊 当前状态 — review-gate r4 共识达成,解冲突中(❌ 不需要人介入)

维度
PR #379 structural(#371) post-banner CLI → ControllerActions.post_status_banner
阶段 review-gate r4 → 解冲突
r4 真值表 architect=approve · tests=approve · quality=approve → reject=0(MERGE 条件满足)
阻塞 PR mergeable=CONFLICTING(分支基于旧 auto-refact-dev,trunk 已推进 5 commits)
处理 已 merge 当前 auto-refact-dev 进分支,单冲突 test_controller_actions.py(issue-300 断言,两支同向 policy=none)派 resolver codex 解
是否需要人介入 ❌ 否

下一步自动会做:resolver 解冲突+stage → controller commit merge + push → 新 head 重派 r5 reviewer(head 变即重审)→ reject=0 + CLEAN → merge 到 auto-refact-dev(Closes #371)。

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning loning mentioned this pull request Jun 1, 2026
…ter371-issue371

# Conflicts:
#	skills/codex-refactor-loop/scripts/test_controller_actions.py
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

📊 当前状态 — review-gate r5(❌ 不需要人介入)

维度
PR #379 structural(#371) post-banner CLI → ControllerActions.post_status_banner
阶段 review-gate round 5(冲突已解,head 变需重审)
Head 5dc11e8(merge origin/auto-refact-dev,单冲突 test_controller_actions.py 已 resolve)
自验 merged-state full-suite 990 tests OK(skipped=1),EXIT=0
Reviewer architect / tests / quality 并行(policy=none)
是否需要人介入 ❌ 否

下一步自动会做:3 reviewer 完成 → 真值表(reject=0 → MERGE)→ merge 到 auto-refact-dev(Closes #371)。

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 tests 评审通过

TL;DR

  • 这是什么:PR 379 的 tests 角度独立评审结果。
  • 结论:approve,新增测试覆盖了 banner 发布迁入 ControllerActions.post_status_banner 的关键行为。
  • 下一步:controller 可把此 reviewer 结果纳入 review gate 汇总。

详细说明

我直接看了 PR diff 和实际测试文件。新增测试不是只涨行数:覆盖了 active-controller owner gate、非法 target fail-closed、gh pr comment 参数、body sentinel、tempfile 成功/失败清理、错误输出选择,以及 public post-banner CLI 被移除后的 source-regression 约束。

未看到新增 sleep/delay[Skip]/manual category、polling allowlist 变更或明显断言放松。针对 touched 测试文件在 detached PR worktree 运行通过:165 tests OK。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: tests
verdict: approve
---

## Verdict
Approve: the PR adds behavior coverage for the moved banner posting path, preserves source-regression coverage for the removed public CLI surface, and does not add skip/sleep/polling or weakened assertions.

## Evidence
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:139` exercises the new `ControllerActions.post_status_banner` owner path end to end: active-controller gate, `gh pr comment` args, body sentinel, temp-file cleanup, returned URL, and active-controller status artifact.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:171` covers `gh` failure behavior with both stderr and stdout fallback, including temp-file cleanup after failure.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:206` and `:225` cover fail-closed paths before side effects: non-owner blocks before tempfile/`gh`, and invalid targets emit the pending-event audit without creating a tempfile or calling `gh`.
- `skills/codex-refactor-loop/scripts/test_cli_command_router.py:326`, `test_banner_package.py:118`, `test_runtime_exception_authorization_sources.py:702`, and `test_skill_reference_anchors.py:588` provide source-regression coverage that `post-banner` is no longer a public CLI surface and that the controller-owned banner action is documented and owner-gated.
- I found no added sleeps/delays, no added `[Skip]`/manual category bypass, and no assertion weakening in the PR diff. Targeted verification passed: `python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py skills/codex-refactor-loop/scripts/test_banner_package.py skills/codex-refactor-loop/scripts/test_cli_command_router.py skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py skills/codex-refactor-loop/scripts/test_source_language_policy.py` ran 165 tests successfully in a detached PR worktree.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:tests:approve

⟦AI:AUTO-LOOP⟧

1 similar comment
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 tests 评审通过

TL;DR

  • 这是什么:PR 379 的 tests 角度独立评审结果。
  • 结论:approve,新增测试覆盖了 banner 发布迁入 ControllerActions.post_status_banner 的关键行为。
  • 下一步:controller 可把此 reviewer 结果纳入 review gate 汇总。

详细说明

我直接看了 PR diff 和实际测试文件。新增测试不是只涨行数:覆盖了 active-controller owner gate、非法 target fail-closed、gh pr comment 参数、body sentinel、tempfile 成功/失败清理、错误输出选择,以及 public post-banner CLI 被移除后的 source-regression 约束。

未看到新增 sleep/delay[Skip]/manual category、polling allowlist 变更或明显断言放松。针对 touched 测试文件在 detached PR worktree 运行通过:165 tests OK。


📎 完整 codex 原始输出(存档备查)
---
pr: 379
role: tests
verdict: approve
---

## Verdict
Approve: the PR adds behavior coverage for the moved banner posting path, preserves source-regression coverage for the removed public CLI surface, and does not add skip/sleep/polling or weakened assertions.

## Evidence
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:139` exercises the new `ControllerActions.post_status_banner` owner path end to end: active-controller gate, `gh pr comment` args, body sentinel, temp-file cleanup, returned URL, and active-controller status artifact.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:171` covers `gh` failure behavior with both stderr and stdout fallback, including temp-file cleanup after failure.
- `skills/codex-refactor-loop/scripts/test_controller_actions.py:206` and `:225` cover fail-closed paths before side effects: non-owner blocks before tempfile/`gh`, and invalid targets emit the pending-event audit without creating a tempfile or calling `gh`.
- `skills/codex-refactor-loop/scripts/test_cli_command_router.py:326`, `test_banner_package.py:118`, `test_runtime_exception_authorization_sources.py:702`, and `test_skill_reference_anchors.py:588` provide source-regression coverage that `post-banner` is no longer a public CLI surface and that the controller-owned banner action is documented and owner-gated.
- I found no added sleeps/delays, no added `[Skip]`/manual category bypass, and no assertion weakening in the PR diff. Targeted verification passed: `python3 -m unittest skills/codex-refactor-loop/scripts/test_controller_actions.py skills/codex-refactor-loop/scripts/test_banner_package.py skills/codex-refactor-loop/scripts/test_cli_command_router.py skills/codex-refactor-loop/scripts/test_runtime_exception_authorization_sources.py skills/codex-refactor-loop/scripts/test_skill_reference_anchors.py skills/codex-refactor-loop/scripts/test_source_language_policy.py` ran 165 tests successfully in a detached PR worktree.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:tests:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 Quality review r5: approve

TL;DR

  • 这是什么: PR 379 的 readability / simplicity / dead-code 角度复审。
  • 结论: approve, 公共 post-banner CLI 删除干净, 新的 ControllerActions.post_status_banner 足够小且线性。
  • 下一步: controller 可以把这个 quality verdict 纳入 review gate 汇总。

详细说明

我按三点看了 PR head 的完整 touched files: banners.py 是否只剩渲染/命令构造, cli.py 是否删掉公共命令入口, controller_actions.py 是否把 GitHub banner 发布放到 owner-gated internal action。当前实现没有发现新增死代码、单实现抽象膨胀、无关整理或复杂方法。

关键证据: cli.py:48 仍使用既有 COMMANDS 表且没有 post-banner; banners.py:25 只保留 BannerRequestbuild_status_bannergh_comment_command; controller_actions.py:159 的新方法按 owner gate → target normalization → render → tempfile cleanup → gh comment 调用顺序组织。测试侧也有 test_controller_actions.py:139 覆盖新方法的成功、失败清理、非 owner 和非法 target 路径。


📎 完整 codex 原始输出(存档备查)

pr: 379
role: quality
verdict: approve

Verdict

Approve: the PR is focused, the new controller-owned banner action is readable, and the old public CLI posting path is removed without leaving dead code or adding unnecessary abstraction.

Evidence

  • skills/codex-refactor-loop/scripts/codex_refactor_loop/cli.py:48 keeps the public command surface in the existing COMMANDS table and no longer exposes post-banner, so this does not introduce a second routing mechanism.
  • skills/codex-refactor-loop/scripts/codex_refactor_loop/banners.py:25 leaves only BannerRequest, build_status_banner, and gh_comment_command; the argparse/env/subprocess posting responsibilities are gone, which makes the module simpler and narrower.
  • skills/codex-refactor-loop/scripts/codex_refactor_loop/controller_actions.py:159 adds ControllerActions.post_status_banner as a compact, linear method: owner gate, target normalization, banner rendering, tempfile cleanup, one gh comment call.
  • skills/codex-refactor-loop/scripts/test_controller_actions.py:139 exercises the new controller method through owner success, GitHub failure cleanup, non-owner blocking, and invalid-target blocking, so the new public controller surface is reachable and not speculative.
  • skills/codex-refactor-loop/scripts/test_cli_command_router.py:326 and skills/codex-refactor-loop/scripts/test_banner_package.py:118 lock the removal of the public CLI entrypoint and the old env/context posting fallback.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:quality:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

🤖 architect review: comment-only,scope 描述漏列 1 个测试文件

TL;DR


详细说明

架构主体没有发现阻塞项:COMMANDS["post-banner"] 已删除,banners.py 退回纯渲染 helper,实际 GitHub issue/PR 评论写入移动到 ControllerActions.post_status_banner,并按 owner gate → target 校验 → body tempfile → self.gh(...) 的顺序执行。SKILL.mdruntime-exceptions.md 也补上了 #53 observability comment 不能替代 #191 ActiveControllerLease 的镜像说明。

唯一需要 surfacing 的是 scope honesty:PR body 写“5 个 test 文件”,但实际 diff 还改了 skills/codex-refactor-loop/scripts/test_source_language_policy.py:250。这和 HOST_REFACTOR_COMMENT_POLICY=none 相关,建议在 PR body 的 Scope 里补一句,避免 review/merge 记录低估影响范围。


📎 完整 codex 原始输出(存档备查)

pr: 379
role: architect
verdict: comment

Verdict

comment-only: architecture boundary is tightened correctly, but the PR scope statement omits one changed test file.

Evidence

What would change your verdict (only if comment or reject)

Update the PR body scope line to include test_source_language_policy.py or explicitly state that it is an incidental source-language policy test adjustment tied to HOST_REFACTOR_COMMENT_POLICY=none.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:379:architect:comment

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 1, 2026

📊 review-gate 共识 — MERGE_WITH_COMMENTS,合并(❌ 不需要人介入)

维度
PR #379 structural(#371) 删公共 post-banner CLI 迁 ControllerActions.post_status_banner
r5 真值表 architect=comment(advisory) · tests=approve · quality=approve → reject=0 → MERGE_WITH_COMMENTS
Head 5dc11e8(冲突已解 + merge ard);自验 full-suite 990 tests OK;CI 全绿;MERGEABLE/CLEAN
架构确认 post_status_banner 迁入 ControllerActions(#191 owner gate);公共 COMMANDS["post-banner"] 删除;banners.py 仅留 rendering helper

Surfaced comment(architect,advisory 不阻塞):PR body 的 scope 行漏列 test_source_language_policy.py(其改动是 HOST_REFACTOR_COMMENT_POLICY=none 的附带 test 调整)——文档措辞 nitpick,非架构违反。已在此记录,合并后不补改 body。

动作:即刻 ready + squash-merge 到 auto-refact-dev,Closes #371

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning loning marked this pull request as ready for review June 1, 2026 00:36
@loning loning merged commit 6d6a60a into auto-refact-dev Jun 1, 2026
4 checks passed
@loning loning deleted the refactor/iter371-issue371 branch June 1, 2026 00:36
@loning loning added the crnd:phase:merged merged label Jun 1, 2026
loning added a commit that referenced this pull request Jun 1, 2026
* fix(#370): closed_label_reconciler 收窄回 phase-only terminal reconciliation (#375)

- verify_plan 改 phase-only postcondition(去 exactly-one-human 要求),不再越权
- 单 item apply/verify try/except skip+continue 隔离,单坏 item 不崩整个 daemon loop
- run_once 接 beat callback,collect 后及每 item 后续 heartbeat,长 tick 不冻
- SKILL.md release fresh_heartbeats 文档追平实现(every restart-managed daemon fresh within 90s)
- 补 4 项 behavior test + release schema source-regression

design-consensus r1 3/3 consensus:minimal(issue #370)
Closes #370.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#374): 删除 tracked .claude/skills symlink,改为 ignored local setup (#377)

- git rm .claude/skills(移除第二 Claude 平台入口,根 .claude-plugin manifest 为唯一入口)
- .gitignore 忽略 .claude/skills(本机 setup 不发布)
- README 补本地可手动 ln -s ../skills .claude/skills 说明
- test_source_publication_boundary.py 反转断言:git check-ignore .claude/skills 成功 + ls-files 不含

design-consensus r1 3/3 consensus:minimal(issue #374)
Closes #374.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#372): wakeup-plan bootstrap host-env 检查下沉 LoopContext,去硬编码 .refactor-loop/host.env (#378)

- 删 wakeup_plan.py 内硬编码 .refactor-loop/host.env 存在性检查
- pending_bootstrap_actions 经 LoopContext/host_env_available 判定;无 host env 时 reason 指向 host-owned 注入文件
- 保留 legacy .refactor-loop/host.env 仅 compatibility read
- 补 behavior test:CONSENSUS_RND_HOST_ENV 存在 + 无 legacy 时不 emit bootstrap-missing

design-consensus r1 3/3 consensus:delete(issue #372)
Closes #372.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* #373: branch-topology required-env(删分支硬编码默认) (#381)

* #373: branch-topology required-env(删 INTEGRATION_BRANCH/REVIEW_BASE_BRANCH 硬编码默认)

r4 consensus:minimal(option A):sync/dev.py、sync/executor.py、controller_actions.py、
release/commits.py 删 auto-refact-dev/dev/origin-dev 硬编码 fallback;SKILL.md host env
matrix INTEGRATION_BRANCH/REVIEW_BASE_BRANCH defaulted→required 语义;host.env.example 更新;
+5 test(含 release-commits/sync fail-closed-without-branch-env behavior test)。
full $TEST_CMD 981 OK(skipped=1)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#381 review r1): 删 sync/dev.py if-False 死代码,断言改真 branch-topology behavior check

quality reviewer reject(applied):#373 implement 为满足 source-regression 塞的 if False: +
裸表达式 Refactor(iter373/issue-373) 是不可达死代码;删除,test_sync_dev source-regression
断言改为锁真实合同(无 DEFAULT_INTEGRATION_BRANCH/DEFAULT_REVIEW_BASE_BRANCH 硬编码默认、
存在 missing required host branch env fail-closed、无 legacy alias 读)。
architect/tests=comment(advisory)。full $TEST_CMD 982 OK(skipped=1)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* structural(#371): 删公共 post-banner CLI 迁 ControllerActions.post_status_banner (#379)

* structural(#371): 删公共 post-banner CLI,迁 ControllerActions.post_status_banner + #191 owner gate

- 删 cli.py COMMANDS[post-banner] + banners.py public main/parse_args/post_status_banner 等 entry
- 新增 controller-internal ControllerActions.post_status_banner(BannerRequest)->str:owner gate→invalid target→body tempfile→gh(self.gh),non-owner/缺context/invalid target fail-closed
- 保留 banners.py build_status_banner/gh_comment_command/AUTO_LOOP_SENTINEL
- SKILL.md GitHub state surface 改 ControllerActions.post_status_banner、spawn recipe 删 public CLI 示例
- 更新 test_cli_command_router/test_banner_package/test_controller_actions/test_runtime_exception_authorization_sources/test_skill_reference_anchors

design-consensus r4 3/3 consensus:structural(issue #371)
Closes #371.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#379 review r1): 补 post_status_banner gh-failure 分支 behavior test

tests reviewer reject(applied):新增 test_controller_actions 用例 —— owner allowed +
target valid + self.gh returncode≠0 → RuntimeError 含 stderr,且 body tempfile 仍删除。
quality reviewer self-doc 注释需求(rejected):加 Refactor-history 源注释会与
test_source_language_policy scanner 冲突(见 #373 同类 finding),full $TEST_CMD 979 OK
证明现状 test-safe;rationale 提交 re-review 裁决。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#379 review r3): policy=none 下对齐 source-language scanner 的注释期望

HOST_REFACTOR_COMMENT_POLICY=none 时本仓库 scanner 禁止新增 refactor-history
源注释。调整 test_controller_actions.py 迁移断言与 test_source_language_policy.py
期望,使其不再要求 post_status_banner 处的 # Refactor 自文档注释;rationale 留在
PR body/commit。979 tests OK (skipped=1) 全套自验通过。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: 删除 2 个违反 HOST_REFACTOR_COMMENTPOLICY=none 的 refactor-history 源注释

review-gate architect(PR #382 rollup)发现 test_source_publication_boundary.py
(iter374)与 test_wakeup_plan.py(iter372)各有一个 net-new `# Refactor` Old/New
源注释块,违反本 session 已生效的 HOST_REFACTOR_COMMENT_POLICY=none(test-file
scanner scope gap 未机械捕获,architect 按 policy 语义抓到)。仅删这两块注释,
rationale 保留在各自 PR body/commit;不改任何 test 逻辑。全套 990 tests OK。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@loning loning removed the crnd:phase:reviewing review-gate reviewers in flight label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crnd:human:auto auto-advancing, no human needed crnd:lifecycle:managed loop-managed item crnd:phase:merged merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant