Harden worker federation and operator UI
This commit is contained in:
@@ -66,6 +66,13 @@ type Task struct {
|
||||
Version int `json:"version"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
// Block evidence is projected from TaskBlocked so terminal records remain
|
||||
// diagnosable after the live coordinator mapping is gone.
|
||||
Blocker string `json:"blocker,omitempty"`
|
||||
BlockedAt time.Time `json:"blocked_at,omitempty"`
|
||||
LastPaneID string `json:"last_pane_id,omitempty"`
|
||||
LastHarness string `json:"last_harness_id,omitempty"`
|
||||
PaneState string `json:"pane_state,omitempty"` // open, closed, unreachable, unknown
|
||||
}
|
||||
|
||||
type Event struct {
|
||||
@@ -189,6 +196,9 @@ func ValidatePayload(typ string, p map[string]any) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if v, ok := p["pane_state"]; ok && v != "open" && v != "closed" && v != "unreachable" && v != "unknown" {
|
||||
return fmt.Errorf("%w: pane_state invalid", ErrInvalid)
|
||||
}
|
||||
case "TaskAmended":
|
||||
if len(p) == 0 {
|
||||
return fmt.Errorf("%w: amendment cannot be empty", ErrInvalid)
|
||||
|
||||
Reference in New Issue
Block a user