Durable Task States

How Aevum Encyclopedia persists, tracks, and transitions long-running knowledge workflows across AI processing, expert review, and publication pipelines.

ⓘ Note Task states are immutable snapshots stored via event sourcing. Each transition appends a deterministic event to the task's event log, enabling full auditability and idempotent replay.

State Overview

The durable task state machine governs all article creation, revision, and metadata synchronization workflows. Each state represents a stable checkpoint where the system guarantees persistence, observability, and safe transition conditions.

DRAFT
AI_ANALYSIS
PEER_REVIEW
RESOLUTION_REQUIRED
APPROVED
PUBLISHED
DEPRECATED

State Machine Flow

Tasks progress through a deterministic directed acyclic graph (DAG). Backtracking is only permitted via explicit resolution events.

DRAFT
AI_ANALYSIS
PEER_REVIEW
RESOLUTION_REQUIRED
PEER_REVIEW
APPROVED
PUBLISHED
DEPRECATED

State Definitions

State ID Description Entry Trigger Exit Conditions
DRAFT Initial state. Content is locally stored but not queued for processing. Manual creation or import webhook Submit for AI review
AI_ANALYSIS Automated fact-checking, entity extraction, and cross-reference generation. Transition from DRAFT Analysis complete → PEER_REVIEW or RESOLUTION_REQUIRED
PEER_REVIEW Assigned to domain experts for human verification and editorial pass. AI analysis passes confidence threshold Approval → APPROVED, or Rejection → RESOLUTION_REQUIRED
RESOLUTION_REQUIRED Conflicts, low-confidence assertions, or editorial disputes flagged. AI or reviewer flags issues Author/editor resolves → re-enters PEER_REVIEW
APPROVED Content meets all quality gates. Queued for canonical publication. Consensus from ≥2 domain reviewers Auto-transition to PUBLISHED
PUBLISHED Live in the public encyclopedia. Indexed and cached globally. Approval pipeline completes Manual deprecation or version supersession
DEPRECATED Archived. Superseded by newer version or factually invalidated. Editorial board decision or automated decay rule Terminal state (immutable)

State Transitions & API Contract

All state changes must be requested via the orchestration API. The system validates preconditions, applies business rules, and appends a signed event to the durable log.

POST /api/v1/orchestration/tasks/:taskId/transition
{
  "new_state": "PEER_REVIEW",
  "metadata": {
    "reviewer_ids": ["usr_8x92a", "usr_4k11m"],
    "ai_confidence_score": 0.94,
    "flagged_claims": [],
    "version": "v2.1.0"
  },
  "idempotency_key": "uuid-7a3b9c2d-1e4f-5g6h-7i8j-9k0l1m2n3o4p"
}
⚠ Idempotency Required The idempotency_key field is mandatory. Duplicate requests with the same key within a 24-hour window are silently deduplicated to prevent state corruption.

Transition Guards

Before committing a transition, the engine evaluates:

Persistence & Replay Architecture

Durable tasks are implemented using an event-sourced architecture. Instead of storing mutable state, the system maintains an append-only event log:

  1. Each state transition emits a strongly-typed event (TaskCreated, AnalysisCompleted, ReviewApproved, etc.)
  2. Events are written to a distributed commit log with WAL (Write-Ahead Logging) guarantees.
  3. State is derived by projecting events forward from a known checkpoint.
  4. Crash recovery replays the event log to reconstruct the exact state at the time of failure.

This design ensures exactly-once semantics, full audit trails, and safe horizontal scaling of the orchestration workers.

Related Documentation

Last updated: November 2025 • Engine v4.2.0 • Report documentation issue