Skip to content

fix(#138): 修 test_restart_daemons 泄漏 detached daemon 进程#151

Merged
loning merged 3 commits into
auto-refact-devfrom
refactor/issue138-test-daemon-leak
May 28, 2026
Merged

fix(#138): 修 test_restart_daemons 泄漏 detached daemon 进程#151
loning merged 3 commits into
auto-refact-devfrom
refactor/issue138-test-daemon-leak

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented May 28, 2026

Phase 9 r3 consensus(hybrid test-only cleanup,no production contract change)。tearDown 按 tmp_root/进程组回收 detached daemon + behavior test 断言无残留。全量绿。Closes #138

⟦AI:AUTO-LOOP⟧

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@loning loning added auto-loop codex-refactor-loop 管理的 issue/PR 👀 phase:reviewing labels May 28, 2026
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 quality review: 小死码清理建议

TL;DR


详细说明

这次改动集中在 restart-daemons.sh 的测试清理路径, 没看到 scope creep 或新抽象问题。新增的 cleanup helper 命名基本表达了测试意图, Refactor (iter1/issue-138) 的 Old/New 说明也能独立读懂。

我只卡两个小的死码/可读性点:skills/codex-refactor-loop/scripts/test_restart_daemons.py:109REFACTOR_SELF_DOCUMENTATION 没有任何 caller, 而同一段信息已经在 class comment 里存在;skills/codex-refactor-loop/scripts/test_restart_daemons.py:487command local 在 subprocess 调用改成 _start_helper_process 后不再使用。删掉这两处即可。


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

## Verdict
Comment: the change is focused and the cleanup helpers are readable, but two small dead-code leftovers should be removed.

## Evidence
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:109 defines `REFACTOR_SELF_DOCUMENTATION`, but nothing reads it. The actual required self-doc already exists as the class comment at lines 104-108, so the string constant is duplicated dead code rather than a useful contract.
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:487 assigns `command = ["bash", ...]` after the subprocess calls were moved into `_start_helper_process`; the local is now unused and makes the race test look like it still uses an inline command path.

## What would change your verdict
Delete the unused `REFACTOR_SELF_DOCUMENTATION` constant and the unused `command` local. The remaining refactor self-doc comment is clear enough and self-contained.

REVIEW_DONE::quality:comment

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 Architect review approve: test-only cleanup, no runtime contract expansion

TL;DR

  • 这是什么:PR fix(#138): 修 test_restart_daemons 泄漏 detached daemon 进程 #151 的架构合规 review,只看 CLAUDE/AGENTS 边界。
  • 结论:approve,变更只在 test harness 回收测试 daemon 泄漏,没有扩大 restart-daemons.sh 生产权限。
  • 下一步:controller 可把 architect 视角计为通过,其他 reviewer 继续按各自职责判断。

详细说明

我按 PR 的真实 base/head 复核了三点:实际 diff 只有 test_restart_daemons.pytest_anti_stop_restart_helper_contract.py;issue #138 r3 judge 明确授权的是 test-only cleanup;生产 restart-daemons.sh 没被改,也没有新增 ps/pgrep/killpg 这类 runtime process probe contract。

关键证据是 test_restart_daemons.pystart_new_session=Trueos.killpgps -axo 限定在测试 fixture 内,并用 self.tmp_root 做命令行范围过滤;test_anti_stop_restart_helper_contract.py 又把这个边界写成 source-regression,防止以后把 process probe 搬进生产 helper。这个符合 CLAUDE.md 的 narrow allowlist、no lifecycle authority、behavior/source-regression 可验证要求。


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

pr: 151
role: architect
verdict: approve

Verdict

approve: PR #151 is test-harness-only cleanup for issue #138 and does not widen the production daemon/runtime contract.

Evidence

  • skills/codex-refactor-loop/scripts/test_restart_daemons.py:103: the changed test class carries explicit Old/New refactor self-documentation for issue bug: test_restart_daemons.py 泄漏 detached daemon 进程(本轮发现 256 个孤儿) #138, satisfying the prompt's refactor-comment requirement.
  • skills/codex-refactor-loop/scripts/test_restart_daemons.py:172: cleanup remains inside the behavior test harness, and tearDown reuses the same path at skills/codex-refactor-loop/scripts/test_restart_daemons.py:164, matching CLAUDE.md:「变更必须可验证:行为约束必须落到机械验证手段(behavior test / source-regression test / 段落 lint);仅靠"agent 应该记得"承载的约束视为未落地。」
  • skills/codex-refactor-loop/scripts/test_restart_daemons.py:257: the process-table sweep is scoped to self.tmp_root, not host/runtime state, preserving CLAUDE.md:「skill 无 host 项目改动权:不修改 host 的 .git 配置 / CI 配置 / policy 文档;只在 host.env 暴露的 surface 上工作。」
  • skills/codex-refactor-loop/scripts/test_restart_daemons.py:500: the new behavior test asserts cleanup leaves no tmp-root process behind, matching the issue bug: test_restart_daemons.py 泄漏 detached daemon 进程(本轮发现 256 个孤儿) #138 consensus artifact .refactor-loop/runs/phase9-issue138-r3-judge.md, which authorized test_restart_daemons.py cleanup plus no production contract change.
  • skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210: source-regression pins the ps/killpg cleanup to the test file, and skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:225 keeps restart-daemons.sh free of production process probes/process-group contracts, matching CLAUDE.md:「任何 controller-runtime 例外必须 narrow allowlist + no lifecycle authority by default」and「新增后台脚本或 runtime surface 必须显式说明:允许做什么 / 不允许做什么 / 事实源在哪里 / 如何验证」.
  • Scope honesty: PR fix(#138): 修 test_restart_daemons 泄漏 detached daemon 进程 #151 changes only skills/codex-refactor-loop/scripts/test_restart_daemons.py and skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py, which are the exact files named in .refactor-loop/runs/phase9-issue138-r3-judge.md implement plan. No restart-daemons.sh, SKILL.md, manifest, host config, external repo reference, actor/store split, schema/protocol, or compat shim is introduced.

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

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 tests review: sleep 轮询需要收口

TL;DR


详细说明

这轮测试确实覆盖了核心业务结果:test_cleanup_daemons_reaps_tmp_root_wrappers_and_children 会先确认 tmp root 下存在 wrapper/child 进程, cleanup 后断言为空;test_restart_helper_test_cleanup_is_test_only_tmp_root_scoped 也把 ps / killpg 限定在测试文件里, 防止生产 helper 偷偷长出 process-probe contract。

阻塞点是稳定性规则。skills/codex-refactor-loop/scripts/test_restart_daemons.py:243:250 新增的 _wait_for_pid_exit / _wait_for_process_group_exit 都是 timeout 循环 + time.sleep(0.02)。仓库规则写着测试不得用 sleep/delay 做节奏, 要用 deterministic awaiters。我也没在 worktree 里找到 test_polling_allowlist.txt 或等价 allowlist 来解释这个例外。按 tests reviewer 规则, sleep/delay 未进 allowlist 是 reject。

我本地验证过 focused tests 仍然能过:

python3 skills/codex-refactor-loop/scripts/test_restart_daemons.py
Ran 10 tests in 23.945s, OK

python3 skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py
Ran 11 tests in 0.004s, OK

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

## Verdict
Reject: the regression coverage is meaningful, but the PR adds sleep-based polling in test cleanup without an allowlist entry or documented exception.

## Evidence
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:243 `test_restart_daemons.py` adds `_wait_for_pid_exit`, which polls process liveness until a timeout and sleeps with `time.sleep(0.02)` on each iteration; this violates the repo rule in `skills/codex-refactor-loop/SKILL.md` that tests must use deterministic awaiters and not sleep/delay-based pacing.
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:250 adds the same timeout + `time.sleep(0.02)` pattern for process-group exit. I found no `test_polling_allowlist.txt` or equivalent allowlist entry in the worktree documenting this as an accepted unstable/polling exception.
- Positive coverage note: `test_cleanup_daemons_reaps_tmp_root_wrappers_and_children` does assert the real leak outcome, and `test_restart_helper_test_cleanup_is_test_only_tmp_root_scoped` pins the test-only source contract. The failure is the added pacing mechanism, not missing business-outcome assertions.

## What would change your verdict
Replace the sleep-polling cleanup waits with a deterministic process wait/reap path, or add the repository's documented polling exception/allowlist entry with a specific reason for why process-exit waiting cannot be deterministic here.

REVIEW_DONE::tests:reject

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 PR #151 r1 fix: 已移除 sleep 轮询

TL;DR


详细说明

我只在 PR 原本的两个测试文件内改动。test_restart_daemons.py 的 cleanup 等待不再用 time.sleep 轮询, Linux 走 pidfd_open + select, macOS/BSD 走 kqueueKQ_FILTER_PROC;process group cleanup 仍然限定在测试 tmp-root 发现到的进程, 没有修改生产 restart-daemons.shtest_anti_stop_restart_helper_contract.py 也新增 source-regression, 钉住 deterministic awaiter 并禁止 time.sleep( 回到这个 test harness。

另外 quality reviewer 的两个 comment 不是 blocking demand, 但都在 scope 内:删除了 unused REFACTOR_SELF_DOCUMENTATION 常量和 unused command local。验证已通过 git diff --check、两个 focused test 文件, 以及 python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py' 共 399 个测试。


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

## Applied
- (A) skills/codex-refactor-loop/scripts/test_restart_daemons.py:238: replaced the sleep-based `_wait_for_pid_exit` loop with deterministic OS process-exit awaiters: Linux `pidfd_open` + `select`, and macOS/BSD `kqueue` `KQ_FILTER_PROC`. This addresses reviewer:tests evidence #1 citing `time.sleep(0.02)` at the former line 243 and the `skills/codex-refactor-loop/SKILL.md` rule "No sleep/delay-based test pacing; use deterministic awaiters."
- (A) skills/codex-refactor-loop/scripts/test_restart_daemons.py:247: replaced the sleep-based process-group wait loop with per-process deterministic exit waits over the tmp-root-scoped group members. This addresses reviewer:tests evidence #2 citing `time.sleep(0.02)` at the former line 250 and preserves the issue #138 judge boundary: test-only process-group cleanup, no `restart-daemons.sh` runtime contract change.
- (A) skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210: extended the source-regression contract to require `pidfd_open`, `KQ_FILTER_PROC`, and absence of `time.sleep(` in `test_restart_daemons.py`, preventing the reject pattern from silently returning.
- (A) skills/codex-refactor-loop/scripts/test_restart_daemons.py:103: removed unused `REFACTOR_SELF_DOCUMENTATION` string constant. This was advisory reviewer:quality context, not blocking reject evidence, but it is in-scope dead-code cleanup and the class-level `Refactor (iter1/issue-138)` Old/New comment remains.
- (A) skills/codex-refactor-loop/scripts/test_restart_daemons.py:516: removed unused `command` local from the race test. This was advisory reviewer:quality context, not blocking reject evidence.

## Rejected as false positive
- None. The only reject demand was reviewer:tests' sleep-polling objection, and it was valid.

## Blocked (cannot fix this round)
- None. Local files `.refactor-loop/runs/review-pr151-tests.md` and `.refactor-loop/runs/review-pr151-quality.md` were absent, so I used the PR #151 GitHub comments as the available reviewer source. The missing local artifacts did not block a concrete fix because the GitHub comments contained the full verdict, evidence, and "What would change your verdict" sections.

## Build status
- build: pass (`git diff --check`)
- tests: pass (`python3 skills/codex-refactor-loop/scripts/test_restart_daemons.py`: 10 tests; `python3 skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py`: 11 tests; `python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'`: 399 tests)

## Recommendation for next round
- expect MERGE or MERGE_WITH_COMMENTS: the only reject was addressed, architect already approved, and quality's advisory dead-code requests were also applied.

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

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

loning commented May 28, 2026

🤖 quality review approve: 当前轮可读性通过

TL;DR


详细说明

这轮 diff 仍然只落在两个测试文件里, 范围很干净。test_restart_daemons.py 里的 cleanup orchestration 保持短小, 具体终止进程、终止进程组、等待退出、扫描 tmp-root 的逻辑都拆到了命名明确的小 helper, 没有堆成一个大方法。

helper_process_groups 这条状态也不是死字段:helper 启动时注册 process group, teardown 里消费并清理。Refactor (iter1/issue-138) 的 Old/New 注释能独立说明为什么要从 tracked wrapper pid cleanup 扩到 tmp-root-scoped wrapper/group/descendant cleanup。test_anti_stop_restart_helper_contract.py 只新增 source-regression, 没有把生产 restart-daemons.sh 变复杂。


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

## Verdict
Approve: the current PR is focused, readable, free of the earlier dead-code leftovers, and the refactor self-doc is clear.

## Evidence
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:104 has a readable `Refactor (iter1/issue-138)` Old/New block that explains why cleanup moved from tracked wrapper PID cleanup to tmp-root-scoped wrapper/group/descendant cleanup.
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:167 keeps cleanup orchestration in one small method, while the process termination, group termination, deterministic wait, and tmp-root scan details are split into named helpers instead of one large branchy block.
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:117, skills/codex-refactor-loop/scripts/test_restart_daemons.py:179, skills/codex-refactor-loop/scripts/test_restart_daemons.py:368, and skills/codex-refactor-loop/scripts/test_restart_daemons.py:385 show the new `helper_process_groups` state is reachable: helper launches register process groups, and teardown consumes them.
- skills/codex-refactor-loop/scripts/test_restart_daemons.py:193 still has a caller at skills/codex-refactor-loop/scripts/test_restart_daemons.py:565, so the compatibility wrapper is not dead code.
- skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210 adds source-regression coverage for the test-only cleanup contract without adding production abstractions or unrelated cleanup.

REVIEW_DONE::quality:approve

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 架构审查通过: test-only daemon leak cleanup

TL;DR


详细说明

我按 看了实际 diff, 净改动只有 和 。新增进程探测只留在测试清理里, 并且 source-regression 明确禁止 PID TTY TIME CMD
31937 ttys000 0:00.09 -zsh
56574 ttys000 14:53.25 claude
25736 ttys002 0:00.03 -zsh
68273 ttys002 14:36.61 claude
21579 ttys003 0:00.05 -zsh
63171 ttys005 0:00.01 /bin/zsh -l
63451 ttys005 3:14.26 claude
74486 ttys006 0:00.02 /bin/zsh -il / / / 漏进生产 。

架构规则映射: 这次改动满足 的 behavior test + source-regression 要求, 也保持 controller-runtime 例外的 narrow allowlist / no lifecycle authority 边界。没有发现 actor/store 拆分、外部 repo reference、compat shim 或 scope drift。


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

## Verdict
Approve: no architecture compliance concern; the PR is a test-only leak cleanup with source-regression guardrails keeping process probing out of the production restart helper.

## Evidence
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:104` documents the refactor with Old/New intent in the surrounding Python comment style, satisfying the reviewer prompt's Old/New pattern requirement and `CLAUDE.md`'s "命名跟随职责" clause: "文件、目录、脚本、marker、artifact 的名字表达职责边界".
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:167` keeps cleanup logic inside the behavior test, and `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210` adds the matching source-regression contract. This satisfies `CLAUDE.md`'s verification clause: "行为变更必须配套 **behavior test**(断言行为本身)+ **source-regression test**".
- `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:228` explicitly forbids `ps`, `pgrep`, `setsid`, and `killpg` in `restart-daemons.sh`, preserving the `CLAUDE.md` narrow-boundary rule: "任何 controller-runtime 例外必须 narrow allowlist + no lifecycle authority by default".
- `git diff origin/auto-refact-dev...HEAD -- '*.md' '*.sh' '*.py' '*.json'` shows only `skills/codex-refactor-loop/scripts/test_restart_daemons.py` and `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py`; this matches PR #151's declared issue #138 daemon leak cleanup and introduces no schema/protocol files, external repo references, actor/store splits, compat shim, or lifecycle authority.

REVIEW_DONE::architect:approve

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 tests review approve: 泄漏回归测试已收口

TL;DR


详细说明

我复核的是当前 refactor/issue138-test-daemon-leak 相对 auto-refact-dev 的三点 diff。test_cleanup_daemons_reaps_tmp_root_wrappers_and_children 会先确认 tmp-root 下有 wrapper/child 进程, 再断言 _cleanup_daemons() 后为空, 这是 issue #138 要防的真实泄漏结果。

上一轮 tests reject 的阻塞点是 time.sleep(0.02) 轮询;当前分支已经改成 Linux pidfd_open + select, macOS/BSD KQ_FILTER_PROC 的确定性等待, 并在 source-regression 里加了 self.assertNotIn("time.sleep(", self.helper_test)。同时 source-regression 也钉住 ps / killpg 只存在于测试 harness, 生产 restart-daemons.sh 不新增 process-probe contract。

本地验证通过:

python3 skills/codex-refactor-loop/scripts/test_restart_daemons.py
Ran 10 tests in 22.436s, OK

python3 skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py
Ran 11 tests in 0.003s, OK

python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'
Ran 399 tests in 38.946s, OK

git diff --check origin/auto-refact-dev...HEAD
pass

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

## Verdict
Approve: the current branch has meaningful leak-regression coverage, source-regression coverage for the test-only boundary, and no remaining sleep/delay pacing or assertion weakening.

## Evidence
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:528` adds `test_cleanup_daemons_reaps_tmp_root_wrappers_and_children`, which asserts the real outcome for issue #138: tmp-root daemon wrapper/child processes exist before cleanup and are gone after `_cleanup_daemons()`.
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:238` now waits for process exit through deterministic OS awaiters, `pidfd_open` on Linux and `KQ_FILTER_PROC` on kqueue platforms, instead of the earlier `time.sleep(0.02)` polling pattern.
- `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210` adds source-regression coverage for the new cleanup rule: it pins `start_new_session=True`, `os.killpg`, tmp-root scoping, deterministic awaiters, and `self.assertNotIn("time.sleep(", self.helper_test)`.
- `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:228` keeps the production helper free of process-probe/process-group contract tokens such as `ps`, `pgrep`, `setsid`, and `killpg`, so the new cleanup machinery stays in tests.
- I found no added `[Skip]`, manual-category equivalent, sleep/delay pacing, loosened assertions, or mock-only pseudo-coverage in the current diff.
- Verification passed locally: `python3 skills/codex-refactor-loop/scripts/test_restart_daemons.py` ran 10 tests OK; `python3 skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py` ran 11 tests OK; `python3 -m unittest discover -s skills/codex-refactor-loop/scripts -p 'test_*.py'` ran 399 tests OK; `git diff --check origin/auto-refact-dev...HEAD` passed.

REVIEW_DONE::tests:approve

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 28, 2026

🤖 架构审查通过: test-only daemon leak cleanup

TL;DR

  • 这是什么: PR fix(#138): 修 test_restart_daemons 泄漏 detached daemon 进程 #151 只改 restart-daemons 相关测试和 source-regression guard。
  • 结论是什么: architect 角度 approve, 没有新增 lifecycle authority、schema/protocol 变更或平行 runtime path。
  • 下一步: controller 可以把这个 architect verdict 纳入共识计算。

详细说明

上一条同 headline 评论的 raw artifact 是正确的, 但 TL;DR 被 shell 展开污染;本条是 canonical review comment。

我按 origin/auto-refact-dev...HEAD 看了实际 diff, 净改动只有 skills/codex-refactor-loop/scripts/test_restart_daemons.pyskills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py。新增进程探测只留在测试清理里, 并且 source-regression 明确禁止 ps / pgrep / setsid / killpg 漏进生产 restart-daemons.sh

架构规则映射: 这次改动满足 CLAUDE.md 的 behavior test + source-regression 要求, 也保持 controller-runtime 例外的 narrow allowlist / no lifecycle authority 边界。没有发现 actor/store 拆分、外部 repo reference、compat shim 或 scope drift。


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

## Verdict
Approve: no architecture compliance concern; the PR is a test-only leak cleanup with source-regression guardrails keeping process probing out of the production restart helper.

## Evidence
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:104` documents the refactor with Old/New intent in the surrounding Python comment style, satisfying the reviewer prompt's Old/New pattern requirement and `CLAUDE.md`'s "命名跟随职责" clause: "文件、目录、脚本、marker、artifact 的名字表达职责边界".
- `skills/codex-refactor-loop/scripts/test_restart_daemons.py:167` keeps cleanup logic inside the behavior test, and `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:210` adds the matching source-regression contract. This satisfies `CLAUDE.md`'s verification clause: "行为变更必须配套 **behavior test**(断言行为本身)+ **source-regression test**".
- `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py:228` explicitly forbids `ps`, `pgrep`, `setsid`, and `killpg` in `restart-daemons.sh`, preserving the `CLAUDE.md` narrow-boundary rule: "任何 controller-runtime 例外必须 narrow allowlist + no lifecycle authority by default".
- `git diff origin/auto-refact-dev...HEAD -- '*.md' '*.sh' '*.py' '*.json'` shows only `skills/codex-refactor-loop/scripts/test_restart_daemons.py` and `skills/codex-refactor-loop/scripts/test_anti_stop_restart_helper_contract.py`; this matches PR #151's declared issue #138 daemon leak cleanup and introduces no schema/protocol files, external repo references, actor/store splits, compat shim, or lifecycle authority.

REVIEW_DONE::architect:approve

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

…ssue138-test-daemon-leak

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

loning commented May 28, 2026

🎉 MERGE(r2:3× approve)。test daemon leak 修复(#138),rebase 解决 test 冲突,CI 绿。Closes #138

⟦AI:AUTO-LOOP⟧

@loning loning merged commit e64f6f6 into auto-refact-dev May 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-loop codex-refactor-loop 管理的 issue/PR 🎉 phase:merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant