refactor: セッションディレクトリ名を SESSIONS_DIR 定数に集約#436
Merged
Conversation
`.usagi/sessions/` の "sessions" リテラルが usecase・presentation の複数箇所に ハードコードされていたため、repo_paths.rs に SESSIONS_DIR を追加して一本化する。 既存の STATE_DIR と同じく単一情報源とし、ディレクトリ名変更時のドリフトを防ぐ。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📊 Test Coverage
🎉✨ パーフェクト!全ファイル Lines カバレッジ 100% を達成しました 🏆🐰 |
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.
目的
SSoT(単一情報源)レビューで検出したコード重複の解消。
.usagi/sessions/の"sessions"ディレクトリ名が複数レイヤー(usecase / presentation)にハードコードされており、ディレクトリ構成変更時にドリフトする恐れがあった。既存のISSUES_DIR_NAME/MEMORY_DIR_NAME/STATE_DIRと同様、単一の定数へ集約する。変更内容
infrastructure/repo_paths.rsにpub const SESSIONS_DIR: &str = "sessions";を追加(STATE_DIRと同じ場所・同じ意図で文書化)。"sessions"リテラルをSESSIONS_DIRへ置換:usecase/session/mod.rs(セッション作成パス・パス判定・session_roots)usecase/session/reconcile.rs(reconcile 起点)presentation/tui/home/mod.rs(削除セッションの evict パス)挙動は不変(リテラルの集約のみ)。
テスト・確認方法
cargo fmt/cargo clippy --all-targets -- -D warnings/cargo test通過。