Skip to content

Auto-assignment algorithm v1 (Hearts + Stars) #4

@guangshinhaha

Description

@guangshinhaha

Context

Every serious competitor (Dive, Untis, aSc/Edupage) ships auto-assignment. Without this ReliefCher is a worse spreadsheet — admins click through every period manually. This is the #1 blocker to a credible demo.

Westwood Sec (HOD Eric Foo) gave us a ready-made config schema from their Dive setup, so we don't need to invent one.

Algorithm (Hearts + Stars)

  • Hearts → workload balancing. Each teacher starts the week at full hearts; every relief slot taken decrements. Resets weekly. Lower hearts = lower assignment priority.
  • Stars → compatibility / role priority. Customisable per school. Westwood's order:
    1. SRE (Student Relief Educators) — highest
    2. Untrained teachers / TAs
    3. FAJT (Form & Admin Job Teachers)
    4. EO (Executive Officers) — lowest
  • Subject/department match adds star weight.
  • Hard constraints: teacher must not already be teaching that period; teacher must not be on leave.

Acceptance criteria

  • Admin can trigger auto-assign for a given date from the dashboard.
  • Algorithm proposes assignments for every uncovered period in <5s.
  • Output is editable (admin can override before publishing).
  • School-level config UI for the priority order (drag-to-reorder).
  • Weekly hearts reset job (cron or on-read recompute).
  • Conflict checks reuse existing logic in /api/relief-assignments.

Out of scope (separate tickets)

  • Consecutive-period optimisation pass — see #(P1 wedge)
  • AI absence-note validation — see #(P1 wedge)
  • Notifications — see P0 email ticket

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    p0Table-stakes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions