Task Lifecycle
This document describes the lifecycle of a Task, including its interactions with Referee Requests and Judgements.
1. Overview
The Task status moves primarily through three stages: Draft, Open, and Closed (or Completed).
Within the Open state, the Referee Request and Judgement lifecycles operate.
2. Prerequisites
This is the foundational feature. Other features depend on this:
-
Evidence Submission — Evidence submission within the Judgement lifecycle.
-
Judgement — Referee approve/reject flow.
-
Payment & Reward Flow — Point lock/settle mechanism.
3. State Transition Diagram
The following diagram illustrates the state transitions for Tasks, Referee Requests, and Judgements.
3.1. State Descriptions
3.1.1. Task Status
-
Draft: Task is being created. No points consumed yet.
-
Open: Task is published. Referees can be matched.
-
Closed: All process finished.
3.1.2. Request Status
-
Pending: Waiting for a referee to be matched.
-
Matched: System found a referee. (Auto-transits to Accepted in MVP).
-
Accepted: Referee accepted the request. Points reserved.
-
Cancelled: Referee cancelled assignment. New request created for re-matching.
-
Expired: Pending request expired (past rematch cutoff). Points refunded.
-
Closed: Request finished (either Judgement Confirmed or Evidence Timeout).
3.1.3. Judgement Status
-
Awaiting Evidence: Initial state. Waiting for Tasker to submit evidence.
-
In Review: Evidence submitted. Referee is reviewing.
-
Approved: Referee approved the task. Tasker confirmation required.
-
Rejected: Referee rejected. Tasker can update evidence (once, before due date).
-
Review Timeout: Referee failed to make a judgement in time.
-
Evidence Timeout: Tasker failed to submit evidence in time.
-
Confirmed: Final state. Judgement is finalized.
4. Timeline and Notifications
Notifications and state changes occur based on time limits (timeouts).
5. Time Constraints
All matching time constraints live in the matching_time_config singleton table with a CHECK constraint enforcing open_deadline > rematch_cutoff > cancel_deadline.
| Parameter | Default | Purpose |
|---|---|---|
|
24 |
Min hours before due_date to open a task |
|
12 |
Hours before due_date until referee can cancel |
|
14 |
Hours before due_date until system retries matching; past this, pending requests expire with refund |
The rematch cutoff (14h) is the binding constraint — a referee assigned overnight may not notice the assignment before due_date.
6. Points and Closure
-
Points are locked when a Task is opened and settled when each judgement is confirmed. See Payment & Reward Flow for details.
-
A Task transitions to
Closedwhen all judgements are confirmed (is_confirmed = true), not when requests are closed. -
To prevent tasks from hanging indefinitely, the system auto-confirms if the Tasker takes no action within a grace period after the due date.