fix(governance): report only the dashboard sections that exist (#2147)

#2121 removed the pages behind sixteen sections and both capability handlers
still named them, so GET /api/capabilities advertised sections nothing can
render and the old service probed for pages that are gone.

The single binary now reports an organisation as unavailable (its page exists,
its writes do not) and lists nothing else it has no page for; the old service
reports only the sections and probes its pages still make.
This commit is contained in:
sam committed 2026-11-27 19:35:01 +11:00
1 parent 6a25153659
commit 77e291fdfc
2 files changed
+4 -18

No files matched your search

-10
View File
@@ -11,13 +11,8 @@ import (
func (s *Server) handleCapabilities(w http.ResponseWriter, r *http.Request) { func (s *Server) handleCapabilities(w http.ResponseWriter, r *http.Request) {
sections := map[string]bool{ sections := map[string]bool{
"chat": s.Chat != nil && s.Chat.Contract != nil, "chat": s.Chat != nil && s.Chat.Contract != nil,
"logs": s.LogFeed != nil,
"skills": s.Skills != nil,
"curators": s.Curators != nil,
"channels": s.Channels != nil,
"captures": s.Captures != nil, "captures": s.Captures != nil,
"mappings": s.Mappings != nil, "mappings": s.Mappings != nil,
"bindings": s.Bindings != nil,
// The workflows page draws its statistics from the task store // The workflows page draws its statistics from the task store
// and its definition list from the local registry, so it is // and its definition list from the local registry, so it is
// worth showing with only the former. // worth showing with only the former.
@@ -48,11 +43,6 @@ type pageProbe struct{ section, method, path string }
func pageProbes() []pageProbe { func pageProbes() []pageProbe {
return []pageProbe{ return []pageProbe{
{"org_members", http.MethodPost, "/api/orgs/_/members"}, {"org_members", http.MethodPost, "/api/orgs/_/members"},
{"org_agents", http.MethodPut, "/api/orgs/_/agents/_"},
{"org_policies", http.MethodPut, "/api/access/policies"}, {"org_policies", http.MethodPut, "/api/access/policies"},
{"org_denials", http.MethodGet, "/api/access/denials"},
{"org_audit", http.MethodGet, "/api/audit"},
{"org_usage", http.MethodGet, "/api/usage"},
{"org_config", http.MethodPost, "/api/control-plane/resources/_/commands/replace"},
} }
} }
+4 -8
View File
@@ -612,17 +612,13 @@ func (m *Module) capabilities(ctx context.Context, _ *struct{}) (*httpapi.Reply[
sections := map[string]bool{"chat": signedIn, "memory": signedIn} sections := map[string]bool{"chat": signedIn, "memory": signedIn}
for _, name := range []string{ for _, name := range []string{
"settings", "events", "workflows", "runs", "credentials", "secret_engines", "controls", "memory_admin", "settings", "events", "workflows", "runs", "credentials", "secret_engines", "controls", "memory_admin",
"home", "system_status", "org_config", "captures", "mappings", "bindings", "extension_catalogue", "model_aliases", "workflow_editor", "home", "system_status", "org_config", "captures", "mappings", "extension_catalogue", "model_aliases", "workflow_editor",
} { } {
sections[name] = p.InstanceAdmin() sections[name] = p.InstanceAdmin()
} }
for _, name := range []string{ // An organisation is created through the API alone here, so its page is
"tasks", "work_requests", "logs", "skills", "curators", "channels", // offered but its writes are not.
"task_execution", "organisations", "tools", "plugins", "container_runtime", "agent_profiles", sections["organisations"] = false
"org_agents", "org_audit", "org_usage", "org_work_intake",
} {
sections[name] = false
}
// The access pages are offered to those the policy chain lets use them. // The access pages are offered to those the policy chain lets use them.
sections["org_members"] = m.mayUse(ctx, p, ActionManageMembers, KindMember) sections["org_members"] = m.mayUse(ctx, p, ActionManageMembers, KindMember)
sections["org_policies"] = m.mayUse(ctx, p, ActionManagePolicies, KindPolicy) sections["org_policies"] = m.mayUse(ctx, p, ActionManagePolicies, KindPolicy)