# Decisions - Self-Assignment Bug Fix

## Architectural Choices

*(To be populated as work progresses)*

## Trade-offs Made

*(To be populated as work progresses)*

## T3: Contract Parity Decision (2026-03-08)

**Decision**: Task self-assignment will use existing `useUpdateTask` mutation with `assigneeId` field.

**Rationale**:
1. **UpdateTaskRequest Interface** already includes `assigneeId?: string` field (line 45)
2. **useUpdateTask Mutation** accepts arbitrary UpdateTaskRequest fields via PATCH /api/tasks/{id}
3. **Shift Pattern** uses implicit self-assignment via POST /signup, but tasks require explicit assigneeId
4. **Member Role Assumption**: No frontend restrictions observed on member role updating assigneeId

**Implementation Pattern** (for T7):
```typescript
// Detection pattern (similar to shift isSignedUp)
const isAssignedToMe = task.assigneeId === session?.user?.id;

// Self-assignment action (via useUpdateTask)
await updateTaskMutation.mutateAsync({
  id: task.id,
  data: { assigneeId: session.user.id }
});

// Unassignment action
await updateTaskMutation.mutateAsync({
  id: task.id,
  data: { assigneeId: null }
});
```

**Backend Verification Required** (T8):
- Confirm PATCH /api/tasks/{id} permits member role to set assigneeId to self
- Verify no policy restrictions on member role task assignment
- Document any backend adjustments needed

**Evidence Files**:
- `.sisyphus/evidence/task-3-contract-parity.txt` (contract analysis)
- `.sisyphus/evidence/task-3-contract-mismatch.txt` (empty - no mismatches found)
