hopefully done refining

This commit is contained in:
2026-03-06 16:14:31 -05:00
parent 88e27ae414
commit 1294104f7f
20 changed files with 1736 additions and 734 deletions

View File

@@ -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