hopefully done refining
This commit is contained in:
@@ -1,33 +1,131 @@
|
||||
# Implementation Plan: Manual Ticket Queue Management (ticket_queue_mgmt_20260306)
|
||||
|
||||
## Phase 1: UI Framework
|
||||
- [ ] Task: Initialize MMA Environment
|
||||
- [ ] Task: Add drag-drop support
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Enable ticket reordering via drag
|
||||
- HOW: imgui drag-drop or custom handling
|
||||
- SAFETY: Validate after drop
|
||||
> **Reference:** [Spec](./spec.md) | [Architecture Guide](../../../docs/guide_architecture.md)
|
||||
|
||||
## Phase 2: Priority System
|
||||
- [ ] Task: Add priority field
|
||||
- WHERE: src/models.py
|
||||
- WHAT: Add priority to Ticket
|
||||
- HOW: Enum (high/med/low)
|
||||
- [ ] Task: Add priority UI
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Dropdown or buttons
|
||||
- HOW: imgui.combo
|
||||
## Phase 1: Priority Field
|
||||
Focus: Add priority to Ticket model
|
||||
|
||||
## Phase 3: Bulk Operations
|
||||
- [ ] Task: Implement multi-select
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Checkbox per ticket
|
||||
- HOW: imgui.checkbox
|
||||
- [ ] Task: Implement bulk actions
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Execute/skip/block buttons
|
||||
- HOW: Apply to selected
|
||||
- [ ] Task 1.1: Initialize MMA Environment
|
||||
- Run `activate_skill mma-orchestrator` before starting
|
||||
|
||||
## Phase 4: Verification
|
||||
- [ ] Task: Test operations
|
||||
- [ ] Task: Conductor - Phase Verification
|
||||
- [ ] Task 1.2: Add priority field to Ticket
|
||||
- WHERE: `src/models.py` `Ticket` dataclass
|
||||
- WHAT: Add `priority: str = "medium"` field
|
||||
- HOW:
|
||||
```python
|
||||
@dataclass
|
||||
class Ticket:
|
||||
# ... existing fields ...
|
||||
priority: str = "medium" # "high" | "medium" | "low"
|
||||
```
|
||||
- CODE STYLE: 1-space indentation
|
||||
|
||||
- [ ] Task 1.3: Update Ticket serialization
|
||||
- WHERE: `src/models.py` `Ticket.to_dict()` and `from_dict()`
|
||||
- WHAT: Include priority in serialization
|
||||
- HOW: Add `priority` to dict conversion
|
||||
|
||||
## Phase 2: Priority UI
|
||||
Focus: Add priority dropdown to ticket display
|
||||
|
||||
- [ ] Task 2.1: Add priority dropdown
|
||||
- WHERE: `src/gui_2.py` ticket rendering
|
||||
- WHAT: Dropdown for priority selection
|
||||
- HOW:
|
||||
```python
|
||||
priorities = ["high", "medium", "low"]
|
||||
current_idx = priorities.index(ticket.priority) if ticket.priority in priorities else 1
|
||||
if imgui.begin_combo("Priority", priorities[current_idx]):
|
||||
for i, p in enumerate(priorities):
|
||||
if imgui.selectable(p, i == current_idx):
|
||||
ticket.priority = p
|
||||
imgui.end_combo()
|
||||
```
|
||||
|
||||
- [ ] Task 2.2: Add color coding
|
||||
- WHERE: `src/gui_2.py` ticket rendering
|
||||
- WHAT: Color-code priority display
|
||||
- HOW:
|
||||
```python
|
||||
priority_colors = {"high": vec4(255, 100, 100, 255), "medium": vec4(255, 200, 100, 255), "low": vec4(150, 150, 150, 255)}
|
||||
imgui.text_colored(priority_colors.get(ticket.priority, vec4(200, 200, 200, 255)), f"[{ticket.priority.upper()}]")
|
||||
```
|
||||
|
||||
## Phase 3: Multi-Select
|
||||
Focus: Enable ticket selection for bulk operations
|
||||
|
||||
- [ ] Task 3.1: Add selection state
|
||||
- WHERE: `src/gui_2.py` or `src/app_controller.py`
|
||||
- WHAT: Track selected ticket IDs
|
||||
- HOW:
|
||||
```python
|
||||
self._selected_tickets: set[str] = set()
|
||||
```
|
||||
|
||||
- [ ] Task 3.2: Add checkbox per ticket
|
||||
- WHERE: `src/gui_2.py` ticket list rendering
|
||||
- WHAT: Checkbox for selection
|
||||
- HOW:
|
||||
```python
|
||||
selected = ticket.id in self._selected_tickets
|
||||
if imgui.checkbox(f"##select_{ticket.id}", selected):
|
||||
if selected:
|
||||
self._selected_tickets.discard(ticket.id)
|
||||
else:
|
||||
self._selected_tickets.add(ticket.id)
|
||||
imgui.same_line()
|
||||
```
|
||||
|
||||
- [ ] Task 3.3: Add select all/none buttons
|
||||
- WHERE: `src/gui_2.py` ticket list header
|
||||
- WHAT: Buttons to select/deselect all
|
||||
- HOW:
|
||||
```python
|
||||
if imgui.button("Select All"):
|
||||
self._selected_tickets = {t.id for t in self.track.tickets}
|
||||
imgui.same_line()
|
||||
if imgui.button("Select None"):
|
||||
self._selected_tickets.clear()
|
||||
```
|
||||
|
||||
## Phase 4: Bulk Actions
|
||||
Focus: Execute bulk operations on selected tickets
|
||||
|
||||
- [ ] Task 4.1: Add bulk action buttons
|
||||
- WHERE: `src/gui_2.py` ticket list area
|
||||
- WHAT: Execute, Skip, Block buttons
|
||||
- HOW:
|
||||
```python
|
||||
if imgui.button("Bulk Execute"):
|
||||
for tid in self._selected_tickets:
|
||||
self.engine.approve_task(tid)
|
||||
imgui.same_line()
|
||||
if imgui.button("Bulk Skip"):
|
||||
for tid in self._selected_tickets:
|
||||
self.engine.update_task_status(tid, "completed")
|
||||
imgui.same_line()
|
||||
if imgui.button("Bulk Block"):
|
||||
for tid in self._selected_tickets:
|
||||
self.engine.update_task_status(tid, "blocked")
|
||||
```
|
||||
|
||||
## Phase 5: Drag-Drop (Optional)
|
||||
Focus: Allow ticket reordering
|
||||
|
||||
- [ ] Task 5.1: Implement drag-drop reordering
|
||||
- WHERE: `src/gui_2.py` ticket list
|
||||
- WHAT: Drag tickets to reorder
|
||||
- HOW: Use imgui drag-drop API
|
||||
- SAFETY: Validate DAG after reorder (no dependency violations)
|
||||
|
||||
## Phase 6: Testing
|
||||
Focus: Verify all functionality
|
||||
|
||||
- [ ] Task 6.1: Write unit tests
|
||||
- WHERE: `tests/test_ticket_queue.py` (new file)
|
||||
- WHAT: Test priority serialization, bulk operations
|
||||
- HOW: Create mock tickets, verify state changes
|
||||
|
||||
- [ ] Task 6.2: Conductor - Phase Verification
|
||||
- Run: `uv run pytest tests/test_ticket_queue.py -v`
|
||||
- Manual: Verify UI controls work
|
||||
|
||||
@@ -1,41 +1,112 @@
|
||||
# Track Specification: Manual Ticket Queue Management (ticket_queue_mgmt_20260306)
|
||||
|
||||
## Overview
|
||||
Allow user to manually reorder, prioritize, or requeue tickets. Add drag-drop, priority tags, bulk selection.
|
||||
Allow user to manually reorder, prioritize, or requeue tickets in the DAG. Add drag-drop reordering, priority tags, and bulk selection for execute/skip/block operations.
|
||||
|
||||
## Current State Audit
|
||||
|
||||
### Already Implemented
|
||||
- **`models.Ticket`**: No priority field
|
||||
- **`dag_engine.py`**: `get_ready_tasks()` returns in order
|
||||
- **GUI**: Linear ticket list display
|
||||
### Already Implemented (DO NOT re-implement)
|
||||
|
||||
### Gaps to Fill
|
||||
- No priority field on Ticket
|
||||
- No drag-drop reordering
|
||||
- No bulk selection/operations
|
||||
#### Ticket Model (src/models.py)
|
||||
- **`Ticket` dataclass**: Has `status`, `depends_on`, but no `priority` field
|
||||
- **`mark_blocked(reason)`**: Sets status to blocked with reason
|
||||
- **`mark_complete()`**: Sets status to completed
|
||||
|
||||
## Functional Requirements
|
||||
- Add `priority: str = "medium"` to Ticket (high/medium/low)
|
||||
- Drag-drop reordering in ticket list
|
||||
- Multi-select for bulk operations
|
||||
- Bulk execute/skip/block
|
||||
#### DAG Engine (src/dag_engine.py)
|
||||
- **`TrackDAG`**: Manages ticket dependency graph
|
||||
- **`get_ready_tasks()`**: Returns tasks with satisfied dependencies
|
||||
- **`update_task_status()`**: Updates ticket status
|
||||
- **`has_cycle()`**: Validates DAG
|
||||
|
||||
## Key Integration Points
|
||||
| File | Purpose |
|
||||
|-----|---------|
|
||||
| `src/models.py` | Add priority field |
|
||||
| `src/gui_2.py` | Drag-drop, bulk UI |
|
||||
| `src/dag_engine.py` | Priority-aware ordering |
|
||||
### Gaps to Fill (This Track's Scope)
|
||||
- No `priority` field on Ticket
|
||||
- No drag-drop reordering in GUI
|
||||
- No multi-select for bulk operations
|
||||
- No bulk execute/skip/block actions
|
||||
|
||||
## Architectural Constraints
|
||||
- DAG validity maintained after reorder
|
||||
- Dependency order cannot be violated
|
||||
|
||||
### DAG Validity
|
||||
- Reordering MUST NOT violate dependencies
|
||||
- Cannot move ticket before its dependencies
|
||||
- `depends_on` relationships preserved
|
||||
|
||||
### Atomic Operations
|
||||
- Bulk operations apply to all selected tickets atomically
|
||||
- Partial failure rolls back all changes
|
||||
|
||||
## Architecture Reference
|
||||
|
||||
### Key Integration Points
|
||||
|
||||
| File | Lines | Purpose |
|
||||
|------|-------|---------|
|
||||
| `src/models.py` | 30-50 | `Ticket` - add priority field |
|
||||
| `src/gui_2.py` | 2650-2750 | Ticket display - add drag-drop |
|
||||
| `src/dag_engine.py` | 50-80 | Status updates |
|
||||
|
||||
### Proposed Ticket Enhancement
|
||||
```python
|
||||
@dataclass
|
||||
class Ticket:
|
||||
# ... existing fields ...
|
||||
priority: str = "medium" # "high" | "medium" | "low"
|
||||
```
|
||||
|
||||
## Functional Requirements
|
||||
|
||||
### FR1: Priority Field
|
||||
- Add `priority: str = "medium"` to Ticket dataclass
|
||||
- Values: "high", "medium", "low"
|
||||
- Persist in track state
|
||||
|
||||
### FR2: Priority UI
|
||||
- Dropdown or button group per ticket
|
||||
- Color-coded: high=red, medium=yellow, low=gray
|
||||
- Save to state on change
|
||||
|
||||
### FR3: Drag-Drop Reordering
|
||||
- Drag ticket to reorder in list
|
||||
- Drop validates DAG (no dependency violation)
|
||||
- Show error if invalid position
|
||||
|
||||
### FR4: Multi-Select
|
||||
- Checkbox per ticket for selection
|
||||
- Select all / deselect all buttons
|
||||
- Track selected ticket IDs
|
||||
|
||||
### FR5: Bulk Actions
|
||||
- Execute: Mark all selected as ready
|
||||
- Skip: Mark all selected as completed
|
||||
- Block: Mark all selected as blocked
|
||||
|
||||
## Non-Functional Requirements
|
||||
|
||||
| Requirement | Constraint |
|
||||
|-------------|------------|
|
||||
| Response Time | <100ms for drag-drop validation |
|
||||
| Persistence | Priority saved to state.toml |
|
||||
|
||||
## Testing Requirements
|
||||
|
||||
### Unit Tests
|
||||
- Test priority field serialization
|
||||
- Test DAG validation on reorder
|
||||
|
||||
### Integration Tests
|
||||
- Drag-drop tickets, verify order changes
|
||||
- Bulk block tickets, verify all blocked
|
||||
|
||||
## Out of Scope
|
||||
- Automatic priority assignment
|
||||
- Priority-based auto-scheduling
|
||||
- Cross-track ticket movement
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] Drag-drop reordering works
|
||||
- [ ] Priority tags display and save
|
||||
- [ ] Multi-select functional
|
||||
- [ ] Bulk actions apply correctly
|
||||
- [ ] DAG validity maintained
|
||||
- [ ] 1-space indentation
|
||||
- [ ] Priority field added to Ticket
|
||||
- [ ] Priority dropdown works in UI
|
||||
- [ ] Drag-drop reordering functional
|
||||
- [ ] DAG validity enforced on drop
|
||||
- [ ] Multi-select with checkboxes
|
||||
- [ ] Bulk execute/skip/block works
|
||||
- [ ] 1-space indentation maintained
|
||||
|
||||
Reference in New Issue
Block a user