Repository navigation
feat: Python 運用基盤整備 (pyproject.toml + uv.lock + python-test CI job) - #58
Merged
Merged
Conversation
) pyproject.toml + uv.lock で Python 開発依存 (pytest, pyyaml) を宣言し、 CI に python-test job を追加することで pytest がローカルと CI 両方で 再現可能に実行できる基盤を整備する。 - AC1: pyproject.toml を新規作成 (loop-protocol-tools, requires-python>=3.12) - AC2: uv.lock を生成・コミット - AC3: uv run pytest test_model_routing.py が 21/21 PASS - AC4: ci.yml に python-test job (astral-sh/setup-uv@v5 + uv run pytest) を追加 - AC6: project-constitution.md の必須検証セクションに uv run pytest を追記 - AC7: .gitignore に .venv/ __pycache__ .pytest_cache/ を追加 - AC8: pnpm typecheck/lint/test/build が regress なし Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
squne121
commented
May 19, 2026
squne121
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=BEHIND
BEHIND は上流が進んだことを示すが、conflict なし。blocker 条件(CONFLICTING / DIRTY / BLOCKED / UNKNOWN)に該当しない。
Evidence Check
- AC coverage: AC1-AC8 全項目に根拠記載あり。AC5(CI 上 python-test job success)は PR 本文時点で「待機中」記載だったが、
gh pr checks 58でpython-test: passを確認済み。 - Allowed Paths 遵守:
gh pr diff --name-onlyの 5 ファイルがすべて Issue #39 の Allowed Paths に含まれる(.claude/rules/project-constitution.md/.github/workflows/ci.yml/.gitignore/pyproject.toml/uv.lock)。 - CI Verification: build/lint/python-test/test/typecheck — 全 5 job pass。
- 検証コマンド結果: PR 本文の Verification 結果セクションに AC1-AC8 各コマンドの出力が具体的に記録されている。
- Out of Scope 違反: PEP 723 inline metadata 導入・pre-commit hook 追加・既存 script リファクタリングはいずれも diff に含まれない。
Blockers
なし
Non-blockers(任意改善)
CLAUDE.mdの「最低限の確認コマンド」とproject-constitution.mdの「必須検証」間のuv run pytest非対称は PR 本文でも言及済み。別 Issue での対応が推奨される(PR 本文記載通り)。isDraft: trueのまま。マージ前に Draft 解除を忘れずに。
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: BEHIND
reviewed_head_sha: 4e2dbb38b9abb1eb451f04dd84e8ab01ab309cf9
squne121
marked this pull request as ready for review
May 19, 2026 16:04
This was referenced May 19, 2026
Closed
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.
Closes #39
Summary
pyproject.tomlを新規作成し Python 開発依存 (pytest, pyyaml) を宣言uv.lockを生成・コミットして再現可能な依存解決を保証.github/workflows/ci.ymlにpython-testjob を追加 (pnpm 系 4 job と並列実行).claude/rules/project-constitution.mdの必須検証セクションにuv run pytestを追記.gitignoreに Python runtime artifacts を追加AC 別実装サマリ
pyproject.toml新規作成 (loop-protocol-tools,requires-python>=3.12, dev: pytest + pyyaml)uv lockでuv.lock生成・コミットuv run pytest test_model_routing.pyローカル実行ci.ymlにpython-testjob 追加 (astral-sh/setup-uv@v5)python-testjob success (PR push 後に確認)project-constitution.md必須検証セクションにuv run pytest追記.gitignoreに.venv/__pycache__/.pytest_cache/追加Verification 結果
改善点・観測メモ
CLAUDE.md と project-constitution.md の二重管理 gap:
CLAUDE.mdの「最低限の確認コマンド」は Allowed Paths 外のため今回更新していない。project-constitution.mdのみにuv run pytestが追記された結果、両文書間に整合性 gap が残っている。別 Issue としてCLAUDE.mdの更新または両文書の統合を検討することを推奨する。既存 Python script の yaml optional import:
run_gemini_headless.py等でtry: import yaml/except ImportErrorの optional 扱いが存在するが、本 PR 後はpyyamlが dev dep として保証されるため optional 扱いの妥当性を再評価する余地がある。ただし dev dep であり runtime では保証されないため、慎重に評価が必要 (Out of Scope)。uv.lock の Python バージョン:
uv lockが CPython 3.13.12 環境で実行されたがrequires-python = ">=3.12"の宣言と一致している。CI のastral-sh/setup-uv@v5はデフォルトで最新 Python を使用するため、バージョン固定が必要な場合は別 Issue で対応する。worktree の
.venvディレクトリ:uv run pytest実行時に worktree 内に.venvが作成されるが、.gitignoreのルート.venv/エントリで除外されるため意図通りに動作する。Contract Snapshot
#39 (comment)
🤖 Generated with Claude Code
impl-review-loop / refinement-loop 観測ノート (本セッション全体)
本 PR を完成させるまでの一連ループ (issue-refinement-loop → issue-contract-review → impl-review-loop) で観測された運用改善候補を追記する。Issue 起票判断の参考用。
観測 A: state ラベル未付与の Issue が contract-review 段階で blocked になる
state/queued,phase/implementation,agent/implementer,enhancementを手動付与)issue-contract-reviewskill のstate_labelcheck (state/queuedorstate/in-progressを必須) が fail し、ループ起動不能になるcreate-issueskill 側で起票時に標準ラベル (state/queued+phase/implementation+agent/implementer+enhancement) を自動付与する。またはissue-contract-review内で「ラベル未付与時は提案 + 自動付与」フォールバックを追加観測 B: edit-issue.template_guard と review-issue.C1 の必須セクション集合不整合
issue-refinement-loopiteration 1 でedit-issueのtemplate_guardが pass を返したが、直後のreview-issueC1 で Parent 系 5 セクション (Machine-Readable Contract / Parent Issue / Parent Goal Ref / Current Validated Scope / Remaining Parent Gaps) の欠如を検出 → 2 iteration 必要になった.github/ISSUE_TEMPLATE/*.ymlのrequired: true全件を SSOT として参照する実装に統一観測 C: review-issue の diff_proposal が skeleton を含まない
観測 D: impl-review-loop に Draft 解除自動化が無い (既知)
isDraft: trueのままで残る--auto-ready-on-approveフラグを追加する」で対応予定観測 E: SubAgent 委任設定の改善余地
uvコマンドが含まれておらず、初回実行時に permission prompt が発生する可能性がある (本セッションでは worktree 内でpython3 -m pip install --user uvの fallback を通過した可能性).claude/settings.jsonの Bash allow リストにuv lock,uv run,uv syncを追加することを検討 (update-config skill 範囲)観測 F: pyproject.toml の二重管理リスク
requires-python = ">=3.12"宣言と CI のsetup-uv@v5が使う Python のバージョン整合性が CI 設定で明示されていない。uv.lock再生成時に環境差で別バージョンが採択されると CI で再現性が崩れる可能性.python-versionファイル追加 orsetup-uvstep でpython-version引数を明示