Skip to content

Stamp schedule-dispatched runs with a $eve.schedule attribution attribute #708

Description

@warmwind

Problem

The only durable trace a schedule execution leaves is $eve.trigger = 'schedule' on workflow runs — nothing records which schedule fired:

  • run history cannot be aggregated per schedule ("did daily run last night? what's its success rate?" is unanswerable);
  • handler-form schedules that dispatch through receive(channel, ...) produce sessions whose $eve.trigger is the channel kind, not schedule, so filtering by trigger misses them entirely — and that dispatch path is a first-class pattern (Handler-form schedule → channel receive() fails in eve dev with LoadCompiledModuleMapError #104);
  • observability tooling is left with trigger-based heuristics and cannot attribute runs precisely.

Proposal

ScheduleDispatcher is the single choke point for all schedule dispatch (markdown via runMarkdown; handler-form receive() runs in its context too — see the analysis in #387). Stamp the runs it dispatches with:

  • $eve.schedule = the schedule id (optionally $eve.schedule_cron as well);
  • sessions spawned in a schedule context carry the attribute, propagated the same way as $eve.root / $eve.parent;
  • $eve.trigger semantics stay unchanged — channel-dispatched sessions keep the channel kind; this only adds provenance.

Pure metadata addition, no behavior change, backward compatible. With it, attributes ->> '$eve.schedule' = <id> yields any schedule's complete run history regardless of how the handler dispatched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions