feat(webui): park model credential failures with a recovery link, add Model setup step, readiness badges, and move audit to the organisation

This commit is contained in:
sam committed 2026-10-27 11:06:18 +11:00
1 parent 2fb0084d2c
commit 1a8b442acd
28 files changed
+131 -61

No files matched your search

+13
View File
@@ -1,6 +1,7 @@
package webui
import (
"context"
"net/http"
"github.com/samcharles93/archie-core/internal/domain/identity"
@@ -17,6 +18,11 @@ type SetupStep struct {
Path string `json:"path,omitempty"`
}
// ModelReader reads the model aliases the calling principal's org may use.
type ModelReader interface {
CallerModels(ctx context.Context) (org string, aliases map[string]string, err error)
}
// handleSetup reports which setup steps are still missing in the caller's
// organisation, from live state. Optional capabilities (a chat channel, a
// repository) are set up where they are used, not listed here.
@@ -36,6 +42,13 @@ func (s *Server) handleSetup(w http.ResponseWriter, r *http.Request) {
}
steps = append(steps, SetupStep{Title: "First task", Done: total > 0, Path: "/tasks"})
}
if s.Models != nil {
// Shown only while the org has no model to run, so a working setup
// carries no extra step.
if _, aliases, err := s.Models.CallerModels(r.Context()); err == nil && len(aliases) == 0 {
steps = append(steps, SetupStep{Title: "Model", Path: "/org/models"})
}
}
writeJSON(w, map[string]any{"steps": steps})
}