Back to home page

EIC code displayed by LXR

 
 

    


Warning, /swf-testbed/docs/agentic-workflow-view.md is written in an unsupported language. File is not indexed.

0001 # Agentic workflow view
0002 
0003 A temporal view of one workflow execution: the agents that ran it, the
0004 workers it provisioned, the messages that passed between them, and the
0005 data that flowed through them — rendered as a live display while the
0006 workflow runs and as a replay of any past execution. The view is a
0007 Snapper surface; the engine mechanisms it requires are specified in
0008 snapper-ai `docs/EPISODES.md`.
0009 
0010 ## Display
0011 
0012 The plot is a stack of horizontal lanes over a time axis, in the
0013 established Snapper Time history vocabulary (lanes, tiles, cut,
0014 floater, step arrows).
0015 
0016 - One lane per participant. The workflow runner and the agents open
0017   the stack; worker lanes appear below as workers come into
0018   existence. A prompt-processing execution opens with a handful of
0019   lanes and fans out to tens of worker lanes, then converges as jobs
0020   finish and the run tears down.
0021 - Lanes are dynamic: a lane begins when its participant registers and
0022   ends when it exits. A finished participant's lane keeps its
0023   vertical slot, dimmed, to the end of the episode, so the fanout and
0024   convergence render as a stable shape and the vertical layout never
0025   reshuffles during a replay.
0026 - Messages render as marks at their send time on the sender's lane,
0027   with connectors to recorded consumers where consumption records
0028   exist (see Data contract below).
0029 - Activity on a lane renders as tiles: an agent's processing spans, a
0030   worker's created / started / finished phases.
0031 - A click on any element opens its detail card: message payload,
0032   agent record, PanDA job record, file record.
0033 - The cut and step arrows carry their Time history meanings: a click
0034   is a time slice, the arrows step the window. An execution-stepping
0035   mode — arrows move between executions rather than time windows —
0036   is a candidate addition.
0037 - Live mode: while the execution runs, the view follows it, either
0038   pseudo-realtime as events land or promptly after completion. Both
0039   are feasible with current record latencies (seconds for messages
0040   and file records, minutes for PanDA job state).
0041 
0042 ## Evidence audit
0043 
0044 Audited 2026-08-02 against prompt-processing execution
0045 `prompt_processing-zyang2-0845` (run 102827, 15 STFs, decision-box
0046 broadcast to E1_BNL and E1_JLAB) and the stf_datataking executions of
0047 the same day. The full event sequence is reconstructable from
0048 existing records, all in the system database with sub-second
0049 timestamps:
0050 
0051 | time (UTC) | event | record |
0052 |---|---|---|
0053 | 20:00:13 | execution starts | WorkflowExecution |
0054 | 20:00:18 | run_imminent | message log |
0055 | 20:00:26 | start_run | message log |
0056 | 20:00:27–20:01:02 | stf_gen ×15, pause/resume around standby | message log |
0057 | 20:00:29.6/.7 | stf_ready per site: the decision-box fanout | message log |
0058 | 20:00:34.6 | PanDA tasks created, one per site | PanDA tasks |
0059 | 20:05:55 | 15+15 jobs created | PanDA jobs |
0060 | 20:11:22–43 | jobs start | PanDA jobs |
0061 | 20:13–20:14:43 | jobs finish, tasks done | PanDA jobs, tasks |
0062 
0063 ## Data contract
0064 
0065 Sources, all local database reads (no remote calls in the render
0066 path):
0067 
0068 - **WorkflowExecution** — episode identity, start and end, full
0069   parameter set including agent roster and workflow configuration.
0070 - **WorkflowMessage** — sender agent, type, namespace, execution id,
0071   run id, payload, sent-at to the microsecond.
0072 - **SystemAgent** — lane birth (`created_at` at registration), lane
0073   death (`operational_state` EXITED, stamped by `updated_at`),
0074   heartbeats, pid, hostname.
0075 - **STF files / TF slices** — file-level flow; TF slice records name
0076   their `assigned_worker`.
0077 - **PanDA tasks** — the run number is embedded in the task name
0078   (`user.<user>.swf.<run>.processed.<site>/`), giving a direct join
0079   from execution to tasks; creation, start, and end times per task.
0080 - **PanDA jobs** — one record per worker with creation, start, and
0081   end times, site, and output metadata; jobs join to tasks by
0082   `jeditaskid`. For these workflows the worker lanes are the PanDA
0083   jobs born within the execution's tasks.
0084 
0085 ## Gaps to fill
0086 
0087 Verified in code at the executing commits, 2026-08-02:
0088 
0089 1. **Consumption records.** Messages record their sender only. The
0090    messaging philosophy is open listening — any agent may subscribe —
0091    so an addressee list recorded at send time would misstate the
0092    model. Instead, consumers record consumption: an agent that receives a
0093    message and acts on it records that fact with message id and
0094    timestamp. This yields the message connectors for the view and,
0095    independently, a workflow-integrity tool: a message no agent
0096    consumed, or a message consumed by an unexpected agent, becomes a
0097    detectable condition. Requires team discussion before
0098    implementation.
0099 2. **Processing agent announcements.** The prompt-processing agent
0100    emits only heartbeats; its PanDA task submissions are visible only
0101    through the task records appearing. It should announce submission
0102    events on the bus like its peers announce theirs.
0103 3. **Explicit agent exit stamp.** Lane death is currently inferred
0104    from the EXITED transition's `updated_at`; an explicit exit
0105    timestamp would remove the approximation.
0106 4. **Durable episode capture.** Messages and file records are
0107    operational logs with retention policies. An episode is captured
0108    into a durable Snapper record at (or promptly after) execution
0109    end, so replay never depends on raw log retention.
0110 
0111 ## Delivery phases
0112 
0113 1. **Episode capture** — a builder that joins the sources above into
0114    a durable episode record for each execution, live or promptly
0115    after completion.
0116 2. **Replay view** — the lane display for any captured episode.
0117 3. **Live mode** — the view follows a running execution.
0118 4. **Production scale** — the same mechanism applied to epicprod
0119    workflows: campaign tasks fanning out across grid sites, with
0120    PanDA jobs as worker lanes. The mechanism is generic; only the
0121    provider data differs.
0122 
0123 Related documentation: `fast-processing-workflow.md`,
0124 `e0-e1-state-machine.md`, snapper-ai `docs/EPISODES.md`.