feat: セッション間の変更ファイル逆引き+コンフリクト警告(#18)#37
Merged
Merged
Conversation
#18。同一リポジトリの複数セッション(別 worktree/ブランチ)が同じファイルを編集して いたら警告する。 - LaboLaboEngine に純粋関数 CrossSessionConflicts(同一 repoKey で変更パスが重なるものを 列挙)を追加。 - SessionStore が変更ファイルの逆引き(session→変更パス集合)を保持。多重 repo のセッション だけ git status を 5s 間隔+セッション/repo 解決時にリフレッシュ。 - SessionDetailView 上部に ConflictBanner を追加。件数・ファイル一覧を表示し、どの他 ブランチ/セッションと衝突しているかを help に出す。 - テスト: CrossSessionConflicts 6 件(同一/別 repo・単独・未解決 repoKey・複数他者・空集合)。 swift test 46 passed / app build 成功。 逆引きはライブ git status から都度計算(常に最新)。永続テーブル(session_file)は陳腐化リスク があり本警告には不要なため見送り。 Closes #18
sasagar
added a commit
that referenced
this pull request
Jul 2, 2026
#18。同一リポジトリの複数セッション(別 worktree/ブランチ)が同じファイルを編集して いたら警告する。 - LaboLaboEngine に純粋関数 CrossSessionConflicts(同一 repoKey で変更パスが重なるものを 列挙)を追加。 - SessionStore が変更ファイルの逆引き(session→変更パス集合)を保持。多重 repo のセッション だけ git status を 5s 間隔+セッション/repo 解決時にリフレッシュ。 - SessionDetailView 上部に ConflictBanner を追加。件数・ファイル一覧を表示し、どの他 ブランチ/セッションと衝突しているかを help に出す。 - テスト: CrossSessionConflicts 6 件(同一/別 repo・単独・未解決 repoKey・複数他者・空集合)。 swift test 46 passed / app build 成功。 逆引きはライブ git status から都度計算(常に最新)。永続テーブル(session_file)は陳腐化リスク があり本警告には不要なため見送り。 Closes #18
sasagar
added a commit
that referenced
this pull request
Jul 2, 2026
#18。同一リポジトリの複数セッション(別 worktree/ブランチ)が同じファイルを編集して いたら警告する。 - LaboLaboEngine に純粋関数 CrossSessionConflicts(同一 repoKey で変更パスが重なるものを 列挙)を追加。 - SessionStore が変更ファイルの逆引き(session→変更パス集合)を保持。多重 repo のセッション だけ git status を 5s 間隔+セッション/repo 解決時にリフレッシュ。 - SessionDetailView 上部に ConflictBanner を追加。件数・ファイル一覧を表示し、どの他 ブランチ/セッションと衝突しているかを help に出す。 - テスト: CrossSessionConflicts 6 件(同一/別 repo・単独・未解決 repoKey・複数他者・空集合)。 swift test 46 passed / app build 成功。 逆引きはライブ git status から都度計算(常に最新)。永続テーブル(session_file)は陳腐化リスク があり本警告には不要なため見送り。 Closes #18
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.
背景
#18「逆引き(どのセッションがどのファイルを触ったか)+ セッション間コンフリクト警告」。1 セッション = 1 worktree だが、同じリポジトリ(共有
.git)の別 worktree/ブランチが同じ相対パスのファイルを編集していると、後のマージで衝突しうる。これを検知して警告する。変更点
エンジン(純粋ロジック)
CrossSessionConflicts(純粋関数)を追加。(id, repoKey, 変更パス集合)の一覧から、同一repoKeyで変更パスが重なるものを列挙する。アプリ
SessionStoreが変更ファイルの逆引き(session → 変更パス集合)を保持。同一 repo に 2 つ以上セッションがある場合だけgit statusを回す(無ければほぼ空処理)。リフレッシュ契機:SessionDetailView上部にConflictBannerを追加。衝突ファイル数と一覧を表示し、どの他ブランチ/セッションと衝突しているかを help(ツールチップ)に出す。検証
swift test: 46 passed(CrossSessionConflictsTests6 件 = 同一/別 repo・単独・未解決 repoKey・複数他者・空集合)。xcodebuild … build成功(既存のNSSplitViewDelegate警告のみ)。設計メモ
git statusから都度計算(常に最新)。プランのsession_file永続テーブルは見送り:ライブ状態を SQLite に写すと陳腐化リスクがあり、本警告(現在編集中の重なり)には不要なため。履歴的な逆引きが要るなら別途。