33 lines
1.2 KiB
Haskell
33 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 = do
|
||
|
|
autoRefresh
|
||
|
|
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 }
|