Repository navigation
impl(#946): delivery-rollup child materialization を create_issue_txn 正規フローへ統合する - #969
Conversation
…正規フローへ統合する materialize_child_issues.py を新規追加し、CHILD_MATERIALIZATION_PLAN_V2 互換の closed schema 検証 → canonical body render → validate_issue_body parity 通過 → create_issue_txn 経由起票・read-back → parent checklist 安全 patch → CHILD_MATERIALIZATION_RESULT_V2 出力までを決定論的に実行する。 - AC1: closed schema fail-closed(unknown key / duplicate child_id / issue_lookup.complete:false / 不正 action / 非整数 depends_on / 空 allowed_paths / AC↔VC set 不一致 / 非JSON を拒否) - AC2: ISSUE_TEMPLATE/<kind>.yml の required label order から spec-driven render し validate_issue_body.py --kind --title を通過した body のみ起票 - AC3: create_issue_txn.py が internal validator に --kind/--title を転送 - AC4: depends_on を create_issue_txn --dependency に写像し read-back - AC5: parent ## Child Issues section 内で body_sha256 / exact old_line / expected_match_count==1 / post-edit read-back を満たす場合のみ patch - AC6: 起票は create_issue_txn 経由のみ(--label-profile triage_only 含む)。 fake-gh integration test で raw gh issue create 非経由を証明 - AC7: CHILD_MATERIALIZATION_RESULT_V2 を返し partial_failure では parent patch しない - AC8: overlap preflight 未導入時は #948 依存を要求、判定不能時は human_escalation tests/create-issue に AC1-AC8 の 56 テストを追加(negative+positive)。 SKILL.md / agent-skill-boundaries.md に executor 設計境界を記載。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Preview URLPreview removed (PR #969 closed). |
create_issue_txn が internal validator へ --kind/--title を転送する(AC3)ようになった結果、
TestRunTransactionImplementationLabels の 2 テストが placeholder title("Test Implementation
Issue" 等、"実装:" prefix なし) + 最小 body で validation に落ちるようになった。これらは label
適用ロジックの検証が目的のため、_run_issue_body_validator を monkeypatch で pass 化し、
validation gate から分離する(既存の _issue_create / _poll / _readback monkeypatch と同様の isolation)。
Allowed Paths を `.claude/skills/create-issue/tests/**` に拡張(Issue Scope Delta に人間判断を記録)。
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
pr-review-judge: APPROVE(self-authored / impl-review-loop Step 4)
NOTE: implementation-worker / pr-reviewer SubAgent は Sonnet 上限のため、Opus control-plane が pr-review-judge 基準で直接レビューした。self-authored PR につき verdict は
--commentで記録する(GitHub approval は付与しない)。
linked issue / CI
- linked issue: #946(
Closes #946)。issue-contract-review go 済み(snapshot: #issuecomment-4729331879) - CI: 全 required job green(python-test / test / typecheck / lint / build / e2e / actionlint / PR Body Japanese Check / ci-verdict-summary)。mergeStateStatus=CLEAN
AC coverage(VC pass + 意味検証)
| AC | 判定根拠(VC pass だけでなく AC 意味を検証) |
|---|---|
| AC1 | closed schema fail-closed: unknown key / dup child_id / issue_lookup.complete:false / 不正 action / 非整数 depends_on / 空 allowed_paths / AC↔VC set 不一致 / 非JSON を fallback せず拒否(negative 各々を個別 assert) |
| AC2 | render は validate_issue_body._load_required_section_labels 由来の order を使い、monkeypatch で order 変更に追従することを確認(ハードコードでない)。実 validator を --kind/--title 付きで通過 |
| AC3 | validator 呼出 argv の --kind/--title 転送を assert し、さらに kind 有無で validator 結果が変わることを behavioral に証明 |
| AC4 | depends_on→--dependency 写像と read-back(txn _readback_dependencies に委譲)。自由記述 dependency は schema 段で fail-closed |
| AC5 | parent ## Child Issues section 内で sha256 一致 + exact old_line + match_count==1 + post-edit read-back。guard 違反時は edit 未実行(section 外の同一行は誤マッチしない section-scoped 実装) |
| AC6 | 起票は txn 経由のみ。fake-gh integration で gh issue create が txn 経由でのみ到達し materializer 直呼びがないことを確認 |
| AC7 | RESULT_V2 出力、status 決定(ok/partial_failure/failed/human_escalation)、partial_failure では parent patch を試みない(gh 未呼出を assert) |
| AC8 | overlap gate: clear→続行 / deferred で #948 欠落→human_escalation / deferred+#948→続行 / undeterminable→human_escalation |
- 検証:
tests/create-issue/56 / 既存.claude/skills/create-issue/tests/243 / edit-issue 87 / 関連 scripts/tests 全 pass
設計上の判断(human merge 前に確認推奨)
- AC5/AC6 境界: issue 起票は全て
create_issue_txn.py経由(rawgh issue createなし)。parent checklist patch は materializer が行う唯一の直接gh issue editであり、txn に body-edit 経路がないため、sha256/exact-line/match-count/read-back の全ガード下で実施する設計とした。AC6 の "create/edit" は issue 起票系の raw gh 禁止と解釈し、guard 付き parent patch は対象外とした。docs に明記済み。 - Scope 拡張: AC3 の validator parity 厳格化で既存 label テスト 2件が落ちたため、人間判断で Allowed Paths を
.claude/skills/create-issue/tests/**に拡張し最小 monkeypatch で分離(Issue Scope Delta 記録)。スコープ拡張のため contract 再レビューは merge 前確認を推奨。
Verdict
APPROVE。merge-ready(Draft)。最終 merge は人間判断。
結論PR #969 は現状 PR #969 は open / draft / unmerged で、#946 を close する実装として 15 files、+1804/-5 の大きめの差分です。PR本文では 56 tests pass と各種 CI green が主張されていますが、レビューコメントは self-authored の 参照した関連文脈#946 は「delivery-rollup child materialization を create_issue_txn 正規フローへ統合する」issue で、closed child plan、canonical body render、 #946 の初期コメントでは、現状のままでは false green になるとして、validator parity、plan schema、parent patch precondition、triage-only raw path、dependency/sub-issue API 境界、Issue Forms template-driven rendering、#948 overlap preflight が blocker / high として挙げられていました。人間判断により scope 拡張が承認され、contract review は #948 は duplicate / Allowed Paths overlap preflight の issue で、 Blocker 1: escalation が混在しても
|
REQUEST_CHANGES レビューの merge 条件を反映: - Blocker1: _decide_status を created+(errors|escalations)→partial_failure に修正し、 parent patch は errors / escalation_items が空の ok のみに限定(mixed outcome で parent checklist を完了扱いにしない)。 - Blocker2: parent_body_updates 非空時に parent.body_sha256(sha256:<64hex>) を必須化。 - Blocker3: materialize(gh_bin) + CLI --gh + _default_gh_runner(gh_bin) を追加し、 実 CLI 経路(--plan-file --gh fake-gh)で create が txn 経由でのみ gh に到達することを 検査する integration test を追加。 - High1: create_issue_txn が --issue-kind 省略時に body MRC issue_kind を採用し、 明示 --issue-kind と MRC kind の矛盾を fail-closed(両空は後方互換)。 - High2: overlap.status=clear に preflight provenance(source/verdict/checked_at/ input_sha256)を必須化し、untrusted plan の bare clear を fail-closed。 - High3: parent section 検出を exact heading regex 化し 0/2件以上は fail-closed。 - Medium1: MRC を yaml.safe_dump で生成、allowed_paths/VC/title の control-char・ backtick・code-fence break-out を schema 段で拒否。 - Medium2: materializer 用 strict template loader(不在/malformed/空ラベルは fail-closed、 validator の後方互換 fallback を継承しない)。 - Medium4: create_issue_txn の partial_failure/dedupe で作成済み issue を affected_issues に 捕捉し silent loss を防止。 Medium3(dependency 失敗モード)は create_issue_txn 既存 suite の 34 テストで網羅済みのため materializer 層では委譲し、partial_failure 捕捉テストのみ追加。 既存テスト退行ゼロ: create-issue 243 / scripts-tests 318 / edit-issue+contract 130 / 新規 materializer 70。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
レビュー対応(独立レビューの Blocker / High / Medium を解消)ご指摘は全て妥当でした。self-review が見逃した実経路の穴を的確に突いており、修正しました(commit 05f691b)。 Blocker
High
Medium
検証
CI 再実行を待って再レビューします。 |
squne121
left a comment
There was a problem hiding this comment.
pr-review-judge 再判定: APPROVE(merge-ready / Draft 維持)— iteration 1
independent review の REQUEST_CHANGES(7 merge 条件)を全て解消し、各修正を名指しテストで検証した(commit 05f691b, CI 全 green / CLEAN)。
| 指摘 | 解消テスト(個別 pass 確認済み) |
|---|---|
| Blocker1 escalation混在 | test_mixed_escalation_blocks_parent_patch(partial_failure・parent gh 未呼出) |
| Blocker2 body_sha256必須 | test_parent_body_updates_require_body_sha256 / test_missing_sha_aborts_without_edit |
| Blocker3 CLI実経路 | test_cli_fake_gh_integration_real_path(--plan-file --gh fake-gh subprocess) |
| High1 MRC kind | test_adopts_mrc_kind_when_issue_kind_omitted / test_issue_kind_mrc_mismatch_fails_closed |
| High2 overlap信頼 | test_bare_clear_without_provenance_fails(provenance 必須) |
| High3 section検出 | test_old_line_only_outside_section_aborts / section exact regex |
| Medium1 escaping | test_mrc_yaml_safe_with_special_chars / VC code-fence・backtick 拒否 |
| Medium2 template | test_strict_template_loader_fails_closed_on_missing_kind |
| Medium4 capture | test_partial_failure_records_affected_issue(affected_issues) |
Medium3(dependency 失敗モード)は create_issue_txn 既存 34 テストで網羅済みのため委譲。
残存事項(human merge 前)
- これは self-review(implementation-worker / pr-reviewer SubAgent が Sonnet 上限のため Opus が直接担当)。independent deep review の再実行を merge 前に推奨する。
- #948(overlap helper 本体 / PR #967)との merge-order: 本 PR は
overlap.status: clearに provenance を要求する設計にしたため #967 未merge でも false-green を防げるが、#967 merge 後は materializer が helper を直接呼ぶ統合を follow-up で検討。
Verdict: APPROVE(merge_ready / required_auto_actions=[])。最終 merge は人間判断。
post-merge-cleanup: 完了 (2026-06-17)
実行済み(main thread)
parent / superseded / follow-up
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
schema_version: 1
materialized_by: post-merge-cleanup
follow_up_issues: []
note_only_observations:
- dedupe_key: "post-merge:squne121/loop-protocol:pr/969:stale-worktrees"
source_url: "https://github.com/squne121/loop-protocol/pull/969"
source_note_id: "1"
summary: "別 PR #957 由来の detached worktree が /tmp/loop-pr957, /tmp/loop-protocol-pr957, /tmp/loop-protocol-pr957-v2, /tmp/pr957-head に残存。本 cleanup の対象外(作成者が別)のため未削除。不要なら手動で git worktree remove 推奨。" |
概要
delivery-rollup parent の child materialization を
create_issue_txn.py正規フローへ統合する。新規 helpermaterialize_child_issues.pyがCHILD_MATERIALIZATION_PLAN_V2互換 plan を入力に取り、closed-schema 検証 → canonical body render →validate_issue_body.pyparity 通過 →create_issue_txn.py経由起票・read-back → parent checklist 安全 patch →CHILD_MATERIALIZATION_RESULT_V2出力までを決定論的に実行する。本 PR は #946 をクローズする。Closes #946
変更内容
.claude/skills/create-issue/scripts/materialize_child_issues.py(executor 本体)create_issue_txn.py— internal validator へ--kind/--titleを転送(AC3)し、--label-profile {standard,triage_only}を追加(AC6)。いずれも後方互換(既定値あり)。tests/create-issue/に AC1–AC8 対応の 56 テスト(negative + positive)と fixture を追加。SKILL.md(ステップ 4b)/agent-skill-boundaries.md(executor 設計境界)を更新。AC 対応
issue_lookup.complete:false/ 不正 action / 非整数 depends_on / 空 allowed_paths / AC↔VC 不一致 / 非JSON)test_materialize_child_issues_schema.pyISSUE_TEMPLATE/<kind>.ymlの required label order から spec-driven render し validator 通過 body のみ起票test_materialize_child_issues_body_render.pycreate_issue_txn.pyが validator に--kind/--title転送test_create_issue_txn_validator_parity.pydepends_onを--dependencyに写像し read-back。自由記述依存は fail-closedtest_materialize_child_issues_dependencies.py## Child Issuessection 内でbody_sha256/ exactold_line/expected_match_count==1/ post-edit read-back を満たす場合のみ patchtest_parent_child_section_patch.pycreate_issue_txn経由のみ(--label-profile triage_only含む)。fake-gh integration で rawgh issue create非経由を証明test_materialize_child_issues_no_raw_gh.pyCHILD_MATERIALIZATION_RESULT_V2を返しpartial_failureでは parent patch しないtest_materialize_child_issues_result_schema.pyhuman_escalationtest_materialize_child_issues_overlap_gate.py検証
uv run pytest tests/create-issue/: 56 passedpnpm typecheck/pnpm lint/pnpm build: いずれも成功pnpm test(vitest): 687 passed (38 files)pnpm run lint:docs(markdownlint / textlint): エラーなしuv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py: 21 passed設計上の判断
create_issue_txn.pyのみを経路とし、helper はgh issue createを直接呼ばない。parent checklist patch は helper が行う唯一の直接ghmutation であり、body_sha256一致 + exactold_line+expected_match_count==1+ post-edit read-back の全ガードを満たす場合に限る。partial_failureでは parent patch を行わない。depends_onに明記することを要求し、判定不能時はhuman_escalationへ落とす。Scope 拡張(人間承認済み)
AC3 で
create_issue_txn.pyが internal validator へ--kind/--titleを転送するようになった結果、同一 create-issue skill 内の既存テストTestRunTransactionImplementationLabels(2件)が無効な placeholder title/body で validation に落ちるようになった。impl-review-loop 中の人間判断(AskUserQuestion)で Allowed Paths を.claude/skills/create-issue/tests/**に拡張し、label 検証を validation gate から分離する最小 monkeypatch を追加した(Issue の Scope Delta に記録)。.claude/skills/create-issue/tests/の既存 243 件と edit-issue 87 件は全て pass。スコープ拡張のため contract 再レビューは human merge 前に確認することを推奨する。対象外(Out of Scope)
plan_child_materialization.py(producer 側)の変更