chore: commit sisyphus evidence and CI/CD artifacts
This commit is contained in:
46
.sisyphus/notepads/self-assign-shift-task-fix/decisions.md
Normal file
46
.sisyphus/notepads/self-assign-shift-task-fix/decisions.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# 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)
|
||||
9
.sisyphus/notepads/self-assign-shift-task-fix/issues.md
Normal file
9
.sisyphus/notepads/self-assign-shift-task-fix/issues.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Issues - Self-Assignment Bug Fix
|
||||
|
||||
## Known Problems & Gotchas
|
||||
|
||||
*(To be populated as work progresses)*
|
||||
|
||||
## Edge Cases
|
||||
|
||||
*(To be populated as work progresses)*
|
||||
136
.sisyphus/notepads/self-assign-shift-task-fix/learnings.md
Normal file
136
.sisyphus/notepads/self-assign-shift-task-fix/learnings.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# Learnings - Self-Assignment Bug Fix
|
||||
|
||||
## Conventions & Patterns
|
||||
|
||||
*(To be populated as work progresses)*
|
||||
|
||||
## Technical Decisions
|
||||
|
||||
*(To be populated as work progresses)*
|
||||
|
||||
## Traceability Strategy (Task 5)
|
||||
- Every acceptance criterion (AC) must map to a specific evidence file path.
|
||||
- QA scenarios are categorized into happy-path (successful operations) and failure-path (error handling/guards).
|
||||
- Playwright is used for UI/integration evidence (screenshots).
|
||||
- Vitest and Bash are used for unit/build/cli evidence (text/logs).
|
||||
- A traceability map file acts as the single source of truth for verification coverage.
|
||||
|
||||
## Task 4: Branch Setup Verification
|
||||
|
||||
### Branch Configuration
|
||||
- **Branch Name**: `feature/fix-self-assignment`
|
||||
- **Worktree Location**: `/Users/mastermito/Dev/opencode-self-assign-fix`
|
||||
- **Base Commit**: `785502f` (matches main tip - no divergence)
|
||||
- **Working Tree Status**: Clean, ready for implementation
|
||||
|
||||
### Key Observations
|
||||
1. **Worktree correctly isolated**: Separate git directory prevents accidental main branch commits
|
||||
2. **Feature branch at main tip**: Branch created fresh from latest main (commit 785502f)
|
||||
3. **Zero commits ahead**: Branch has no local commits yet - ready for new work
|
||||
4. **Safety verification**: Main branch untouched and not checked out in worktree
|
||||
|
||||
### Verification Artifacts
|
||||
- Evidence file: `.sisyphus/evidence/task-4-branch-created.txt`
|
||||
- Evidence file: `.sisyphus/evidence/task-4-main-safety.txt`
|
||||
|
||||
### Next Steps (Task 5+)
|
||||
- Ready for implementation on feature/fix-self-assignment branch
|
||||
- Changes will be isolated and independently reviewable
|
||||
- Main branch remains protected and clean
|
||||
|
||||
## Task 2: Frontend Test Command Validation
|
||||
|
||||
### Canonical Commands Confirmed
|
||||
All three required commands are present in `frontend/package.json` and callable:
|
||||
|
||||
1. **Lint Command**: `bun run lint`
|
||||
- Definition: `eslint`
|
||||
- Tool: ESLint v9
|
||||
- Config: `eslint.config.mjs`
|
||||
- Status: ✓ Verified callable
|
||||
|
||||
2. **Test Command**: `bun run test`
|
||||
- Definition: `vitest run`
|
||||
- Tool: Vitest v4.0.18
|
||||
- Config: `vitest.config.ts`
|
||||
- Status: ✓ Verified callable
|
||||
|
||||
3. **Build Command**: `bun run build`
|
||||
- Definition: `next build`
|
||||
- Tool: Next.js 16.1.6
|
||||
- Output Format: standalone (Docker-ready)
|
||||
- Config: `next.config.ts`
|
||||
- Status: ✓ Verified callable
|
||||
|
||||
### Environment Variables for Build
|
||||
The `build` command is **NOT blocked by environment variables**:
|
||||
- `NEXT_PUBLIC_API_URL`: Optional (fallback: http://localhost:5001)
|
||||
- `NEXTAUTH_URL`: Optional (authentication layer only)
|
||||
- `NEXTAUTH_SECRET`: Optional (authentication layer only)
|
||||
- Keycloak vars: Optional (provider configuration only)
|
||||
|
||||
Build will succeed without any env vars set.
|
||||
|
||||
### Key Findings
|
||||
- All scripts section entries verified at lines 5-12
|
||||
- No missing or misnamed commands
|
||||
- Build uses `next build` (not a custom build script)
|
||||
- Next.js standalone output format optimized for containerization
|
||||
- Commands ready for green gate verification
|
||||
|
||||
### Evidence Files Generated
|
||||
- `.sisyphus/evidence/task-2-frontend-script-map.txt` - Command definitions
|
||||
- `.sisyphus/evidence/task-2-script-guard.txt` - Completeness & env var analysis
|
||||
|
||||
|
||||
## Task 9: Test Implementation for Self-Assignment Feature
|
||||
|
||||
### Session Mock Pattern (next-auth)
|
||||
- **Source Pattern**: `shift-detail.test.tsx` (lines 26-31)
|
||||
- **Pattern Format**:
|
||||
```typescript
|
||||
vi.mock('next-auth/react', () => ({
|
||||
useSession: vi.fn(() => ({
|
||||
data: { user: { id: 'user-123' } },
|
||||
status: 'authenticated',
|
||||
})),
|
||||
}));
|
||||
```
|
||||
- **Key Insight**: Session mock must be placed at TOP of test file, BEFORE imports of hooks/components that use it
|
||||
- **Position**: Lines 15-23 in task-detail.test.tsx (after navigation mock, before task hooks mock)
|
||||
|
||||
### Test Dependency: Implementation Required First
|
||||
- Tests initially failed because component didn't have "Assign to Me" button implementation
|
||||
- **Root Cause**: T7 implementation notes indicated button should be in component, but wasn't present
|
||||
- **Solution**: Added to component at execution time:
|
||||
1. Import `useSession` from 'next-auth/react'
|
||||
2. Call `useSession()` hook at component start
|
||||
3. Add button rendering when `!task.assigneeId && session.data?.user`
|
||||
4. Add click handler calling `updateTask` with `assigneeId: session.data.user.id`
|
||||
|
||||
### Test Coverage Added
|
||||
**Test 1**: Button Visibility (task-detail.test.tsx:100-112)
|
||||
- Mocks task with `assigneeId: null`
|
||||
- Asserts "Assign to Me" button renders
|
||||
- Status: ✓ PASSING
|
||||
|
||||
**Test 2**: Mutation Call (task-detail.test.tsx:114-137)
|
||||
- Mocks task with `assigneeId: null`
|
||||
- Spy on `useUpdateTask.mutate`
|
||||
- Clicks "Assign to Me" button via `fireEvent.click`
|
||||
- Asserts mutation called with correct payload: `{ id: task.id, data: { assigneeId: 'user-123' } }`
|
||||
- Status: ✓ PASSING
|
||||
|
||||
### Testing Library Choice
|
||||
- **Initial Error**: `@testing-library/user-event` not installed
|
||||
- **Solution**: Used `fireEvent` instead (from `@testing-library/react`, already installed)
|
||||
- **Why**: All existing tests use `fireEvent`, so consistent with codebase pattern
|
||||
|
||||
### Test File Structure
|
||||
- Total tests: 5 (3 existing + 2 new)
|
||||
- All existing transition tests remain intact ✓
|
||||
- Session mock added without side effects to existing tests ✓
|
||||
- New tests follow existing pattern: mock hook, render, assert ✓
|
||||
|
||||
### Evidence File
|
||||
- `.sisyphus/evidence/task-9-test-visibility.txt` - Contains full test run output showing all 5/5 pass
|
||||
@@ -0,0 +1,9 @@
|
||||
# Problems - Self-Assignment Bug Fix
|
||||
|
||||
## Unresolved Blockers
|
||||
|
||||
*(To be populated when blockers arise)*
|
||||
|
||||
## Escalation Log
|
||||
|
||||
*(To be populated when escalation needed)*
|
||||
Reference in New Issue
Block a user