Repository navigation
実装: fan-out AGY provider processのlifecycle telemetryと実overlap validatorを追加する - #1713
Merged
squne121 merged 2 commits intoJul 24, 2026
Merged
Conversation
…orを追加する make_subprocess_runner() が Popen() 成功後にのみ process-start event を、 proc.wait() reap 後に process-exit event を journal へ記録するようにし、 pid/pgid/started_monotonic_ns/exited_monotonic_ns を用いた overlap 判定 関数・distinct pid かつ distinct subtask_id を要求する集約関数・ subtask_started イベント順序のみに依存しない validator を実装した。 fake executable を使った real subprocess integration test を8ケース追加。 Closes #1707
Contributor
Preview URLPreview removed (PR #1713 closed). |
CI (python-test / Ruff check) が test_fan_out_process_lifecycle.py の 227行目で E501(121 > 120 文字)を検出したため、リスト内包表記を複数行へ 分割した。テスト内容・アサーションは変更していない。 Refs #1707
squne121
commented
Jul 24, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
レビュー結果
Closes #1707 の contract(Outcome / In Scope AC1-11 / Allowed Paths / Verification Commands)と PR #1713 の diff・CI 証跡を照合した。
- Allowed Paths: 変更ファイルは
git diff --name-only $(git merge-base main HEAD) HEADで確認した通り、.claude/skills/gemini-cli-headless-delegation/scripts/fan_out_orchestrator.pyと.claude/skills/gemini-cli-headless-delegation/tests/test_fan_out_process_lifecycle.py(新規)のみであり、Issue #1707 の Allowed Paths と完全一致する。scope 混入なし。 - Verification Commands:
uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_fan_out_process_lifecycle.py .claude/skills/gemini-cli-headless-delegation/tests/test_fan_out_orchestrator.py -qで 50 テスト全 PASS(AC1-AC11 に対応する既存テスト・回帰テストを含む)を確認した。 - CI:
ci_verdict_summary.py --pr 1713 --expected-head-sha 502b375687d902b7198c64a96eef883c005356c2の結果はstatus: all_pass、failed_checks: []、pending_checks: []。当初 python-test で E501(test_fan_out_process_lifecycle.py:227)が検出されたため修正コミット(502b3756)を追加し、再度全 required check が green になったことを確認した。 - Schema Change Applicability:
not_schema_change(journal 内部イベントprocess_lifecycle_event_v1の追加のみで、公開 request/result schema・既存イベントの削除/rename なし)と PR 本文に明記されており、Schema Consumer Inventory は N/A で妥当。 - Safety Claim Matrix:
.claude/skills/**配下の subprocess/SIGTERM/SIGKILL を扱う safety-sensitive PR として本セクションが記載されており、各 claim に AC 対応テストの Evidence が付与され、process_role: provider_cli未実装の claim も Implemented: no として正直に記載されている(Not controlledは全行 N/A で bounded な主張のみ)。 - Overlap Preflight: Issue 側コメントに記録された通り、根本原因(#1706 の
depends_on: #1707散文記述が構造化パーサー未対応形式だった)を #1706 の Machine-Readable Contract 修正で解消し、route: proceed_with_collision_evidenceを確認した上で本 PR を作成している。 - Mergeability:
mergeable: MERGEABLE,mergeStateStatus: CLEAN。
blocker なし。
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "502b375687d902b7198c64a96eef883c005356c2"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
squne121
marked this pull request as ready for review
July 24, 2026 20:07
squne121
deleted the
worktree-issue-1707-fan-out-agy-provider-process-lifecycle-t
branch
July 24, 2026 20:08
This was referenced Jul 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pid/pgid/started_monotonic_ns/exited_monotonic_ns)をfan_out_orchestrator.pyのmake_subprocess_runner()へ追加し、subtask_startedイベント順序のみに依拠していた誤った並列性検証(レビュー Blocker 2)を、実 process の区間重複判定に置き換える。max(start) < min(exit))と、distinctpidかつ distinctsubtask_idを要求する集約関数を実装し、fake executable を用いた real subprocess integration test で 8 ケース(成功 overlap / sequential no-overlap / spawn failure / timeout / SIGKILL escalation / malformed exit event / wrapper-level のみの overlap)を検証する。executableフィールドは basename のみを記録し(absolute path を journal に残さない)、既存のtest_fan_out_orchestrator.py(33 テスト)は無変更で全 PASS のまま。Checks
uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_fan_out_process_lifecycle.py -q(17 テスト PASS)uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_fan_out_orchestrator.py -q(33 テスト PASS、回帰なし)uv run python3 .claude/skills/implement-issue/scripts/check_implementation_overlap.py --issue-number 1707 --repo squne121/loop-protocol --limit 1800(route: proceed_with_collision_evidence)pnpm typecheck/pnpm lint/pnpm test/pnpm build(本 PR は.claude/skills/gemini-cli-headless-delegation/配下の Python のみを変更し、pnpm workspace のコードを変更しない)Schema Change Applicability
not_schema_changeprocess_lifecycle_event_v1はfan_out_orchestrator.py内部の NDJSON journal に追加される purely additive なイベントであり、既存のdelegation_fanout_request_v1/delegation_fanout_result_v1の producer-consumer 境界を変更しない(既存subtask_started/subtask_finishedイベントの削除・rename も行っていない)。Schema Consumer Inventory
N/A(
not_schema_changeのため)。Safety Claim Matrix
subprocess.Popen()のOSError)を process-start として記録しないtest_fan_out_process_lifecycle.py -k test_process_start_event_only_after_popen_successPASSexecutableフィールドに absolute path を含めない(basename のみ)test_fan_out_process_lifecycle.py -k test_executable_field_is_redacted_to_basenamePASStermination_reasonを正確に分類するtest_fan_out_process_lifecycle.py -k "timeout_termination_recorded or sigkill_escalation_recorded"PASStest_fan_out_process_lifecycle.py -k test_concurrent_journal_writes_do_not_corruptPASSprocess_role: provider_cli(agyCLI 実行そのもの)の telemetryrun_gemini_headless.py内の実 AGY 起動箇所は本 Issue の Allowed Paths 外のため、delegation_wrappertelemetry のみを実装記載ルール遵守: 本 PR の Summary / タイトルでは
safe/read-only/sandboxed/isolated/completeを無限定に使用していない。process_role: provider_clitelemetry は実装していない旨を明記した。Notes
M4: Upgrade Loop (v0.4.x)境界内(docs/dev/current-focus.md参照)。resource consumption / fan-out 並列実行の検証可能性向上。Overlap Preflight Evidence(Issue #1707 の overlap preflight 解決の補足説明)
check_implementation_overlap.pyは当初route: human_review_required(policy_class C3, parent_child_collision, 兄弟 Issue #1706 との Allowed Paths 重複fan_out_orchestrator.py+ shared parent #1265)を返していた。根本原因は、#1706 の本文に既に記述されていた「depends_on: #1707」という散文が、overlap classifier の構造化パーサー(Machine-Readable Contractblocked_by:キー、または legacyDepends on #N正規表現。いずれも underscore + colon 形式のdepends_on:にはマッチしない)に一致しない形式だったことにある。#1706 の Machine-Readable Contract に構造的に解析可能なblocked_by:\n - "#1707"を追加する本文修正(既存の判断内容・スコープは変更しない構文修正のみ)を実施した結果、route: proceed_with_collision_evidence(dependency_relation: successor,policy_class: C2a)へ解決した。