feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
module Web.View.FederatedGovernance.Dashboard where
|
|
|
|
|
|
|
|
|
|
import Web.Types
|
|
|
|
|
import Generated.Types
|
|
|
|
|
import IHP.Prelude
|
|
|
|
|
import IHP.ViewPrelude
|
2026-04-04 09:55:12 +00:00
|
|
|
import Web.Routes ()
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
import qualified Data.List as List
|
|
|
|
|
|
|
|
|
|
data FederatedGovernanceDashboardView = FederatedGovernanceDashboardView
|
|
|
|
|
{ hubs :: ![Hub]
|
|
|
|
|
, widgets :: ![Widget]
|
|
|
|
|
, ownerships :: ![WidgetOwnership]
|
|
|
|
|
, rules :: ![HubRoutingRule]
|
|
|
|
|
, routedCandidates :: ![RequirementCandidate]
|
|
|
|
|
, overlays :: ![FederatedPolicyOverlay]
|
|
|
|
|
, allDecisions :: ![DecisionRecord]
|
|
|
|
|
, allPolicies :: ![PolicyReference]
|
|
|
|
|
, stewards :: ![StewardshipRole]
|
|
|
|
|
, recentArchives :: ![ArchiveRecord]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
instance View FederatedGovernanceDashboardView where
|
|
|
|
|
html FederatedGovernanceDashboardView { .. } = [hsx|
|
|
|
|
|
<div class="flex items-center justify-between mb-6">
|
|
|
|
|
<h1 class="text-2xl font-semibold">Federated Governance</h1>
|
|
|
|
|
<a href={PolicyComplianceDashboardAction}
|
|
|
|
|
class="text-sm text-indigo-600 hover:underline">Policy Compliance →</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
|
|
|
|
{panel1Ownership}
|
|
|
|
|
{panel2Routing}
|
|
|
|
|
{panel3PolicyCompliance}
|
|
|
|
|
{panel4Stewardship}
|
|
|
|
|
{panel5Archive}
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
where
|
|
|
|
|
-- ── Panel 1: Ownership coverage ──────────────────────────────────
|
|
|
|
|
totalWidgets = length widgets
|
|
|
|
|
ownedWidgetIds = List.nub (map (.widgetId) ownerships)
|
|
|
|
|
ownedCount = length ownedWidgetIds
|
|
|
|
|
localCount = length (filter (\o -> o.ownershipType == "local") ownerships)
|
|
|
|
|
delegatedCount = length (filter (\o -> o.ownershipType == "delegated") ownerships)
|
|
|
|
|
globalCount = length (filter (\o -> o.ownershipType == "global") ownerships)
|
|
|
|
|
ownershipPct :: Int
|
|
|
|
|
ownershipPct = if totalWidgets == 0 then 0 else (ownedCount * 100) `div` totalWidgets
|
|
|
|
|
|
|
|
|
|
panel1Ownership = [hsx|
|
|
|
|
|
<div class="bg-white rounded-lg border border-gray-200 p-5">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h2 class="font-medium text-gray-800">Ownership Coverage</h2>
|
|
|
|
|
<a href={WidgetOwnershipsAction}
|
|
|
|
|
class="text-xs text-blue-600 hover:underline">View all →</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex gap-6 mb-4">
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-gray-900">{show ownedCount}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">of {show totalWidgets} widgets owned</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-indigo-600">{show ownershipPct}%</div>
|
|
|
|
|
<div class="text-xs text-gray-500">coverage</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex gap-3 text-xs">
|
|
|
|
|
<span class="bg-gray-100 text-gray-700 px-2 py-1 rounded">
|
|
|
|
|
local: {show localCount}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="bg-blue-100 text-blue-700 px-2 py-1 rounded">
|
|
|
|
|
delegated: {show delegatedCount}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="bg-purple-100 text-purple-700 px-2 py-1 rounded">
|
|
|
|
|
global: {show globalCount}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
-- ── Panel 2: Routing activity ─────────────────────────────────────
|
|
|
|
|
activeRulesCount = length rules
|
|
|
|
|
routedCount = length routedCandidates
|
fix(WP-0014/A2): continued type-correctness fixes and Tailwind CSS output
- Schema.sql: add FK constraints for phases 6–12 so IHP generates Id X
instead of UUID for FK columns (widget_adapter_specs, friction_scores,
hub_routing_rules, agent_proposals, hub_capability_manifests, etc.)
- HubHealth, ModelRouter, ApiInteractionEvents: remove toUUID() wrappers
now that FK columns carry proper Id types
- FederatedGovernance/Dashboard, HubRoutingRules/Index: same Id comparison fix
- AgentProposals/Index, DecisionRecords/Index, ApiConsumers/Edit: Id type fixes
- BottleneckDetector: add Data.Coerce import; CrossHubPropagation: add guard
- ApiKeys: qualify cryptohash-sha256 import to resolve package ambiguity
- WebhookDeliveryJob: use LBS.fromStrict; remove duplicate diffUTCTime
- Sessions/New: use renderFlashMessages (IHP built-in)
- ArchiveRecords/LineageInspector: simplify renderChainStep signature
- static/app.css: Tailwind CSS output (2011 lines) — A3 confirmed
- workplans/IHUB-WP-0015-local-deployment-intro-ui.md: add workplan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 01:49:41 +00:00
|
|
|
hubName hid = maybe (show hid) (.name) (find (\h -> h.id == hid) hubs)
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
|
|
|
|
|
panel2Routing = [hsx|
|
|
|
|
|
<div class="bg-white rounded-lg border border-gray-200 p-5">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h2 class="font-medium text-gray-800">Routing Activity</h2>
|
|
|
|
|
<a href={HubRoutingRulesAction}
|
|
|
|
|
class="text-xs text-blue-600 hover:underline">Rules →</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex gap-6 mb-4">
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-gray-900">{show activeRulesCount}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">active rules</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-green-600">{show routedCount}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">routed (30 days)</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-04 09:55:12 +00:00
|
|
|
{renderRulesSection rules}
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
2026-04-04 09:55:12 +00:00
|
|
|
renderRulesSection :: [HubRoutingRule] -> Html
|
|
|
|
|
renderRulesSection [] = [hsx|<p class="text-xs text-gray-400">No active routing rules.</p>|]
|
|
|
|
|
renderRulesSection rs = [hsx|
|
|
|
|
|
<div class="space-y-1">
|
|
|
|
|
{forEach (take 5 rs) renderRuleRow}
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
renderRuleRow :: HubRoutingRule -> Html
|
|
|
|
|
renderRuleRow r = [hsx|
|
|
|
|
|
<div class="flex items-center gap-2 text-xs text-gray-600">
|
|
|
|
|
<span class="font-medium">{hubName r.sourceHubId}</span>
|
|
|
|
|
<span class="text-gray-400">→</span>
|
|
|
|
|
<span class="font-medium">{hubName r.targetHubId}</span>
|
2026-04-04 09:55:12 +00:00
|
|
|
{maybe mempty renderMatchCategory r.matchCategory}
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
2026-04-04 09:55:12 +00:00
|
|
|
renderMatchCategory :: Text -> Html
|
|
|
|
|
renderMatchCategory c = [hsx|<span class="text-gray-400">({c})</span>|]
|
|
|
|
|
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
-- ── Panel 3: Policy compliance ────────────────────────────────────
|
|
|
|
|
activeOverlaysCount = length overlays
|
2026-04-04 09:55:12 +00:00
|
|
|
decisionIdsWithPolicy = List.nub $ map (Just . (.decisionId)) allPolicies
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
coveredDecisions = length $ filter (\d -> Just d.id `elem` decisionIdsWithPolicy) allDecisions
|
|
|
|
|
totalDecisions = length allDecisions
|
|
|
|
|
policyPct :: Int
|
|
|
|
|
policyPct = if totalDecisions == 0 then 0
|
|
|
|
|
else (coveredDecisions * 100) `div` totalDecisions
|
|
|
|
|
|
|
|
|
|
panel3PolicyCompliance = [hsx|
|
|
|
|
|
<div class="bg-white rounded-lg border border-gray-200 p-5">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h2 class="font-medium text-gray-800">Policy Compliance</h2>
|
|
|
|
|
<a href={PolicyComplianceDashboardAction}
|
|
|
|
|
class="text-xs text-blue-600 hover:underline">Dashboard →</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex gap-6 mb-4">
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-gray-900">{show activeOverlaysCount}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">active overlays</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-indigo-600">{show policyPct}%</div>
|
|
|
|
|
<div class="text-xs text-gray-500">decision coverage</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-04 09:55:12 +00:00
|
|
|
{renderOverlaysList overlays}
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
-- ── Panel 4: Stewardship coverage ─────────────────────────────────
|
|
|
|
|
hubsWithStewards = List.nub (map (.hubId) stewards)
|
|
|
|
|
stewardedCount = length hubsWithStewards
|
|
|
|
|
totalHubs = length hubs
|
fix(WP-0014/A2): continued type-correctness fixes and Tailwind CSS output
- Schema.sql: add FK constraints for phases 6–12 so IHP generates Id X
instead of UUID for FK columns (widget_adapter_specs, friction_scores,
hub_routing_rules, agent_proposals, hub_capability_manifests, etc.)
- HubHealth, ModelRouter, ApiInteractionEvents: remove toUUID() wrappers
now that FK columns carry proper Id types
- FederatedGovernance/Dashboard, HubRoutingRules/Index: same Id comparison fix
- AgentProposals/Index, DecisionRecords/Index, ApiConsumers/Edit: Id type fixes
- BottleneckDetector: add Data.Coerce import; CrossHubPropagation: add guard
- ApiKeys: qualify cryptohash-sha256 import to resolve package ambiguity
- WebhookDeliveryJob: use LBS.fromStrict; remove duplicate diffUTCTime
- Sessions/New: use renderFlashMessages (IHP built-in)
- ArchiveRecords/LineageInspector: simplify renderChainStep signature
- static/app.css: Tailwind CSS output (2011 lines) — A3 confirmed
- workplans/IHUB-WP-0015-local-deployment-intro-ui.md: add workplan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 01:49:41 +00:00
|
|
|
hubsWithNoSteward = filter (\h -> h.id `notElem` hubsWithStewards) hubs
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
|
|
|
|
|
panel4Stewardship = [hsx|
|
|
|
|
|
<div class="bg-white rounded-lg border border-gray-200 p-5">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h2 class="font-medium text-gray-800">Stewardship Coverage</h2>
|
|
|
|
|
<a href={StewardshipRolesAction}
|
|
|
|
|
class="text-xs text-blue-600 hover:underline">Roles →</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex gap-6 mb-4">
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-gray-900">{show stewardedCount}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">of {show totalHubs} hubs stewarded</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div class="text-3xl font-bold text-amber-600">{show (length hubsWithNoSteward)}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">hubs unassigned</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-04 09:55:12 +00:00
|
|
|
{renderUnstewarded hubsWithNoSteward}
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
-- ── Panel 5: Archive activity ─────────────────────────────────────
|
|
|
|
|
archiveByType = List.sortBy (\a b -> compare (fst a) (fst b))
|
fix(WP-0014/A2): close remaining pure-param and structural compilation errors
Convert all remaining `<- paramOrNothing / param / paramOrDefault /
currentUserOrNothing` monadic binds to `let` — these functions are pure
(ImplicitParams-based) in IHP v1.5, so `<-` is a type error in an IO
do-block.
Controllers fixed:
AgentDelegations, AiGovernancePolicies, Annotations, ApiConsumers,
CollectiveProposals, DecisionRecords, DeploymentRecords,
HubCapabilityManifests, HubRoutingRules, InstitutionalKnowledge,
OutcomeCorrelations, RequirementCandidates, TypeRegistries,
WebhookSubscriptions, Widgets,
Api/V2/{Annotations,InteractionEvents,Token}
WebhookSubscriptions: remove orphaned `Right () ->` case arm that was
left inside a bare `unless` block (structural parse error).
Also carries forward all in-progress fixes from the working tree:
helpers (AgentBridge, ApiRateLimit, BottleneckDetector,
CrossHubPropagation, FrictionScore),
views (CanSelect instances, HSX lambda extraction, formFor wrappers),
env/build (envrc GHCi perms, flake.nix Tailwind + GHC resource limits,
static/app.css additional Tailwind output).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 01:14:08 +00:00
|
|
|
$ map (\grp -> (maybe "" (.subjectType) (head grp), length grp))
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
$ List.groupBy (\a b -> a.subjectType == b.subjectType)
|
|
|
|
|
$ List.sortBy (\a b -> compare a.subjectType b.subjectType) recentArchives
|
|
|
|
|
|
|
|
|
|
panel5Archive = [hsx|
|
|
|
|
|
<div class="bg-white rounded-lg border border-gray-200 p-5 lg:col-span-2">
|
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
|
|
|
<h2 class="font-medium text-gray-800">Archive Activity (90 days)</h2>
|
|
|
|
|
<a href={ArchiveRecordsAction}
|
|
|
|
|
class="text-xs text-blue-600 hover:underline">All records →</a>
|
|
|
|
|
</div>
|
2026-04-04 09:55:12 +00:00
|
|
|
{renderArchiveActivity recentArchives archiveByType}
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|
2026-04-04 09:55:12 +00:00
|
|
|
|
|
|
|
|
renderOverlaysList :: [FederatedPolicyOverlay] -> Html
|
|
|
|
|
renderOverlaysList [] = [hsx|<p class="text-xs text-gray-400">No active policy overlays.</p>|]
|
|
|
|
|
renderOverlaysList overlays = [hsx|
|
|
|
|
|
<div class="space-y-1">
|
|
|
|
|
{forEach overlays renderOverlayTitle}
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
renderOverlayTitle :: FederatedPolicyOverlay -> Html
|
|
|
|
|
renderOverlayTitle o = [hsx|<div class="text-xs text-gray-600 truncate">{o.title}</div>|]
|
|
|
|
|
|
|
|
|
|
renderUnstewarded :: [Hub] -> Html
|
|
|
|
|
renderUnstewarded [] = [hsx|<p class="text-xs text-green-600">All hubs have active stewards.</p>|]
|
|
|
|
|
renderUnstewarded hs = [hsx|
|
|
|
|
|
<div>
|
|
|
|
|
<p class="text-xs text-gray-500 mb-1">Hubs without stewards:</p>
|
|
|
|
|
<div class="flex flex-wrap gap-1">
|
|
|
|
|
{forEach hs renderUnstewardedHub}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
renderUnstewardedHub :: Hub -> Html
|
|
|
|
|
renderUnstewardedHub h = [hsx|<span class="text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded">{h.name}</span>|]
|
|
|
|
|
|
|
|
|
|
renderArchiveActivity :: [ArchiveRecord] -> [(Text, Int)] -> Html
|
|
|
|
|
renderArchiveActivity [] _ = [hsx|<p class="text-sm text-gray-400">No artifacts archived in the last 90 days.</p>|]
|
|
|
|
|
renderArchiveActivity archives byType = [hsx|
|
|
|
|
|
<div class="flex items-center gap-3 mb-2">
|
|
|
|
|
<div class="text-3xl font-bold text-gray-900">{show (length archives)}</div>
|
|
|
|
|
<div class="text-xs text-gray-500">total archived artifacts</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-wrap gap-2">
|
|
|
|
|
{forEach byType renderArchiveTypeChip}
|
|
|
|
|
</div>
|
|
|
|
|
|]
|
|
|
|
|
|
|
|
|
|
renderArchiveTypeChip :: (Text, Int) -> Html
|
|
|
|
|
renderArchiveTypeChip (typ, cnt) = [hsx|
|
|
|
|
|
<span class="text-sm bg-amber-50 border border-amber-200 text-amber-800 px-3 py-1 rounded">
|
|
|
|
|
{typ}: {show cnt}
|
|
|
|
|
</span>
|
|
|
|
|
|]
|