Observation lifecycle src

sequenceDiagram
  participant ALERT as Alert Integrations<br>
  participant U as User
  participant API as Skynet API
  participant SCH as Scheduler
  participant SN as Sky-Node
  participant OBJ as Object Storage
  participant PIPE as Pipelines
  participant TOOL as Data Tools

  autonumber
  ALERT ->> API: Send alert (candidate/transient event)
  API ->> API: Auto-create Observation from alert metadata
  API -->> U: Notify new Observation (optional)
  U ->> API: Submit observation (manual path also supported)
  SCH ->> API: Read observations
  SCH ->> API: Create tasks per telescope
  loop poll
    SN ->> API: Get next task
    API -->> SN: Task details
  end
  SN ->> SN: Execute task (orchestrate devices)
  SN ->> OBJ: Upload files
  SN ->> API: Mark upload complete
  API ->> PIPE: Trigger processing
  PIPE ->> OBJ: Read raw files
  PIPE -->> API: Register products
  API -->> TOOL: Enable tools for dataset
  U ->> TOOL: Open and analyze
  opt Closed-loop optimization
    TOOL ->> API: Propose/Apply Observation updates<br/>(exposure, cadence, filters, constraints)
    API ->> SCH: Recompute schedule & remaining tasks
    SCH ->> API: Update tasks for Observation
    Note over SN, API: Next poll fetches updated tasks reflecting tool feedback
  end