feat(watchdog): quarantine escalates to ask_owner; reinstate/retire resolve fail-safe (#45)

This commit is contained in:
Smokey committed 2026-10-28 09:20:34 -06:00
1 parent bf4844c010
commit 720352c45b
6 files changed
+207 -23

No files matched your search

+5 -2
View File
@@ -16,6 +16,7 @@ import (
"os/signal"
"path/filepath"
"strconv"
"sync/atomic"
"time"
)
@@ -36,11 +37,13 @@ type Server struct {
msgs *MessageStore
ctx context.Context // cancelled on shutdown; lists and streams end with it
beat time.Duration
askTimeout time.Duration // an ask_owner unanswered past this reads as rejected (#41, fail safe like WebApprover)
askTimeout atomic.Int64 // nanos: an ask_owner unanswered past this reads as rejected (#41, fail safe like WebApprover). Atomic because handlers and the watchdog emit path read it concurrently, and tests narrow the window while the server runs (#45).
}
func NewServer(ctx context.Context, p *Pipeline, approver *WebApprover, nests *NestStore) *Server {
return &Server{p: p, approver: approver, hub: NewHub(), nests: nests, ctx: ctx, beat: heartbeat, askTimeout: 10 * time.Minute}
s := &Server{p: p, approver: approver, hub: NewHub(), nests: nests, ctx: ctx, beat: heartbeat}
s.askTimeout.Store(int64(10 * time.Minute))
return s
}
// WithMessages attaches the nest conversation log (chatroom path).