feat(conflicts): add file overlap conflict detection (S-1 Phase 1)

Detects when 2+ agent sessions write the same file within a project.
New conflicts.svelte.ts store, shared tool-files.ts utility, dispatcher
integration, health attention scoring (SCORE_FILE_CONFLICT=70), and UI
indicators in ProjectHeader + StatusBar. 170/170 tests pass.
This commit is contained in:
Hibryda 2026-03-11 00:12:10 +01:00
parent 8e00e0ef8c
commit 82fb618c76
12 changed files with 483 additions and 37 deletions

View file

@ -2,6 +2,7 @@
import { getAgentSessions } from '../../stores/agents.svelte';
import { getActiveGroup, getEnabledProjects, setActiveProject } from '../../stores/workspace.svelte';
import { getHealthAggregates, getAttentionQueue, type ProjectHealth } from '../../stores/health.svelte';
import { getTotalConflictCount } from '../../stores/conflicts.svelte';
let agentSessions = $derived(getAgentSessions());
let activeGroup = $derived(getActiveGroup());
@ -15,6 +16,7 @@
let health = $derived(getHealthAggregates());
let attentionQueue = $derived(getAttentionQueue(5));
let totalConflicts = $derived(getTotalConflictCount());
let showAttention = $state(false);
function projectName(projectId: string): string {
@ -67,6 +69,12 @@
</span>
<span class="sep"></span>
{/if}
{#if totalConflicts > 0}
<span class="item state-conflict" title="{totalConflicts} file conflict{totalConflicts > 1 ? 's' : ''} — multiple agents writing same file">
{totalConflicts} conflict{totalConflicts > 1 ? 's' : ''}
</span>
<span class="sep"></span>
{/if}
<!-- Attention queue toggle -->
{#if attentionQueue.length > 0}
@ -173,6 +181,11 @@
font-weight: 600;
}
.state-conflict {
color: var(--ctp-red);
font-weight: 600;
}
.pulse {
width: 6px;
height: 6px;