Repository navigation
実装: check_agy_causal_claim_drift.pyをCI required checkとして統合する - #1790
Merged
Merged
Conversation
Issue #1778 (PR #1780) で追加された scripts/check_agy_causal_claim_drift.py が CI workflow から一切呼び出されておらず required check として機能して いなかった問題を解消する。 - check_agy_causal_claim_drift.py に --apply-baseline フラグを追加 (検出ロジック自体は不変。既存 54 件の drift を _CI_GATE_BASELINE_KEYS として許容し、新規 drift のみを fail-close する baseline snapshot 方式) - .github/workflows/ci.yml に agy-causal-claim-drift-gate job を追加し ci-verdict-summary の needs に統合 - scripts/tests/test_check_agy_causal_claim_drift_ci_gate.py を新規追加 (AC4: 意図的な drift fixture で fail-close / AC5: clean fixture で pass / 実リポジトリで baseline 適用時に無関係な PR をブロックしないことを検証) - docs/dev/ci-operations.md に Section 8.3 (採用方針・fail-close 対応手順) を追加 Scope Delta (Allowed Paths 外だが AC6 に必須と判明したため追加、Issue 本文 に判断根拠を記載済み): - .claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py: CLASSIFICATION_MAP/REQUIRED_CHECKS に新 check を登録 (未登録だと classification: unknown で常時 blocking になり AC6 が成立しない) - 対応する契約テストの fixture 更新 - .github/ci/python-test-plan.json に新規テストファイルを登録 Closes #1788 Co-Authored-By: Claude Sonnet 5 <[email protected]>
#1788) check_agy_causal_claim_drift.py の --apply-baseline が manifest に追加した 3つの任意 top-level field (baseline_applied / baseline_count / new_finding_count) を、additionalProperties: false の共有 schema (audit_agy_auth_surface.py と共有) に追加登録する (Scope Delta、Issue 本文に 判断根拠を記載済み)。全て optional のため additive/backward-compatible。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Preview URLPreview removed (PR #1790 closed). |
- docs/dev/ci-operations.md: 既存の非 canonical 英語見出し 17 ブロックに 日本語併記を追加し、whole-file 日本語比率チェック(PR Body Japanese Check)を通過させる。本文の意味・構成は変更しない。 - .github/ci/python-test-plan.json: test_baseline_vc_preflight.py:: test_issue_393_snapshot_fixture_processed が 4-way xdist の CPU 飽和下で 90s subprocess timeout に達して flake するため、ファイル全体を parallel_exclude(serial lane, -n 0)へ移動した。検出ロジック・テスト 内容は不変(serial 実行では 139 passed / 1 skipped で安定)。 - scripts/ci/tests/test_python_test_plan.py: 上記 parallel_exclude 追加を 反映して契約テストの期待値を更新した。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
squne121
commented
Jul 26, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: "3ac571caa616b6d6dc85b97c9e831216249fa5ab"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
notes: "変更9ファイルは Issue #1788 の Allowed Paths + 事前宣言済み Scope Delta(4ファイル)に一致。scripts/ci/tests/test_python_test_plan.py への差分は CI green化のための parallel_exclude 追加のみで、機能ロジックへの影響なし。"Evidence Summary
- CI:
ci_verdict_summary.py --pr 1790 --expected-head-sha 3ac571ca...→status: all_pass、failed_checks: []、pending_checks: []、stale_checks: []。head_sha 一致(stale なし)。agy-causal-claim-drift-gateとci-verdict-summaryを含む全 19 チェック中 evaluated 14 pass / excluded 5(Japanese Check retrospective 系・deploy-main・cleanup-pr は仕様上 skip)。 - Mergeability:
mergeable: MERGEABLE,merge_state_status: CLEAN。git merge-base --is-ancestor origin/main <head>で PR branch が最新 main を包含していることを確認(BEHIND ではない、update_branch 不要)。 - AGY causal-claim drift gate の fail-close 挙動を独立検証(既存テストの存在確認だけでなく実挙動):
scripts/tests/test_check_agy_causal_claim_drift_ci_gate.py3件を実行 → 3 pass(AC4 drift fixture exit1 / AC5 clean fixture exit0 / AC3 real-repo baseline exit0・raw exit1一致)。- さらに control-plane 独自の adversarial fixture(Issue #7777 の未SUPERSEDED drift claim、テストファイルとは無関係に新規作成)で検証:
--apply-baselineなし・ありの両方でexit code 1、new_finding_count: 1を確認。baseline 機構が「既存54件は許容し新規driftのみblockする」という設計通りに機能することを、テストコードに依存せず直接確認した。 .github/workflows/ci.ymlのagy-causal-claim-drift-gatejob 定義を実ファイルで確認: pytest統合テスト実行後にcheck_agy_causal_claim_drift.py --apply-baselineを実行する構成。ci-verdict-summaryのneeds:list に含まれ、ci_verdict_summary_v2.pyのCLASSIFICATION_MAP/REQUIRED_CHECKSにもrequiredとして登録済み(B5 ルールのunknown化を回避)。
- AC1-AC7 全件、issue #1788 contract と照合し個別に確認:
- AC1/AC7:
docs/dev/ci-operations.mdSection 8.3「AGY causal-claim drift gate 採用方針」に採用方針・判断根拠・fail-close時対応手順を確認。 - AC2:
ci.ymlに実行 step 存在を確認。 - AC3: 実リポジトリに対する
--apply-baseline実行が exit0(既存54件 baseline 内)であることを既存テストで確認。 - AC4/AC5: 上記の通り。
- AC6:
ci-verdict-summaryneeds 統合 + 集約ロジック登録を確認。
- AC1/AC7:
- Schema Consumer Inventory:
AGY_CAUSAL_CLAIM_MANIFEST_V1への3 optional field追加(baseline_applied/baseline_count/new_finding_count)を実diffで確認。additive・後方互換の記述が実装と一致。 - Safety Claim Matrix:
.claude/skills/**差分を含むため safety-sensitive 判定。matrix 記載あり。Not controlledの1件(branch protection required check 一覧への追加は人間の repo 設定変更が必要)は Issue #1788 Out of Scope に明記された既知の制約で、follow-up不要と判断(人間が branch protection 設定を別途行う前提)。 - Scope: 変更ファイル9件は Allowed Paths + Issue本文に事前宣言済みの Scope Delta 4件と完全一致。無関係な混入なし。
Blockers なし。required_auto_actions なし。Draft 状態解除後、squash merge 可能。
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
scripts/check_agy_causal_claim_drift.pyを、CI required check として.github/workflows/ci.ymlのci-verdict-summary集約 job に統合した。実測 54 件の既存 drift finding は baseline snapshot 方式(--apply-baselineフラグ)で許容しつつ、新規 drift のみを fail-close する。Checks
pnpm typecheckpnpm lintpnpm test(変更対象外のため未実行。ローカルpytestfull run で 9419 passed / 1 failed。失敗は本 PR と無関係な既存環境依存の local-only テスト、詳細は Notes for Reviewer 参照)pnpm build(フロントエンド未変更のため未実行。CI 上のbuildjob で検証)Schema Change Applicability
schema_changeAGY_CAUSAL_CLAIM_MANIFEST_V1(.claude/skills/gemini-cli-headless-delegation/schemas/agy_causal_claim_manifest_v1.schema.json)に、check_agy_causal_claim_drift.pyの--apply-baselineが出力する 3 つの任意 top-level field(baseline_applied/baseline_count/new_finding_count)を追加登録した。Schema Consumer Inventory
変更対象 schema:
AGY_CAUSAL_CLAIM_MANIFEST_V1before/after 差分:
Consumer 列挙(rg コマンド例と結果):
$ rg -l "agy_causal_claim_manifest_v1|AGY_CAUSAL_CLAIM_MANIFEST_V1" .claude scripts docs .github .claude/skills/gemini-cli-headless-delegation/schemas/agy_causal_claim_manifest_v1.schema.json .claude/skills/gemini-cli-headless-delegation/scripts/audit_agy_auth_surface.py scripts/check_agy_causal_claim_drift.py scripts/tests/test_check_agy_causal_claim_drift.py scripts/tests/test_check_agy_causal_claim_drift_ci_gate.py docs/dev/ci-operations.md .github/workflows/ci.ymlConsumer 更新状況:
agy_causal_claim_manifest_v1.schema.jsonaudit_agy_auth_surface.py--apply-baselineを持たないため新 field を出力しないcheck_agy_causal_claim_drift.py--apply-baseline時のみ新 field を出力する producer 本体test_check_agy_causal_claim_drift.py(既存)--apply-baselineを使わない既存テストは影響なし(8 test 全 pass 確認済み)test_check_agy_causal_claim_drift_ci_gate.py(新規)ci.yml/ci-operations.mdCompatibility Decision(互換性判定)
additivebackward_compatiblenoN/Arequiredに含めない optional field であり、--apply-baselineを渡さない既存呼び出し(既存test_check_agy_causal_claim_drift.pyの呼び出し含む)は一切影響を受けない。Safety Claim Matrix
agy-causal-claim-drift-gatejob が失敗するとci-verdict-summaryのoverall_statusがmerge_readyにならない(REQUIRED_CHECKS/CLASSIFICATION_MAP登録による).claude/skills/pr-review-judge/scripts/tests/test_ci_verdict_summary_v2.py::test_all_required_success_is_merge_ready/test_unknown_check_blocks_merge_ready(pass)check_agy_causal_claim_drift.pyは--apply-baselineなしでは Issue #1778 時点と完全同一の fail-closed 挙動を維持する(検出ロジック不変)scripts/tests/test_check_agy_causal_claim_drift.py(既存 8 test 全 pass)CI_TEST_PERFORMANCE_DECISION_V1(Issue #1788 の CI テストパフォーマンス判断根拠)
Runtime 実測:
scripts/check_agy_causal_claim_drift.py --apply-baselineはローカルで <100ms(stdlib のみ、外部依存なし)。CI 上のagy-causal-claim-drift-gatejob の大半はuv syncセットアップ時間であり、これは既存python-testjob と共通。20-run baseline 計測は本 PR のスコープ外(新規 job のため既存 baseline が存在しない。performance claim は行わない =claim.kind: none相当)。Notes for Reviewer(レビュアー向け補足)
docs/dev/ci-operations.mdSection 8.3 に記載(要約: 既存 54 件は 2 ファイルに集中し、各コメントの現況再調査を要する「修正済み」は別スコープの作業になる。diff-scoped は既存 54 件を実質永久放置する点で baseline と実効性が変わらず実装コストが増えるだけ)。.claude/skills/pr-review-judge/scripts/ci_verdict_summary_v2.py/ その contract test /.github/ci/python-test-plan.json/agy_causal_claim_manifest_v1.schema.jsonを Allowed Paths 外で追加変更した。理由は各ファイルで PR diff コメント相当のコミットメッセージに記載。特にci_verdict_summary_v2.pyへのREQUIRED_CHECKS/CLASSIFICATION_MAP登録は、新規 CI job をci-verdict-summaryのneeds:に加える場合に必須(未登録だとclassification: unknownで success でも恒久的に blocking になる B5 ルールがあるため)。--apply-baselineを付けない場合、check_agy_causal_claim_drift.pyの挙動・exit code は Issue 実装: AGY auth surfaceと因果主張のmachine-readable baselineを追加する #1778 時点から一切変更していない(test_check_agy_causal_claim_drift.py既存 8 test 全 pass で確認済み)。--apply-baselineはオプトインの exit-code フィルタのみを追加する。scripts/tests/test_check_agy_causal_claim_drift_ci_gate.py::test_drift_gate_does_not_block_unrelated_prは、実リポジトリに対して (a)--apply-baselineありで exit 0(無関係な PR をブロックしない)、(b)--apply-baselineなしで exit 1 かつ全 findings 数が baseline_count と一致(検出ロジック自体は変わっていない)ことの両方を検証している。pytestfull run(.github/ci/python-test-plan.jsonの対象全体、9419 test): 9419 passed / 1 failed。失敗はtests/context_mode/test_fetch_strict_artifact.py::test_artifact_head_sha_matches_git_headで、これはCI=trueで自動 skip される local-only テスト(stale local artifact head_sha に起因、本 PR の変更対象と無関係)。CI 上ではこのテストは skip される。docs/dev/ci-operations.mdSection 8.3 に明記した。Notes