Repository navigation
docs: milestone-ops.md に M1 close 条件(descendant rollup 確認)を追記する - #1155
Conversation
fail-closed な close predicate を docs/milestone-ops.md・milestone-rollup SKILL.md・ milestone_rollup.py に統一し、descendant traversal 完全性・open blocker・partial・ warnings・defer decision の扱いを定義した。 - docs/dev/milestone-ops.md: Key Definitions / fail-closed close predicate / MILESTONE_CLOSE_DECISION_V1 スキーマ / defer 禁止リスト / 間接所属(AC5)規則を追加 - .claude/skills/milestone-rollup/SKILL.md: Close Readiness Predicate を partial/open_blocker/warnings を含む fail-closed に更新(AC6) - .claude/skills/milestone-rollup/scripts/milestone_rollup.sh: close_readiness 出力を fail-closed predicate 対応に更新 - scripts/milestone_rollup.py: depth>=1 + milestone=null を間接所属として正常扱い(AC5 fix) - scripts/tests/test_milestone_rollup.py: AC8 fixture tests 追加(open blocker / partial / warnings / valid defer / invalid defer / indirect child)、AC5 に合わせ test_milestone_null_mismatch を更新 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Preview URLPreview removed (PR #1155 closed). |
LOOP_VERDICT_V2verdict: REQUEST_CHANGES
B1: PR Body Japanese Check(CI FAILURE) CI ログ: 5 prose blocks が ratio=0.000 で per-block 判定に失敗。aggregate=0.280 は threshold を超えているが per-block チェックは block ごとに独立。CI run: https://github.com/squne121/loop-protocol/actions/runs/28135410804/job/83320998680 B2: python-test(CI FAILURE) Generate ci_test_selection/v1 artifact ステップが exit 1。ログ出力: Changed tests: 1 / Uncovered tests: 1。scripts/tests/test_milestone_rollup.py の新規テストが .github/ci/python-test-plan.json の scope に未登録と判定。pytest suite 自体(4284+10 passed)は正常通過済み。CI run: https://github.com/squne121/loop-protocol/actions/runs/28135410791/job/83320998796 B3: node-backed-hook-tests(CI FAILURE) B2 と同様の原因で Generate node-backed hook selection artifact が exit 1。CI run: https://github.com/squne121/loop-protocol/actions/runs/28135410791/job/83320998778 AC Coverage: AC1-AC7 は PR 本文 rg 自己申告(baseline_fail_expected/go)、AC8 pytest 96 passed(coverage gate B2 解消が必要)、AC9 pnpm typecheck/lint/test/build CI PASS。 Allowed Paths Gate: 全 5 ファイルが contract Allowed Paths 内。contract fingerprint 一致確認済み。 |
…lestone-close-predicate
LOOP_VERDICT_V2verdict: REQUEST_CHANGES
B1(PR Body Japanese Check): RESOLVED — PR Body Japanese Check が SUCCESS に転換(iteration 1 修正が有効)。 B2(python-test Uncovered tests): RESOLVED — python-test ジョブの Generate ci_test_selection/v1 artifact が SUCCESS。scripts/tests/test_milestone_rollup.py の python-test-plan.json 登録により解消。 B3(node-backed-hook-tests): 未解消 — 根本原因は B2 と異なる。node-backed-hook-tests ジョブは generate_ci_test_selection_artifact.py を plan=None で呼び出し、PR diff から変更テストを独立検出する。scripts/tests/test_milestone_rollup.py が git diff に含まれるため「Changed tests: 1 / Uncovered tests: 1」が発生。python-test-plan.json への登録は python-test ジョブの coverage gate のみを解消し、node-backed-hook-tests ジョブの coverage gate には影響しない。main 最新 run(28134794664)では node-backed-hook-tests が PASS しており、この失敗は本 PR が導入したもの。 B4(BEHIND): RESOLVED — merge_state_status が BEHIND から UNSTABLE に改善。 修正方針の示唆(参考): node-backed-hook-tests ジョブは .claude/hooks/tests/ 配下のテストを対象とし、scripts/tests/ 配下のテストを node-backed ではないと識別できれば coverage check から除外できる可能性がある。あるいは generate_ci_test_selection_artifact.py の scope 設定で scripts/tests/ を python-test 側として扱う設定が必要と考えられる。実装判断は implementation-worker に委ねる。 AC Coverage: AC1–AC8 は iteration 0 時点で確認済み(iteration 1 変更は .github/ci/python-test-plan.json のみの追加で既存 AC 実装に影響なし)。B3 解消が merge-ready の唯一の残存条件。 |
…enerator node-backed-hook-tests ジョブの generate_artifact() は plan=None で呼び出されていたため、 scripts/tests/test_milestone_rollup.py を uncovered として誤検出していた。 修正内容: - generate_ci_test_selection_artifact.py: pytest_args かつ plan が両方提供された場合に plan targets を secondary coverage(cross-job coverage)として参照する。 changed_test_files のうち primary collected_test_files にも plan targets にも 含まれないファイルのみを uncovered とする。 - .github/workflows/ci.yml: node-backed-hook-tests ジョブの "Generate node-backed hook selection artifact" ステップで args.plan を None から ".github/ci/python-test-plan.json" に変更。
LOOP_VERDICT_V2verdict: APPROVE B3 解消確認(iteration 2) 修正 1: generate_ci_test_selection_artifact.py に pytest_args と plan の両方が提供された場合に plan targets を cross-job secondary coverage として参照するロジックを追加。scripts/tests/test_milestone_rollup.py は plan の targets に exact match し uncovered として扱われない。secondary coverage は best-effort(exception silent pass)で primary gate の fail-closed 性は維持される。 修正 2: .github/workflows/ci.yml の node-backed-hook-tests ジョブで plan=None を plan=".github/ci/python-test-plan.json" に変更。同ジョブは pytest_args を hardcoded list で提供しているため secondary coverage 条件(pytest_args AND plan の両方提供)が満たされ cross-job coverage が有効になる。 CI 証跡(head_sha 一致確認済み) CI run 28137240807 の head_sha: 54f4f5d(期待 SHA と一致):
AC Coverage AC1–AC8 は iteration 0 で確認済み。iteration 2 変更は AC1–AC8 の実装に影響を与えない。AC9 standard gates は CI CLEAN により確認済み。 Allowed Paths Gate 8 ファイル全て contract Allowed Paths 内。Scope Delta B2: .github/ci/python-test-plan.json、Scope Delta B3: .claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py および .github/workflows/ci.yml を含む。contract fingerprint sha256:5b4004d01f9b6605f87a5a4e5a613f04df0d27d20a0e390a4c09de2e7caee332 は contract snapshot #4792673018 と一致。 |
判定:
|
…s + shell + tests
LOOP_VERDICT_V2\n\nverdict: APPROVE\nreviewed_head_sha: 260cdcd\nmerge_ready: true\nmergeability:\n mergeable: MERGEABLE\n merge_state_status: CLEAN\nblockers: []\nrequired_auto_actions: []\nauto_fix_applied: []\nfollow_up_issue_requests: []\nallowed_paths_gate:\n status: ok\n all_files_within_allowed_paths: true\n producer_role: review_subagent\n worker_report_used_as_canonical: false\n contract_source_kind: issue_comment\n contract_source_id: 4792673018\n expected_contract_fingerprint: sha256:5b4004d01f9b6605f87a5a4e5a613f04df0d27d20a0e390a4c09de2e7caee332\n\nB1-B4 and H1-H3 all resolved. AC1-AC9 verified. CI CLEAN. All 10 changed files within Allowed Paths. |
Summary
docs/dev/milestone-ops.mdに fail-closed な close predicate(descendant traversal 確認)を追記し、milestone-rollupskill・shell script・Python checker の close predicate を統一した。OWNER iter3 レビュー指摘(B1〜B4・H1〜H3)を全て解消した。
evaluate_close_readiness()をscripts/milestone_rollup.pyに production 関数として追加し、shell からその戻り値で close_judgment を決定するvalidate_defer_decision()/evaluate_close_readiness()をテストファイル内再実装から本番モジュールへ移動し、テストはmr.evaluate_close_readiness()/mr.validate_defer_decision()を直接呼ぶclosure_followups/defer_records/scope_conflict_countをMILESTONE_DESCENDANT_ROLLUP_V1に追加し、--parent-issue引数でMILESTONE_CLOSE_DECISION_V1を fetch・検証するschema_change: trueに変更し Consumer Inventory を追加assignment_readback_complete=falseとして close 不可とするassignment_drift_listフィールドを追加し、scope_conflict_countを summary に追加generate_ci_test_selection_artifact.pyにsecondary_coverage_provider_job/cross_job_covered_test_files/secondary_coverage_errorフィールドを追加変更内容
scripts/milestone_rollup.py(B1・B2・B3 実装)evaluate_close_readiness(report) -> tuple[bool, list[str]]を production 関数として追加open_issues == 0、pr_mixed_count == 0、partial == false、warnings == []、open_blocker_count == 0、scope_conflict_count == 0(AND 条件・fail-closed)validate_defer_decision(defer) -> tuple[bool, list[str]]を production 関数として追加destination.issue必須、destination.milestone任意--parent-issue Nを追加(optional)MILESTONE_CLOSE_DECISION_V1YAML を fetch しdeferredリストを抽出・検証analyze()にscope_conflict_count(depth >= 1 の milestone_mismatches 数)を返すよう追加build_report()にclosure_followups・defer_recordsパラメータを追加summaryにscope_conflict_countフィールドを追加scripts/tests/test_milestone_rollup.py(B2 実装)_is_close_judgment_available()モジュールレベル関数を削除_validate_defer_decision()モジュールレベル関数を削除TestClosePredicateFixturesクラスをmr.evaluate_close_readiness()/mr.validate_defer_decision()を直接呼ぶよう更新TestEvaluateCloseReadinessクラスを新規追加(9 テスト)TestValidateDeferDecisionクラスを新規追加(12 テスト)TestShellE2Eクラスを追加(E2E 構造テスト・GitHub API 不要部分のみ・skip 付き).claude/skills/milestone-rollup/scripts/milestone_rollup.sh(B1・H1・H2 実装)assignment_readback_complete=falseとして close 不可扱いuv run python3でevaluate_close_readiness()を呼び出し close_judgment を決定assignment_readback_complete/assignment_drift_listを追加.claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py(H3 実装)secondary_coverage_provider_job: str | Noneフィールドをアーティファクトに追加cross_job_covered_test_files: list[str]フィールドを追加secondary_coverage_error: str | Noneフィールドを追加.claude/skills/pr-review-judge/tests/test_generate_ci_test_selection_artifact.py(H3 テスト).github/ci/python-test-plan.json.claude/skills/pr-review-judge/tests/を targets に追加登録Checks
uv run pytest scripts/tests/test_milestone_rollup.py -q→ 124 passed, 1 skippeduv run pytest .claude/skills/pr-review-judge/tests/test_generate_ci_test_selection_artifact.py -q→ 4 passedpnpm typecheck→ PASS(前 iteration で確認済み)pnpm lint→ PASS(前 iteration で確認済み)pnpm test→ PASS(前 iteration で確認済み)pnpm build→ PASS(前 iteration で確認済み)Schema Change Applicability
MILESTONE_DESCENDANT_ROLLUP_V1にclosure_followups・defer_records・scope_conflict_countフィールドを追加(additive・後方互換)。ci_test_selection/v1artifact にsecondary_coverage_provider_job・cross_job_covered_test_files・secondary_coverage_errorフィールドを追加(additive・後方互換)。Schema Consumer Inventory
before
MILESTONE_DESCENDANT_ROLLUP_V1にclosure_followups・defer_records・scope_conflict_countフィールドなし。ci_test_selection/v1にsecondary_coverage_provider_job・cross_job_covered_test_files・secondary_coverage_errorフィールドなし。after
MILESTONE_DESCENDANT_ROLLUP_V1にclosure_followups: list・defer_records: list・summary.scope_conflict_count: intを追加。ci_test_selection/v1にsecondary_coverage_provider_job: str|null・cross_job_covered_test_files: list・secondary_coverage_error: str|nullを追加。scripts/milestone_rollup.py.claude/skills/milestone-rollup/scripts/milestone_rollup.shevaluate_close_readiness()呼び出し元.claude/skills/milestone-rollup/SKILL.mdMILESTONE_CLOSE_DECISION_V1(docs/dev/milestone-ops.md)--parent-issueで fetch のみ.claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py.github/ci/python-test-plan.jsoncheck_pr_review_gates.py(該当時)Safety Claim Matrix
closure_followups・defer_recordsはデフォルト[]、scope_conflict_countはデフォルト 0evaluate_close_readinessは fail-closedNotes
.claude/skills/pr-review-judge/tests/を Allowed Paths に追加(新規テストファイル配置に必要)--parent-issueで fetch した defer 検証の fail-close 連動・live shell E2E テスト(GitHub API 依存)は follow-up とする🤖 Claude Code で生成