Repository navigation
test: リファクタリング Phase 1 — テスト安全網の構築 (D-1) - #35
Merged
Merged
Conversation
プロダクションコードは変更せず、現行挙動を固定するテストを追加: - find_input_vars / find_created_deleted_vars - id_graph (construct/structure/root equals, 共有・循環参照) - object_hash / compare_fingerprint (inplace vs 上書き, numpy) - DependencyGraph + update_graph - OptimizerExact.select_vss (migrate/recompute の2ケース) - CheckpointFile ビルダー - migrate -> resume ラウンドトリップ + 異常系(破損ファイル) ※ 異常系は D-2 の現行バグ挙動を明示的に固定(Phase 4 で反転) - 統合テスト: record_event -> checkpoint -> load_checkpoint pytest を dev 依存に追加、[tool.pytest.ini_options] を設定。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
既存ワークフローには手を加えず、push/PRでテストを走らせるジョブを新規追加。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 14, 2026
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.
概要
docs/prompts/refactor-instructions.mdの Phase 1(安全網の構築) を実施。チェックポイント保存・復元という壊れると致命的な機能にテストが1つも無い状態(D-1)を解消する。
プロダクションコードは一切変更していない。 追加したのはテスト・dev依存(pytest)・CI のみ。現行挙動をそのまま固定している。
追加したテスト(40件、全パス)
test_find_input_vars.pytest_find_output_vars.pytest_id_graph.pytest_object_hash.pytest_graph.pytest_optimizer.pyOptimizerExact.select_vssの「サイズ極大→再計算」「実行時間極大→マイグレート」2ケースtest_checkpoint_file.pytest_migrate_resume.pytest_integration.py重要ポイント
ces_to_recomputeへの再計算追加が破棄される」現行の誤挙動をassert ces_to_recompute == set()でピン留めし、「Phase 4 で反転する」とコメント済み。__skip_recordのテストは指示書どおり Phase 4 に保留(カーネルのインスタンス化が重く private name-mangling のため)。変更ファイル
tests/一式(新規)pyproject.toml— pytest を dev 依存に追加、[tool.pytest.ini_options]設定uv.lock— pytest 追加に伴う更新.github/workflows/test.yml— pytest 実行ジョブを新規追加(既存ワークフローは不変)検証結果
uv run pytestuv run black --check elastic_kernel elastic_notebook testsuv run mypy elastic_kernel elastic_notebook挙動差分
Stop-And-Ask 該当事項なし。
🤖 Generated with Claude Code