task.py
1"""A task's objective and the notification that caused it to run now."""23from __future__ import annotations45from dataclasses import dataclass, field6from typing import Any, Dict78from sim_platform.domain.models import ContractError91011@dataclass(frozen=True)12class Task:13 """Tell the agent what to do, separately from Runtime's wake-up bookkeeping.1415 instruction is the task to perform. notification carries the wake reason and16 timing/events, not current market data. Work IDs remain on AgentClient.17 """1819 instruction: str20 notification: Dict[str, Any] = field(default_factory=dict)2122 def __post_init__(self) -> None:23 if not isinstance(self.instruction, str) or not self.instruction.strip():24 raise ContractError('task requires a nonempty instruction')