Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Ruff の rule 設定を pyproject.toml に集約し、既存 CI の検査対象 path 集合を固定したまま CLI rule override を排除する"
change_kind: tooling-and-docsParent Issue
なし(単独改善。CI current-state projection verifier は別 Issue で管理する)
Parent Goal Ref
Ruff の設定 authority を pyproject.toml に一本化し、CI の Ruff 実行が同一の対象 path 集合を検査し続けること。
Current Validated Scope
- 現行 workflow は
.claude/scripts scripts schemas .claude/skillsを対象に、--select E,F --ignore E402を CLI で指定している。 - 現行
pyproject.tomlは line length を持つが、Ruff rule selection と E402 exception policy を authority としては持たない。
Remaining Parent Gaps
- CI topology、dedicated coverage、stable phase inventory、docs/Skill projection の current-state manifest は本 Issue の対象外とし、依存 Issue 完了後の別 Issue で扱う。
Outcome
Ruff の E/F rule selection と E402 exception policy を pyproject.toml に集約し、CI は既存の対象 path 集合を変えずに設定由来の ruff check を実行する状態になる。
In Scope
pyproject.tomlの[tool.ruff.lint]に E/F rule selection を定義する。- global
E402ignore を除去し、例外が必要な場合だけ具体的 file path に限定する。 - workflow の Ruff step から
--selectと global--ignore E402を除去し、対象 path 集合.claude/scripts scripts schemas .claude/skillsを維持する。 scripts/ci/verify_ruff_configuration.pyと fixture-driven negative tests で、設定 authority・対象 path・CLI rule override を検証する。- canonical Skill の Ruff 実行例を設定由来の command に更新し、旧 CLI rule override を再導入しない。
Out of Scope
- CI job topology、pytest invocation、dedicated coverage、stable phase inventory の検証。
- CI current-state manifest と docs/Skill projection verifier。
- Ruff rule category の E/F 以外への拡張。
Acceptance Criteria
- AC1:
[tool.ruff.lint].selectがEとFだけを設定 authority として定義する。 - AC2: workflow の Ruff step は
--selectと global--ignore E402を持たず、対象 path 集合を変更しない。 - AC3: global E402 ignore は存在せず、例外を追加する場合は具体的 file path と E402 だけに限定する。
- AC4: verifier は設定 authority の欠落、workflow の CLI rule override、対象 path の変更、不正な E402 exception を安定した failure key で拒否する。
- AC5: verifier の negative fixture tests と既存対象 path に対する Ruff gate が成功する。
- AC6:
.claude/skills/ci-test-performance/SKILL.mdの Ruff 実行例がpyproject.tomlを設定 authority とし、--select E,Fと--ignore E402を含まない。
Verification Commands
# AC1
# preflight-scope: pr_review_only
$ uv run --locked python3 scripts/ci/verify_ruff_configuration.py --root .# AC2
# baseline-expect: fail
$ uv run --locked pytest scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_workflow_cli_rule_override# AC3
# baseline-expect: fail
$ uv run --locked pytest scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_global_e402_ignore# AC4
# baseline-expect: fail
$ uv run --locked pytest scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_changed_target_paths# AC5
# preflight-scope: pr_review_only
$ uv run --locked ruff check .claude/scripts scripts schemas .claude/skills# AC6
# baseline-expect: fail
$ uv run --locked pytest scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_skill_cli_rule_overrideAllowed Paths
- pyproject.toml
- .github/workflows/ci.yml
- scripts/ci/verify_ruff_configuration.py
- scripts/ci/tests/test_verify_ruff_configuration.py
- scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_workflow_cli_rule_override
- scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_global_e402_ignore
- scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_changed_target_paths
- .claude/skills/ci-test-performance/SKILL.md
- scripts/ci/tests/test_verify_ruff_configuration.py::test_rejects_skill_cli_rule_override
Runtime Verification Applicability
decision: not_applicable
reason: 本 Issue の受け入れ条件は repository-local verifier、fixture tests、Ruff gate で検証でき、外部 runtime 環境を必要としない。Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- E/F 以外の Ruff rule category を追加する必要が判明した場合。
- CI topology、pytest invocation、dedicated coverage、stable phase inventory の契約変更が必要になった場合。
- CI current-state manifest または docs/Skill projection verifier の実装が必要になった場合。
- 既存対象 path に baseline Ruff violation があり、設定移管だけでは解消できない場合。
Required Skills
ci-test-performance
Required Design References
docs/dev/workflow.mddocs/dev/test-lane-policy.md.claude/skills/ci-test-performance/SKILL.md
Scope Delta
reason: OWNER anchor comment の責務分離に従い、Ruff設定SSOT化を独立した1 Issue = 1 PRへ狭める。
removed_scope:
- CI current-state manifest
- docs/Skill projection verifier
- job topology と dedicated coverage
follow_up_destination: Issue #1782(依存 #1725/#1760/#1761/#1762 の merge 後に着手)Notes for Reviewer
- Anchor comment: 実装: Ruff設定をpyproject.tomlへ集約し対象path集合を維持する #1764 (comment)
- CI Ruff step の対象 path 集合は変更しない。対象拡大は別 Issue として baseline migration plan を伴う。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jul 26, 2026
判定
REQUEST_CHANGES — 現状の Issue 契約では実装着手不可です。
方向性自体は妥当です。Ruff のルール指定を
pyproject.tomlに集約し、workflow・計画ファイル・運用文書間の不整合を検出する狙いには価値があります。しかし現在の #1764 は、依存関係、verifier の責務境界、Acceptance Criteria の検証強度が不足しており、このまま実装すると「SSOT化のための verifier が複数の新しい正本を生む」可能性があります。Issue 本体にはコメントがなく、まだ契約レビューによる修正が入っていません。ブロッカー
P0-1: 依存 Issue がすべて open なのに、着手禁止が機械契約化されていない
#1764 は #1725 → #1760 → #1761 → #1762 の完了後に実施する順序を Notes に書いていますが、
depends_onやreadiness: blockedのような機械可読な制約がありません。しかも #1725、#1760、#1761、#1762 はすべて現在 open です。これは単なる実施順序ではありません。
したがって、先に #1764 を実装すると、直後に verifier の期待値が全交換されます。
修正要求
さらに、単なる Issue close ではなく、対応PRの merge commit が現行
mainの ancestor であることを着手条件にしてください。P0-2: #1760・#1762 と verifier の責務が重複している
#1760 は
verify_python_test_lane.pyにより、job 欠落、Node/Codex 再混入、plan 外 pytest invocation を拒否する予定です。#1762 はverify_python_test_inventory.pyと provider artifact により、dedicated target、未分類・重複分類、cross-job coverage を拒否する予定です。一方、#1764 の AC5 は、新しい
verify_ci_test_performance_contract.pyでも以下を検査するとしています。これは同じ不変条件を3本の verifier が所有する設計です。しかも #1764 の Allowed Paths には、#1760・#1762 が追加する verifier 自体が含まれないため、共通化や責務移管もできません。
修正要求
#1764 の verifier は次の範囲だけに限定すべきです。
pyproject.toml由来であることjob topology や dedicated coverage の判定ロジックを再実装してはいけません。
P0-3: Verification Commands が Acceptance Criteria を証明していない
現在の検証は、ほぼすべて文字列の存在確認です。例えば以下は証明になりません。
rg -n "dedicated" verifier.pyrg -n "stable_phase" verifier.pytest -f verifier.pyrg -c "1080" docs/...rg -n "actionlint" ci.ymlrg -n "per-file-ignores" pyproject.tomlリポジトリ内には既に、任意の fixture root に対して純粋な violation collector を実行し、安定した failure key と非ゼロ終了コードを返す実装パターンがあります。新しい verifier もこの形式に合わせるべきです。
最低限必要な検証
uv run --locked python scripts/ci/verify_ci_test_performance_contract.py --root . uv run --locked pytest -q scripts/ci/tests/test_verify_ci_test_performance_contract.py uv run --locked ruff check .claude/scripts scripts schemas .claude/skills actionlint .github/workflows/ci.ymlnegative fixture は、期待する failure key と終了コードまで検査してください。
重要指摘
P1-1: Ruff command を裸の
ruff checkにすると検査対象が変わる現行 workflow は、次の4領域だけを検査しています。
さらに
--select E,F --ignore E402をCLIに埋め込んでいます。Ruff ではCLI指定が設定ファイルより優先され、コマンドに渡すpathがファイル探索範囲を決めます。したがって、ルール指定を
pyproject.tomlに移すことと、path引数を削除することは別変更です。裸のruff checkへ変更すると、意図せず検査対象が拡大・変化する可能性があります。([Astral Docs]1)推奨 command
Issue の AC に「Ruffの対象path集合は変更しない」を追加してください。対象拡大を意図するなら、別Issueで baseline violation と migration plan を扱うべきです。
P1-2:
per-file-ignoresの存在を必須化してはいけないIssue 本文は「必要な場合だけ具体的ファイル単位」と書いていますが、AC3 の検証は
per-file-ignoresの存在を無条件に要求しています。現行コードでは、import path調整が必要な箇所に既にインラインの
# noqa: E402を使っている例があります。例えばverify_lane_union.pyはsys.path.insert後のimportを明示的に抑制しています。Ruff の
ignoreとper-file-ignoresは別設定であり、無条件に per-file table を作る必要はありません。([Astral Docs]2)修正版AC
lint.ignoreにE402が存在しないper-file-ignoresは0件でもよいE402のみに限定**/*.py = ["E402"]のような実質global ignoreは禁止P1-3: Markdown prose を直接「契約」にする設計は脆い
現在の
docs/dev/test-lane-policy.mdと Skill は、Current Implementation と Target Policy を同一文書内に持っています。しかも #1080 を将来実装とする記述が残っていますが、#1080 は既に completed で、Claude/Codex双方のhook、schema、testが実装されています。また、Skill には固定workerが4である現行実装と、
-n autoを推奨する古いTarget Policyが混在しています。任意の日本語Markdownを正規表現で解析する verifier は、表現変更だけでCIを壊します。
推奨構造
docs と Skill は、このmachine-readable stateへのリンクまたは生成済みprojectionにしてください。「workflow・plan・docs・SkillのすべてがSSOT」は成立しません。正本は領域ごとに1つで、残りはconsumerです。
補足として、
.agents/skills/ci-test-performance/SKILL.mdは本文の複製ではなく、.claude側のcanonical Skillを読む薄いbridgeでした。このファイルを同期対象へ追加する必要はありません。P1-4: stable phase inventory の「欠落・余剰」の意味が未定義
docs/dev/ci-performance.mdの stable phase table は、python-testの主要phaseを列挙しています。一方、実際のnode-backed-hook-testsjob は、hook adapter、initial branch、xdist、Node debounceなど複数の追加phase_idを出力していますが、stable tableは一部しか載せていません。したがって AC6 の「欠落・余剰を拒否」は、次のどちらなのか決める必要があります。
phase_idの完全inventory現在の文書は後者に見えますが、Issueは前者のように読めます。このまま実装すると、既存workflowが即座に違反するか、verifierが都合よく一部を無視することになります。
スコープ再設計
#1764 は二つに分割するのが妥当です。
Issue A: Ruff設定SSOT化
依存Issueを待たず実施可能です。
[tool.ruff.lint].select = ["E", "F"]E402ignore削除--select/--ignoreを削除Issue B: CI current-state projection verifier
#1725/#1760/#1761/#1762 のmerge後にのみ着手します。
これにより、Ruff設定の小さい変更と、CI topology全体の契約固定を独立してレビュー・ロールバックできます。
actionlint の位置づけ
actionlintは workflow syntax、式、action input/output、shell script等の静的検査には有効ですが、python-test-planとdocsの一致や、専用jobが本当に特定テストを実行するかといったリポジトリ固有の意味論までは証明しません。したがって actionlint とcustom verifierは併用が必要です。([GitHub]3)AC10 は文字列検索ではなく、以下を要求すべきです。
actionlint .github/workflows/ci.yml uv run --locked python scripts/ci/verify_ci_test_performance_contract.py --root .GitHub Actions の job は順序付きstep群として構成されるため、workflow verifierはファイル全体のgrepではなく、YAML ASTから対象jobと各stepの
uses/runを検査する設計が適切です。([GitHub Docs]4)最終提案
Issue #1764 は現時点では
phase/implementationではなく、依存完了待ちのblocked/refinement状態へ戻すべきです。最低限、次を直すまで実装エージェントへ渡してはいけません。per-file-ignoresを条件付きに修正契約品質は現状 3/10、技術的方向性は 8/10です。 問題は目的ではなく、実装順序と検証アーキテクチャです。
squne121 commentedon Jul 26, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
[-]実装: Ruff設定をpyproject.tomlへ集約しCI test-lane contract parity verifierを追加する[/-][+]実装: Ruff設定をpyproject.tomlへ集約し対象path集合を維持する[/+]squne121 commentedon Jul 26, 2026
Issue Refinement: OWNER 推奨アクションを適用
mainの ancestor になるまで実装を開始しません。squne121 commentedon Jul 26, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jul 26, 2026
利用者の継続指示に基づき、レビュー再開に必要な契約修正を適用しました。
Runtime Verification Applicabilityをnot_applicableとして明示しました。preflight-scope: pr_review_onlyにし、fixture の pytest node IDs には# baseline-expect: failを付与しました。validate_issue_bodyと静的 readiness preflight でgoです。次に anchor 付き preflight と independent review を再実行します。
squne121 commentedon Jul 26, 2026
Contract Review Result
squne121 commentedon Jul 26, 2026
Contract Review Result
squne121 commentedon Jul 26, 2026
Contract Review Result
squne121 commentedon Jul 26, 2026
Contract Review Result
fix: Ruff 設定 authority verifier を強化する (#1764)
squne121 commentedon Jul 26, 2026
Contract Review Result
fix(ci): Ruff設定検証をcurrent workflowに同期する (#1764)
squne121 commentedon Jul 26, 2026
TEST_VERDICT_MACHINE:
schema: TEST_VERDICT_MACHINE/v2
issue_number: 1764
pr_number: 1784
reviewed_head_sha: 0107e32
contract_body_sha256: sha256:dd147b8f6471487b43d3dc91b107d4ee97136eb82c417b7f65228abfe4b13b55
overall_result: PASS
CI_CHECK_RUN_SCOPED: {run_id: 30202791964, conclusion: success}
ALLOWED_PATHS_GATE_RESULT_V1: {status: PASS}
squne121 commentedon Jul 26, 2026
Contract Review Result
fix(ci): Ruff authority verifierをfail-closed化 (#1764)
squne121 commentedon Jul 26, 2026
Contract Review Result
feat(ci): Ruff設定をpyprojectへ集約 (#1784)
squne121 commentedon Jul 26, 2026
post-merge-cleanup: partial
PR #1784 の merge 後 cleanup を実行しました。worktree/branch の削除は executor が fail-closed で拒否したため、未実施です。
親 Issue はありません。
linked:issue/1764検索の open PR 候補は本文上の Closes binding を確認できないため、close/comment を行っていません。squne121 commentedon Jul 26, 2026
post-merge-cleanup: resolved
人間判断に基づき、PR #1784 の残存 worktree/branch を sanctioned
cleanup_execで整理しました。.claude/tmpの残留物は削除していません。