feature/task-dependencies
File: contract/src/lib.rs
-
Added new error types:
SelfDependency(8)DependencyNotFound(9)CircularDependency(10)DependencyBlocked(11)
-
Extended
TaskConfigstruct:- Added
blocked_by: Vec<u64>field
- Added
-
Added
TaskDependenciestoDataKeyenum -
New contract functions:
add_dependency(task_id, depends_on_task_id)- Creates blocking relationshipremove_dependency(task_id, depends_on_task_id)- Removes blocking relationshipget_dependencies(task_id)- Returns list of blocking tasksis_task_blocked(task_id)- Checks if task has incomplete dependencieswould_create_cycle()- DFS-based circular dependency detectionhas_path_to()- Helper for cycle detection
-
Updated
execute()function:- Added dependency check before execution
- Panics with
DependencyBlockedif dependencies incomplete
-
Added comprehensive tests:
- Dependency add/remove
- Self-dependency prevention
- Circular dependency detection
- Blocked task execution
- Dependency state checking
New Components:
-
frontend/components/TaskDependencyManager.tsx- Dependency list display with status badges
- Add dependency dropdown
- Remove dependency buttons
- Error handling
-
frontend/components/TaskCard.tsx- Task summary card
- Blocked status indicator
- Dependency count badge
- Click to view details
-
frontend/components/TaskDetailModal.tsx- Full task details view
- Integrated dependency manager
- Task status indicators
-
frontend/app/page.tsx- Updated dashboard with task cards
- Blocked tasks alert banner
- Mock data and handlers (ready for contract integration)
Tests:
File: frontend/__tests__/TaskDependencyManager.test.tsx
- 8 test cases covering all functionality
- All tests passing
Configuration Updates:
frontend/tsconfig.json- Updated jsx mode to "preserve"frontend/jest.config.js- Fixed test paths for new structure
File: docs/task-dependencies.md
- Complete feature documentation
- API reference
- Usage examples
- Best practices
- Error codes reference
✅ Users can create and remove task dependencies ✅ Blocked state is visible in relevant task views ✅ Invalid relationships are prevented or clearly handled ✅ The feature fits naturally into existing task workflows ✅ Tests cover dependency creation, removal, and edge cases
cd contract
cargo testAll dependency tests passing:
test_add_dependencytest_remove_dependencytest_self_dependency_preventedtest_circular_dependency_preventedtest_task_blocked_by_dependencytest_execute_fails_when_blockedtest_dependency_not_found
cd frontend
pnpm testAll 8 tests passing in TaskDependencyManager.test.tsx
- Deploy updated contract to testnet
- Integrate frontend with actual contract calls
- Add keeper logic to respect dependencies
- Update event indexing for dependency events
- Add dependency visualization (graph view)