Skip to content

Subject Dispatch

What SubjectDispatch Is

SubjectDispatch is Animus's universal work envelope. Every workflow start, whether it comes from the CLI, a queue tick, a schedule, or MCP, enters the runtime through the same contract.

The daemon only needs this envelope plus execution facts. It does not need to understand task rules, requirement rules, or pack-specific behavior.

Subject Identity

Animus has moved from a task-shaped subject model toward a generic subject identity contract:

text
SubjectRef {
  kind: String,
  id: String,
  title: Option<String>,
  description: Option<String>,
  labels: Vec<String>,
  metadata: Value,
}

Common subject kinds today:

KindExample
animus.taskTASK-042
animus.requirementREQ-007
customplanning-intake

Compatibility adapters still preserve the existing task and requirement flows, but routing is now keyed by generic kind and id.

Dispatch Shape

text
SubjectDispatch {
  subject: SubjectRef,
  workflow_ref: String,
  input: Option<Value>,
  vars: HashMap<String, String>,
  priority: Option<String>,
  trigger_source: String,
  requested_at: DateTime<Utc>,
}
FieldPurpose
subjectIdentity of the work item
workflow_refWorkflow to execute, usually a pack-qualified ref
inputOptional JSON payload for the workflow
varsExplicit string variables passed to the workflow
priorityOptional queue priority hint
trigger_sourceDispatch origin such as manual, ready-queue, schedule, or mcp
requested_atUTC timestamp for auditability and queue ordering

Canonical Workflow Refs

Examples of current workflow refs consumed by dispatch and animus workflow run:

Use CaseSubjectWorkflow Ref
Requirement executionanimus.requirement:REQ-007animus.requirement/execute
Standard task deliveryanimus.task:TASK-042animus.task/standard

Legacy aliases such as builtin/requirements-execute still resolve, but they are compatibility shims rather than the preferred surface.

Why This Boundary Matters

The single dispatch contract lets Animus keep clean boundaries:

  • the daemon schedules and supervises subprocesses
  • subject adapters resolve subject-specific context and cwd policy
  • workflows and packs define behavior
  • execution projectors map facts back onto subject state

That is how Animus can add new domains without pushing more branching logic into the daemon.

Released under the Elastic License 2.0 (ELv2).