# Sprint 1 — Agile Execution Foundation Report

**Date:** 2026-06-05  
**Scope:** Drag-and-drop board, time tracking, My Work, dependencies UI, milestones.

---

## Validation

| Command | Result |
|---------|--------|
| `php artisan test` | Pass (includes `Sprint1AgileExecutionTest`) |
| `npm run type-check` | Pass |
| `npm run lint` | Pass |
| `npm run build` | Pass |
| `npm run test -- --run` | Pass |

---

## Architecture

All features reuse existing **Tickets**, **Projects**, **Sprints**, notifications, audit, realtime, and permissions. No parallel task system.

| Feature | Backend | Frontend |
|---------|---------|----------|
| Sprint board | `ProjectBoardService`, `ProjectBoardController` | `/projects/:id/board`, `@dnd-kit` |
| Time tracking | `TicketTimeTrackingService`, `TicketTimeController` | `TicketTimeTrackingSection` on ticket detail |
| My Work | `MyWorkService`, `MyWorkController` | `/my-work` |
| Dependencies | `TicketDependencyController` | `TicketDependenciesSection` (FS create) |
| Milestones | `ProjectMilestoneController` | `/projects/:id/milestones` |

---

## 1. Drag & Drop Sprint Board

- **Route:** `GET/PATCH /api/v1/projects/{project}/board`
- Columns from `project_kanban_mappings` → department **ticket statuses** (not hardcoded labels).
- Filters: sprint, search, assignee, status.
- Card payload: ticket number, title, priority, assignee, due date, points, dependency count.
- **Realtime:** `project.ticket.moved` on `private-project.{id}`.
- **Audit:** `ticket_moved` metadata on ticket update (`from_status`, `to_status`, `from_sprint`, `to_sprint`).

---

## 2. Time Tracking

- Table: `ticket_time_entries` (+ `paused_at`, `paused_minutes` via migration).
- **Routes:** `/api/v1/tickets/{id}/time/*`, `/api/v1/time/pause|resume|stop`.
- States: not_started, running, paused, completed.
- One active timer per user (enforced server-side).
- Ticket summary: estimated / actual / remaining / logged minutes.
- **Notifications:** `TIME_ESTIMATE_EXCEEDED` at 125%, 150%, 200% with dedupe keys.

---

## 3. My Work

- **Route:** `GET /api/v1/my-work`
- Sections: assigned, collaborating, due today, due this week, overdue, recently updated.
- Watching: empty (no watcher model).
- Widgets: assigned count, overdue, due today, story points.

---

## 4. Ticket Dependencies UI

- **Routes:** `GET/POST/DELETE /api/v1/tickets/{id}/dependencies`
- Blocked by / blocking lists; warnings when predecessor not done (warn only).
- V1 UI: Finish-to-Start create only; backend supports FS/SS/FF/SF.

---

## 5. Milestones

- Table: `project_milestones` (extended: `start_date`, `created_by_user_id`, status `planned|in_progress|completed|cancelled`).
- **Routes:** CRUD + `PATCH .../complete`
- Dashboard metrics on milestones index: upcoming, overdue, completed.
- Gantt: milestones in payload; UI shows hierarchy (diamond markers deferred — see below).

---

## Permissions

Existing project/ticket policies; all mutations authorized server-side.

---

## Tests

**Backend:** `tests/Feature/Projects/Sprint1AgileExecutionTest.php` — board move, timer conflict, my work, milestones, dependencies.

**Frontend:** Extend `ProjectV2Pages` pattern; board uses dnd-kit (manual QA recommended).

---

## Deferred

| Item | Reason |
|------|--------|
| Gantt dependency SVG lines | Backend ready; UI shows count/hierarchy only |
| Gantt milestone diamond markers | Listed in Gantt hierarchy; diamond styling not implemented |
| Milestone due notification job | Types + templates seeded; scheduled job not wired |
| My Work realtime auto-refresh | Relies on existing ticket/user channels; no dedicated hook |
| Ticket search in dependency picker | UUID input only in V1 UI |
| Sprint A → B drag on board | API supports `sprint_id`; UI column drop sets backlog/sprint via column rules |

---

## Risks

- Board drop to sprint across columns needs explicit sprint selector (filter) for sprint moves.
- `created_by_user_id` on milestones requires migration on existing DBs.
- Notification tests require seeder templates for new types (added).

---

## Readiness score: **8 / 10**

Production-usable core flows with tests and validation green. Remaining gaps are visual Gantt polish, milestone cron, and richer dependency picker UX.
