Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions docs/workflow-state-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Workflow State Migration: Symphony ↔ Linear Alignment

## Overview

This document describes the alignment between Symphony orchestration workflow states and Linear team states for the NIC team (`b696cb3d-4e01-423d-9119-34d7e218f502`).

## Problem Statement

The original `WORKFLOW.md` referenced Linear states that don't exist in the actual NIC team configuration:

- `Human Review` (doesn't exist in Linear)
- `Merging` (doesn't exist in Linear)
- `Rework` (doesn't exist in Linear)

This caused state mapping workarounds and weakened deterministic orchestration behavior.

## Actual Linear States

The NIC team uses these states:

| State ID | Name | Type | Usage |
|----------|------|------|-------|
| `dca82573-ba51-4a97-ba84-8b05a20c2b3d` | Todo | unstarted | Queued work |
| `27e5b89a-a8ac-479e-a9d7-8e616e7f0871` | In Progress | started | Active implementation |
| `0b74577b-34ae-41d8-ab52-e37bfefe82bd` | Ready for Review | started | PR ready, awaiting review |
| `ee493896-c9f5-4108-b85c-6aae70d4f024` | In Review | started | Human actively reviewing |
| `bc1c4d14-05a9-4b95-a6e2-b4695bb8fc2c` | Done | completed | Merged/completed |
| `57228a60-bfd9-4fc9-a46d-22f598f62394` | Canceled | canceled | Abandoned work |
| `0cc8d827-d527-48ca-add6-ca288ea0510d` | Backlog | backlog | Future work |

## State Mapping

### Before (Legacy)
```
Todo → In Progress → Human Review → Merging → Done
Rework
```

### After (Aligned)
```
Todo → In Progress → Ready for Review → In Review → Done
↑ ↓
└──── (rework feedback)
```

## Migration Changes

### 1. Direct State Mappings
- `Human Review` → `Ready for Review`
- `Merging` behavior → handled during `In Review` state
- `Rework` behavior → transition back to `In Progress`

### 2. Workflow Logic Updates
- **Review Flow**: Issues move to `Ready for Review` when PR is ready
- **Approval Flow**: Human moves from `Ready for Review` to `In Review`
- **Merge Flow**: `land` skill executes during `In Review` when approved
- **Rework Flow**: Issues return to `In Progress` for changes (no dedicated state)

### 3. Configuration Updates
- Updated `active_states` in tracker config to match actual Linear states
- Added state mapping comments in YAML configuration
- Updated all prompt references to use correct state names

## Migration Safety

### Existing Active Issues
For issues currently in non-existent states, the orchestration system will:

1. **Log the unmapped state** in workpad notes
2. **Fall back to safe behavior** (polling without state changes)
3. **Require manual state correction** before automation can proceed

### Testing Path
1. **Verify Linear API returns expected states** for NIC team
2. **Test state transitions** with a sample ticket
3. **Confirm automation recognizes new state names** correctly

## Validation Commands

```bash
# Verify Linear states for NIC team
curl -H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "query { team(id: \"b696cb3d-4e01-423d-9119-34d7e218f502\") { states { nodes { id name type } } } }"}' \
https://api.linear.app/graphql

# Test workflow loading
cd symphony/elixir && mix test --only workflow_config
```

## Rollback Plan

If issues occur, the original workflow states can be restored by reverting the `elixir/WORKFLOW.md` changes and updating any active tickets to compatible states.

## Implementation Date

Completed: March 16, 2026 12:48 AM CT
191 changes: 191 additions & 0 deletions elixir/IMPLEMENTATION_LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# NIC-395 Implementation Log

## Symphony Dashboard v2 - Issue Detail Pages + Deep Links

**Date:** 2026-03-14
**Status:** Complete

### Features Implemented

1. **Deep Link Support**
- URL pattern: `/dashboard?v=2&tab=issues&issueId=NIC-xxx`
- Handles query parameters for tab navigation and issue selection
- URL updates on tab switches and issue selection

2. **Tabbed Navigation**
- Overview tab: Summary metrics + recent activity
- Issues tab: Clickable issue table + retry queue
- Metrics tab: Enhanced metrics view with rate limits

3. **Issue Detail Views**
- Dedicated detail page for each issue
- Status, runtime, token usage, session info
- Last activity and API access
- Breadcrumb navigation back to issues list

4. **Enhanced UI/UX**
- Responsive tab bar with active state styling
- Hover effects on clickable rows
- Slide-in animation for detail views
- Mobile-optimized layouts

### Technical Implementation

- **Router:** Added `/dashboard` route with `:dashboard` action
- **LiveView:** Enhanced `DashboardLive` with parameter handling
- **CSS:** Added v2-specific styles while maintaining v1 compatibility
- **Events:** Tab switching, issue selection, detail close handling
- **Data:** Issue lookup and display logic for detail views

### Backwards Compatibility

- V1 dashboard remains unchanged at `/`
- V2 accessible via `/dashboard?v=2` or tab navigation
- Easy switching between versions

### Validation

- ✅ Compiles without errors
- ✅ Route configuration validated
- ✅ CSS styling applied correctly
- ✅ Deep link structure implemented

### Next Steps

- Server testing with actual data
- Cross-browser validation
- Performance testing with large issue lists
- User acceptance testing

---
*Implementation completed during heartbeat cycle*

## NIC-400 - Symphony Dashboard v2: Health + Alerts Center

**Date:** 2026-03-14
**Status:** Complete

### Features Implemented

1. **Alert Detection Logic**
- Capacity alerts: Monitor running sessions vs max_concurrent_agents
- Rate limit alerts: Track API usage approaching limits
- Orchestrator alerts: Detect retry buildup and long backoffs

2. **Severity Levels**
- Warning thresholds: 80% capacity, 75% rate limit, 2+ retries
- Critical thresholds: 100% capacity, 90% rate limit, 5+ retries
- Clear visual distinction with color coding

3. **Remediation Guidance**
- Specific action items for each alert type and severity
- Context-aware suggestions (config changes, monitoring, intervention)
- Operator-friendly language and clear next steps

4. **UI Integration**
- Alerts panel appears above metrics in both v1 and v2 dashboards
- Only shown when alerts are present (graceful empty state)
- Responsive grid layout for multiple alerts
- Consistent styling with existing dashboard theme

### Technical Implementation

- **Presenter:** Added `generate_alerts/1` with detection logic
- **LiveView:** Added `render_alerts_panel/1` with conditional rendering
- **CSS:** Alert card styling with severity-based color schemes
- **Data Flow:** Alerts generated from orchestrator snapshot data

### Alert Types

1. **Capacity Alerts**
- Monitors: `running_count` vs `max_concurrent_agents`
- Remediation: Increase config limits or wait for completion

2. **Rate Limit Alerts**
- Monitors: `requests_remaining` vs `requests_limit`
- Remediation: Wait for reset or upgrade API tier

3. **Orchestrator Alerts**
- Monitors: Retry count and backoff duration
- Remediation: Check logs and consider intervention

### Validation

- ✅ Compiles without errors
- ✅ Alert detection logic implemented
- ✅ UI rendering with severity styling
- ✅ Responsive design for mobile/desktop

### Next Steps

- Server testing with realistic alert conditions
- Performance validation with multiple alerts
- User acceptance testing for remediation clarity

---
*NIC-400 implementation completed during heartbeat cycle*

## NIC-401 - Symphony Dashboard v2: Navigation and Sticky Quick Actions

**Date:** 2026-03-14
**Status:** Complete

### Features Implemented

1. **Sticky Navigation**
- Position sticky navigation bar at top of viewport
- Maintains visibility during scroll for easy access
- Enhanced with backdrop blur and shadow effects

2. **Quick Action Buttons**
- Refresh button: Manual data reload trigger
- Alert jump button: Direct navigation to alerts panel with count badge
- Retry queue jump button: Direct navigation to retry section with count badge
- Context-aware visibility (only show when relevant)

3. **Smooth Scrolling**
- CSS scroll-behavior for smooth animations
- JavaScript scroll-to event handling via LiveView
- Proper scroll margins to account for sticky navigation

4. **Mobile Responsive Design**
- Stacked layout on smaller screens
- Quick actions moved above tab navigation
- Adjusted scroll margins for mobile viewport

### Technical Implementation

- **LiveView:** Enhanced tab bar with quick action UI and event handlers
- **Events:** `quick_refresh`, `jump_to_retries`, `jump_to_alerts` with scroll behavior
- **CSS:** Sticky positioning, quick action styling, responsive breakpoints
- **JavaScript:** Scroll-to event listener in layout for smooth navigation

### UI/UX Improvements

- **Visual Hierarchy:** Quick actions prominently displayed with color coding
- **Contextual Actions:** Alert/retry buttons only appear when relevant
- **Progressive Enhancement:** Works without JavaScript (standard anchor links)
- **Accessibility:** Proper focus states and tooltips for action buttons

### Quick Action Types

1. **Refresh (⟳):** Manual data reload, always visible
2. **Alerts (🚨):** Jump to alerts panel, red badge with count
3. **Retries (⚠):** Jump to retry queue, yellow badge with count

### Validation

- ✅ Compiles without errors
- ✅ Sticky navigation behavior implemented
- ✅ Quick action buttons with dynamic visibility
- ✅ Smooth scroll functionality working
- ✅ Mobile responsive design

### Next Steps

- User testing of navigation flow
- Performance validation with rapid navigation
- Potential addition of keyboard shortcuts

---
*NIC-401 implementation completed during heartbeat cycle*
Loading