curator and other components aren't being logged or shown in the Web UI (archie)

This commit is contained in:
samcharles93 committed 2026-09-02 04:00:05 +00:00
1 parent 70afbf7f95
commit 7515ad82aa
4 files changed
+47 -5

No files matched your search

+6 -3
View File
@@ -220,7 +220,9 @@ func (b *boot) setupLogging() error {
Stderr: !cfg.Log.Quiet,
Feed: logFeed,
})
b.log = fileLog
// All daemon diagnostics carry an explicit component so the dashboard's
// component filter does not have to infer ownership from message text.
b.log = fileLog.With("component", "daemon")
b.addCleanup(func() { _ = logCloser.Close() })
if logErr != nil {
b.log.Error("file logging disabled", "err", logErr)
@@ -318,7 +320,7 @@ func (b *boot) setupObservability() {
Path: origin.Path, Role: string(origin.Role), Layer: string(origin.Layer), Feature: string(origin.Feature),
})
}
b.web = &webui.Server{Store: b.st, Log: log, LogFeed: b.logFeed, TaskLogs: b.taskLogs, Cfg: config.NewHolder(cfg), Channels: b.channelManager, Events: bus}
b.web = &webui.Server{Store: b.st, Log: log.With("component", "webui"), LogFeed: b.logFeed, TaskLogs: b.taskLogs, Cfg: config.NewHolder(cfg), Channels: b.channelManager, Events: bus}
b.web.UpdateReportPath = updateReportPath(cfg.WorkDir, "webui")
if cfg.Chat.Telegram.TokenEnv != "" && len(cfg.Chat.Telegram.AllowedUserIDs) > 0 {
b.web.TelegramUpdateReportPath = updateReportPath(cfg.WorkDir, cfg.BotUser)
@@ -828,7 +830,7 @@ func (b *boot) setupMemoryAll() error {
// bounded dropping per-subscriber buffers guarantee curator activity can
// never backpressure the daemon or a chat turn.
func (b *boot) setupCurators(ctx context.Context) {
log := b.log
log := b.log.With("component", "curator")
// Skills root matches loadWorkflows' own resolution of skillsBase --
// the skill curator maintains the same local skills this daemon
// already treats as authoritative, not the full multi-root catalog a
@@ -838,6 +840,7 @@ func (b *boot) setupCurators(ctx context.Context) {
skillsRoot = b.cfg.WorkDir
}
b.curatorRegistry = curator.NewRegistry(curator.Registrar{
Log: log.With("component", "curator"),
Events: curatorEventSink{b.bus},
// b.memEngines (*domainmemory.Registry) satisfies
// curator.MemoryEngineSource's Get(name) signature directly, no
+4
View File
@@ -2,6 +2,7 @@ package curator
import (
"context"
"log/slog"
"time"
domainmemory "github.com/samcharles93/archie-core/internal/domain/memory"
@@ -14,6 +15,9 @@ import (
// daemon itself is never part of it. Fields are typed contracts declared
// here — this package never names who implements them.
type Registrar struct {
// Log is the curator-scoped diagnostic logger. It is optional so domain
// tests and embedders can construct a registrar without a logging sink.
Log *slog.Logger
// Model is the default model reference ("provider/model") for
// curators whose manifest leaves Model empty.
Model string
+6
View File
@@ -224,6 +224,9 @@ func (r *Registry) Start(ctx context.Context) error {
r.mu.Lock()
if err != nil {
r.status[name] = curatorStatus{startErr: err}
if r.host.Log != nil {
r.host.Log.Error("curator lifecycle failed", "curator", name, "phase", "start", "err", err)
}
errs = append(errs, fmt.Errorf("curator %s: %w", name, err))
} else {
r.status[name] = curatorStatus{started: true}
@@ -294,6 +297,9 @@ func (r *Registry) Stop(ctx context.Context) error {
}
c := r.curators[name]
if err := stopSafely(ctx, c); err != nil {
if r.host.Log != nil {
r.host.Log.Error("curator lifecycle failed", "curator", name, "phase", "stop", "err", err)
}
errs = append(errs, fmt.Errorf("curator %s: %w", name, err))
}
}
+31 -2
View File
@@ -94,6 +94,13 @@ func (rt *Runtime) Start(ctx context.Context) error {
rt.mu.Unlock()
startErr := rt.registry.Start(ctx)
if log := rt.registry.Host().Log; log != nil {
if startErr != nil {
log.Error("curator runtime start completed with failures", "err", startErr)
} else {
log.Info("curator runtime started", "curators", len(rt.registry.Names()))
}
}
for _, name := range rt.registry.Names() {
c, _ := rt.registry.Get(name)
rt.wg.Add(1)
@@ -145,9 +152,20 @@ func (rt *Runtime) Stop(ctx context.Context) error {
select {
case <-done:
case <-ctx.Done():
if log := rt.registry.Host().Log; log != nil {
log.Error("curator runtime shutdown timed out", "err", ctx.Err())
}
return fmt.Errorf("curator runtime shutdown: %w", ctx.Err())
}
return rt.registry.Stop(ctx)
err := rt.registry.Stop(ctx)
if log := rt.registry.Host().Log; log != nil {
if err != nil {
log.Error("curator runtime stopped with failures", "err", err)
} else {
log.Info("curator runtime stopped")
}
}
return err
}
// runLoop is one curator's lifetime: sleep until eligible or nudged, ask
@@ -278,6 +296,9 @@ func (rt *Runtime) safePass(ctx context.Context, c CuratorEngine, in PassInput)
// non-blocking by contract (bounded dropping buffers), so even a failing
// curator cannot backpressure anything.
func (rt *Runtime) fail(name, phase string, err error) {
if log := rt.registry.Host().Log; log != nil {
log.Error("curator failed", "curator", name, "phase", phase, "err", err)
}
if sink := rt.registry.Host().Events; sink != nil {
sink.Emit(events.KindCuratorError, name, map[string]any{
"curator": name,
@@ -292,7 +313,15 @@ func (rt *Runtime) fail(name, phase string, err error) {
func (rt *Runtime) emitRun(name string, at time.Time, result PassResult) {
rt.registry.RecordActivity(name, at, result.Actions)
sink := rt.registry.Host().Events
host := rt.registry.Host()
if log := host.Log; log != nil {
log.Info("curator pass completed", "curator", name, "actions", len(result.Actions), "at", at)
for _, a := range result.Actions {
log.Info("curator action", "curator", name, "type", a.Type, "detail", a.Detail, "reason", a.Reason, "at", a.At)
}
}
sink := host.Events
if sink == nil {
return
}