Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "process-group cancellation 統合 test の固定 0.6s outer deadline が負荷下で readiness marker 未作成の flake を起こす問題を、readiness 観測後に production outer-timeout handling path を test-local deterministic fault injection で発火させる形へ置換して解消する(PR #2876 CI run 37068873394 の python-test-core failure 起点)"
change_kind: test
Parent Issue
なし(単独改善)
Parent Goal Ref
- Goal: 単独改善(parent なし)
- Desired Destination: N/A
Current Validated Scope
- 対象は
.claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.pyのtest_outer_deadline_via_run_baseline_vc_preflight_reaps_full_process_tree(HEAD 1974fdd で実在確認済み)。 - production script(
baseline_vc_preflight.py/contract_readiness_check.py)の timeout semantics は正しいと判断しており変更しない。 - current production API では outer deadline は
baseline_vc_preflight.run_subprocess_with_cooperative_supervisor()が child をPopenした直後にprocess.communicate(timeout=timeout_seconds)へ入った時点で arm される。contract_readiness_check.run_baseline_vc_preflight()の test seam はoverride_timeout_seconds/override_grace_seconds/_test_extra_envのみで、「readiness 後に timer を arm する」入口は存在しない。したがって「readiness 観測後に outer deadline を発火」は production seam の追加ではなく、test file 内の test-local deterministic fault injection で実現する(本 Issue で accepted mechanism として固定する。下記 In Scope 参照)。 .github/ci/python-test-plan.jsonは.claude/skills/issue-contract-review/scripts/tests/ディレクトリを既に対象に含むため、既存ファイルへの変更なら plan 登録変更は不要。
Remaining Parent Gaps
なし
Outcome
test_vc_process_group_cancellation.py の outer-timeout 統合 test が、固定 _OUTER_DEADLINE_SECONDS = 0.6 の elapsed wall-clock 前提ではなく、「real な VC leader + SIGTERM を無視する real な grandchild が readiness marker に到達したことを同期で確認した後に、production supervisor の outer-timeout handling branch を test-local fault injection で発火させる」構造へ変更され、CPU 負荷の有無に関わらず決定論的に PASS し、fixture readiness を遅延させる deterministic な regression test と共にコミットされた状態。product code・required CI は変更しない。
Runtime Verification Applicability
- decision: not_applicable
- reason: pytest のみの test 設計変更であり、live 環境での runtime 検証は不要。ローカル pytest(無負荷・xdist 下)で完結する
In Scope
- accepted mechanism(test-local deterministic fault injection): 既存 Allowed Path の test file 内だけで、real
baseline_vc_preflight.py+ real VC leader + real SIGTERM-ignoring grandchild + real readiness marker を使い、process tree が ready になったことを決定論的に確認した後で、production supervisor の outer-timeout handling branch(TimeoutExpired後の SIGTERM → grace → SIGKILL → reap → typed timeout result)を test-local に発火させる。具体的な injection point(例: supervisor がPopenするbaseline_vc_preflight.py子プロセスに限定したPopen.communicate(timeout=...)の test-local subclass /monkeypatch)は current code で設計してよい。ただし注入してよいのは「TimeoutExpiredが発生する時点」だけであり、supervisor 自身の SIGTERM 送信・grace 待機・SIGKILL escalation・reap・typed result 構築・run_baseline_vc_preflight()の呼び出し経路を stub / 再実装 / 迂回してはならない(production の outer-timeout handling path を実際に通すこと)。 - この test は「0.6 秒という elapsed wall-clock deadline 自体」を試験するものではなく、「ready な real process tree に対して production outer-timeout handling path が実行された場合の cooperative cancellation / full reap / typed timeout result」を検証する fault-injection integration test であることを、test の docstring と本 Issue 上に明記する。これは synthetic timeout の禁止対象ではなく、accepted mechanism である。
- 新規 regression test
test_outer_timeout_fault_injection_waits_for_ready_process_treeを同 test file に追加する(命名は同 file の既存test_scaled_fault_injection_*/test_outer_deadline_*のtest_<subject>_<action>_<outcome>規約に整合)。 - 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2207 / 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2221 の integration guarantee を後退させない: 責務分離を採用する場合でも、少なくとも1つの integration test は、同一
run_baseline_vc_preflight()invocation について「ready な real VC leader + grandchild → production outer-timeout handling path 発火 →baseline_vc_preflight.pyの SIGTERM handler(marker)→ wrapper / VC leader / grandchild の full reap → typed timeout result(status == "runtime_error"/failure_class == "timeout"/timeout_phase == "baseline_vc_preflight_aggregate"/retryable is False)」を一続きで検証する。timeout と reap を完全に別 test へ分離して 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2221 が埋めた coverage gap を再導入する変更は不可。_OUTER_DEADLINE_REPEAT_COUNT回の repeat による register/unregister race 検出も維持する。 - deterministic delayed-readiness regression: fixture の readiness(
self.pid/grandchild.pidの書き込み)を test が制御する同期 primitive(release marker file /threading.Event等)で旧_OUTER_DEADLINE_SECONDS(0.6s)を超えて確実に遅延させ、旧設計(固定 0.6s で deadline を発火)なら必ず readiness 前に発火して破綻する条件を作る。新設計では readiness 観測後にのみ timeout path を発火するため、この条件でも決定論的に PASS する。実 CPU 飽和(busy loop 等)を required test に埋め込まない。 - 既存の
test_outer_deadline_via_run_baseline_vc_preflight_reaps_full_process_treeが持つ readiness 依存 assertion(self.pid/grandchild.pidの存在確認と reap 確認)は、wall-clock deadline 依存のまま残さない。この test は新設計へ置換・改名するか、readiness 非依存の assertion(typed payload 等)のみへ縮小する。test_scaled_fault_injection_inner_timeout_precedes_outer_deadlineは per-command の inner timeout のみを検証し、supervisor の outercommunicate(timeout=...)を自然に時間切れにしないため、natural outer-timeout coverage を担わない(OWNER 指摘 PR test: outer-timeout 統合 test の固定 0.6s deadline を readiness 同期の fault injection へ置換する #2885 issuecomment-5963140832 P1。前提誤りの訂正)。 - 旧 600ms 設計根拠コメントを新設計に合わせて更新する。
- natural outer-timeout regression(P1 訂正): 同 test file に
test_outer_timeout_natural_elapsed_timeout_returns_typed_timeout_resultを 1 本追加する。fault injection を一切使わず、readiness assertion / grandchild readiness 依存を持たず、realrun_baseline_vc_preflight()に十分長く動く VC と小さなoverride_timeout_secondsを渡し、production のcommunicate(timeout=...)が実経過時間で自然にTimeoutExpiredを起こす経路を通す。実装条件:override_grace_secondsに小さな値を渡して実行時間を bound し、VC は有限長 sleep 等で orphan を残さないものにする。検証は typed result(status == "runtime_error"/failure_class == "timeout"/timeout_phase == "baseline_vc_preflight_aggregate"/retryable is False)と、経過時間が指定 timeout 以上であること(下限のみ。上限・startup 速度は assert しない)に限る。grandchild の readiness / full reap の integration guarantee は fault-injection test 側が担う。 - injection validation failure 時の cleanup(P2): fault injection 実装(例: PR test: outer-timeout 統合 test の固定 0.6s deadline を readiness 同期の fault injection へ置換する #2885 の
_OuterTimeoutFaultInjection.fire()。具体的な構造は実装時に決めてよい)は、自身の内部検証(例: timeout 値不一致、readiness wait 失敗)の失敗を記録しても、matched outer process に必ずTimeoutExpiredを送出して production cleanup branch(SIGTERM → grace → SIGKILL → reap)を完遂させ、cleanup 完了後に記録した failure を test failure として表面化する。回帰 testtest_outer_timeout_fault_injection_validation_failure_still_reaps_process_treeが、意図的に不一致の expected timeout を与えた injection でも wrapper / VC leader / grandchild が reap され、failure が記録されることを固定する。generic cleanup framework は追加しない。 - 本 test file の docstring / コメントから「別 test が real elapsed timeout coverage を担う」という誤記述を除去し、natural outer-timeout regression を参照する。
Out of Scope
baseline_vc_preflight.py/contract_readiness_check.pyなど production script の変更・timeout semantics の変更・production への test seam 追加- required CI /
python-testaggregate policy /ci-verdict-summaryの緩和、.github/ci/python-test-plan.jsonの変更、CPU 飽和 job の CI 追加 - blind sleep や timeout の単純な増加のみによる対処
- 新規 generic test harness / pytest plugin / approval layer の追加、新規 dependency の追加
- 同ファイル内の他 test(
test_sigterm_reaps_active_vc_process_groups、test_scaled_fault_injection_inner_timeout_precedes_outer_deadline、test_kill_process_group_reaps_sigterm_ignoring_grandchild等)の挙動変更 - 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2207 / 実装: review pipeline の timeout budget を動的 VC 本数ベースに再設計する #2221 / 実装: fan-out timeout/cancellation テストを readiness 同期と責務分離で決定論化する #2371 で完了した実装の再実装
Acceptance Criteria
- AC1:
test_vc_process_group_cancellation.pyにtest_outer_timeout_fault_injection_waits_for_ready_process_treeが存在し、self.pid/grandchild.pidの readiness marker を観測した後にのみ outer-timeout handling path を test-local fault injection で発火させる。readiness 依存 assertion が固定 0.6s deadline 内に fixture が readiness へ到達する wall-clock 前提に依存しない - AC2: 同一
run_baseline_vc_preflight()invocation について、typed result(status == "runtime_error"/failure_class == "timeout"/timeout_phase == "baseline_vc_preflight_aggregate"/retryable is False)、SIGTERM handler marker、wrapper / VC leader / grandchild の full reap の assertion が一続きで存在する(timeout と reap を別 test に分離していない) - AC3:
run_baseline_vc_preflight()経由・realbaseline_vc_preflight.py/ real VC leader / real SIGTERM-ignoring grandchild・_OUTER_DEADLINE_REPEAT_COUNT回 repeat の production-shaped integration 構造が維持され、fault injection はTimeoutExpiredの発生時点のみを注入し supervisor の SIGTERM / grace / SIGKILL / reap / typed result 構築を stub していない - AC4: fixture readiness を同期 primitive で旧 0.6s を超えて確実に遅延させる deterministic delayed-readiness regression が存在し、CPU 負荷を一切かけない状態でも PASS する(旧 0.6s 固定 deadline 設計なら readiness 前に発火して破綻する条件である)。CPU 飽和(busy loop)を required test に含めない
- AC5: production script・CI 設定・
.github/ci/python-test-plan.json・pyproject.toml・uv.lockに branch 起因の diff がなく、新規 dependency / pytest plugin が追加されていない - AC7:
test_outer_timeout_natural_elapsed_timeout_returns_typed_timeout_resultが存在し、fault injection fixture を使わず realrun_baseline_vc_preflight()のcommunicate(timeout=...)が実経過時間で自然に timeout し、typed result(status == "runtime_error"/failure_class == "timeout"/timeout_phase == "baseline_vc_preflight_aggregate"/retryable is False)が返ること、および経過時間が指定 timeout 以上であることを検証する。readiness assertion / readiness marker wait を持たず、fault injection fixture を参照せず、elapsed >= timeoutを assert する - AC8: injection 内部検証が失敗した場合でも production の timeout cleanup branch が最後まで実行され(wrapper / VC leader / grandchild が reap される)、記録された injection failure が cleanup 完了後に test failure として表面化する。
test_outer_timeout_fault_injection_validation_failure_still_reaps_process_treeがこれを deterministic に固定する(意図的に不一致な expected timeout を injection に与え、cleanup 後に failure が記録・表面化されることと、tree が reap されることの両方を assert する。reap のみの assert は不可) - AC6: 対象ファイルが無負荷および xdist(
-n 4 --dist loadscope)下で PASS する(xdist compatibility の secondary check であり、CPU 飽和 regression の authority ではない)
Verification Commands
# AC1
# AC2
# AC3
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py::test_outer_timeout_fault_injection_waits_for_ready_process_tree -q
# AC1
# AC2
# AC3
# AC4
# AC6
# AC7
# AC8
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py -q
# AC6
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py -n 4 --dist loadscope -q
# AC7
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py::test_outer_timeout_natural_elapsed_timeout_returns_typed_timeout_result -q
# AC8
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py::test_outer_timeout_fault_injection_validation_failure_still_reaps_process_tree -q
# AC2
# baseline-expect: pass
$ rg -n -F 'assert result["timeout_phase"] == "baseline_vc_preflight_aggregate"' .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py
# AC3
# baseline-expect: pass
$ rg -n "= crc\.run_baseline_vc_preflight\(" .claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py
# AC5
# baseline-expect: pass
$ git diff --quiet origin/main...HEAD -- .github .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py .claude/skills/issue-contract-review/scripts/contract_readiness_check.py .github/ci/python-test-plan.json pyproject.toml uv.lock
Allowed Paths
.claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(production script の変更・production への seam 追加が必要と判明した場合を含む。test-local fault injection で production の outer-timeout handling branch を実際に通せないことが実証された場合は、独自に production seam を追加せず停止して refinement へ戻す)
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- pytest / Python テスト設計(readiness 同期・test-local fault injection による決定論的 timing test)
- subprocess ライフサイクル(process group / SIGTERM / SIGKILL)の理解
Required Design References
.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py(run_subprocess_with_cooperative_supervisor、SIGTERM cooperative cancellation /_kill_process_group).claude/skills/issue-contract-review/scripts/contract_readiness_check.py(run_baseline_vc_preflightと test seam).claude/skills/issue-contract-review/SKILL.md(baseline VC preflight /baseline-expectの契約)
Scope Delta(任意)
N/A
Background
PR #2876(Issue #2872)の CI run https://github.com/squne121/loop-protocol/actions/runs/37068873394 (attempt 1)で python-test-core(job 111043458302)が failure。依存 failure は python-test(111045684905、aggregate policy core='failure')と ci-verdict-summary(111045926568、AC9 violations → blocked)。同一 HEAD 6d47db9 の先行 run 37066185633 は success。失敗 test は test_outer_deadline_via_run_baseline_vc_preflight_reaps_full_process_tree、AssertionError: marker file not created within 5.0s: .../iter_2/self.pid(suite は 1 failed, 17580 passed)。PR #2876 は issue-contract-review に触れておらず PR 起因ではない。
root cause: test は 10 回、0.6s の outer deadline を発火させた後に fixture の readiness marker を要求する。fixture は python3 -m pytest として起動され、interpreter 起動 + pytest import(無負荷で約 200ms)と grandchild spawn が 0.6s 内に完了する wall-clock 前提を持つ。CPU 飽和(busy loop 48 本)で PR 非関与の main checkout(origin/main 6ee0823)でも 3/3 失敗し CI と同一メッセージ、無負荷では 3/3 PASS(約 9s)。コメントは startup jitter を 50-200ms から 600ms へ拡大してきた履歴(Issue #2207 OWNER P1-2 item 5、PR #2221)を示しており、wall-clock 拡大での追従は限界に来ている。
設計の理由: production supervisor は child を Popen した直後に communicate(timeout=...) で deadline を arm するため、「readiness 後に timer を arm する」入口が production API に無い。production seam の追加は個人開発のコストに見合わないため、test file 内の fault injection で「readiness 後に timeout branch を発火」する。#2221 の OWNER review が要求した「production wrapper の outer deadline → active VC tree → cooperative reap の合成経路」の証明は、fault injection 後も real process tree と production の timeout handling branch を通すことで維持する。近い precedent は #2371 / PR #2373(fan-out test の readiness 同期 + 責務分離)だが、本 test は timeout と reap を一続きで証明する必要があるため、責務分離ではなく同一 invocation の fault injection を採る。
dedupe 結果: OPEN Issue に同一 root cause・同一 scope のものなし。#2371(fan-out test の readiness 同期、CLOSED、別 test)・#2792(調査、CLOSED)・#1796(別 test の hermetic 化、OPEN、別 scope)は別 concern。
Notes for Reviewer
-
重大度は CI flake(required check を稀に赤くする)。product 挙動の不具合ではない。
-
本 contract は OWNER の REQUEST_CHANGES(https://github.com/squne121/loop-protocol/issues/2883#issuecomment-5962624631)を反映した reframe である: test-local deterministic fault injection を accepted mechanism として許可(BLOCKER)、CPU 飽和 regression を deterministic delayed-readiness regression へ置換(P1)、baseline-red の named regression VC を追加(P1)、同一 invocation の integration guarantee を明記(P1)、
rg -cの false-green VC を assertion shape 検査へ修正(P2)、origin/main...HEADの merge-base diff へ修正(P2)。 -
fault injection は elapsed wall-clock deadline 自体の試験ではない。real elapsed outer timeout の coverage は同 file に追加する natural outer-timeout regression(AC7)が担う(既存 inner-timeout test は outer timeout を通さないため担えない。OWNER PR test: outer-timeout 統合 test の固定 0.6s deadline を readiness 同期の fault injection へ置換する #2885 issuecomment-5963140832 による前提訂正)。
-
readiness 同期の具体的な injection point は実装時に current code で設計してよい。production code の seam 追加が必要になる場合は Stop Condition として停止する。
-
AC7/AC8 の named pytest VC は存在確認だけでなく、上記の構造条件(AC7: injection 非使用・readiness wait 非含有・elapsed 下限 assert、AC8: 不一致 expected timeout と failure 表面化の assert)を満たすことを pr-reviewer が diff で確認する。pytest VC は semantic proof を担う一次 VC であり、rg VC(AC2/AC3)は secondary check である。
Source
- dedupe_key: issue-contract-review:process-group-cancellation-outer-deadline-readiness-sync:flake-prevention:v1
- origin: PR fix: Claude-GPT issue-refinement preflight の read transport を #2299 の native GitHub auth 契約へ整合する (#2872) #2876 CI run 37068873394
- source_url: https://github.com/squne121/loop-protocol/actions/runs/37068873394
Activity
squne121 commentedon Oct 2, 2026
判定
REQUEST_CHANGES —
reframe_in_placeが妥当です。Issue #2883 の root cause 診断自体はかなり強いです。PR #2876 由来の deterministic regression ではなく、
test_outer_deadline_via_run_baseline_vc_preflight_reaps_full_process_treeが「0.6 秒以内に fixture が readiness へ到達する」という wall-clock 仮定を持つ timing flake、という説明は CI 実ログ・current code・#2207/#2221 の履歴と整合しています。pytest 公式も、CI/並列実行で顕在化する flake は未制御の状態・timing dependency を疑い、固定 timing ではなく制御可能な同期へ移す方向を支持しています。[pytest ドキュメント](https://docs.pytest.org/en/latest/explanation/flaky.html?utm_source=chatgpt.com)ただし、現在の Issue contract には実装不能または false-green になり得る穴が残っています。
1. BLOCKER — 「readiness 後に outer deadline を発火」と「production code 不変更」が current API では両立していない
current
main1974fddf76ca1c0956e3eb77df52c8a5c31dd382で確認すると、contract_readiness_check.run_baseline_vc_preflight()の test seam はoverride_timeout_seconds、override_grace_seconds、_test_extra_envまでです。実際の deadline は
baseline_vc_preflight.run_subprocess_with_cooperative_supervisor()が child をPopenした直後に、へ入ることで開始されます。Python の
Popen.communicate(timeout=...)も、プロセス終了まで待ち、指定時間を超えればTimeoutExpiredを発生させる契約です。[Python documentation](https://docs.python.org/3/library/subprocess.html?highlight=universal_newlines\&utm_source=chatgpt.com)一方 #2883 は、
self.pid/grandchild.pidreadiness を確認してから outer deadline を発火run_baseline_vc_preflight()production path を維持を同時に要求しています。
current API には「readiness 到達後に timer を arm する」入口がありません。 このままだと実装者は、① production seam が必要として停止するか、② test-local monkeypatch で synthetic timeout を注入するが「actual outer deadline ではない」と reviewer に却下される、のどちらかになり得ます。
これは #2221 の OWNER review と特に衝突します。あの review がこの test を要求した理由は、以前の「baseline へ手動 SIGTERM」と「inner timeout」の個別テストだけでは、production wrapper の outer deadline → active VC tree → cooperative reap の合成経路を証明できなかったからです。
最小修正: #2883 本文で accepted mechanism を固定してください。個人趣味開発のコストを考えると、新しい production harness より次が小さいです。
これを許可しないなら、Allowed Paths に最小限の test-only deadline-arm seam を追加する必要があります。
2. P1 — AC4 の「CPU 飽和下 regression」を現在の Verification Commands は検証していない
AC4 は CPU 飽和下での再発防止を要求していますが、VC は、
です。
pytest-xdist 公式仕様では
loadscopeは top-level test function を module 単位で grouping し、その group 全体を1 workerに割り当てます。したがって、この1 moduleだけを対象にした invocation は、CI のように4 workerが別 module を並列実行して CPU を奪い合う負荷を再現しません。[pytest-xdist.readthedocs.io](https://pytest-xdist.readthedocs.io/en/stable/distribution.html?utm_source=chatgpt.com)つまり AC4 は実装が間違っていても green になれます。
ここでは 48本の busy loop のような負荷 generator を required CI に埋め込むのも推奨しません。workflow を無駄に重くします。より良い regression は「CPU が遅い状況」を wall-clock load で再現するのではなく、fixture の readiness を決定論的に遅延・gate して、旧 0.6s 仮定なら必ず失敗する状態を作ることです。
-n 4 --dist loadscopeは「xdist compatibility」の secondary VC として残して構いませんが、AC4 の主要証拠にはしない方がよいです。3. P1 — 新しい regression test を追加しなくても全 VC が baseline で通り得る
現在の Verification Commands はすべて
# baseline-expect: passです。しかし #2883 の中心成果は「この failure class を固定する regression を追加する」です。現状の full-file pytest、
rg -c、production file diff は、新しい regression test を1件も追加せずとも通ります。repository の current
create-issue/references/body-authoring.mdは、このケースを明示的に扱っています。既存 Allowed Path の test file に新しい test function を追加する場合は、missing node-id に対して直前に、を付ける canonical form があります。
したがって例えば AC1/AC4 用に名前を固定し、
のような baseline red → implementation後 green の VC を1本入れるべきです。
4. P1 — 「責務分離」を無条件に許すと #2221 が修復した coverage gap を再導入できる
Outcome/In Scope は「readiness 同期 または readiness 非依存 assertion / 依存 assertion への責務分離」を許しています。
責務分離そのものは悪くありません。実際、closed Issue #2371 / PR #2373 は、
へ責務を分けて flake を解消しており、良い precedent です。
ただし、この test は事情が異なります。#2221 では、まさに「timeout」と「reap」を別々に確認するだけでは不十分として、
run_baseline_vc_preflight()→ actual outer timeout → already-running leader/grandchild → handler → full reap を一つにつないだ integration test が追加されました。したがって #2883 には次の制約を明記すべきです。
これなら #2371 の知見を利用しつつ、#2207/#2221 の safety claim を後退させません。
5. P2 —
rg -cの AC2/AC3 検証は semantic false-green現在、
がありますが、対象 token は docstring/comment に残っているだけでも成功します。
たとえば実 assertion を削除しても
"baseline_vc_preflight_aggregate"がコメントに残れば AC2 の VC は PASS します。ここは named pytest regression を authority にするのが最も良いです。static check も残すなら少なくとも、
のように actual assertion shape へ寄せるべきです。ただし最終的な semantic sufficiency は pytest 側で担保する方が堅いです。
6. P2 — AC5 の
git diff origin/mainは moving base に弱い現在は、
ですが、実装中に
origin/mainが進むと、その upstream change を「この branch が production を変更した」かのように検出できます。逆方向の取り違えも起こり得ます。branch が導入した差分だけを見るなら、単一コマンドのまま、
の方が意図に近いです。あるいは repository-native な changed-path authority があればそちらを使うべきです。
確認できた関連関係
GitHub live state では、#2883 は open、現時点で issue comment はなく、
2883を直接参照する実装 PR は検索上まだ見つかっていません。起点の PR #2876 は現在も open ですが、対象 flake は #2872 の Allowed Paths 外です。元 CI attempt
37068873394のpython-test-coreは実際に[gw0]で iteration 2 のself.pidが生成されず、1 failed, 17580 passedで終了しています。これは #2883 の Background と一致します。関連履歴では、#2207 / merged PR #2221 がこの production outer-timeout integration test の起源、closed #2371 / PR #2373 が「wall-clock race を readiness synchronization + responsibility separation に変える」近い precedent です。#1796 は別 snapshot fixture timeout の hermetic 化、#2792 は別の CI 並列非決定 failure 調査であり、live dedupe 検索でも #2883 と同一 scope の open Issue は確認できませんでした。
推奨する reframe の中心
#2883 の方向性は変えなくてよく、generic framework、pytest plugin、CI gate 緩和、production timeout 緩和は不要です。変更すべきなのは contract の精度です。
特に次の3点を固定すれば実装可能性と review convergence が大きく上がります。
baseline-expect: failにする。-n4 --dist loadscopeは compatibility check に降格する。pytest 側も、flake は未制御の system state/timing を制御する方向で修正することを推奨しており、単なる timeout 延長より今回の readiness synchronization 方針の方が適切です。[pytest ドキュメント](https://docs.pytest.org/en/latest/explanation/flaky.html?utm_source=chatgpt.com)
セキュリティ/ハーネス面で新たな blocker は見つけていません。 問題は process lifecycle 自体ではなく、現在の Issue contract が「何を deterministic に注入すれば #2221 の integration guarantee を維持したとみなすか」をまだ固定できていない点です。
squne121 commentedon Oct 2, 2026
live GitHub と current
issue-refinement-loopを確認しました。対象コメントはREQUEST_CHANGES / reframe_in_placeで、current Skill ではこの種のユーザー指定コメントをpreflight.run.with_human_contextとして扱い、canonical Step 2 はissue-reviewerSubAgent ではなく root-owned review pipeline を background 起動して完了 join 必須です。以下をそのまま既存の auto mode Claude Code に貼り付けてください。repo=
squne121/loop-protocol対象:
実装: process-group cancellation 統合 test の固定 0.6s outer deadline を readiness 同期へ置き換え、負荷下の timing flake を解消する #2883 (comment)
.claude/skills/issue-refinement-loop/SKILL.mdこの対話セッションは既に auto mode で起動済みである。
Claude Code の permission mode は変更しないこと。
bypassPermissions、--dangerously-skip-permissions、その他 permission bypass を要求・使用しないこと。目的
Issue #2883 に対して、current HEAD の
issue-refinement-loopを正式な control-plane として使用し、指定した human-context comment のREQUEST_CHANGES / reframe_in_placeを反映して Issue contract を改善する。人間による iteration ごとの承認は不要。
repository の current loop policy が許す範囲で、調査 → contract rewrite → fresh review → readiness/final gate → 必要なら再修正、を bounded に自律継続し、refinement が terminal state に到達するまで行う。
これは Issue refinement の依頼であり implementation の依頼ではない。
impl-review-loop、implementation worker、production/test implementation、commit/push/PR 作成へ進んではならない。approved になったら refinement の正式な termination/handoff を完了して停止する。
明示的に承認する作業
以下の非破壊的作業は、人間への追加確認なしで実施してよい。
.claude/skills/issue-refinement-loop/**、関連 references、scripts、schemas、agents、SSOT の読取codebase-investigatorSubAgent の利用web-researcherSubAgent の利用issue-editor/edit-issueroute の利用needs-fix、deterministic repair、structural repair、contract rewrite に対する bounded 自動修正・再review通常の
needs-fix、rewrite 要求、checker failure、stale review、freshness mismatch、修正可能な contract defect は停止理由にしない。current Skill に従い、修正して fresh state で再検証すること。最初に必ず fresh 確認すること
過去セッションの状態やこの prompt に書かれた repository details を正本にしない。
最初に current repository / GitHub から以下を再取得する。
issuecomment-5962624631の current snapshot.claude/skills/issue-refinement-loop/SKILL.mdSKILL.mdが今回必要と指示する references.claude/agents/**のうち実際に dispatch する SubAgent contract古い Skill contract、古い command syntax、古い agent role を推測で再利用しないこと。
anchor comment の扱い
今回はユーザーが明示的に指定した direct human context である。
したがって canonical root/default-branch context から、current command registry に従って
preflight.run.with_human_contextlane を使用し、次の anchor URL を binding すること。
https://github.com/squne121/loop-protocol/issues/2883#issuecomment-5962624631preflight.run.with_anchorや agent-report lane にすり替えないこと。current Skill に書かれている canonical executor / command registry を使う。
run_refinement_preflight.pyを policy を迂回して直接叩かない。planner / checker / routing authority が出した structured decision を prose で再実装・再判定しない。
今回の reframe で達成すべき中心事項
anchor comment の findings は単なる参考意見ではなく、今回の refinement input として扱う。
fresh evidence と current repository contract に矛盾しない限り、以下を Issue #2883 の contract に反映させる方向を優先する。
1. BLOCKER 解消: deterministic fault injection を明示的に許可
現在の Issue は、
run_baseline_vc_preflight()path を保持を要求しつつ、current production API に readiness 後に wall-clock timer を arm する seam がない、という矛盾を持つ。
この refinement では、既存 Allowed Path 内の test-local deterministic fault injection を明示的に accepted mechanism として許可する reframe を第一選択とする。
意図は:
baseline_vc_preflight.pyを使って process tree が ready になったことを決定論的に確認した後に、test-local fault injection により production supervisor の outer-timeout handling branch を発火させること。
この integration test は「0.6 秒という elapsed wall-clock deadline 自体」を試験するものではなく、
ready な real process tree に対して production outer-timeout handling path が実行された場合の cooperative cancellation / full reap / typed timeout result
を検証する fault-injection integration test であることを Issue contract に明記する。
real elapsed timeout 自体の既存 coverage は、別の既存 coverage として保持する。
単に timeout を延長する、blind sleep を増やす、generic test harness / pytest plugin を追加する、といった解決は採用しない。
fresh code evidence により test-local injection では本当に production timeout branch を通せないことが実証された場合のみ、別案を検討する。
その場合も勝手に production seam を追加する implementation decisionへ進まず、refinement contract 上で必要な scope を current Skill の trusted reframe rules に従って扱うこと。
2. CPU saturation regression を deterministic delayed-readiness regression に置換
AC4 の主要 regression proof として 48 busy-loop 等の実 CPU saturation を required CI に埋め込まない。
代わりに、
という regression にする。
pytest -n 4 --dist loadscopeは必要なら xdist compatibility の secondary check として保持してよいが、CPU saturation regression の authority として扱わない。3. baseline-red の named regression VC を追加
現在の VC はすべて baseline pass で、新しい regression test を実装しなくても green になり得る。
current repository の authoring contract に従い、新しい regression node-id を contract 上で固定し、implementation 前には missing node-id により red になる VC を追加する。
候補名として anchor comment が示した
test_outer_timeout_fault_injection_waits_for_ready_process_treeを検討する。
current naming convention / current code と整合するならこれを使用し、例えば AC1/AC4 に対して:
# baseline-expect: failの named pytest VC を持たせる。
名前を変更する場合は、なぜ current code / repository convention 上その方が正しいか evidence を残すこと。
4. #2207 / #2221 の integration guarantee を後退させない
責務分離を採用しても、少なくとも1つの integration test は、同一 invocation について以下を一続きで証明する contract にする。
ready な real VC leader + grandchild
→ production outer-timeout handling path 発火
→ SIGTERM handler
→ wrapper / leader / grandchild の full reap
→ typed timeout result
最低限、既存 safety claim である以下を保持する。
status == "runtime_error"failure_class == "timeout"timeout_phase == "baseline_vc_preflight_aggregate"retryable is Falserun_baseline_vc_preflight()production-shaped path_OUTER_DEADLINE_REPEAT_COUNTの意図する register/unregister race coveragetimeout と reap を完全に別 test に分離し、#2221 が埋めた coverage gap を再導入する contract にしてはならない。
5. semantic false-green な VC を修正
単なる
rg -c "baseline_vc_preflight_aggregate"rg -c "run_baseline_vc_preflight"を semantic authority にしない。
named pytest regression を主要な verification authority とする。
static verification を残す場合は actual assertion / invocation shape を検査するものへ寄せるが、semantic sufficiency は pytest で担保する。
6. moving
origin/mainに弱い diff VC を修正branch が導入した差分を確認する目的なら、current repository-native changed-path authority が存在する場合はそれを優先する。
単純 git command が適切なら、
origin/main...HEADの merge-base based diff を使う方向で contract を修正し、moving upstream の差分を当該 branch の変更と誤認しないようにする。
7. Issue contract 全体の整合性を取る
上記変更に伴い、必要な範囲で以下を相互整合させる。
特に、「test-local deterministic fault injection を accepted mechanism とする」と決めたのに、それを synthetic timeout として禁止するような記述を残さない。
一方で production code / CI policy / generic harness へ scope を膨らませない。
SubAgent 利用要件
SubAgent は current Skill が要求・許可する役割だけを使う。
Investigation
REFINEMENT_LOOP_PLAN_V1.decisions.investigation_policy.required == trueの場合は、codebase-investigatorを使用する。dispatch 時には親会話の暗黙 context に依存させず、最低限以下を明示する。
SubAgent を dispatch しただけで完了扱いにしない。
terminal completion を待ち、最終結果を取得してから次工程へ進むこと。
Web research
planner の
web_research_policy.required == trueの場合だけweb-researcherを使用する。pytest / pytest-xdist / Python subprocess semantics 等、external claim が disposition に影響する場合は一次資料を優先する。
Investigation と Web research がともに required なら並列実行してよいが、
両方の最終結果を join してから Step 2 へ進むこと。
Rewrite
canonical routing が Step 4 /
issue_editor_requiredを要求する場合は currentissue-editor/edit-issuecontract を使用する。これも dispatch だけで成功扱いにしない。
まで完了して初めて rewrite が downstream authorization を得たとみなす。
canonical Step 2 に関する重要事項
current
issue-refinement-loopの canonical Step 2 では、issue-reviewerSubAgent を起動しないこと。current
.claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py produceを root-owned producer として使用し、current Skill が規定する通り Claude Code Bash で 明示的 background launch する。そして、background task の起動を Step 2 完了とみなしてはならない。
task notification / completion result を mandatory join し、実際の完成 JSON を取得してから
canonical_step2_routeを読むこと。routing は
canonical_step2_routeを唯一の authority とし、status/verdict/next_actionから独自に再計算しない。refinement loop の継続方針
current Skill の default bounded loop を使用する。明示的理由がなければ
max_iterationsは current default を使う。needs-fixの場合、上限未到達なら自動で rewrite → fresh review を継続する。各 iteration で人間承認を要求しない。
以下は途中停止理由にしない。
ただし current canonical authority が明示的に
human_judgment_requiredまたは environment/integrity failure を返した場合は、その route を無視して突破しない。
Final Gate
Issue body を rewrite した後は、古い review/readiness result を再利用しない。
fresh body に対して current canonical final review/readiness gate を通す。
通常の implementation Issue なので、current policy が要求する
CONTRACT_REVIEW_RESULT_V1.status == "go"および freshness 条件を満たすまで approved 終了しない。
status: blockedで修正可能なら refinement loop を継続する。next_action: human_judgmentの場合のみ human escalation とする。approved に到達しても、この invocation から
impl-review-loopを開始してはならない。current termination policy に従い
LOOP_HANDOFF_RESULT_V1/ termination report を正式に publish して終了する。再発防止 Issue の扱い
今回の refinement 中に、#2883 自体を直すだけでは再発する 別 scope の concrete systemic defect を確認した場合は follow-up Issue を検討する。
例:
rg -c tokenの存在だけで満たす false-green が複数 Issue で繰り返されるただし generic hardening や speculative security/harness Issue を増やさない。
起票前に必ず:
dedupe_keyを設計4.既存 Issue があるなら重複起票しない
新規 Issue が本当に必要なら、current
issue-refinement-loopの follow-up materialization policy に従って起票してよい。これは明示的に承認する。
単に #2883 の contract rewrite で十分な事項を別 Issue に分割しないこと。
品質方針
個人趣味開発であるため、具体的 defect を解決しない enterprise hardening、追加 approval layer、generic wrapper、恒久 gate、schema 増殖は避ける。
優先順位は:
security/harness は正規 workflow を妨げない範囲にする。
停止境界
以下の場合のみ停止/escalate する。
human_judgment_requiredを返した通常の reviewer finding や修正可能な checker failureだけでは停止しない。
最終報告
terminal completion 後、簡潔に以下を報告する。
調査や提案だけで止まらず、current
issue-refinement-loopの terminal state まで実際に実行すること。特に重要なのは、指定コメントを
with_human_contextとして処理すること、Step 2 の background task を必ず join すること、そして refinement 完了後にそのまま実装へ越境しないことです。squne121 commentedon Oct 2, 2026
issue-refinement-loop 終了報告(approved)
Issue #2883 の refinement を完了しました。OWNER の REQUEST_CHANGES / reframe_in_place(https://github.com/squne121/loop-protocol/issues/2883#issuecomment-5962624631)を
preflight.run.with_human_contextlane で反映し、承認済み本文は sha256:242b6d91ba1993fc9ba1bea7edc27ba2b6c024fad6607e2a6e7a62ba9a0ef95c です。codebase-investigatorで current main(1974fddf)を fact-check(production seam なしで test-local fault injection が成立することを root が独立にコード確認)issue-editor経由の controlled transaction。GitHub readback で本文一致を確認produceの canonical_step2_route はstep_2_5(approve / proceed)、semantic_review_applicable は false のため Step 4.5 へ。final review gate はfinal_review_allowed: trueCONTRACT_REVIEW_ONCE_RESULT_V1(execute mode)がstatus: go。名前付き regression VC は baseline でexpected_failimpl-review-loopは起動していません。approved は実装開始の代替承認ではありませんsqune121 commentedon Oct 2, 2026
live GitHub を再確認したところ、#2883 は現在も open で実装契約が確定済み、refinement 終了コメントは
fresh_go、currentmainは1974fddf76ca1c0956e3eb77df52c8a5c31dd382、#2883 を参照する既存 PR は現時点の検索では見つかっていません。前セッションも「実装・commit・PR は開始していない」状態で終了しています。貼り付けたテキスト(1)推奨アクションは、fresh session から current
impl-review-loopの Root-Owned Synchronous Entry Transition を正規入口として実行し、pre-Step-1 の landing disposition が通常 dispatch を返した場合だけ実装開始です。過去のLOOP_HANDOFF_RESULT_V1を実装 authorization として再利用しない点が重要です。以下を、そのまま既に auto mode で起動済みの fresh Claude Code に貼り付けてください。
repo=
squne121/loop-protocol対象:
実装: process-group cancellation 統合 test の固定 0.6s outer deadline を readiness 同期へ置き換え、負荷下の timing flake を解消する #2883 (comment)
実装: process-group cancellation 統合 test の固定 0.6s outer deadline を readiness 同期へ置き換え、負荷下の timing flake を解消する #2883 (comment)
.claude/skills/impl-review-loop/SKILL.mdこの対話は fresh Claude Code session で、既に auto mode で起動済みである。
Claude Code の現在の permission mode は変更しないこと。
bypassPermissions、--dangerously-skip-permissions、その他 permission bypass を要求・使用してはならない。目的
Issue #2883 を current HEAD の canonical
impl-review-loopで、fresh intake → implementation → independent verification → PR review → fix → re-test → fresh re-review
まで bounded に自律実行し、人間が merge 判断できる直前の terminal state まで進める。
iteration ごとの人間承認は不要。
通常の implementation failure、test failure、REQUEST_CHANGES、修正可能な CI failure、stale review、main drift、BEHIND、reviewer が要求する bounded fix は、人間確認の理由にせず current canonical routing に従って自動修正・再検証すること。
実 merge、auto-merge、force push、history rewrite は行わない。
1. 最初に必ず fresh state を取得する
この prompt や過去 session の SHA、PR 不在、refinement 結果を current authority とみなさない。
最初に live repository / GitHub から以下を fresh 取得すること。
.claude/skills/impl-review-loop/SKILL.mdsteps/preparation.mdsteps/step-1-implementation.mdsteps/step-2-verification.mdsteps/step-4-pr-review.mdsteps/step-5-feedback-and-termination.mdsteps/step-5-mergeability-handling.md.claude/agents/implementation-worker.md.claude/agents/test-runner.md.claude/agents/pr-reviewer.md.claude/agents/issue-creator.md古い command syntax、古い agent role、過去 session の LOOP_STATE を推測で再利用しない。
2. 過去の refinement handoff を implementation authorization にしない
Issue #2883 には過去の:
LOOP_HANDOFF_RESULT_V1.status: refinement_approvedが存在するが、current
impl-review-loopの契約上、それ自体は Step 1 起動 authorization ではない。current
impl-review-loopの Root-Owned Synchronous Entry Transition を正規入口とすること。root/main thread が current Skill の SSOT に従い、同一の continuous invocation / control flow 内で少なくとも:
を連続して行うこと。
過去 comment、artifact、body SHA、snapshot、handoff marker、旧 invocation token を Step 1 起動 authority として代用しない。
current repository の
.claude/skills/issue-refinement-loop/scripts/root_entry_router.pyおよび current termination-policy が正本として要求する route を使用すること。
structured routing result を prose で再実装・再解釈しない。
3. Step 1 より前に Evidence-Based Landing Disposition を必ず評価する
worker dispatch、worktree 作成、新規 PR 作成より前に current
impl-review-loopの pre-Step-1 landing disposition を実行する。特に次を fresh に確認する:
current producer が返す disposition を authority とし、独自判定しない。
routing:
implementation_already_landed→ worker / new worktree / duplicate PR を開始しない
existing_pr_resume→ 既存 PR / branch / worktree を再利用し、新規 PR を作らない
already_satisfied→ current canonical already-satisfied route に従い no-op recommendation を報告
ordinary_dispatch_or_explicit_recovery→ Step 1 へ進む
reconciliation_required→ current workflow の reconciliation を実行。証拠を無視して新規 PR を作らない
現時点では live GitHub 検索上 #2883 の PR は見つかっていないが、これは prompt 作成時点の観測にすぎない。必ず fresh に再検索すること。
4. 明示的に承認する作業
以下の作業は、この依頼により追加の人間承認なしで実施してよい。
ただし current canonical Skill / SubAgent / controlled executor の責務分担を守ること。root thread が data-plane operation を直接行うべきでない場合は適切な SubAgent に委譲する。
承認する:
open-prroute を使った PR 作成承認しない:
5. Issue #2883 の実装 scope
fresh live Issue body を最終 authority とする。
prompt 作成時点では Allowed Paths は:
.claude/skills/issue-contract-review/scripts/tests/test_vc_process_group_cancellation.pyの1ファイルだけである。
live contract が変化していなければ このファイル以外を編集しない。
production scripts、CI policy、dependency、pytest plugin、generic framework 等へ scope を膨らませない。
特に以下は current contract 上 Out of Scope のため変更禁止:
.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py.claude/skills/issue-contract-review/scripts/contract_readiness_check.py.github/ci/python-test-plan.jsonpyproject.tomluv.lockproduction seam が本当に不可避だと実証された場合、独自に scope を拡張せず current Stop Condition / routing に従う。
6. 実装上の load-bearing requirements
Issue body の AC/VC を authority としつつ、少なくとも以下の設計意図を失わないこと。
A. wall-clock 0.6s dependency を除去
旧設計の:
_OUTER_DEADLINE_SECONDS = 0.6以内に fixture startup + pytest import + grandchild spawn が完了するという assumption に依存しない。
単なる timeout 延長、blind sleep 増加では修正しない。
B. test-local deterministic fault injection
real:
baseline_vc_preflight.pyを使用する。
real process tree が ready になったことを同期で確認した後に、test-local fault injection で production supervisor の outer-timeout handling branch を発火させる。
注入してよいのは timeout 発生点のみ。
以下を stub / fake / 再実装 / bypass しない:
run_baseline_vc_preflight()production-shaped invocation pathC. 同一 invocation の integration guarantee を維持
少なくとも1つの integration test で同一 invocation 内に:
ready real VC leader + grandchild
→ production outer-timeout handling branch
→ SIGTERM handler marker
→ wrapper / VC leader / grandchild full reap
→ typed timeout result
を一続きで検証する。
最低限維持する assertion:
status == "runtime_error"failure_class == "timeout"timeout_phase == "baseline_vc_preflight_aggregate"retryable is Falserun_baseline_vc_preflight()経由timeout と reap を完全に別々の test に分離して #2207 / #2221 の coverage guarantee を後退させない。
D. deterministic delayed-readiness regression
current Issue が指定する named regression:
test_outer_timeout_fault_injection_waits_for_ready_process_treeを実装する。
fixture readiness を test-controlled synchronization primitive で deterministic に gate / delay し、旧 0.6s 設計なら readiness 前に timeout して失敗する failure class を固定する。
required regression に CPU busy loop を入れない。
-n 4 --dist loadscopeは xdist compatibility check として扱い、CPU saturation proof の代用にしない。7. SubAgent を必ず使用し、terminal completion を join する
SubAgent dispatch だけで作業完了扱いにしてはならない。
すべての必要な SubAgent は最終 result / terminal completion を取得してから downstream step へ進む。
Step 1 — implementation-worker
current
implementation-workerを使用する。child message は current Step 1 contract に従い、親会話の暗黙 context に依存させず実値を渡す。
最低限:
IMPLEMENT_RESULT_V1を明示する。
worker が current
.claude/skills/implement-issue/SKILL.mdを実行し、worktree → implementation → local verify → commit → push → PR create/update
まで current Skill が担当する範囲を完了させる。
dispatch 後は worker の terminal completion を必ず待つ。
IMPLEMENT_RESULT_V1.status: okを取得する前に Step 2 へ進まない。Step 2 — test-runner
implementation の exact HEAD を対象に
test-runnerを sibling SubAgent として起動する。最低限:
を materialize して渡す。
independent read-only verification とする。
test-runner の terminal result を取得するまで Step 4 に進まない。
current canonical VC adjudication / current-head gate を使用し、過去 HEAD の PASS を再利用しない。
Step 4 — pr-reviewer
exact current PR HEAD を対象に
pr-reviewerを起動する。current
.claude/skills/pr-review-judge/SKILL.mdの手順に従わせる。最低限:
を与える。
Allowed Paths Gate は live Issue body を authority にする。
pr-reviewer の terminal completion を必ず待ち、最低限:
verdictreviewed_head_shablockerswarningsを取得する。
reviewer が自己申告する mergeability を authority にしない。
mergeability は root/control-plane が live GitHub から取得する。
8. review/fix loop を人間承認なしで継続する
current default loop policy を使用する。
明示的な別値が current SSOT にない限り
max_iterationsは current default(現在は 3)を用いる。REQUEST_CHANGESactual conflict がなければ停止しない。
fix_deltaにするstale reviewed HEAD
human escalation しない。
fresh current HEAD で pr-reviewer を再実行する。
BEHIND / update_branch
current router が
route_to_update_branchを返した場合は currentimplementation-workerの canonical update_branch mode に委譲する。worker 完了後:
する。
ordinary test / CI failure
修正可能で #2883 scope 内なら自動修正する。
test/CI failure を「人間承認が必要」として停止しない。
false-green を作るために test を削る、assertion を弱める、CI policy を緩和する、timeout を単純延長することは禁止。
9. Step 5 は current deterministic router に従う
reviewer verdict と live mergeability を独自 prose で判定しない。
current
route_loop_verdict_v2()/ current Step 5 procedure を使用する。main drift facts も current SSOT の方法で fresh に構築する。
特に:
を必要に応じて current canonical implementation から取得する。
semantic ambiguity を推測値
falseで埋めない。actual Git conflict:
mergeable == CONFLICTINGmerge_state_status == DIRTYだけは current runbook に従う hard stop とする。
BLOCKED/UNSTABLE/DRAFT/UNKNOWNを自動的に Git conflict と扱わない。10. PR 作成・再利用
pre-Step-1 landing disposition で既存 PR が検出された場合、それを再利用する。
duplicate PR を作らない。
新規 PR が必要な場合は
implementation-worker→ currentimplement-issue→open-prの正規経路を使う。current repository policy が Draft PR を要求するなら Draft のまま進める。
PR body / closing relationship / Issue reference は current
open-prcontract に従う。PR が既に存在している状態で fix iteration に入った場合、新規 PR を作らず同一 branch / PR を更新する。
11. 再発防止 Issue
今回の実装・review 中に、#2883 を直すだけでは再発する 具体的な別 scope の systemic defect が確認された場合は follow-up GitHub Issue を起票する。
これはこのユーザー指示により明示的に承認する。
ただし generic hardening、enterprise-style gate、wrapper、schema、approval layer を理由なく追加しない。
対象例:
起票前に必ず:
dedupe_keyを設計新規起票が必要なら、root/main thread から sibling の current
issue-creatorSubAgent を使用する。current
.claude/agents/issue-creator.md+
.claude/skills/create-issue/SKILL.mdを fresh に読み、
FOLLOW_UP_ISSUE_REQUEST_V1等の current canonical input を使う。raw
gh issue createを即席で組み立てない。current controlled transaction route を使う。
issue-creatorを dispatch したら terminal completion を待ち、Issue URL / number / dedupe result を取得する。follow-up Issue の起票は #2883 の Allowed Paths を拡張する権限ではない。
もし live #2883 contract の Stop Condition が scope split を要求する場合:
human_judgment_requiredを返した場合だけ、それを無視して突破しない12. 品質方針
個人趣味開発である。
優先順位:
具体的 defect を解決しない generic security hardening、追加 approval layer、恒久 gate、wrapper/schema 増殖は避ける。
security / harness は正規 workflow を妨げない範囲にする。
13. 停止境界
以下の場合のみ停止 / escalation 候補とする。
human_judgment_required/ human escalation を返す以下は停止理由ではない:
14. merge 直前で停止する
最終目的は 人間が merge を判断できる直前。
current canonical terminal conditionが満たされるまで進める。
期待状態は current Skill が定義する
approved/draft_pr_ready相当:ここまで到達したら停止する。
gh pr merge、merge API、auto-merge enable は実行しない。15. 最終報告
terminal completion 後、簡潔に以下を報告する。
調査・計画・SubAgent dispatch だけで止まらないこと。
current
impl-review-loopの terminal state、または上記の正当な停止境界に到達するまで、実際に implementation / verification / review / fix loop を遂行すること。この形なら、直前の refinement 成果を尊重しつつも、fresh session が古い handoff を authorization と誤認するのを防ぎ、現在の
impl-review-loopが要求する synchronous entry と pre-Step-1 duplicate detection から開始できます。squne121 commentedon Oct 2, 2026
implement-issue: 実装完了
.claude/worktrees/issue-2883-process-group-cancellation-test-0-6s-outworktree-issue-2883-process-group-cancellation-test-0-6s-outsqune121 commentedon Oct 2, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: outer-timeout 統合 test に natural elapsed timeout 回帰と injection 検証…
squne121 commentedon Oct 3, 2026
impl-review-loop: 完了 (2026-10-03)
今回の経緯: OWNER コメント(https://github.com/squne121/loop-protocol/pull/2885#issuecomment-5963140832)の P1(自然発火する outer timeout の coverage 消失)と P2(injection 検証失敗時の cleanup 迂回)を human-context として取り込み、#2883 の契約を最小 reframe(AC7 と AC8 を追加)したうえで、既存 PR を再開して修正しました。
test: outer-timeout 統合 test の固定 0.6s deadline を readiness 同期の fault i…