MCPcopy Create free account
hub / github.com/compozy/agh / Validate

Method Validate

internal/task/wake.go:115–130  ·  view source on GitHub ↗

Validate reports whether the wake event has the minimum delivery identity.

()

Source from the content-addressed store, hash-verified

113
114// Validate reports whether the wake event has the minimum delivery identity.
115func (e WakeEvent) Validate() error {
116 normalized := e.Normalize()
117 if normalized.WakeEventID == "" {
118 return fmt.Errorf("%w: wake_event_id is required", ErrValidation)
119 }
120 if normalized.TaskID == "" {
121 return fmt.Errorf("%w: wake_event.task_id is required", ErrValidation)
122 }
123 if err := normalized.Reason.Validate("wake_event.reason"); err != nil {
124 return err
125 }
126 if normalized.Summary == "" {
127 return fmt.Errorf("%w: wake_event.summary is required", ErrValidation)
128 }
129 return nil
130}
131
132func (m *Service) dispatchTerminalWake(ctx context.Context, taskRecord Task, run Run, actor ActorContext) {
133 status := run.Status.Normalize()

Callers

nothing calls this directly

Calls 2

NormalizeMethod · 0.95
ValidateMethod · 0.65

Tested by

no test coverage detected