Files
inter-hub/Web/Controller/LearningDashboard.hs
Bernd Worsch 2c22766cd6 fix(WP-0017/E5): Layer 3 error fixes — round 3 (24 files)
Int16→Int in score/stars functions; uuid-based readMay→UUID.fromText;
autoRefresh do-notation fix; id→\x->x ambiguity in HubRoutingRules;
MarketplaceDashboard replaced raw SQL with IHP query builder; optional
hub selector in TypeRegistry views via CanSelect (Text, Maybe Id) instance
added to Web.View.Prelude; import consolidations to Web.View.Prelude.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:11:32 +00:00

32 lines
1.2 KiB
Haskell

module Web.Controller.LearningDashboard where
-- IHF Phase 12 — Platform Memory (IHUB-WP-0013 T07)
import Web.Controller.Prelude
import Web.View.LearningDashboard.Show
instance Controller LearningDashboardController where
beforeAction = ensureIsUser
action LearningDashboardAction = autoRefresh do
topCorrelations <- query @OutcomeCorrelation
|> orderByDesc #correlationScore
|> limit 10
|> fetch
patternRankings <- query @PatternPerformanceRecord
|> orderByAsc #outcomeRank
|> limit 10
|> fetch
hubs <- query @Hub |> orderByAsc #name |> fetch
configs <- query @AdaptiveThresholdConfig |> fetch
let thresholdStatus = map (\h -> (h, find (\c -> c.hubId == h.id) configs)) hubs
recentInsights <- query @LearningInsight
|> orderByDesc #computedAt
|> limit 10
|> fetch
knowledgeHighlights <- query @InstitutionalKnowledgeEntry
|> orderByDesc #createdAt
|> limit 5
|> fetch
render ShowView { topCorrelations, patternRankings, thresholdStatus, recentInsights, knowledgeHighlights }