Problem
The current routing logic invokes grading tasks directly via Celery, without abstraction. As logic for grading, validation, or future priority/queue management grows, this direct coupling will make it hard to extend or optimize.
Proposal
- Implement a GradingOrchestrator service class responsible for all grading submission operations
- The orchestrator validates submission state, manages queueing (priority, retry, error cases), and decouples routers from background task mechanics
- Refactor routers to depend on this service (with FastAPI
Depends)
- Add tests for orchestrator logic
Rationale
- Abstraction makes the grading workflow testable and ready for evolving requirements
- Enables async/priority queueing, alternate task backends, or business rules with minimal router changes
Acceptance Criteria
- Routers depend only on service interface, not Celery tasks directly
- GradingOrchestrator is covered by unit tests
- Submission flows are unchanged from user POV
Labels: architecture, enhancement, backend
Problem
The current routing logic invokes grading tasks directly via Celery, without abstraction. As logic for grading, validation, or future priority/queue management grows, this direct coupling will make it hard to extend or optimize.
Proposal
Depends)Rationale
Acceptance Criteria
Labels: architecture, enhancement, backend