Skip to content

Establish a GradingOrchestrator service layer #29

@AishaA-cpu

Description

@AishaA-cpu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions