#include "HyperTwistTraining/HyperTwistCoachDashboardWidget.h"

#include "HyperTwistTraining/HyperTwistTrainingAnalyticsLibrary.h"
#include "HyperTwistTraining/HyperTwistTrainingCoachLibrary.h"
#include "HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.h"
#include "HyperTwistTraining/HyperTwistTrainingRuntimeLibrary.h"
#include "HyperTwistTraining/HyperTwistTrainingSubsystem.h"
#include "Blueprint/WidgetTree.h"
#include "Components/Button.h"
#include "Components/ButtonSlot.h"
#include "Components/EditableTextBox.h"
#include "Components/HorizontalBox.h"
#include "Components/HorizontalBoxSlot.h"
#include "Components/TextBlock.h"
#include "Components/VerticalBox.h"
#include "Components/VerticalBoxSlot.h"

namespace HyperTwistCoachDashboardWidgetInternal
{
	FHyperTwistTrainingTemplateLaunchProvenance BuildTemplateLaunchProvenance(
		const FHyperTwistTrainingSessionTemplate& SessionTemplate
	)
	{
		FHyperTwistTrainingTemplateLaunchProvenance Provenance;
		if (!SessionTemplate.IsStructurallyValid())
		{
			return Provenance;
		}

		Provenance.UserId = SessionTemplate.UserId;
		Provenance.TemplateId = SessionTemplate.TemplateId;
		Provenance.SourceTemplateId = SessionTemplate.SourceTemplateId;
		Provenance.Title = SessionTemplate.Title;
		Provenance.TemplateKind = SessionTemplate.TemplateKind;
		Provenance.FocusDeckId = SessionTemplate.FocusDeckId;
		Provenance.MethodSegmentId = SessionTemplate.MethodSegmentId;
		Provenance.SuggestedMode = SessionTemplate.SuggestedMode;
		Provenance.SuggestedSelectionPolicy = SessionTemplate.SuggestedSelectionPolicy;
		Provenance.RecommendedCaseCount = SessionTemplate.RecommendedCaseCount;
		Provenance.FocusCaseIds = SessionTemplate.FocusCaseIds;
		Provenance.GuidanceLabel = SessionTemplate.GuidanceLabel;
		Provenance.SourceReviewPlanId = SessionTemplate.SourceReviewPlanId;
		Provenance.bPreferReviewRun = SessionTemplate.bPreferReviewRun;
		Provenance.bCoachReview = SessionTemplate.bCoachReview;
		Provenance.bPreferShortReviewSet = SessionTemplate.bPreferShortReviewSet;
		return Provenance;
	}

	FHyperTwistTrainingSession BuildSessionFromSummary(
		const FHyperTwistTrainingSessionSummary& Summary,
		const FString& UserId,
		const EHyperTwistTrainingDeliveryMode Mode
	)
	{
		FHyperTwistTrainingSession Session;
		Session.TrainingSessionId = Summary.TrainingSessionId;
		Session.DeckId = Summary.DeckId;
		Session.UserId = !Summary.UserId.IsEmpty() ? Summary.UserId : UserId;
		Session.Mode = Mode;
		Session.SessionState = Summary.SessionState;
		Session.CurrentCaseId = Summary.LastCaseId;
		Session.AttemptCount = Summary.AttemptCount;
		Session.EndedAtUtc = Summary.LastCompletedAtUtc;
		return Session;
	}

	FHyperTwistTrainingSessionDomainBundle BuildDisplayedSessionDomainBundle(
		const FHyperTwistTrainingRunState& RunState,
		const FHyperTwistTrainingSessionSummary& RunSummary,
		const FHyperTwistTrainingTemplateLaunchProvenance& TemplateLaunchProvenance,
		const FHyperTwistTrainingCoachPanelState& CoachPanelState,
		const FHyperTwistTrainingMethodDrillRunState& MethodDrillRunState,
		const FHyperTwistTrainingAnalyticsReportBundle& ReportBundle
	)
	{
		const FHyperTwistTrainingAttempt SolveAttempt =
			RunState.Attempts.Num() > 0 ? RunState.Attempts.Last() : FHyperTwistTrainingAttempt();
		return UHyperTwistTrainingAnalyticsLibrary::BuildSessionDomainBundle(
			RunState.Session,
			RunSummary,
			SolveAttempt,
			TemplateLaunchProvenance,
			CoachPanelState,
			MethodDrillRunState,
			ReportBundle
		);
	}

	FHyperTwistTrainingSessionDomainBundle BuildDisplayedRecapSessionDomainBundle(
		const FHyperTwistTrainingSessionSummary& RunSummary,
		const FString& UserId,
		const EHyperTwistTrainingDeliveryMode Mode,
		const FHyperTwistTrainingTemplateLaunchProvenance& TemplateLaunchProvenance,
		const FHyperTwistTrainingCoachPanelState& CoachPanelState,
		const FHyperTwistTrainingMethodDrillRunState& MethodDrillRunState
	)
	{
		return UHyperTwistTrainingAnalyticsLibrary::BuildSessionDomainBundle(
			BuildSessionFromSummary(RunSummary, UserId, Mode),
			RunSummary,
			FHyperTwistTrainingAttempt(),
			TemplateLaunchProvenance,
			CoachPanelState,
			MethodDrillRunState,
			FHyperTwistTrainingAnalyticsReportBundle()
		);
	}

	FHyperTwistCoachDashboardTemplateLaunchHistoryEntry BuildTemplateLaunchHistoryEntry(
		const FHyperTwistTrainingRunRecord& RunRecord
	)
	{
		FHyperTwistCoachDashboardTemplateLaunchHistoryEntry Entry;
		if (!RunRecord.IsStructurallyValid() || !RunRecord.TemplateLaunchProvenance.IsStructurallyValid())
		{
			return Entry;
		}

		Entry.RecordedAtUtc = !RunRecord.LastUpdatedAtUtc.IsEmpty()
			? RunRecord.LastUpdatedAtUtc
			: (!RunRecord.Summary.LastCompletedAtUtc.IsEmpty()
				? RunRecord.Summary.LastCompletedAtUtc
				: RunRecord.Session.EndedAtUtc);
		Entry.SourceSessionId = RunRecord.Session.TrainingSessionId;
		Entry.TemplateId = RunRecord.TemplateLaunchProvenance.TemplateId;
		Entry.TemplateTitle = RunRecord.TemplateLaunchProvenance.Title;
		Entry.UserId = RunRecord.TemplateLaunchProvenance.UserId;
		Entry.FocusDeckId = RunRecord.TemplateLaunchProvenance.FocusDeckId;
		Entry.SourceReviewPlanId = RunRecord.TemplateLaunchProvenance.SourceReviewPlanId;
		Entry.TemplateKind = RunRecord.TemplateLaunchProvenance.TemplateKind;
		Entry.SessionState = RunRecord.Summary.SessionState;
		Entry.SuggestedMode = RunRecord.TemplateLaunchProvenance.SuggestedMode;
		Entry.SuggestedSelectionPolicy = RunRecord.TemplateLaunchProvenance.SuggestedSelectionPolicy;
		Entry.RecommendedCaseCount = RunRecord.TemplateLaunchProvenance.RecommendedCaseCount;
		Entry.FocusCaseCount = RunRecord.TemplateLaunchProvenance.FocusCaseIds.Num();
		Entry.CompletedAttemptCount = RunRecord.Summary.CompletedAttemptCount;
		Entry.TotalMistakes = RunRecord.Summary.TotalMistakes;
		Entry.SuccessRate = RunRecord.Summary.SuccessRate;
		Entry.CompletedAtUtc = !RunRecord.Summary.LastCompletedAtUtc.IsEmpty()
			? RunRecord.Summary.LastCompletedAtUtc
			: RunRecord.Session.EndedAtUtc;
		Entry.bPreferReviewRun = RunRecord.TemplateLaunchProvenance.bPreferReviewRun;
		Entry.bCoachReview = RunRecord.TemplateLaunchProvenance.bCoachReview;
		Entry.bPreferShortReviewSet = RunRecord.TemplateLaunchProvenance.bPreferShortReviewSet;
		Entry.SelectionProvenance = RunRecord.TemplateLaunchProvenance.SelectionProvenance;
		return Entry;
	}

	FString BuildTemplateLaunchAnalyticsOutcomeFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no stored template-backed outcomes yet");
		}

		return FString::Printf(
			TEXT("launches %d | completed %d | aborted %d | open %d | success %.2f"),
			TemplateStats->LaunchCount,
			TemplateStats->CompletedRunCount,
			TemplateStats->AbortedRunCount,
			TemplateStats->OpenRunCount,
			TemplateStats->OverallSuccessRate
		);
	}

	FString BuildTemplateLaunchSelectionLaneAnalyticsSummary(
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SelectionStats,
		const TCHAR* LaneLabel
	);

	FString BuildTemplateLaunchSelectionSplitAnalyticsFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakSupportSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportBiasSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionBiasSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalConfidenceSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsTieBreakPeerDispositionSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchComparablePeerConfidenceLaneFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot
	BuildTemplateLaunchComparablePeerConfidenceSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshot
	BuildTemplateLaunchTemplateSignalSupportBiasSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot
	BuildTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchComparablePeerConfidenceAuditClause(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		const TCHAR* SubjectLabel
	);

	FString BuildTemplateLaunchComparablePeerConfidenceStatusClauseFromSnapshot(
		const FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot& Snapshot
	);

	FString BuildTemplateLaunchComparablePeerConfidenceStatusClause(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance,
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchSelectionComparablePeerConfidenceDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	);

	FString BuildTemplateLaunchSelectionTemplateSignalSupportBiasDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	);

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	);

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	);

	bool HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutComparablePeerOutcomeRuns = nullptr,
		int32* OutSplitConfidenceOutcomeRuns = nullptr,
		float* OutComparablePeerOutcomeShare = nullptr,
		int32* OutPeerNoEvidenceOutcomeRuns = nullptr
	);

	bool HasTemplateLaunchTemplateSignalConfidenceSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutConfidenceEligibleOutcomeRuns = nullptr,
		int32* OutTemplateSignalOutcomeRuns = nullptr,
		float* OutConfidenceEligibleOutcomeShare = nullptr,
		int32* OutSuppressedOutcomeRuns = nullptr
	);

	bool HasTemplateLaunchTemplateSignalSupportBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutConfidenceLaneBiasOutcomeRuns = nullptr,
		int32* OutBroaderOutcomeOnlyOutcomeRuns = nullptr
	);

	bool HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutEarnedOutcomeRuns = nullptr,
		int32* OutComparisonOutcomeRuns = nullptr
	);

	bool HasTemplateLaunchTemplateSignalSupportDecisionBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutDecisionSplitGuardOutcomeRuns = nullptr,
		int32* OutPlainSnapshotGuardOutcomeRuns = nullptr
	);

	bool HasTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutEarnedOutcomeRuns = nullptr,
		int32* OutComparisonOutcomeRuns = nullptr
	);

	int32 BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition
	ResolveTemplateLaunchPeerSupportKindDisposition(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	);

	FString BuildTemplateLaunchAnalyticsSupportKindGuardAuditClause(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		const TCHAR* SubjectLabel
	);

	FString BuildTemplateLaunchAnalyticsDetailFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no retained per-template analytics are available for this template id yet");
		}

		return FString::Printf(
			TEXT("avg recommended %d | avg focus %d | avg completed attempts %d | total success/failure/timeout/dnf %d/%d/%d/%d | avg mistakes %.2f | review-backed %d | coach-review %d | short set %d | selector split %s | tie-break support %s | template-signal support %s | template-signal decision %s | template-signal support-bias snapshot %s | template-signal decision-bias snapshot %s | template-signal confidence snapshot %s | peer support split %s | comparable-peer confidence %s | last launch %s | last completed %s"),
			TemplateStats->AverageRecommendedCaseCount,
			TemplateStats->AverageFocusCaseCount,
			TemplateStats->AverageCompletedAttemptCount,
			TemplateStats->TotalSuccessCount,
			TemplateStats->TotalFailureCount,
			TemplateStats->TotalTimeoutCount,
			TemplateStats->TotalDNFCount,
			TemplateStats->AverageMistakesPerOutcomeRun,
			TemplateStats->ReviewBackedLaunchCount,
			TemplateStats->CoachReviewLaunchCount,
			TemplateStats->ShortReviewSetLaunchCount,
			*BuildTemplateLaunchSelectionSplitAnalyticsFragment(TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakSupportSplitFragment(TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportSplitFragment(TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionSplitFragment(
				TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportBiasSnapshotFragment(
				TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionBiasSnapshotFragment(
				TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakTemplateSignalConfidenceSnapshotFragment(
				TemplateStats),
			*BuildTemplateLaunchAnalyticsTieBreakPeerDispositionSplitFragment(TemplateStats),
			*BuildTemplateLaunchComparablePeerConfidenceLaneFragment(TemplateStats),
			TemplateStats->LastLaunchAtUtc.IsEmpty()
				? TEXT("n/a")
				: *TemplateStats->LastLaunchAtUtc,
			TemplateStats->LastCompletedAtUtc.IsEmpty()
				? TEXT("n/a")
				: *TemplateStats->LastCompletedAtUtc
		);
	}

	FString ResolveDashboardTemplateLaunchDisplayTitle(
		const FHyperTwistTrainingSessionTemplate& Template
	)
	{
		if (!Template.Title.IsEmpty())
		{
			return Template.Title;
		}

		if (!Template.TemplateId.IsEmpty())
		{
			return Template.TemplateId;
		}

		return TEXT("unnamed template");
	}

	FString BuildTemplateLaunchAnalyticsTieBreakSignalFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no meaningful stored outcomes");
		}

		const int32 OutcomeRuns = TemplateStats->CompletedRunCount + TemplateStats->AbortedRunCount;
		if (OutcomeRuns <= 0)
		{
			return TEXT("no meaningful stored outcomes");
		}

		return FString::Printf(
			TEXT("outcome runs %d | success %.2f | avg mistakes %.2f | aborted %d"),
			OutcomeRuns,
			TemplateStats->OverallSuccessRate,
			TemplateStats->AverageMistakesPerOutcomeRun,
			TemplateStats->AbortedRunCount
		);
	}

	FString ResolveTemplateLaunchSelectionAnalyticsSupportKindLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind AnalyticsSupportKind
	)
	{
		switch (AnalyticsSupportKind)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::TemplateScopedOutcomeSignal:
			return TEXT("Template Scoped Outcome Signal");
		case EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::SelectorSplitConfidence:
			return TEXT("Selector Split Confidence");
		case EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::None:
		default:
			return TEXT("None");
		}
	}

	FString ResolveTemplateLaunchSelectionTemplateSignalSupportKindLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind
			TemplateSignalSupportKind
	)
	{
		switch (TemplateSignalSupportKind)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::
			BroaderOutcomeOnly:
			return TEXT("broader-outcome-only");
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::
			ConfidenceLaneBias:
			return TEXT("confidence-lane-bias");
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::None:
		default:
			return TEXT("none");
		}
	}

	FString ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionKindLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind
			TemplateSignalSupportDecisionKind
	)
	{
		switch (TemplateSignalSupportDecisionKind)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind::
			SupportBiasSnapshotGuard:
			return TEXT("support-bias-snapshot-guard");
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind::None:
		default:
			return TEXT("none");
		}
	}

	FString ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKindLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind
			TemplateSignalSupportDecisionBiasKind
	)
	{
		switch (TemplateSignalSupportDecisionBiasKind)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind::
			DecisionSplitGuard:
			return TEXT("decision-split-guard");
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind::None:
		default:
			return TEXT("none");
		}
	}

	FString ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKindLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind
			TemplateSignalSupportDecisionBiasSnapshotDecisionKind
	)
	{
		switch (TemplateSignalSupportDecisionBiasSnapshotDecisionKind)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind::
			DecisionBiasSnapshotGuard:
			return TEXT("decision-bias-snapshot-guard");
		case EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind::
			None:
		default:
			return TEXT("none");
		}
	}

	FString ResolveTemplateLaunchSelectionPeerSupportKindDispositionLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition
			PeerSupportKindDisposition
	)
	{
		switch (PeerSupportKindDisposition)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
			PeerLackedComparableEvidence:
			return TEXT("Peer Lacked Comparable Evidence");
		case EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
			PeerFailedGuardOnWeakerSupportKindOutcomes:
			return TEXT("Peer Failed Guard On Weaker Support Kind Outcomes");
		case EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
			PeerFailedGuardOnMarginalSupportKindOutcomes:
			return TEXT("Peer Failed Guard On Marginal Support Kind Outcomes");
		case EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
			PeerClearedComparableSupportKindGuard:
			return TEXT("Peer Cleared Comparable Support Kind Guard");
		case EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::None:
		default:
			return TEXT("None");
		}
	}

	FString BuildTemplateLaunchAnalyticsSupportKindGuardSignalFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return FString();
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& TemplateSignalStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		if (!TemplateSignalStats.IsStructurallyValid()
			|| !SplitConfidenceStats.IsStructurallyValid()
			|| TemplateSignalStats.GetOutcomeRunCount() <= 0
			|| SplitConfidenceStats.GetOutcomeRunCount() <= 0)
		{
			return FString();
		}

		return FString::Printf(
			TEXT("split-confidence outcomes %d | success %.2f | avg mistakes %.2f vs template-signal outcomes %d | success %.2f | avg mistakes %.2f"),
			SplitConfidenceStats.GetOutcomeRunCount(),
			SplitConfidenceStats.OverallSuccessRate,
			SplitConfidenceStats.AverageMistakesPerOutcomeRun,
			TemplateSignalStats.GetOutcomeRunCount(),
			TemplateSignalStats.OverallSuccessRate,
			TemplateSignalStats.AverageMistakesPerOutcomeRun
		);
	}

	FHyperTwistTrainingTemplateLaunchSelectionProvenance BuildTemplateLaunchAnalyticsTieBreakSelectionProvenance(
		const FHyperTwistTrainingSessionTemplate& SelectedTemplate,
		const FHyperTwistTrainingTemplateLaunchScopedStats* SelectedStats,
		const FHyperTwistTrainingSessionTemplate& PeerTemplate,
		const FHyperTwistTrainingTemplateLaunchScopedStats* PeerStats,
		const EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind AnalyticsSupportKind,
		const bool bUsedTemplateSignalSupportBiasSnapshotGuard = false,
		const bool bUsedTemplateSignalSupportDecisionBiasGuard = false,
		const bool bUsedTemplateSignalSupportDecisionBiasSnapshotGuard = false
	)
	{
		FHyperTwistTrainingTemplateLaunchSelectionProvenance Provenance;
		Provenance.SelectorSourceLabel = TEXT("CoachDashboard");
		Provenance.ReasonClass =
			EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak;
		Provenance.AnalyticsSupportKind = AnalyticsSupportKind;
		Provenance.PeerSupportKindDisposition =
			EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::None;
		Provenance.PeerTemplateId = PeerTemplate.TemplateId;
		Provenance.PeerTemplateTitle = ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate);
		if (AnalyticsSupportKind
			== EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::SelectorSplitConfidence)
		{
			if (BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(SelectedStats) > 0)
			{
				Provenance.PeerSupportKindDisposition =
					ResolveTemplateLaunchPeerSupportKindDisposition(PeerStats);
				const FString SelectedSupportKindAuditClause =
					BuildTemplateLaunchAnalyticsSupportKindGuardAuditClause(
						SelectedStats,
						TEXT("chosen template"));
				const FString PeerSupportKindAuditClause =
					BuildTemplateLaunchAnalyticsSupportKindGuardAuditClause(PeerStats, TEXT("peer"));
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s with selector-split confidence support: %s; %s | chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*SelectedSupportKindAuditClause,
					*PeerSupportKindAuditClause,
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
			else
			{
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s with selector-split confidence support: chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
		}
		else
		{
			Provenance.TemplateSignalSupportKind = bUsedTemplateSignalSupportBiasSnapshotGuard
				? EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::
					ConfidenceLaneBias
				: EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::
					BroaderOutcomeOnly;
			Provenance.TemplateSignalSupportDecisionKind =
				bUsedTemplateSignalSupportBiasSnapshotGuard
					? EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind::
						SupportBiasSnapshotGuard
					: EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind::
						None;
			Provenance.TemplateSignalSupportDecisionBiasKind =
				bUsedTemplateSignalSupportDecisionBiasGuard
					? EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind::
						DecisionSplitGuard
					: EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind::
						None;
			Provenance.TemplateSignalSupportDecisionBiasSnapshotDecisionKind =
				bUsedTemplateSignalSupportDecisionBiasSnapshotGuard
					? EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind::
						DecisionBiasSnapshotGuard
					: EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind::
						None;
			Provenance.TemplateSignalSupportBiasSnapshot =
				BuildTemplateLaunchTemplateSignalSupportBiasSnapshot(SelectedStats);
			Provenance.TemplateSignalSupportDecisionBiasSnapshot =
				BuildTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot(SelectedStats);
			Provenance.ComparablePeerConfidenceSnapshot =
				BuildTemplateLaunchComparablePeerConfidenceSnapshot(SelectedStats);
			const FString SelectedComparablePeerConfidenceAuditClause =
				BuildTemplateLaunchComparablePeerConfidenceAuditClause(
					SelectedStats,
					TEXT("chosen template"));
			if (bUsedTemplateSignalSupportDecisionBiasSnapshotGuard)
			{
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s on broader template-scoped outcome signal with earned-vs-non-earned support-bias snapshot guard reinforcement, then the decision-split guard tied again, and earned-vs-non-earned decision-bias snapshot history only reinforced the winner after the reinforced lane also beat plain decision-split history: %s | chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*SelectedComparablePeerConfidenceAuditClause,
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
			else if (bUsedTemplateSignalSupportDecisionBiasGuard)
			{
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s on broader template-scoped outcome signal with earned-vs-non-earned support-bias snapshot guard reinforcement, with the decision-split guard specifically breaking the remaining tie: %s | chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*SelectedComparablePeerConfidenceAuditClause,
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
			else if (bUsedTemplateSignalSupportBiasSnapshotGuard)
			{
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s on broader template-scoped outcome signal with earned-vs-non-earned support-bias snapshot guard reinforcement deciding the winner: %s | chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*SelectedComparablePeerConfidenceAuditClause,
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
			else
			{
				Provenance.DecisionSummaryLine = FString::Printf(
					TEXT("Selector: tied with %s on primary dashboard priority; analytics preferred %s on broader template-scoped outcome signal without the earned-vs-non-earned support-bias snapshot guard deciding the winner: %s | chosen %s | peer %s."),
					*ResolveDashboardTemplateLaunchDisplayTitle(PeerTemplate),
					*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate),
					*SelectedComparablePeerConfidenceAuditClause,
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(SelectedStats),
					*BuildTemplateLaunchAnalyticsTieBreakSignalFragment(PeerStats)
				);
			}
		}
		return Provenance;
	}

	FHyperTwistTrainingTemplateLaunchSelectionProvenance BuildTemplateLaunchPrimarySelectionProvenance(
		const FHyperTwistTrainingSessionTemplate& SelectedTemplate
	)
	{
		FHyperTwistTrainingTemplateLaunchSelectionProvenance Provenance;
		Provenance.SelectorSourceLabel = TEXT("CoachDashboard");
		Provenance.ReasonClass =
			EHyperTwistTrainingTemplateLaunchSelectionReasonClass::PrimaryDashboardPriority;
		Provenance.DecisionSummaryLine = FString::Printf(
			TEXT("Selector: selected %s on dashboard priority lane without an analytics tie-break."),
			*ResolveDashboardTemplateLaunchDisplayTitle(SelectedTemplate)
		);
		return Provenance;
	}

	FString ResolveTemplateLaunchSelectionReasonClassLabel(
		const EHyperTwistTrainingTemplateLaunchSelectionReasonClass ReasonClass
	)
	{
		switch (ReasonClass)
		{
		case EHyperTwistTrainingTemplateLaunchSelectionReasonClass::PrimaryDashboardPriority:
			return TEXT("Primary Dashboard Priority");
		case EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak:
			return TEXT("Analytics Tie Break");
		case EHyperTwistTrainingTemplateLaunchSelectionReasonClass::None:
		default:
			return TEXT("None");
		}
	}

	FString BuildTemplateLaunchSelectionLaneAnalyticsSummary(
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SelectionStats,
		const TCHAR* LaneLabel
	)
	{
		if (!SelectionStats.IsStructurallyValid())
		{
			return FString::Printf(TEXT("%s none yet"), LaneLabel);
		}

		return FString::Printf(
			TEXT("%s launches %d | outcomes %d | success %.2f | avg mistakes %.2f"),
			LaneLabel,
			SelectionStats.LaunchCount,
			SelectionStats.GetOutcomeRunCount(),
			SelectionStats.OverallSuccessRate,
			SelectionStats.AverageMistakesPerOutcomeRun
		);
	}

	FString BuildTemplateLaunchSelectionSplitAnalyticsFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no dashboard selector split analytics are available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PrimaryStats =
			TemplateStats->DashboardPrimarySelectionStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& AnalyticsTieBreakStats =
			TemplateStats->DashboardAnalyticsTieBreakStats;
		if (!PrimaryStats.IsStructurallyValid() && !AnalyticsTieBreakStats.IsStructurallyValid())
		{
			return TEXT("no dashboard selector split analytics are available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(PrimaryStats, TEXT("priority")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				AnalyticsTieBreakStats,
				TEXT("tie-break"))
		);
		if (PrimaryStats.IsStructurallyValid()
			&& AnalyticsTieBreakStats.IsStructurallyValid()
			&& PrimaryStats.GetOutcomeRunCount() > 0
			&& AnalyticsTieBreakStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | delta success %+.2f | delta mistakes %+.2f"),
				AnalyticsTieBreakStats.OverallSuccessRate - PrimaryStats.OverallSuccessRate,
				AnalyticsTieBreakStats.AverageMistakesPerOutcomeRun
					- PrimaryStats.AverageMistakesPerOutcomeRun
			);
		}

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakSupportSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no analytics tie-break support split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& TemplateSignalStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		if (!TemplateSignalStats.IsStructurallyValid() && !SplitConfidenceStats.IsStructurallyValid())
		{
			return TEXT("no analytics tie-break support split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				TemplateSignalStats,
				TEXT("template-signal")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				SplitConfidenceStats,
				TEXT("split-confidence"))
		);
		if (TemplateSignalStats.IsStructurallyValid()
			&& SplitConfidenceStats.IsStructurallyValid()
			&& TemplateSignalStats.GetOutcomeRunCount() > 0
			&& SplitConfidenceStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | delta success %+.2f | delta mistakes %+.2f"),
				SplitConfidenceStats.OverallSuccessRate - TemplateSignalStats.OverallSuccessRate,
				SplitConfidenceStats.AverageMistakesPerOutcomeRun
					- TemplateSignalStats.AverageMistakesPerOutcomeRun
			);
		}

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalConfidenceSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT(
				"no template-signal confidence snapshot split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& NoRetainedLaneStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalNoRetainedComparablePeerConfidenceLaneStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& ConfidenceEligibleStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalConfidenceEligibleStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SuppressedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSuppressedPeerNoEvidenceHeavyStats;
		if (!NoRetainedLaneStats.IsStructurallyValid()
			&& !ConfidenceEligibleStats.IsStructurallyValid()
			&& !SuppressedStats.IsStructurallyValid())
		{
			return TEXT(
				"no template-signal confidence snapshot split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				ConfidenceEligibleStats,
				TEXT("confidence-eligible")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				SuppressedStats,
				TEXT("suppressed")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				NoRetainedLaneStats,
				TEXT("no-retained-lane"))
		);
		int32 ConfidenceEligibleOutcomeRuns = 0;
		int32 TemplateSignalOutcomeRuns = 0;
		int32 SuppressedOutcomeRuns = 0;
		float ConfidenceEligibleOutcomeShare = 0.0f;
		const bool bBiasEarned = HasTemplateLaunchTemplateSignalConfidenceSnapshotBias(
			TemplateStats,
			&ConfidenceEligibleOutcomeRuns,
			&TemplateSignalOutcomeRuns,
			&ConfidenceEligibleOutcomeShare,
			&SuppressedOutcomeRuns
		);
		Fragment += FString::Printf(
			TEXT(" | snapshot-bias %s eligible %d/%d outcomes share %.2f | suppressed outcomes %d"),
			bBiasEarned ? TEXT("earned") : TEXT("suppressed"),
			ConfidenceEligibleOutcomeRuns,
			TemplateSignalOutcomeRuns,
			ConfidenceEligibleOutcomeShare,
			SuppressedOutcomeRuns
		);
		if (ConfidenceEligibleStats.IsStructurallyValid()
			&& SuppressedStats.IsStructurallyValid()
			&& ConfidenceEligibleStats.GetOutcomeRunCount() > 0
			&& SuppressedStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | eligible-minus-suppressed delta success %+.2f | delta mistakes %+.2f"),
				ConfidenceEligibleStats.OverallSuccessRate - SuppressedStats.OverallSuccessRate,
				ConfidenceEligibleStats.AverageMistakesPerOutcomeRun
					- SuppressedStats.AverageMistakesPerOutcomeRun
			);
		}

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no template-signal support split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& BroaderOutcomeOnlyStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalBroaderOutcomeOnlyStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& ConfidenceLaneBiasStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalConfidenceLaneBiasStats;
		if (!BroaderOutcomeOnlyStats.IsStructurallyValid()
			&& !ConfidenceLaneBiasStats.IsStructurallyValid())
		{
			return TEXT("no template-signal support split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				BroaderOutcomeOnlyStats,
				TEXT("broader-outcome-only")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				ConfidenceLaneBiasStats,
				TEXT("confidence-lane-bias"))
		);
		if (BroaderOutcomeOnlyStats.IsStructurallyValid()
			&& ConfidenceLaneBiasStats.IsStructurallyValid()
			&& BroaderOutcomeOnlyStats.GetOutcomeRunCount() > 0
			&& ConfidenceLaneBiasStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | bias-minus-broader delta success %+.2f | delta mistakes %+.2f"),
				ConfidenceLaneBiasStats.OverallSuccessRate
					- BroaderOutcomeOnlyStats.OverallSuccessRate,
				ConfidenceLaneBiasStats.AverageMistakesPerOutcomeRun
					- BroaderOutcomeOnlyStats.AverageMistakesPerOutcomeRun
			);
		}
		int32 ConfidenceLaneBiasOutcomeRuns = 0;
		int32 BroaderOutcomeOnlyOutcomeRuns = 0;
		const bool bSupportBiasEarned = HasTemplateLaunchTemplateSignalSupportBias(
			TemplateStats,
			&ConfidenceLaneBiasOutcomeRuns,
			&BroaderOutcomeOnlyOutcomeRuns
		);
		Fragment += FString::Printf(
			TEXT(" | current support-bias %s bias outcomes %d | broader outcomes %d"),
			bSupportBiasEarned ? TEXT("earned") : TEXT("suppressed"),
			ConfidenceLaneBiasOutcomeRuns,
			BroaderOutcomeOnlyOutcomeRuns
		);

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no template-signal decision split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& NoSnapshotGuardStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalNoSupportBiasSnapshotGuardStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SnapshotGuardStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardStats;
		if (!NoSnapshotGuardStats.IsStructurallyValid()
			&& !SnapshotGuardStats.IsStructurallyValid())
		{
			return TEXT("no template-signal decision split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				NoSnapshotGuardStats,
				TEXT("no-snapshot-guard")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				SnapshotGuardStats,
				TEXT("support-bias-snapshot-guard"))
		);
		if (NoSnapshotGuardStats.IsStructurallyValid()
			&& SnapshotGuardStats.IsStructurallyValid()
			&& NoSnapshotGuardStats.GetOutcomeRunCount() > 0
			&& SnapshotGuardStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | snapshot-guard-minus-no-guard delta success %+.2f | delta mistakes %+.2f"),
				SnapshotGuardStats.OverallSuccessRate - NoSnapshotGuardStats.OverallSuccessRate,
				SnapshotGuardStats.AverageMistakesPerOutcomeRun
					- NoSnapshotGuardStats.AverageMistakesPerOutcomeRun
			);
		}
		int32 DecisionSplitGuardOutcomeRuns = 0;
		int32 PlainSnapshotGuardOutcomeRuns = 0;
		const bool bDecisionBiasEarned = HasTemplateLaunchTemplateSignalSupportDecisionBias(
			TemplateStats,
			&DecisionSplitGuardOutcomeRuns,
			&PlainSnapshotGuardOutcomeRuns
		);
		Fragment += FString::Printf(
			TEXT(" | decision-bias %s reinforced outcomes %d | plain outcomes %d"),
			bDecisionBiasEarned ? TEXT("earned") : TEXT("suppressed"),
			DecisionSplitGuardOutcomeRuns,
			PlainSnapshotGuardOutcomeRuns
		);
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PlainSnapshotGuardStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardNoDecisionBiasStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& DecisionSplitGuardStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardStats;
		if (PlainSnapshotGuardStats.IsStructurallyValid()
			|| DecisionSplitGuardStats.IsStructurallyValid())
		{
			Fragment += FString::Printf(
				TEXT(" | %s | %s"),
				*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
					PlainSnapshotGuardStats,
					TEXT("plain-snapshot-guard")),
				*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
					DecisionSplitGuardStats,
					TEXT("decision-split-guard"))
			);
			if (PlainSnapshotGuardStats.GetOutcomeRunCount() > 0
				&& DecisionSplitGuardStats.GetOutcomeRunCount() > 0)
			{
				Fragment += FString::Printf(
					TEXT(" | decision-split-minus-plain delta success %+.2f | delta mistakes %+.2f"),
					DecisionSplitGuardStats.OverallSuccessRate
						- PlainSnapshotGuardStats.OverallSuccessRate,
					DecisionSplitGuardStats.AverageMistakesPerOutcomeRun
						- PlainSnapshotGuardStats.AverageMistakesPerOutcomeRun
				);
			}
		}
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PlainDecisionSplitGuardStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardPlainStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats&
			DecisionBiasSnapshotGuardStats =
				TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardDecisionBiasSnapshotGuardStats;
		if (PlainDecisionSplitGuardStats.IsStructurallyValid()
			|| DecisionBiasSnapshotGuardStats.IsStructurallyValid())
		{
			Fragment += FString::Printf(
				TEXT(" | %s | %s"),
				*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
					PlainDecisionSplitGuardStats,
					TEXT("plain-decision-split-guard")),
				*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
					DecisionBiasSnapshotGuardStats,
					TEXT("decision-bias-snapshot-guard"))
			);
			if (PlainDecisionSplitGuardStats.GetOutcomeRunCount() > 0
				&& DecisionBiasSnapshotGuardStats.GetOutcomeRunCount() > 0)
			{
				Fragment += FString::Printf(
					TEXT(" | snapshot-guarded-minus-plain-decision-split delta success %+.2f | delta mistakes %+.2f"),
					DecisionBiasSnapshotGuardStats.OverallSuccessRate
						- PlainDecisionSplitGuardStats.OverallSuccessRate,
					DecisionBiasSnapshotGuardStats.AverageMistakesPerOutcomeRun
						- PlainDecisionSplitGuardStats.AverageMistakesPerOutcomeRun
				);
			}
		}

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalSupportBiasSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT(
				"no template-signal support-bias snapshot split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& EarnedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotEarnedStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SuppressedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotSuppressedStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& NoRetainedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotNoRetainedStats;
		if (!EarnedStats.IsStructurallyValid()
			&& !SuppressedStats.IsStructurallyValid()
			&& !NoRetainedStats.IsStructurallyValid())
		{
			return TEXT(
				"no template-signal support-bias snapshot split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(EarnedStats, TEXT("earned")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(SuppressedStats, TEXT("suppressed")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				NoRetainedStats,
				TEXT("no-retained"))
		);
		if (EarnedStats.IsStructurallyValid()
			&& SuppressedStats.IsStructurallyValid()
			&& EarnedStats.GetOutcomeRunCount() > 0
			&& SuppressedStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | earned-minus-suppressed delta success %+.2f | delta mistakes %+.2f"),
				EarnedStats.OverallSuccessRate - SuppressedStats.OverallSuccessRate,
				EarnedStats.AverageMistakesPerOutcomeRun
					- SuppressedStats.AverageMistakesPerOutcomeRun
			);
		}
		int32 EarnedSelectionBiasOutcomeRuns = 0;
		int32 ComparisonSelectionBiasOutcomeRuns = 0;
		const bool bSelectionBiasEarned =
			HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(
				TemplateStats,
				&EarnedSelectionBiasOutcomeRuns,
				&ComparisonSelectionBiasOutcomeRuns
			);
		Fragment += FString::Printf(
			TEXT(" | selection-bias %s earned outcomes %d | comparison outcomes %d"),
			bSelectionBiasEarned ? TEXT("earned") : TEXT("suppressed"),
			EarnedSelectionBiasOutcomeRuns,
			ComparisonSelectionBiasOutcomeRuns
		);

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakTemplateSignalDecisionBiasSnapshotFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT(
				"no template-signal decision-bias snapshot split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& EarnedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotEarnedStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SuppressedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotSuppressedStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& NoRetainedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotNoRetainedStats;
		if (!EarnedStats.IsStructurallyValid()
			&& !SuppressedStats.IsStructurallyValid()
			&& !NoRetainedStats.IsStructurallyValid())
		{
			return TEXT(
				"no template-signal decision-bias snapshot split is available for this template id yet");
		}

		FString Fragment = FString::Printf(
			TEXT("%s | %s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(EarnedStats, TEXT("earned")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(SuppressedStats, TEXT("suppressed")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				NoRetainedStats,
				TEXT("no-retained"))
		);
		if (EarnedStats.IsStructurallyValid()
			&& SuppressedStats.IsStructurallyValid()
			&& EarnedStats.GetOutcomeRunCount() > 0
			&& SuppressedStats.GetOutcomeRunCount() > 0)
		{
			Fragment += FString::Printf(
				TEXT(" | earned-minus-suppressed delta success %+.2f | delta mistakes %+.2f"),
				EarnedStats.OverallSuccessRate - SuppressedStats.OverallSuccessRate,
				EarnedStats.AverageMistakesPerOutcomeRun
					- SuppressedStats.AverageMistakesPerOutcomeRun
			);
		}
		int32 EarnedSelectionBiasOutcomeRuns = 0;
		int32 ComparisonSelectionBiasOutcomeRuns = 0;
		const bool bSelectionBiasEarned =
			HasTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotBias(
				TemplateStats,
				&EarnedSelectionBiasOutcomeRuns,
				&ComparisonSelectionBiasOutcomeRuns
			);
		Fragment += FString::Printf(
			TEXT(" | selection-bias %s earned outcomes %d | comparison outcomes %d"),
			bSelectionBiasEarned ? TEXT("earned") : TEXT("suppressed"),
			EarnedSelectionBiasOutcomeRuns,
			ComparisonSelectionBiasOutcomeRuns
		);

		return Fragment;
	}

	FString BuildTemplateLaunchAnalyticsTieBreakPeerDispositionSplitFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no selector-split peer disposition split is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerNoEvidenceStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerLackedComparableEvidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerWeakerStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedWeakerSupportKindStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerMarginalStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedMarginalSupportKindStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerClearedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerClearedComparableGuardStats;
		if (!PeerNoEvidenceStats.IsStructurallyValid()
			&& !PeerWeakerStats.IsStructurallyValid()
			&& !PeerMarginalStats.IsStructurallyValid()
			&& !PeerClearedStats.IsStructurallyValid())
		{
			return TEXT("no selector-split peer disposition split is available for this template id yet");
		}

		return FString::Printf(
			TEXT("%s | %s | %s | %s"),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				PeerNoEvidenceStats,
				TEXT("peer-no-evidence")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				PeerWeakerStats,
				TEXT("peer-weaker")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				PeerMarginalStats,
				TEXT("peer-marginal")),
			*BuildTemplateLaunchSelectionLaneAnalyticsSummary(
				PeerClearedStats,
				TEXT("peer-cleared"))
		);
	}

	FString BuildTemplateLaunchComparablePeerConfidenceLaneFragment(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return TEXT("no comparable-peer confidence lane is available for this template id yet");
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerNoEvidenceStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerLackedComparableEvidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerWeakerStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedWeakerSupportKindStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerMarginalStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedMarginalSupportKindStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& PeerClearedStats =
			TemplateStats
				->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerClearedComparableGuardStats;
		if (!SplitConfidenceStats.IsStructurallyValid()
			&& !PeerNoEvidenceStats.IsStructurallyValid()
			&& !PeerWeakerStats.IsStructurallyValid()
			&& !PeerMarginalStats.IsStructurallyValid()
			&& !PeerClearedStats.IsStructurallyValid())
		{
			return TEXT("no comparable-peer confidence lane is available for this template id yet");
		}

		auto BuildCombinedLaneSummary =
			[](
				const TCHAR* LaneLabel,
				const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* FirstStats,
				const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SecondStats,
				const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* ThirdStats)
			{
				int32 LaunchCount = 0;
				int32 OutcomeRunCount = 0;
				int32 TotalCompletedAttemptCount = 0;
				int32 TotalSuccessCount = 0;
				double MistakeAccumulator = 0.0;
				bool bHasAnyStats = false;
				auto AccumulateStats =
					[&](
						const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SourceStats)
					{
						if (SourceStats == nullptr || !SourceStats->IsStructurallyValid())
						{
							return;
						}

						bHasAnyStats = true;
						LaunchCount += SourceStats->LaunchCount;
						OutcomeRunCount += SourceStats->GetOutcomeRunCount();
						TotalCompletedAttemptCount += SourceStats->TotalCompletedAttemptCount;
						TotalSuccessCount += SourceStats->TotalSuccessCount;
						MistakeAccumulator += static_cast<double>(
							SourceStats->AverageMistakesPerOutcomeRun)
							* static_cast<double>(SourceStats->GetOutcomeRunCount());
					};
				AccumulateStats(FirstStats);
				AccumulateStats(SecondStats);
				AccumulateStats(ThirdStats);

				if (!bHasAnyStats)
				{
					return FString::Printf(TEXT("%s none yet"), LaneLabel);
				}

				const float SuccessRate = TotalCompletedAttemptCount > 0
					? static_cast<float>(TotalSuccessCount)
						/ static_cast<float>(TotalCompletedAttemptCount)
					: 0.0f;
				const float AverageMistakes = OutcomeRunCount > 0
					? static_cast<float>(
						MistakeAccumulator / static_cast<double>(OutcomeRunCount))
					: 0.0f;
				return FString::Printf(
					TEXT("%s launches %d | outcomes %d | success %.2f | avg mistakes %.2f"),
					LaneLabel,
					LaunchCount,
					OutcomeRunCount,
					SuccessRate,
					AverageMistakes
				);
			};

		int32 ComparablePeerOutcomeRuns = 0;
		int32 SplitConfidenceOutcomeRuns = 0;
		int32 PeerNoEvidenceOutcomeRuns = 0;
		float ComparablePeerOutcomeShare = 0.0f;
		const bool bGuardEarned = HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
			TemplateStats,
			&ComparablePeerOutcomeRuns,
			&SplitConfidenceOutcomeRuns,
			&ComparablePeerOutcomeShare,
			&PeerNoEvidenceOutcomeRuns
		);

		return FString::Printf(
			TEXT("%s | %s | guard %s comparable-peer %d/%d outcomes share %.2f | peer-no-evidence %d"),
			*BuildCombinedLaneSummary(
				TEXT("comparable-peer-backed"),
				&PeerWeakerStats,
				&PeerMarginalStats,
				&PeerClearedStats),
			*BuildCombinedLaneSummary(
				TEXT("peer-no-evidence-heavy"),
				&PeerNoEvidenceStats,
				nullptr,
				nullptr),
			bGuardEarned ? TEXT("earned") : TEXT("suppressed"),
			ComparablePeerOutcomeRuns,
			SplitConfidenceOutcomeRuns,
			ComparablePeerOutcomeShare,
			PeerNoEvidenceOutcomeRuns
		);
	}

	FString BuildTemplateLaunchComparablePeerConfidenceAuditClause(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		const TCHAR* SubjectLabel
	)
	{
		const TCHAR* ResolvedSubjectLabel =
			SubjectLabel != nullptr && SubjectLabel[0] != TEXT('\0')
				? SubjectLabel
				: TEXT("template");
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return FString::Printf(
				TEXT("%s has no retained comparable-peer confidence lane yet"),
				ResolvedSubjectLabel
			);
		}

		int32 ComparablePeerOutcomeRuns = 0;
		int32 SplitConfidenceOutcomeRuns = 0;
		int32 PeerNoEvidenceOutcomeRuns = 0;
		float ComparablePeerOutcomeShare = 0.0f;
		const bool bGuardEarned = HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
			TemplateStats,
			&ComparablePeerOutcomeRuns,
			&SplitConfidenceOutcomeRuns,
			&ComparablePeerOutcomeShare,
			&PeerNoEvidenceOutcomeRuns
		);

		return FString::Printf(
			TEXT("%s split-confidence lane is currently %s under the comparable-peer guard: %s"),
			ResolvedSubjectLabel,
			bGuardEarned ? TEXT("confidence-eligible") : TEXT("suppressed"),
			*BuildTemplateLaunchComparablePeerConfidenceLaneFragment(TemplateStats)
		);
	}

	FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot
	BuildTemplateLaunchComparablePeerConfidenceSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot Snapshot;
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			Snapshot.State =
				EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
					NoRetainedComparablePeerConfidenceLane;
			return Snapshot;
		}

		const bool bGuardEarned = HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
			TemplateStats,
			&Snapshot.ComparablePeerOutcomeRuns,
			&Snapshot.SplitConfidenceOutcomeRuns,
			&Snapshot.ComparablePeerOutcomeShare,
			&Snapshot.PeerNoEvidenceOutcomeRuns
		);
		Snapshot.State = bGuardEarned
			? EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
				ConfidenceEligible
			: EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
				SuppressedPeerNoEvidenceHeavy;
		return Snapshot;
	}

	FHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshot
	BuildTemplateLaunchTemplateSignalSupportBiasSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		FHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshot Snapshot;
		const bool bBiasEarned = HasTemplateLaunchTemplateSignalSupportBias(
			TemplateStats,
			&Snapshot.ConfidenceLaneBiasOutcomeRuns,
			&Snapshot.BroaderOutcomeOnlyOutcomeRuns
		);
		Snapshot.State = bBiasEarned
			? EHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshotState::Earned
			: EHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshotState::Suppressed;
		return Snapshot;
	}

	FHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot
	BuildTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		FHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot Snapshot;
		const bool bBiasEarned = HasTemplateLaunchTemplateSignalSupportDecisionBias(
			TemplateStats,
			&Snapshot.DecisionSplitGuardOutcomeRuns,
			&Snapshot.PlainSnapshotGuardOutcomeRuns
		);
		Snapshot.State = bBiasEarned
			? EHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotState::
				Earned
			: EHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotState::
				Suppressed;
		return Snapshot;
	}

	FString BuildTemplateLaunchComparablePeerConfidenceStatusClauseFromSnapshot(
		const FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot& Snapshot
	)
	{
		switch (Snapshot.State)
		{
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			NoRetainedComparablePeerConfidenceLane:
			return TEXT(
				"Broader analytics pick; split-confidence lane has no retained comparable-peer confidence lane yet.");
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			ConfidenceEligible:
			return FString::Printf(
				TEXT(
					"Broader analytics pick; split-confidence lane is already confidence-eligible for future reinforcement on comparable-peer-backed history (%d/%d outcomes, share %.2f)."),
				Snapshot.ComparablePeerOutcomeRuns,
				Snapshot.SplitConfidenceOutcomeRuns,
				Snapshot.ComparablePeerOutcomeShare
			);
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			SuppressedPeerNoEvidenceHeavy:
			return FString::Printf(
				TEXT(
					"Broader analytics pick; split-confidence lane is still suppressed by peer-no-evidence-heavy history (%d/%d comparable-peer outcomes, share %.2f; peer-no-evidence %d)."),
				Snapshot.ComparablePeerOutcomeRuns,
				Snapshot.SplitConfidenceOutcomeRuns,
				Snapshot.ComparablePeerOutcomeShare,
				Snapshot.PeerNoEvidenceOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::None:
		default:
			return FString();
		}
	}

	FString BuildTemplateLaunchComparablePeerConfidenceStatusClause(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance,
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal)
		{
			return FString();
		}

		if (SelectionProvenance->ComparablePeerConfidenceSnapshot.IsStructurallyValid())
		{
			return BuildTemplateLaunchComparablePeerConfidenceStatusClauseFromSnapshot(
				SelectionProvenance->ComparablePeerConfidenceSnapshot);
		}

		return BuildTemplateLaunchComparablePeerConfidenceStatusClauseFromSnapshot(
			BuildTemplateLaunchComparablePeerConfidenceSnapshot(TemplateStats));
	}

	FString BuildTemplateLaunchSelectionAnalyticsSupportDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				== EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | analytics support %s"),
			*ResolveTemplateLaunchSelectionAnalyticsSupportKindLabel(
				SelectionProvenance->AnalyticsSupportKind)
		);
	}

	FString BuildTemplateLaunchSelectionPeerSupportDispositionDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->PeerSupportKindDisposition
				== EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | peer support %s"),
			*ResolveTemplateLaunchSelectionPeerSupportKindDispositionLabel(
				SelectionProvenance->PeerSupportKindDisposition)
		);
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| SelectionProvenance->TemplateSignalSupportKind
				== EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportKind::None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | template-signal support %s"),
			*ResolveTemplateLaunchSelectionTemplateSignalSupportKindLabel(
				SelectionProvenance->TemplateSignalSupportKind)
		);
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| SelectionProvenance->TemplateSignalSupportDecisionKind
				== EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionKind::None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | template-signal decision %s"),
			*ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionKindLabel(
				SelectionProvenance->TemplateSignalSupportDecisionKind)
		);
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| SelectionProvenance->TemplateSignalSupportDecisionBiasKind
				== EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKind::
					None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | template-signal decision-bias %s"),
			*ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionBiasKindLabel(
				SelectionProvenance->TemplateSignalSupportDecisionBiasKind)
		);
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| SelectionProvenance->TemplateSignalSupportDecisionBiasSnapshotDecisionKind
				== EHyperTwistTrainingTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKind::
					None)
		{
			return FString();
		}

		return FString::Printf(
			TEXT(" | template-signal decision-bias-snapshot %s"),
			*ResolveTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionKindLabel(
				SelectionProvenance->TemplateSignalSupportDecisionBiasSnapshotDecisionKind)
		);
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportBiasDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| !SelectionProvenance->TemplateSignalSupportBiasSnapshot.IsStructurallyValid())
		{
			return FString();
		}

		const FHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshot& Snapshot =
			SelectionProvenance->TemplateSignalSupportBiasSnapshot;
		switch (Snapshot.State)
		{
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshotState::Earned:
			return FString::Printf(
				TEXT(
					" | at-launch support-bias earned on confidence-lane-bias history (%d bias outcomes vs %d broader outcomes)"),
				Snapshot.ConfidenceLaneBiasOutcomeRuns,
				Snapshot.BroaderOutcomeOnlyOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshotState::
			Suppressed:
			return FString::Printf(
				TEXT(
					" | at-launch support-bias suppressed (%d bias outcomes vs %d broader outcomes)"),
				Snapshot.ConfidenceLaneBiasOutcomeRuns,
				Snapshot.BroaderOutcomeOnlyOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportBiasSnapshotState::None:
		default:
			return FString();
		}
	}

	FString BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| !SelectionProvenance->TemplateSignalSupportDecisionBiasSnapshot
					.IsStructurallyValid())
		{
			return FString();
		}

		const FHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshot&
			Snapshot = SelectionProvenance->TemplateSignalSupportDecisionBiasSnapshot;
		switch (Snapshot.State)
		{
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotState::
			Earned:
			return FString::Printf(
				TEXT(
					" | at-launch decision-bias earned on reinforced snapshot-guard history (%d reinforced outcomes vs %d plain outcomes)"),
				Snapshot.DecisionSplitGuardOutcomeRuns,
				Snapshot.PlainSnapshotGuardOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotState::
			Suppressed:
			return FString::Printf(
				TEXT(
					" | at-launch decision-bias suppressed (%d reinforced outcomes vs %d plain outcomes)"),
				Snapshot.DecisionSplitGuardOutcomeRuns,
				Snapshot.PlainSnapshotGuardOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotState::
			None:
		default:
			return FString();
		}
	}

	FString BuildTemplateLaunchSelectionComparablePeerConfidenceDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr
			|| SelectionProvenance->ReasonClass
				!= EHyperTwistTrainingTemplateLaunchSelectionReasonClass::AnalyticsTieBreak
			|| SelectionProvenance->AnalyticsSupportKind
				!= EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
					TemplateScopedOutcomeSignal
			|| !SelectionProvenance->ComparablePeerConfidenceSnapshot.IsStructurallyValid())
		{
			return FString();
		}

		const FHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshot& Snapshot =
			SelectionProvenance->ComparablePeerConfidenceSnapshot;
		switch (Snapshot.State)
		{
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			NoRetainedComparablePeerConfidenceLane:
			return TEXT(" | at-launch confidence lane none yet");
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			ConfidenceEligible:
			return FString::Printf(
				TEXT(
					" | at-launch confidence lane confidence-eligible on comparable-peer-backed history (%d/%d outcomes, share %.2f)"),
				Snapshot.ComparablePeerOutcomeRuns,
				Snapshot.SplitConfidenceOutcomeRuns,
				Snapshot.ComparablePeerOutcomeShare
			);
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::
			SuppressedPeerNoEvidenceHeavy:
			return FString::Printf(
				TEXT(
					" | at-launch confidence lane suppressed by peer-no-evidence-heavy history (%d/%d comparable-peer outcomes, share %.2f; peer-no-evidence %d)"),
				Snapshot.ComparablePeerOutcomeRuns,
				Snapshot.SplitConfidenceOutcomeRuns,
				Snapshot.ComparablePeerOutcomeShare,
				Snapshot.PeerNoEvidenceOutcomeRuns
			);
		case EHyperTwistTrainingTemplateLaunchComparablePeerConfidenceSnapshotState::None:
		default:
			return FString();
		}
	}

	FString BuildTemplateLaunchSelectionDetailFragment(
		const FHyperTwistTrainingTemplateLaunchSelectionProvenance* SelectionProvenance
	)
	{
		if (SelectionProvenance == nullptr || !SelectionProvenance->IsStructurallyValid())
		{
			return FString();
		}

		const FString PeerTemplateLabel = !SelectionProvenance->PeerTemplateTitle.IsEmpty()
			? SelectionProvenance->PeerTemplateTitle
			: (!SelectionProvenance->PeerTemplateId.IsEmpty()
				? SelectionProvenance->PeerTemplateId
					: TEXT("n/a"));
		const FString AnalyticsSupportDetailFragment =
			BuildTemplateLaunchSelectionAnalyticsSupportDetailFragment(SelectionProvenance);
		const FString TemplateSignalSupportDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportDetailFragment(
				SelectionProvenance);
		const FString TemplateSignalSupportDecisionDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportDecisionDetailFragment(
				SelectionProvenance);
		const FString TemplateSignalSupportDecisionBiasDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasDetailFragment(
				SelectionProvenance);
		const FString TemplateSignalSupportDecisionBiasSnapshotDecisionDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDecisionDetailFragment(
				SelectionProvenance);
		const FString TemplateSignalSupportDecisionBiasSnapshotDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportDecisionBiasSnapshotDetailFragment(
				SelectionProvenance);
		const FString TemplateSignalSupportBiasDetailFragment =
			BuildTemplateLaunchSelectionTemplateSignalSupportBiasDetailFragment(
				SelectionProvenance);
		const FString PeerSupportDispositionDetailFragment =
			BuildTemplateLaunchSelectionPeerSupportDispositionDetailFragment(SelectionProvenance);
		const FString ComparablePeerConfidenceDetailFragment =
			BuildTemplateLaunchSelectionComparablePeerConfidenceDetailFragment(
				SelectionProvenance);
		const FString SelectionReasonDetailFragment =
			AnalyticsSupportDetailFragment + TemplateSignalSupportDetailFragment
			+ TemplateSignalSupportDecisionDetailFragment
			+ TemplateSignalSupportDecisionBiasDetailFragment
			+ TemplateSignalSupportDecisionBiasSnapshotDecisionDetailFragment
			+ TemplateSignalSupportDecisionBiasSnapshotDetailFragment
			+ TemplateSignalSupportBiasDetailFragment
			+ PeerSupportDispositionDetailFragment
			+ ComparablePeerConfidenceDetailFragment;
		if (!SelectionProvenance->PeerTemplateTitle.IsEmpty()
			|| !SelectionProvenance->PeerTemplateId.IsEmpty())
		{
			return FString::Printf(
				TEXT("Selector %s | reason %s%s | peer %s | %s"),
				SelectionProvenance->SelectorSourceLabel.IsEmpty()
					? TEXT("n/a")
					: *SelectionProvenance->SelectorSourceLabel,
				*ResolveTemplateLaunchSelectionReasonClassLabel(SelectionProvenance->ReasonClass),
				*SelectionReasonDetailFragment,
				*PeerTemplateLabel,
				SelectionProvenance->DecisionSummaryLine.IsEmpty()
					? TEXT("no retained selector decision summary")
					: *SelectionProvenance->DecisionSummaryLine
			);
		}

		return FString::Printf(
			TEXT("Selector %s | reason %s%s | %s"),
			SelectionProvenance->SelectorSourceLabel.IsEmpty()
				? TEXT("n/a")
				: *SelectionProvenance->SelectorSourceLabel,
			*ResolveTemplateLaunchSelectionReasonClassLabel(SelectionProvenance->ReasonClass),
			*SelectionReasonDetailFragment,
			SelectionProvenance->DecisionSummaryLine.IsEmpty()
				? TEXT("no retained selector decision summary")
				: *SelectionProvenance->DecisionSummaryLine
		);
	}

	struct FClosureRecoveryDashboardBias
	{
		int32 ContinuationBias = 0;
		int32 SuppressionBias = 0;
		bool bHasSignal = false;
	};

	enum class EHandoffRecommendationKind : uint8
	{
		None,
		Queue,
		FollowUp,
		Recommended
	};

	enum class EMethodDrillRecoveryMemoryBias : uint8
	{
		None,
		Strong,
		Weak
	};

	bool ContainsTagIgnoreCase(const TArray<FString>& Tags, const FString& ExpectedTag)
	{
		return Tags.ContainsByPredicate(
			[&ExpectedTag](const FString& Candidate)
			{
				return Candidate.Equals(ExpectedTag, ESearchCase::IgnoreCase);
			}
		);
	}

	bool IsGeneratedModeLaunchDeck(const FHyperTwistTrainingRunState& RunState)
	{
		return RunState.ActiveDeck.IsStructurallyValid()
			&& RunState.ActiveDeck.ImportedRuntimeSurface.IsStructurallyValid()
			&& RunState.ActiveDeck.ImportedRuntimeSurface.SurfaceKind.Equals(
				TEXT("generated-mode"),
				ESearchCase::IgnoreCase
			)
			&& !ContainsTagIgnoreCase(RunState.ActiveDeck.Tags, TEXT("generated-mode:owned-execution"));
	}

	struct FHandoffHistoryDashboardBias
	{
		int32 QueueAcceptedDeltaCount = 0;
		int32 FollowUpAcceptedDeltaCount = 0;
		int32 RecommendedAcceptedDeltaCount = 0;
		int32 AlignedTightFollowUpOutcomeAcceptedDeltaCount = 0;
		int32 AlignedBroadRecommendedOutcomeAcceptedDeltaCount = 0;
		int32 AlignedTightFollowUpPacketAcceptedDeltaCount = 0;
		int32 AlignedBroadRecommendedPacketAcceptedDeltaCount = 0;
		int32 ReliableAcceptedAlignedTightFollowUpPacketAcceptedDeltaCount = 0;
		int32 ReliableAcceptedAlignedBroadRecommendedPacketAcceptedDeltaCount = 0;
		int32 DeferredOverflowQueueAcceptedDeltaCount = 0;
		int32 DeferredOverflowFollowUpAcceptedDeltaCount = 0;
		int32 DeferredOverflowRecommendedAcceptedDeltaCount = 0;
		int32 MethodDrillQueueAcceptedDeltaCount = 0;
		int32 MethodDrillFollowUpAcceptedDeltaCount = 0;
		int32 MethodDrillRecommendedAcceptedDeltaCount = 0;
		int32 QueueRecommendationCount = 0;
		int32 FollowUpRecommendationCount = 0;
		int32 RecommendedRecommendationCount = 0;
		int32 DeferredFirstQueueRecommendationCount = 0;
		int32 DeferredFirstFollowUpRecommendationCount = 0;
		int32 DeferredFirstRecommendedRecommendationCount = 0;
		int32 MethodDrillQueueRecommendationCount = 0;
		int32 MethodDrillFollowUpRecommendationCount = 0;
		int32 MethodDrillRecommendedRecommendationCount = 0;
		int32 StrongRetainedMethodDrillQueueAcceptedDeltaCount = 0;
		int32 StrongRetainedMethodDrillFollowUpAcceptedDeltaCount = 0;
		int32 StrongRetainedMethodDrillRecommendedAcceptedDeltaCount = 0;
		int32 WeakRetainedMethodDrillQueueAcceptedDeltaCount = 0;
		int32 WeakRetainedMethodDrillFollowUpAcceptedDeltaCount = 0;
		int32 WeakRetainedMethodDrillRecommendedAcceptedDeltaCount = 0;
		int32 StrongRetainedMethodDrillQueueRecommendationCount = 0;
		int32 StrongRetainedMethodDrillFollowUpRecommendationCount = 0;
		int32 StrongRetainedMethodDrillRecommendedRecommendationCount = 0;
		int32 WeakRetainedMethodDrillQueueRecommendationCount = 0;
		int32 WeakRetainedMethodDrillFollowUpRecommendationCount = 0;
		int32 WeakRetainedMethodDrillRecommendedRecommendationCount = 0;
		int32 ReliableTrustedTightQueueAcceptedDeltaCount = 0;
		int32 ReliableTrustedTightFollowUpAcceptedDeltaCount = 0;
		int32 ReliableTrustedTightRecommendedAcceptedDeltaCount = 0;
		int32 ReliableTrustedBroadQueueAcceptedDeltaCount = 0;
		int32 ReliableTrustedBroadFollowUpAcceptedDeltaCount = 0;
		int32 ReliableTrustedBroadRecommendedAcceptedDeltaCount = 0;
		int32 ReliableTrustedTightQueueRecommendationCount = 0;
		int32 ReliableTrustedTightFollowUpRecommendationCount = 0;
		int32 ReliableTrustedTightRecommendedRecommendationCount = 0;
		int32 ReliableTrustedBroadQueueRecommendationCount = 0;
		int32 ReliableTrustedBroadFollowUpRecommendationCount = 0;
		int32 ReliableTrustedBroadRecommendedRecommendationCount = 0;
		int32 ReliableAlignedTrustedTightQueueAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedTightFollowUpAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedTightRecommendedAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedBroadQueueAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedBroadFollowUpAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedBroadRecommendedAcceptedDeltaCount = 0;
		int32 ReliableAlignedTrustedTightQueueRecommendationCount = 0;
		int32 ReliableAlignedTrustedTightFollowUpRecommendationCount = 0;
		int32 ReliableAlignedTrustedTightRecommendedRecommendationCount = 0;
		int32 ReliableAlignedTrustedBroadQueueRecommendationCount = 0;
		int32 ReliableAlignedTrustedBroadFollowUpRecommendationCount = 0;
		int32 ReliableAlignedTrustedBroadRecommendedRecommendationCount = 0;
		int32 QueueScore = 0;
		int32 FollowUpScore = 0;
		int32 RecommendedScore = 0;
		EHandoffRecommendationKind PreferredKind = EHandoffRecommendationKind::None;
		EHandoffRecommendationKind PreferredDeferredOverflowKind = EHandoffRecommendationKind::None;
		bool bHasAcceptedSignal = false;
		bool bHasRecommendationSignal = false;
		bool bHasDeferredOverflowAcceptedSignal = false;
		bool bHasDeferredFirstSuppressionRecommendationSignal = false;
		bool bHasMethodDrillAcceptedSignal = false;
		bool bHasMethodDrillRecommendationSignal = false;
		bool bHasStrongRetainedMethodDrillPostureSignal = false;
		bool bHasWeakRetainedMethodDrillPostureSignal = false;
		bool bHasReliableTrustedTightPlanHistorySignal = false;
		bool bHasReliableTrustedBroadPlanHistorySignal = false;
		bool bHasReliableAlignedTrustedTightPlanOutcomeSignal = false;
		bool bHasReliableAlignedTrustedBroadPlanOutcomeSignal = false;
		bool bHasAlignedGuidanceOutcomeAcceptedSignal = false;
		bool bHasAlignedPacketAcceptedSignal = false;
		bool bHasSignal = false;
	};

	struct FMethodDrillRecoveryPacketDashboardBias
	{
		int32 QueueEntryHistoryCount = 0;
		int32 FollowUpPacketHistoryCount = 0;
		int32 RecommendedBriefHistoryCount = 0;
		int32 StrongQueueEntryCount = 0;
		int32 StrongFollowUpPacketCount = 0;
		int32 WeakRecommendedBriefCount = 0;
		int32 TightContinuationPlanCount = 0;
		int32 BroadRedirectPlanCount = 0;
		int32 LaunchRecoveryBias = 0;
		int32 PromoteRecoveryBias = 0;
		int32 QueueHandoffBias = 0;
		int32 FollowUpHandoffBias = 0;
		int32 RecommendedHandoffBias = 0;
		EHandoffRecommendationKind PreferredHandoffKind = EHandoffRecommendationKind::None;
		bool bHasStrongContinuationSignal = false;
		bool bHasWeakRedirectSignal = false;
		bool bHasSignal = false;
	};

	struct FMethodDrillRecoveryPlanComparisonSummary
	{
		int32 TightPlanSourceCount = 0;
		int32 TightPlanAlignedCount = 0;
		int32 TightPlanDivergedCount = 0;
		int32 ReliableTrustedTightPlanSourceCount = 0;
		int32 ReliableTrustedTightPlanAlignedCount = 0;
		int32 ReliableTrustedTightPlanDivergedCount = 0;
		int32 ReliableAlignedTrustedTightPlanSourceCount = 0;
		int32 ReliableAlignedTrustedTightPlanAlignedCount = 0;
		int32 ReliableAlignedTrustedTightPlanDivergedCount = 0;
		int32 BroadPlanSourceCount = 0;
		int32 BroadPlanAlignedCount = 0;
		int32 BroadPlanDivergedCount = 0;
		int32 ReliableTrustedBroadPlanSourceCount = 0;
		int32 ReliableTrustedBroadPlanAlignedCount = 0;
		int32 ReliableTrustedBroadPlanDivergedCount = 0;
		int32 ReliableAlignedTrustedBroadPlanSourceCount = 0;
		int32 ReliableAlignedTrustedBroadPlanAlignedCount = 0;
		int32 ReliableAlignedTrustedBroadPlanDivergedCount = 0;
		bool bHasSignal = false;
	};

	template <typename TEnum>
	FString EnumDisplayName(const TEnum Value)
	{
		if (const UEnum* Enum = StaticEnum<TEnum>())
		{
			return Enum->GetDisplayNameTextByValue(static_cast<int64>(Value)).ToString();
		}

		return TEXT("Unknown");
	}

	FString BuildDisplayedGeneratedLaunchRequestDetail(
		const FHyperTwistTrainingCoachPanelState& PanelState
	)
	{
		return PanelState.bHasLatestGeneratedModeLaunchRequest
			? FString::Printf(
				TEXT("Generated request: %s @ %s | mode: %s\nSelectors: %s"),
				PanelState.LatestGeneratedModeLaunchRequestId.IsEmpty()
					? TEXT("n/a")
					: *PanelState.LatestGeneratedModeLaunchRequestId,
				PanelState.LatestGeneratedModeLaunchRequestedAtUtc.IsEmpty()
					? TEXT("n/a")
					: *PanelState.LatestGeneratedModeLaunchRequestedAtUtc,
				PanelState.LatestGeneratedModeRuntimeModeId.IsEmpty()
					? TEXT("n/a")
					: *PanelState.LatestGeneratedModeRuntimeModeId,
				PanelState.LatestGeneratedModeSelectorSummaryLine.IsEmpty()
					? TEXT("none")
					: *PanelState.LatestGeneratedModeSelectorSummaryLine)
			: TEXT("Generated request: none for active deck");
	}

	FString BuildDisplayedGeneratedExecutionDetail(
		const FHyperTwistTrainingCoachPanelState& PanelState
	)
	{
		return PanelState.bHasActiveGeneratedModeExecutionTarget
			? FString::Printf(
				TEXT("Generated execution ready: %s | Request refresh on execute: %s | Blocked: %s"),
				PanelState.bCanExecuteActiveGeneratedModeLaunchRequest ? TEXT("yes") : TEXT("no"),
				PanelState.bActiveGeneratedModeExecutionWillRefreshLaunchRequest
					? TEXT("yes")
					: TEXT("no"),
				PanelState.ActiveGeneratedModeExecutionBlockedReason.IsEmpty()
					? TEXT("none")
					: *PanelState.ActiveGeneratedModeExecutionBlockedReason)
			: TEXT("");
	}

	FString BuildDisplayedRepositoryVerificationDetailLine(
		const FHyperTwistTrainingRepositoryRoundTripVerification& Verification,
		const FString& VerificationNotePreview,
		const FHyperTwistTrainingCoachPanelState& PanelState
	)
	{
		const FString GeneratedLaunchRequestDetail =
			BuildDisplayedGeneratedLaunchRequestDetail(PanelState);
		const FString GeneratedExecutionDetail =
			BuildDisplayedGeneratedExecutionDetail(PanelState);
		const FString GeneratedExecutionSuffix = GeneratedExecutionDetail.IsEmpty()
			? TEXT("")
			: FString::Printf(TEXT("\n%s"), *GeneratedExecutionDetail);
		return FString::Printf(
			TEXT("Path: %s\nRound-trip pass: %s | Save: %s | Load: %s | Count parity: %s | State parity: %s | Integrity parity: %s | Derived parity: %s\nRuns %d/%d | Learners %d/%d | Reviews %d/%d | Plans %d/%d | Queues %d/%d | History %d/%d | Derived users %d | Derived queues %d | Notes: %s\n%s%s"),
			Verification.ResolvedPath.IsEmpty()
				? TEXT("not yet verified")
				: *Verification.ResolvedPath,
			Verification.bDidRoundTripPass ? TEXT("yes") : TEXT("no"),
			Verification.bSaveSucceeded ? TEXT("yes") : TEXT("no"),
			Verification.bLoadSucceeded ? TEXT("yes") : TEXT("no"),
			Verification.bRepositoryCountsMatch ? TEXT("yes") : TEXT("no"),
			Verification.bSerializedStateMatch ? TEXT("yes") : TEXT("no"),
			Verification.bIntegrityReportMatch ? TEXT("yes") : TEXT("no"),
			Verification.bDerivedStateMatch ? TEXT("yes") : TEXT("no"),
			Verification.LoadedRunRecordCount,
			Verification.ExpectedRunRecordCount,
			Verification.LoadedLearnerStateCount,
			Verification.ExpectedLearnerStateCount,
			Verification.LoadedReviewPlanCount,
			Verification.ExpectedReviewPlanCount,
			Verification.LoadedCoachActionPlanCount,
			Verification.ExpectedCoachActionPlanCount,
			Verification.LoadedCoachSessionQueueCount,
			Verification.ExpectedCoachSessionQueueCount,
			Verification.LoadedCoachSessionQueueHistoryCount,
			Verification.ExpectedCoachSessionQueueHistoryCount,
			Verification.VerifiedDerivedUserCount,
			Verification.VerifiedDerivedQueueCount,
			*VerificationNotePreview,
			*GeneratedLaunchRequestDetail,
			*GeneratedExecutionSuffix);
	}

	bool IsTightCoachPlanPosture(
		const EHyperTwistTrainingDeliveryMode SuggestedMode,
		const EHyperTwistTrainingSelectionPolicy SuggestedSelectionPolicy)
	{
		return SuggestedSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Scripted
			&& (SuggestedMode == EHyperTwistTrainingDeliveryMode::CoachReviewed
				|| SuggestedMode == EHyperTwistTrainingDeliveryMode::RecognitionAssisted);
	}

	bool IsBroadCoachPlanPosture(
		const EHyperTwistTrainingDeliveryMode SuggestedMode,
		const EHyperTwistTrainingSelectionPolicy SuggestedSelectionPolicy)
	{
		return SuggestedSelectionPolicy != EHyperTwistTrainingSelectionPolicy::Scripted
			&& SuggestedMode != EHyperTwistTrainingDeliveryMode::CoachReviewed;
	}

	FString DescribeCoachPlanPosture(
		const EHyperTwistTrainingDeliveryMode SuggestedMode,
		const EHyperTwistTrainingSelectionPolicy SuggestedSelectionPolicy)
	{
		if (IsTightCoachPlanPosture(SuggestedMode, SuggestedSelectionPolicy))
		{
			return TEXT("tight reviewed/scripted continuation");
		}
		if (IsBroadCoachPlanPosture(SuggestedMode, SuggestedSelectionPolicy))
		{
			return TEXT("broad redirect default");
		}
		if (SuggestedSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Scripted)
		{
			return TEXT("scripted mixed posture");
		}
		if (SuggestedMode == EHyperTwistTrainingDeliveryMode::CoachReviewed)
		{
			return TEXT("reviewed mixed posture");
		}

		return TEXT("neutral default posture");
	}

	FString DescribeGuidanceLane(const EHyperTwistTrainingCoachGuidanceLane Lane)
	{
		switch (Lane)
		{
		case EHyperTwistTrainingCoachGuidanceLane::FollowUp:
			return TEXT("follow-up");
		case EHyperTwistTrainingCoachGuidanceLane::Recommended:
			return TEXT("recommended");
		default:
			return TEXT("none");
		}
	}

	EHyperTwistTrainingQueueRecoveryAction ToQueueRecoveryAction(
		const FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind ActionKind)
	{
		switch (ActionKind)
		{
		case FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred:
			return EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred;
		case FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery:
			return EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
		default:
			return EHyperTwistTrainingQueueRecoveryAction::None;
		}
	}

	FString DescribeHandoffRecommendationKind(const EHandoffRecommendationKind Kind)
	{
		switch (Kind)
		{
		case EHandoffRecommendationKind::Queue:
			return TEXT("queue");
		case EHandoffRecommendationKind::FollowUp:
			return TEXT("follow-up");
		case EHandoffRecommendationKind::Recommended:
			return TEXT("recommended");
		default:
			return TEXT("none");
		}
	}

	int32 ScoreTemplateForDashboardLaunch(const FHyperTwistTrainingSessionTemplate& Template)
	{
		if (!Template.IsStructurallyValid())
		{
			return 0;
		}

		int32 Score = 0;
		switch (Template.TemplateKind)
		{
		case EHyperTwistTrainingSessionTemplateKind::ReviewPlan:
			Score = 500;
			break;
		case EHyperTwistTrainingSessionTemplateKind::Coach:
			Score = Template.bPreferReviewRun || Template.bCoachReview ? 450 : 0;
			break;
		case EHyperTwistTrainingSessionTemplateKind::Recovery:
			Score = 400;
			break;
		default:
			Score = 0;
			break;
		}

		if (Score <= 0)
		{
			return 0;
		}

		if (Template.bPreferReviewRun)
		{
			Score += 30;
		}
		if (!Template.SourceReviewPlanId.IsEmpty())
		{
			Score += 20;
		}
		if (Template.bUserCreated)
		{
			Score += 10;
		}
		if (Template.bUserCustomized)
		{
			Score += 5;
		}

		return Score;
	}

	FString ResolveDashboardTemplateAnalyticsUserId(
		const FHyperTwistTrainingSessionTemplate& Template,
		const FString& DefaultUserId
	)
	{
		return !Template.UserId.IsEmpty() ? Template.UserId : DefaultUserId;
	}

	constexpr int32 TemplateLaunchAnalyticsTieBreakMinimumOutcomeRuns = 2;
	constexpr int32 TemplateLaunchSelectionTieBreakConfidenceMinimumSplitConfidenceOutcomeRuns = 3;
	constexpr int32 TemplateLaunchSelectionTieBreakConfidenceMinimumTemplateSignalOutcomeRuns = 2;
	constexpr int32 TemplateLaunchSelectionTieBreakConfidenceMinimumScoreDelta = 2;
	constexpr float TemplateLaunchSelectionTieBreakConfidenceMinimumSuccessDelta = 0.05f;
	constexpr float TemplateLaunchSelectionTieBreakConfidenceMinimumMistakeImprovement = 0.5f;
	constexpr int32 TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeRuns = 2;
	constexpr float TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeShare = 0.40f;
	constexpr int32 TemplateLaunchTemplateSignalConfidenceMinimumEligibleOutcomeRuns = 2;
	constexpr float TemplateLaunchTemplateSignalConfidenceMinimumEligibleOutcomeShare = 0.50f;
	constexpr int32 TemplateLaunchTemplateSignalConfidenceMinimumScoreDelta = 1;
	constexpr float TemplateLaunchTemplateSignalConfidenceMinimumSuccessDelta = 0.05f;
	constexpr float TemplateLaunchTemplateSignalConfidenceMinimumMistakeImprovement = 0.5f;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasMinimumConfidenceLaneBiasOutcomeRuns =
		2;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasMinimumBroaderOutcomeOnlyOutcomeRuns =
		2;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasMinimumScoreDelta = 1;
	constexpr float TemplateLaunchTemplateSignalSupportBiasMinimumSuccessDelta = 0.05f;
	constexpr float TemplateLaunchTemplateSignalSupportBiasMinimumMistakeImprovement = 0.5f;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumEarnedOutcomeRuns = 2;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumComparisonOutcomeRuns =
		2;
	constexpr int32 TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumScoreDelta = 1;
	constexpr float TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumSuccessDelta = 0.05f;
	constexpr float TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumMistakeImprovement =
		0.5f;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionMinimumDecisionSplitGuardOutcomeRuns = 2;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionMinimumPlainSnapshotGuardOutcomeRuns = 2;
	constexpr int32 TemplateLaunchTemplateSignalSupportDecisionMinimumScoreDelta = 1;
	constexpr float TemplateLaunchTemplateSignalSupportDecisionMinimumSuccessDelta = 0.05f;
	constexpr float TemplateLaunchTemplateSignalSupportDecisionMinimumMistakeImprovement = 0.5f;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumEarnedOutcomeRuns = 2;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumComparisonOutcomeRuns =
			2;
	constexpr int32 TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumScoreDelta =
		1;
	constexpr float
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumSuccessDelta = 0.05f;
	constexpr float
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumMistakeImprovement =
			0.5f;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumReinforcedOutcomeRuns =
			2;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumPlainDecisionSplitGuardOutcomeRuns =
			2;
	constexpr int32
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumScoreDelta = 1;
	constexpr float
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumSuccessDelta = 0.05f;
	constexpr float
		TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumMistakeImprovement =
			0.5f;

	int32 CountTemplateLaunchOutcomeRuns(const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats)
	{
		return TemplateStats != nullptr && TemplateStats->IsStructurallyValid()
			? (TemplateStats->CompletedRunCount + TemplateStats->AbortedRunCount)
			: 0;
	}

	int32 CountTemplateLaunchSelectionOutcomeRuns(
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SelectionStats
	)
	{
		return SelectionStats != nullptr && SelectionStats->IsStructurallyValid()
			? SelectionStats->GetOutcomeRunCount()
			: 0;
	}

	int32 BuildTemplateLaunchAnalyticsOutcomeSignalScore(
		const int32 OutcomeRuns,
		const float SuccessRate,
		const float AverageMistakesPerOutcomeRun,
		const int32 AbortedRunCount
	)
	{
		if (OutcomeRuns <= 0)
		{
			return 0;
		}

		int32 Score = 0;
		Score += FMath::Clamp(OutcomeRuns, 0, 4);
		Score += FMath::Clamp(FMath::RoundToInt(SuccessRate * 10.0f), 0, 10);
		Score -= FMath::Clamp(FMath::RoundToInt(AverageMistakesPerOutcomeRun * 2.0f), 0, 8);
		Score -= FMath::Clamp(AbortedRunCount, 0, 3);
		return Score;
	}

	int32 BuildTemplateLaunchSelectionLaneAnalyticsScore(
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SelectionStats
	)
	{
		if (SelectionStats == nullptr || !SelectionStats->IsStructurallyValid())
		{
			return 0;
		}

		return BuildTemplateLaunchAnalyticsOutcomeSignalScore(
			CountTemplateLaunchSelectionOutcomeRuns(SelectionStats),
			SelectionStats->OverallSuccessRate,
			SelectionStats->AverageMistakesPerOutcomeRun,
			SelectionStats->AbortedRunCount
		);
	}

	int32 BuildTemplateLaunchAnalyticsTieBreakScore(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return 0;
		}

		const int32 OutcomeRuns = CountTemplateLaunchOutcomeRuns(TemplateStats);
		if (OutcomeRuns <= 0)
		{
			return 0;
		}

		return BuildTemplateLaunchAnalyticsOutcomeSignalScore(
			OutcomeRuns,
			TemplateStats->OverallSuccessRate,
			TemplateStats->AverageMistakesPerOutcomeRun,
			TemplateStats->AbortedRunCount
		);
	}

	bool HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutComparablePeerOutcomeRuns,
		int32* OutSplitConfidenceOutcomeRuns,
		float* OutComparablePeerOutcomeShare,
		int32* OutPeerNoEvidenceOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SplitConfidenceStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PeerNoEvidenceStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PeerWeakerStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PeerMarginalStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PeerClearedStats = nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			SplitConfidenceStats =
				&TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
			PeerNoEvidenceStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerLackedComparableEvidenceStats;
			PeerWeakerStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedWeakerSupportKindStats;
			PeerMarginalStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerFailedMarginalSupportKindStats;
			PeerClearedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakSelectorSplitConfidencePeerClearedComparableGuardStats;
		}

		const int32 ComparablePeerOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(PeerWeakerStats)
			+ CountTemplateLaunchSelectionOutcomeRuns(PeerMarginalStats)
			+ CountTemplateLaunchSelectionOutcomeRuns(PeerClearedStats);
		const int32 SplitConfidenceOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(SplitConfidenceStats);
		const int32 PeerNoEvidenceOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(PeerNoEvidenceStats);
		const float ComparablePeerOutcomeShare = SplitConfidenceOutcomeRuns > 0
			? static_cast<float>(ComparablePeerOutcomeRuns)
				/ static_cast<float>(SplitConfidenceOutcomeRuns)
			: 0.0f;

		if (OutComparablePeerOutcomeRuns != nullptr)
		{
			*OutComparablePeerOutcomeRuns = ComparablePeerOutcomeRuns;
		}
		if (OutSplitConfidenceOutcomeRuns != nullptr)
		{
			*OutSplitConfidenceOutcomeRuns = SplitConfidenceOutcomeRuns;
		}
		if (OutComparablePeerOutcomeShare != nullptr)
		{
			*OutComparablePeerOutcomeShare = ComparablePeerOutcomeShare;
		}
		if (OutPeerNoEvidenceOutcomeRuns != nullptr)
		{
			*OutPeerNoEvidenceOutcomeRuns = PeerNoEvidenceOutcomeRuns;
		}

		return ComparablePeerOutcomeRuns
				>= TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeRuns
			&& ComparablePeerOutcomeShare
				>= TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeShare;
	}

	bool HasTemplateLaunchTemplateSignalConfidenceSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutConfidenceEligibleOutcomeRuns,
		int32* OutTemplateSignalOutcomeRuns,
		float* OutConfidenceEligibleOutcomeShare,
		int32* OutSuppressedOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* TemplateSignalStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* ConfidenceEligibleStats =
			nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SuppressedStats = nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			TemplateSignalStats =
				&TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
			ConfidenceEligibleStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalConfidenceEligibleStats;
			SuppressedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSuppressedPeerNoEvidenceHeavyStats;
		}

		const int32 ConfidenceEligibleOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(ConfidenceEligibleStats);
		const int32 TemplateSignalOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(TemplateSignalStats);
		const int32 SuppressedOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(SuppressedStats);
		const float ConfidenceEligibleOutcomeShare = TemplateSignalOutcomeRuns > 0
			? static_cast<float>(ConfidenceEligibleOutcomeRuns)
				/ static_cast<float>(TemplateSignalOutcomeRuns)
			: 0.0f;

		if (OutConfidenceEligibleOutcomeRuns != nullptr)
		{
			*OutConfidenceEligibleOutcomeRuns = ConfidenceEligibleOutcomeRuns;
		}
		if (OutTemplateSignalOutcomeRuns != nullptr)
		{
			*OutTemplateSignalOutcomeRuns = TemplateSignalOutcomeRuns;
		}
		if (OutConfidenceEligibleOutcomeShare != nullptr)
		{
			*OutConfidenceEligibleOutcomeShare = ConfidenceEligibleOutcomeShare;
		}
		if (OutSuppressedOutcomeRuns != nullptr)
		{
			*OutSuppressedOutcomeRuns = SuppressedOutcomeRuns;
		}

		if (ConfidenceEligibleOutcomeRuns
				< TemplateLaunchTemplateSignalConfidenceMinimumEligibleOutcomeRuns
			|| ConfidenceEligibleOutcomeShare
				< TemplateLaunchTemplateSignalConfidenceMinimumEligibleOutcomeShare)
		{
			return false;
		}
		if (SuppressedOutcomeRuns <= 0)
		{
			return true;
		}

		const int32 ConfidenceEligibleScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(ConfidenceEligibleStats);
		const int32 SuppressedScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(SuppressedStats);
		const int32 ScoreDelta = ConfidenceEligibleScore - SuppressedScore;
		const float SuccessDelta =
			(ConfidenceEligibleStats != nullptr && ConfidenceEligibleStats->IsStructurallyValid()
					? ConfidenceEligibleStats->OverallSuccessRate
					: 0.0f)
			- (SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->OverallSuccessRate
					: 0.0f);
		const float MistakeImprovement =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->AverageMistakesPerOutcomeRun
					: 0.0f)
			- (ConfidenceEligibleStats != nullptr && ConfidenceEligibleStats->IsStructurallyValid()
					? ConfidenceEligibleStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		return ScoreDelta >= TemplateLaunchTemplateSignalConfidenceMinimumScoreDelta
			|| SuccessDelta >= TemplateLaunchTemplateSignalConfidenceMinimumSuccessDelta
			|| MistakeImprovement
				>= TemplateLaunchTemplateSignalConfidenceMinimumMistakeImprovement;
	}

	bool HasTemplateLaunchTemplateSignalSupportBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutConfidenceLaneBiasOutcomeRuns,
		int32* OutBroaderOutcomeOnlyOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* ConfidenceLaneBiasStats =
			nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* BroaderOutcomeOnlyStats =
			nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			ConfidenceLaneBiasStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalConfidenceLaneBiasStats;
			BroaderOutcomeOnlyStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalBroaderOutcomeOnlyStats;
		}

		const int32 ConfidenceLaneBiasOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(ConfidenceLaneBiasStats);
		const int32 BroaderOutcomeOnlyOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(BroaderOutcomeOnlyStats);
		if (OutConfidenceLaneBiasOutcomeRuns != nullptr)
		{
			*OutConfidenceLaneBiasOutcomeRuns = ConfidenceLaneBiasOutcomeRuns;
		}
		if (OutBroaderOutcomeOnlyOutcomeRuns != nullptr)
		{
			*OutBroaderOutcomeOnlyOutcomeRuns = BroaderOutcomeOnlyOutcomeRuns;
		}

		if (!HasTemplateLaunchTemplateSignalConfidenceSnapshotBias(TemplateStats)
			|| ConfidenceLaneBiasOutcomeRuns
				< TemplateLaunchTemplateSignalSupportBiasMinimumConfidenceLaneBiasOutcomeRuns
			|| BroaderOutcomeOnlyOutcomeRuns
				< TemplateLaunchTemplateSignalSupportBiasMinimumBroaderOutcomeOnlyOutcomeRuns)
		{
			return false;
		}

		const int32 ConfidenceLaneBiasScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(ConfidenceLaneBiasStats);
		const int32 BroaderOutcomeOnlyScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(BroaderOutcomeOnlyStats);
		const int32 ScoreDelta = ConfidenceLaneBiasScore - BroaderOutcomeOnlyScore;
		const float SuccessDelta =
			(ConfidenceLaneBiasStats != nullptr && ConfidenceLaneBiasStats->IsStructurallyValid()
					? ConfidenceLaneBiasStats->OverallSuccessRate
					: 0.0f)
			- (BroaderOutcomeOnlyStats != nullptr && BroaderOutcomeOnlyStats->IsStructurallyValid()
					? BroaderOutcomeOnlyStats->OverallSuccessRate
					: 0.0f);
		const float MistakeImprovement =
			(BroaderOutcomeOnlyStats != nullptr && BroaderOutcomeOnlyStats->IsStructurallyValid()
					? BroaderOutcomeOnlyStats->AverageMistakesPerOutcomeRun
					: 0.0f)
			- (ConfidenceLaneBiasStats != nullptr && ConfidenceLaneBiasStats->IsStructurallyValid()
					? ConfidenceLaneBiasStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		return ScoreDelta >= TemplateLaunchTemplateSignalSupportBiasMinimumScoreDelta
			|| SuccessDelta >= TemplateLaunchTemplateSignalSupportBiasMinimumSuccessDelta
			|| MistakeImprovement
				>= TemplateLaunchTemplateSignalSupportBiasMinimumMistakeImprovement;
	}

	bool HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutEarnedOutcomeRuns,
		int32* OutComparisonOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* EarnedStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SuppressedStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* NoRetainedStats = nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			EarnedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotEarnedStats;
			SuppressedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotSuppressedStats;
			NoRetainedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotNoRetainedStats;
		}

		const int32 EarnedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(EarnedStats);
		const int32 SuppressedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(SuppressedStats);
		const int32 NoRetainedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(NoRetainedStats);
		const int32 ComparisonOutcomeRuns = SuppressedOutcomeRuns + NoRetainedOutcomeRuns;
		if (OutEarnedOutcomeRuns != nullptr)
		{
			*OutEarnedOutcomeRuns = EarnedOutcomeRuns;
		}
		if (OutComparisonOutcomeRuns != nullptr)
		{
			*OutComparisonOutcomeRuns = ComparisonOutcomeRuns;
		}

		if (!HasTemplateLaunchTemplateSignalSupportBias(TemplateStats)
			|| EarnedOutcomeRuns
				< TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumEarnedOutcomeRuns
			|| ComparisonOutcomeRuns
				< TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumComparisonOutcomeRuns)
		{
			return false;
		}

		const int32 ComparisonCompletedAttemptCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->TotalCompletedAttemptCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->TotalCompletedAttemptCount
					: 0);
		const int32 ComparisonSuccessCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->TotalSuccessCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->TotalSuccessCount
					: 0);
		const int32 ComparisonAbortedRunCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->AbortedRunCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->AbortedRunCount
					: 0);
		const float ComparisonSuccessRate = ComparisonCompletedAttemptCount > 0
			? static_cast<float>(ComparisonSuccessCount)
				/ static_cast<float>(ComparisonCompletedAttemptCount)
			: 0.0f;
		const float ComparisonAverageMistakesPerOutcomeRun = ComparisonOutcomeRuns > 0
			? (((SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
						? SuppressedStats->AverageMistakesPerOutcomeRun
						: 0.0f)
					* static_cast<float>(SuppressedOutcomeRuns))
				+ ((NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
						? NoRetainedStats->AverageMistakesPerOutcomeRun
						: 0.0f)
					* static_cast<float>(NoRetainedOutcomeRuns)))
				/ static_cast<float>(ComparisonOutcomeRuns)
			: 0.0f;
		const int32 EarnedScore = BuildTemplateLaunchSelectionLaneAnalyticsScore(EarnedStats);
		const int32 ComparisonScore = BuildTemplateLaunchAnalyticsOutcomeSignalScore(
			ComparisonOutcomeRuns,
			ComparisonSuccessRate,
			ComparisonAverageMistakesPerOutcomeRun,
			ComparisonAbortedRunCount
		);
		const int32 ScoreDelta = EarnedScore - ComparisonScore;
		const float SuccessDelta =
			(EarnedStats != nullptr && EarnedStats->IsStructurallyValid()
					? EarnedStats->OverallSuccessRate
					: 0.0f)
			- ComparisonSuccessRate;
		const float MistakeImprovement = ComparisonAverageMistakesPerOutcomeRun
			- (EarnedStats != nullptr && EarnedStats->IsStructurallyValid()
					? EarnedStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		return ScoreDelta >= TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumScoreDelta
			|| SuccessDelta >= TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumSuccessDelta
			|| MistakeImprovement
				>= TemplateLaunchTemplateSignalSupportBiasSnapshotMinimumMistakeImprovement;
	}

	bool HasTemplateLaunchTemplateSignalSupportDecisionBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutDecisionSplitGuardOutcomeRuns,
		int32* OutPlainSnapshotGuardOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* DecisionSplitGuardStats =
			nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PlainSnapshotGuardStats =
			nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			DecisionSplitGuardStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardStats;
			PlainSnapshotGuardStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardNoDecisionBiasStats;
		}

		const int32 DecisionSplitGuardOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(DecisionSplitGuardStats);
		const int32 PlainSnapshotGuardOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(PlainSnapshotGuardStats);
		if (OutDecisionSplitGuardOutcomeRuns != nullptr)
		{
			*OutDecisionSplitGuardOutcomeRuns = DecisionSplitGuardOutcomeRuns;
		}
		if (OutPlainSnapshotGuardOutcomeRuns != nullptr)
		{
			*OutPlainSnapshotGuardOutcomeRuns = PlainSnapshotGuardOutcomeRuns;
		}

		if (!HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(TemplateStats)
			|| DecisionSplitGuardOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionMinimumDecisionSplitGuardOutcomeRuns
			|| PlainSnapshotGuardOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionMinimumPlainSnapshotGuardOutcomeRuns)
		{
			return false;
		}

		const int32 DecisionSplitGuardScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(DecisionSplitGuardStats);
		const int32 PlainSnapshotGuardScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(PlainSnapshotGuardStats);
		const int32 ScoreDelta = DecisionSplitGuardScore - PlainSnapshotGuardScore;
		const float SuccessDelta =
			(DecisionSplitGuardStats != nullptr && DecisionSplitGuardStats->IsStructurallyValid()
					? DecisionSplitGuardStats->OverallSuccessRate
					: 0.0f)
			- (PlainSnapshotGuardStats != nullptr
					&& PlainSnapshotGuardStats->IsStructurallyValid()
					? PlainSnapshotGuardStats->OverallSuccessRate
					: 0.0f);
		const float MistakeImprovement =
			(PlainSnapshotGuardStats != nullptr
					&& PlainSnapshotGuardStats->IsStructurallyValid()
					? PlainSnapshotGuardStats->AverageMistakesPerOutcomeRun
					: 0.0f)
			- (DecisionSplitGuardStats != nullptr
					&& DecisionSplitGuardStats->IsStructurallyValid()
					? DecisionSplitGuardStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		return ScoreDelta >= TemplateLaunchTemplateSignalSupportDecisionMinimumScoreDelta
			|| SuccessDelta >= TemplateLaunchTemplateSignalSupportDecisionMinimumSuccessDelta
			|| MistakeImprovement
				>= TemplateLaunchTemplateSignalSupportDecisionMinimumMistakeImprovement;
	}

	bool HasTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotBias(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		int32* OutEarnedOutcomeRuns,
		int32* OutComparisonOutcomeRuns
	)
	{
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* EarnedStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* SuppressedStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* NoRetainedStats = nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			EarnedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotEarnedStats;
			SuppressedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotSuppressedStats;
			NoRetainedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportDecisionBiasSnapshotNoRetainedStats;
		}

		const int32 EarnedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(EarnedStats);
		const int32 SuppressedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(SuppressedStats);
		const int32 NoRetainedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(NoRetainedStats);
		const int32 ComparisonOutcomeRuns = SuppressedOutcomeRuns + NoRetainedOutcomeRuns;
		if (OutEarnedOutcomeRuns != nullptr)
		{
			*OutEarnedOutcomeRuns = EarnedOutcomeRuns;
		}
		if (OutComparisonOutcomeRuns != nullptr)
		{
			*OutComparisonOutcomeRuns = ComparisonOutcomeRuns;
		}

		if (!HasTemplateLaunchTemplateSignalSupportDecisionBias(TemplateStats)
			|| EarnedOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumEarnedOutcomeRuns
			|| ComparisonOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumComparisonOutcomeRuns)
		{
			return false;
		}

		const int32 ComparisonCompletedAttemptCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->TotalCompletedAttemptCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->TotalCompletedAttemptCount
					: 0);
		const int32 ComparisonSuccessCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->TotalSuccessCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->TotalSuccessCount
					: 0);
		const int32 ComparisonAbortedRunCount =
			(SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
					? SuppressedStats->AbortedRunCount
					: 0)
			+ (NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
					? NoRetainedStats->AbortedRunCount
					: 0);
		const float ComparisonSuccessRate = ComparisonCompletedAttemptCount > 0
			? static_cast<float>(ComparisonSuccessCount)
				/ static_cast<float>(ComparisonCompletedAttemptCount)
			: 0.0f;
		const float ComparisonAverageMistakesPerOutcomeRun = ComparisonOutcomeRuns > 0
			? (((SuppressedStats != nullptr && SuppressedStats->IsStructurallyValid()
						? SuppressedStats->AverageMistakesPerOutcomeRun
						: 0.0f)
					* static_cast<float>(SuppressedOutcomeRuns))
				+ ((NoRetainedStats != nullptr && NoRetainedStats->IsStructurallyValid()
						? NoRetainedStats->AverageMistakesPerOutcomeRun
						: 0.0f)
					* static_cast<float>(NoRetainedOutcomeRuns)))
				/ static_cast<float>(ComparisonOutcomeRuns)
			: 0.0f;
		const int32 EarnedScore = BuildTemplateLaunchSelectionLaneAnalyticsScore(EarnedStats);
		const int32 ComparisonScore = BuildTemplateLaunchAnalyticsOutcomeSignalScore(
			ComparisonOutcomeRuns,
			ComparisonSuccessRate,
			ComparisonAverageMistakesPerOutcomeRun,
			ComparisonAbortedRunCount
		);
		const int32 ScoreDelta = EarnedScore - ComparisonScore;
		const float SuccessDelta =
			(EarnedStats != nullptr && EarnedStats->IsStructurallyValid()
					? EarnedStats->OverallSuccessRate
					: 0.0f)
			- ComparisonSuccessRate;
		const float MistakeImprovement = ComparisonAverageMistakesPerOutcomeRun
			- (EarnedStats != nullptr && EarnedStats->IsStructurallyValid()
					? EarnedStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		const bool bEarnedSnapshotBeatsComparison =
			ScoreDelta
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumScoreDelta
			|| SuccessDelta
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumSuccessDelta
			|| MistakeImprovement
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotMinimumMistakeImprovement;
		if (!bEarnedSnapshotBeatsComparison)
		{
			return false;
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* ReinforcedStats = nullptr;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats* PlainDecisionSplitGuardStats =
			nullptr;
		if (TemplateStats != nullptr && TemplateStats->IsStructurallyValid())
		{
			ReinforcedStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardDecisionBiasSnapshotGuardStats;
			PlainDecisionSplitGuardStats =
				&TemplateStats
					->DashboardAnalyticsTieBreakTemplateScopedSignalSupportBiasSnapshotGuardDecisionSplitGuardPlainStats;
		}

		const int32 ReinforcedOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(
			ReinforcedStats);
		const int32 PlainDecisionSplitGuardOutcomeRuns = CountTemplateLaunchSelectionOutcomeRuns(
			PlainDecisionSplitGuardStats);
		if (ReinforcedOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumReinforcedOutcomeRuns
			|| PlainDecisionSplitGuardOutcomeRuns
				< TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumPlainDecisionSplitGuardOutcomeRuns)
		{
			return false;
		}

		const int32 ReinforcedScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(ReinforcedStats);
		const int32 PlainDecisionSplitGuardScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(PlainDecisionSplitGuardStats);
		const int32 ReinforcedScoreDelta = ReinforcedScore - PlainDecisionSplitGuardScore;
		const float ReinforcedSuccessDelta =
			(ReinforcedStats != nullptr && ReinforcedStats->IsStructurallyValid()
					? ReinforcedStats->OverallSuccessRate
					: 0.0f)
			- (PlainDecisionSplitGuardStats != nullptr
					&& PlainDecisionSplitGuardStats->IsStructurallyValid()
					? PlainDecisionSplitGuardStats->OverallSuccessRate
					: 0.0f);
		const float ReinforcedMistakeImprovement =
			(PlainDecisionSplitGuardStats != nullptr
					&& PlainDecisionSplitGuardStats->IsStructurallyValid()
					? PlainDecisionSplitGuardStats->AverageMistakesPerOutcomeRun
					: 0.0f)
			- (ReinforcedStats != nullptr && ReinforcedStats->IsStructurallyValid()
					? ReinforcedStats->AverageMistakesPerOutcomeRun
					: 0.0f);
		return ReinforcedScoreDelta
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumScoreDelta
			|| ReinforcedSuccessDelta
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumSuccessDelta
			|| ReinforcedMistakeImprovement
				>= TemplateLaunchTemplateSignalSupportDecisionBiasSnapshotGuardMinimumMistakeImprovement;
	}

	int32 BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return 0;
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& TemplateSignalStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
		const int32 SplitConfidenceOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&SplitConfidenceStats);
		const int32 TemplateSignalOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&TemplateSignalStats);
		if (SplitConfidenceOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumSplitConfidenceOutcomeRuns
			|| TemplateSignalOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumTemplateSignalOutcomeRuns)
		{
			return 0;
		}

		const int32 SplitConfidenceScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&SplitConfidenceStats);
		const int32 TemplateSignalScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&TemplateSignalStats);
		const int32 ScoreDelta = SplitConfidenceScore - TemplateSignalScore;
		if (ScoreDelta <= 0)
		{
			return 0;
		}

		const float SuccessDelta =
			SplitConfidenceStats.OverallSuccessRate - TemplateSignalStats.OverallSuccessRate;
		const float MistakeImprovement =
			TemplateSignalStats.AverageMistakesPerOutcomeRun
			- SplitConfidenceStats.AverageMistakesPerOutcomeRun;
		if (ScoreDelta < TemplateLaunchSelectionTieBreakConfidenceMinimumScoreDelta
			&& SuccessDelta < TemplateLaunchSelectionTieBreakConfidenceMinimumSuccessDelta
			&& MistakeImprovement < TemplateLaunchSelectionTieBreakConfidenceMinimumMistakeImprovement)
		{
			return 0;
		}
		if (!HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(TemplateStats))
		{
			return 0;
		}

		return 1;
	}

	EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition
	ResolveTemplateLaunchPeerSupportKindDisposition(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats
	)
	{
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
				PeerLackedComparableEvidence;
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& TemplateSignalStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
		const int32 SplitConfidenceOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&SplitConfidenceStats);
		const int32 TemplateSignalOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&TemplateSignalStats);
		if (SplitConfidenceOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumSplitConfidenceOutcomeRuns
			|| TemplateSignalOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumTemplateSignalOutcomeRuns)
		{
			return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
				PeerLackedComparableEvidence;
		}

		const int32 SplitConfidenceScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&SplitConfidenceStats);
		const int32 TemplateSignalScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&TemplateSignalStats);
		if (SplitConfidenceScore - TemplateSignalScore <= 0)
		{
			return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
				PeerFailedGuardOnWeakerSupportKindOutcomes;
		}
		if (!HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(TemplateStats))
		{
			return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
				PeerLackedComparableEvidence;
		}

		if (BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(TemplateStats) <= 0)
		{
			return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
				PeerFailedGuardOnMarginalSupportKindOutcomes;
		}

		return EHyperTwistTrainingTemplateLaunchSelectionPeerSupportKindDisposition::
			PeerClearedComparableSupportKindGuard;
	}

	FString BuildTemplateLaunchAnalyticsSupportKindGuardAuditClause(
		const FHyperTwistTrainingTemplateLaunchScopedStats* TemplateStats,
		const TCHAR* SubjectLabel
	)
	{
		const TCHAR* ResolvedSubjectLabel =
			SubjectLabel != nullptr && SubjectLabel[0] != TEXT('\0')
				? SubjectLabel
				: TEXT("template");
		if (TemplateStats == nullptr || !TemplateStats->IsStructurallyValid())
		{
			return FString::Printf(
				TEXT("%s lacked comparable support-kind evidence for the selector-split confidence guard"),
				ResolvedSubjectLabel
			);
		}

		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& SplitConfidenceStats =
			TemplateStats->DashboardAnalyticsTieBreakSelectorSplitConfidenceStats;
		const FHyperTwistTrainingTemplateLaunchSelectionScopedStats& TemplateSignalStats =
			TemplateStats->DashboardAnalyticsTieBreakTemplateScopedSignalStats;
		const int32 SplitConfidenceOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&SplitConfidenceStats);
		const int32 TemplateSignalOutcomeRuns =
			CountTemplateLaunchSelectionOutcomeRuns(&TemplateSignalStats);
		const FString SignalFragment =
			BuildTemplateLaunchAnalyticsSupportKindGuardSignalFragment(TemplateStats);
		if (SplitConfidenceOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumSplitConfidenceOutcomeRuns
			|| TemplateSignalOutcomeRuns
				< TemplateLaunchSelectionTieBreakConfidenceMinimumTemplateSignalOutcomeRuns)
		{
			return SignalFragment.IsEmpty()
				? FString::Printf(
					TEXT("%s lacked comparable support-kind evidence for the selector-split confidence guard"),
					ResolvedSubjectLabel)
				: FString::Printf(
					TEXT("%s lacked comparable support-kind evidence for the selector-split confidence guard: %s"),
					ResolvedSubjectLabel,
					*SignalFragment);
		}

		const int32 SplitConfidenceScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&SplitConfidenceStats);
		const int32 TemplateSignalScore =
			BuildTemplateLaunchSelectionLaneAnalyticsScore(&TemplateSignalStats);
		const int32 ScoreDelta = SplitConfidenceScore - TemplateSignalScore;
		if (ScoreDelta <= 0)
		{
			return FString::Printf(
				TEXT("%s support-kind outcomes did not beat its template-signal bucket strongly enough to clear the selector-split confidence guard: %s"),
				ResolvedSubjectLabel,
				*SignalFragment
			);
		}

		const float SuccessDelta =
			SplitConfidenceStats.OverallSuccessRate - TemplateSignalStats.OverallSuccessRate;
		const float MistakeImprovement =
			TemplateSignalStats.AverageMistakesPerOutcomeRun
			- SplitConfidenceStats.AverageMistakesPerOutcomeRun;
		int32 ComparablePeerOutcomeRuns = 0;
		int32 SplitConfidenceSelectionOutcomeRuns = 0;
		int32 PeerNoEvidenceOutcomeRuns = 0;
		float ComparablePeerOutcomeShare = 0.0f;
		const bool bHasComparablePeerEvidence =
			HasTemplateLaunchComparablePeerEvidenceForConfidenceBonus(
				TemplateStats,
				&ComparablePeerOutcomeRuns,
				&SplitConfidenceSelectionOutcomeRuns,
				&ComparablePeerOutcomeShare,
				&PeerNoEvidenceOutcomeRuns
			);
		if (!bHasComparablePeerEvidence)
		{
			return FString::Printf(
				TEXT("%s lacked enough selector-split wins against peers with comparable support-kind evidence to clear the selector-split confidence guard: comparable-peer outcomes %d of %d split-confidence outcomes (share %.2f, required at least %d at %.2f) | peer-no-evidence %d | %s"),
				ResolvedSubjectLabel,
				ComparablePeerOutcomeRuns,
				SplitConfidenceSelectionOutcomeRuns,
				ComparablePeerOutcomeShare,
				TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeRuns,
				TemplateLaunchSelectionTieBreakConfidenceMinimumComparablePeerOutcomeShare,
				PeerNoEvidenceOutcomeRuns,
				*SignalFragment
			);
		}
		if (BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(TemplateStats) <= 0)
		{
			return FString::Printf(
				TEXT("%s support-kind outcomes only marginally beat its template-signal bucket and did not clear the selector-split confidence guard: %s | delta success %+.2f | delta mistakes %+.2f"),
				ResolvedSubjectLabel,
				*SignalFragment,
				SuccessDelta,
				-MistakeImprovement
			);
		}

		return FString::Printf(
			TEXT("%s split-confidence beat its template-signal bucket on stored support-kind outcomes and cleared the selector-split confidence guard with comparable-peer outcomes %d of %d split-confidence outcomes (share %.2f): %s"),
			ResolvedSubjectLabel,
			ComparablePeerOutcomeRuns,
			SplitConfidenceSelectionOutcomeRuns,
			ComparablePeerOutcomeShare,
			*SignalFragment
		);
	}

	struct FTemplateLaunchAnalyticsPreferenceDecision
	{
		bool bPreferCandidate = false;
		EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind CandidateAnalyticsSupportKind =
			EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::None;
		bool bCandidateUsedTemplateSignalSupportBiasSnapshotGuard = false;
		bool bCandidateUsedTemplateSignalSupportDecisionBiasGuard = false;
		bool bCandidateUsedTemplateSignalSupportDecisionBiasSnapshotGuard = false;
	};

	FTemplateLaunchAnalyticsPreferenceDecision ResolveTemplateAnalyticsPreferenceDecision(
		const FHyperTwistTrainingTemplateLaunchScopedStats* CandidateStats,
		const FHyperTwistTrainingTemplateLaunchScopedStats* IncumbentStats
	)
	{
		FTemplateLaunchAnalyticsPreferenceDecision Decision;
		const int32 CandidateOutcomeRuns = CountTemplateLaunchOutcomeRuns(CandidateStats);
		const int32 IncumbentOutcomeRuns = CountTemplateLaunchOutcomeRuns(IncumbentStats);
		if (CandidateOutcomeRuns < TemplateLaunchAnalyticsTieBreakMinimumOutcomeRuns
			&& IncumbentOutcomeRuns < TemplateLaunchAnalyticsTieBreakMinimumOutcomeRuns)
		{
			return Decision;
		}

		const int32 CandidateBaseScore = BuildTemplateLaunchAnalyticsTieBreakScore(CandidateStats);
		const int32 IncumbentBaseScore = BuildTemplateLaunchAnalyticsTieBreakScore(IncumbentStats);
		const int32 CandidateConfidenceBonus =
			BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(CandidateStats);
		const int32 IncumbentConfidenceBonus =
			BuildTemplateLaunchAnalyticsTieBreakConfidenceBonus(IncumbentStats);
		const int32 CandidateScore = CandidateBaseScore + CandidateConfidenceBonus;
		const int32 IncumbentScore = IncumbentBaseScore + IncumbentConfidenceBonus;
		if (CandidateScore != IncumbentScore)
		{
			Decision.bPreferCandidate = CandidateScore > IncumbentScore;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					CandidateConfidenceBonus > IncumbentConfidenceBonus
						&& CandidateBaseScore <= IncumbentBaseScore
						? EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::SelectorSplitConfidence
						: EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::TemplateScopedOutcomeSignal;
			}
			return Decision;
		}
		const int32 CandidateTemplateSignalSupportBiasSnapshotGuardBonus =
			HasTemplateLaunchTemplateSignalSupportBias(CandidateStats)
				&& HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(CandidateStats)
			? 1
			: 0;
		const int32 IncumbentTemplateSignalSupportBiasSnapshotGuardBonus =
			HasTemplateLaunchTemplateSignalSupportBias(IncumbentStats)
				&& HasTemplateLaunchTemplateSignalSupportBiasSnapshotBias(IncumbentStats)
			? 1
			: 0;
		if (CandidateTemplateSignalSupportBiasSnapshotGuardBonus
			!= IncumbentTemplateSignalSupportBiasSnapshotGuardBonus)
		{
			Decision.bPreferCandidate =
				CandidateTemplateSignalSupportBiasSnapshotGuardBonus
				> IncumbentTemplateSignalSupportBiasSnapshotGuardBonus;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
						TemplateScopedOutcomeSignal;
				Decision.bCandidateUsedTemplateSignalSupportBiasSnapshotGuard = true;
			}
			return Decision;
		}
		const int32 CandidateTemplateSignalSupportDecisionGuardBonus =
			CandidateTemplateSignalSupportBiasSnapshotGuardBonus > 0
				&& HasTemplateLaunchTemplateSignalSupportDecisionBias(CandidateStats)
			? 1
			: 0;
		const int32 IncumbentTemplateSignalSupportDecisionGuardBonus =
			IncumbentTemplateSignalSupportBiasSnapshotGuardBonus > 0
				&& HasTemplateLaunchTemplateSignalSupportDecisionBias(IncumbentStats)
			? 1
			: 0;
		if (CandidateTemplateSignalSupportDecisionGuardBonus
			!= IncumbentTemplateSignalSupportDecisionGuardBonus)
		{
			Decision.bPreferCandidate =
				CandidateTemplateSignalSupportDecisionGuardBonus
				> IncumbentTemplateSignalSupportDecisionGuardBonus;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
						TemplateScopedOutcomeSignal;
				Decision.bCandidateUsedTemplateSignalSupportBiasSnapshotGuard = true;
				Decision.bCandidateUsedTemplateSignalSupportDecisionBiasGuard = true;
			}
			return Decision;
		}
		const int32 CandidateTemplateSignalSupportDecisionBiasSnapshotGuardBonus =
			CandidateTemplateSignalSupportDecisionGuardBonus > 0
				&& HasTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotBias(
					CandidateStats)
			? 1
			: 0;
		const int32 IncumbentTemplateSignalSupportDecisionBiasSnapshotGuardBonus =
			IncumbentTemplateSignalSupportDecisionGuardBonus > 0
				&& HasTemplateLaunchTemplateSignalSupportDecisionBiasSnapshotBias(
					IncumbentStats)
			? 1
			: 0;
		if (CandidateTemplateSignalSupportDecisionBiasSnapshotGuardBonus
			!= IncumbentTemplateSignalSupportDecisionBiasSnapshotGuardBonus)
		{
			Decision.bPreferCandidate =
				CandidateTemplateSignalSupportDecisionBiasSnapshotGuardBonus
				> IncumbentTemplateSignalSupportDecisionBiasSnapshotGuardBonus;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::
						TemplateScopedOutcomeSignal;
				Decision.bCandidateUsedTemplateSignalSupportBiasSnapshotGuard = true;
				Decision.bCandidateUsedTemplateSignalSupportDecisionBiasGuard = true;
				Decision.bCandidateUsedTemplateSignalSupportDecisionBiasSnapshotGuard = true;
			}
			return Decision;
		}
		if (CandidateOutcomeRuns != IncumbentOutcomeRuns)
		{
			Decision.bPreferCandidate = CandidateOutcomeRuns > IncumbentOutcomeRuns;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::TemplateScopedOutcomeSignal;
			}
			return Decision;
		}

		const float CandidateSuccessRate =
			CandidateStats != nullptr && CandidateStats->IsStructurallyValid()
				? CandidateStats->OverallSuccessRate
				: 0.0f;
		const float IncumbentSuccessRate =
			IncumbentStats != nullptr && IncumbentStats->IsStructurallyValid()
				? IncumbentStats->OverallSuccessRate
				: 0.0f;
		if (FMath::Abs(CandidateSuccessRate - IncumbentSuccessRate) >= 0.05f)
		{
			Decision.bPreferCandidate = CandidateSuccessRate > IncumbentSuccessRate;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::TemplateScopedOutcomeSignal;
			}
			return Decision;
		}

		const float CandidateMistakeRate =
			CandidateStats != nullptr && CandidateStats->IsStructurallyValid()
				? CandidateStats->AverageMistakesPerOutcomeRun
				: 0.0f;
		const float IncumbentMistakeRate =
			IncumbentStats != nullptr && IncumbentStats->IsStructurallyValid()
				? IncumbentStats->AverageMistakesPerOutcomeRun
				: 0.0f;
		if (FMath::Abs(CandidateMistakeRate - IncumbentMistakeRate) >= 0.5f)
		{
			Decision.bPreferCandidate = CandidateMistakeRate < IncumbentMistakeRate;
			if (Decision.bPreferCandidate)
			{
				Decision.CandidateAnalyticsSupportKind =
					EHyperTwistTrainingTemplateLaunchSelectionAnalyticsSupportKind::TemplateScopedOutcomeSignal;
			}
			return Decision;
		}

		return Decision;
	}

	EMethodDrillRecoveryMemoryBias ResolveMethodDrillRecoveryMemoryBias(
		const int32 HistoryCount,
		const int32 StrongCount,
		const int32 WeakCount,
		const float AverageOutcomeScore
	)
	{
		if (HistoryCount >= 2 && StrongCount >= WeakCount && AverageOutcomeScore >= 55.0f)
		{
			return EMethodDrillRecoveryMemoryBias::Strong;
		}
		if (HistoryCount >= 2 && WeakCount > StrongCount && AverageOutcomeScore <= 45.0f)
		{
			return EMethodDrillRecoveryMemoryBias::Weak;
		}
		return EMethodDrillRecoveryMemoryBias::None;
	}

	FString DescribeMethodDrillRecoveryMemoryBias(const EMethodDrillRecoveryMemoryBias Bias)
	{
		switch (Bias)
		{
		case EMethodDrillRecoveryMemoryBias::Strong:
			return TEXT("strong retained drill-recovery continuation");
		case EMethodDrillRecoveryMemoryBias::Weak:
			return TEXT("weak retained drill-recovery redirect");
		default:
			return TEXT("balanced drill-recovery posture");
		}
	}

	FString ExtractDetailFieldValue(
		const FString& DetailLine,
		const FString& FieldName)
	{
		if (DetailLine.IsEmpty() || FieldName.IsEmpty())
		{
			return FString();
		}

		const FString Prefix = FieldName + TEXT("=");
		const int32 PrefixIndex = DetailLine.Find(Prefix, ESearchCase::CaseSensitive);
		if (PrefixIndex == INDEX_NONE)
		{
			return FString();
		}

		const int32 ValueStart = PrefixIndex + Prefix.Len();
		int32 ValueEnd = DetailLine.Find(TEXT(","), ESearchCase::CaseSensitive, ESearchDir::FromStart, ValueStart);
		if (ValueEnd == INDEX_NONE)
		{
			ValueEnd = DetailLine.Len();
		}

		return DetailLine.Mid(ValueStart, ValueEnd - ValueStart).TrimStartAndEnd();
	}

	FString DescribeRetainedMethodDrillRecoveryPosture(
		const bool bUsedStrongRetainedMethodDrillRecoveryPosture,
		const bool bUsedWeakRetainedMethodDrillRecoveryPosture)
	{
		if (bUsedStrongRetainedMethodDrillRecoveryPosture)
		{
			return TEXT("strong retained drill-recovery continuation");
		}
		if (bUsedWeakRetainedMethodDrillRecoveryPosture)
		{
			return TEXT("weak retained drill-recovery redirect");
		}

		return TEXT("balanced drill-recovery posture");
	}

	bool IsDashboardHandoffGuidanceSource(const FString& SourceLabel)
	{
		return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-"));
	}

	bool IsQueueRecoveryMemorySource(const FString& SourceLabel)
	{
		return SourceLabel.StartsWith(TEXT("coach-memory-queue-"))
			|| IsDashboardHandoffGuidanceSource(SourceLabel)
			|| SourceLabel.StartsWith(TEXT("coach-memory-method-drill-recovery-"));
	}

	bool IsAlignedTightFollowUpOutcomeSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel == TEXT("recommendation-history-aligned-tight-follow-up-outcome");
	}

	bool IsAlignedBroadRecommendedOutcomeSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel == TEXT("recommendation-history-aligned-broad-recommended-outcome");
	}

	bool IsAlignedTightFollowUpPacketSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel
				== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
			|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
			|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-"))
			|| SourceLabel.StartsWith(
				TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
			|| SourceLabel.StartsWith(
				TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-"));
	}

	bool IsAlignedBroadRecommendedPacketSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel
				== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome")
			|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
			|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-"))
			|| SourceLabel.StartsWith(
				TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
			|| SourceLabel.StartsWith(
				TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-"));
	}

	bool IsAlignedTightFollowUpGuidanceSourceLabel(const FString& SourceLabel)
	{
		return IsAlignedTightFollowUpOutcomeSourceLabel(SourceLabel)
			|| IsAlignedTightFollowUpPacketSourceLabel(SourceLabel);
	}

	bool IsAlignedBroadRecommendedGuidanceSourceLabel(const FString& SourceLabel)
	{
		return IsAlignedBroadRecommendedOutcomeSourceLabel(SourceLabel)
			|| IsAlignedBroadRecommendedPacketSourceLabel(SourceLabel);
	}

	FString DescribeCoachMemorySourceLabel(const FString& SourceLabel)
	{
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-overflow-follow-up"))
		{
			return TEXT("accepted deferred-overflow follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-overflow-recommended"))
		{
			return TEXT("accepted deferred-overflow recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-overflow-queued"))
		{
			return TEXT("accepted deferred-overflow queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-first-queued"))
		{
			return TEXT("accepted deferred-first queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-first-follow-up"))
		{
			return TEXT("accepted deferred-first follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-deferred-first-recommended"))
		{
			return TEXT("accepted deferred-first recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-queued"))
		{
			return TEXT("accepted drill-driven queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up"))
		{
			return TEXT("accepted drill-driven follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recommended"))
		{
			return TEXT("accepted drill-driven recommended handoff history");
		}
		if (IsAlignedTightFollowUpGuidanceSourceLabel(SourceLabel))
		{
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-reliable-outcome-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-")))
			{
				return TEXT("reliable accepted aligned tight follow-up-packet launched-plan outcome");
			}
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-reliable-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-")))
			{
				return TEXT("reliable accepted aligned tight follow-up-packet trust");
			}
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-")))
			{
				return TEXT("accepted aligned tight follow-up-packet outcome trust");
			}
			if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-")))
			{
				return TEXT("accepted aligned tight follow-up-packet handoff history");
			}
			if (SourceLabel
				== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome"))
			{
				return TEXT("accepted aligned tight follow-up-packet outcome history");
			}
			return SourceLabel
					== TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
				? TEXT("aligned tight retained follow-up-packet structure history")
				: TEXT("aligned tight launched-plan follow-up outcome history");
		}
		if (IsAlignedBroadRecommendedGuidanceSourceLabel(SourceLabel))
		{
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-reliable-outcome-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-")))
			{
				return TEXT("reliable accepted aligned broad recommended-packet launched-plan outcome");
			}
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-reliable-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-")))
			{
				return TEXT("reliable accepted aligned broad recommended-packet trust");
			}
			if (SourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
				|| SourceLabel.StartsWith(
					TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-")))
			{
				return TEXT("accepted aligned broad recommended-packet outcome trust");
			}
			if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-")))
			{
				return TEXT("accepted aligned broad recommended-packet handoff history");
			}
			if (SourceLabel
				== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome"))
			{
				return TEXT("accepted aligned broad recommended-packet outcome history");
			}
			return SourceLabel
					== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
				? TEXT("aligned broad retained recommended-packet structure history")
				: TEXT("aligned broad launched-plan recommended outcome history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-strong-queued"))
		{
			return TEXT("accepted strong drill-recovery-memory queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-strong-queued"))
		{
			return TEXT("accepted strong drill-recovery-packet queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-strong-queued"))
		{
			return TEXT("accepted strong retained drill-recovery-posture queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-strong-follow-up"))
		{
			return TEXT("accepted strong drill-recovery-memory follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-strong-follow-up"))
		{
			return TEXT("accepted strong drill-recovery-packet follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-strong-follow-up"))
		{
			return TEXT("accepted strong retained drill-recovery-posture follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-strong-recommended"))
		{
			return TEXT("accepted strong drill-recovery-memory recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-strong-recommended"))
		{
			return TEXT("accepted strong drill-recovery-packet recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-strong-recommended"))
		{
			return TEXT("accepted strong retained drill-recovery-posture recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-weak-queued"))
		{
			return TEXT("accepted weak drill-recovery-memory queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-weak-queued"))
		{
			return TEXT("accepted weak drill-recovery-packet queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-weak-queued"))
		{
			return TEXT("accepted weak retained drill-recovery-posture queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-weak-follow-up"))
		{
			return TEXT("accepted weak drill-recovery-memory follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-weak-follow-up"))
		{
			return TEXT("accepted weak drill-recovery-packet follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-weak-follow-up"))
		{
			return TEXT("accepted weak retained drill-recovery-posture follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-weak-recommended"))
		{
			return TEXT("accepted weak drill-recovery-memory recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-packet-weak-recommended"))
		{
			return TEXT("accepted weak drill-recovery-packet recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-recovery-posture-weak-recommended"))
		{
			return TEXT("accepted weak retained drill-recovery-posture recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-queued"))
		{
			return TEXT("accepted strong drill-follow-up-packet queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-follow-up"))
		{
			return TEXT("accepted strong drill-follow-up-packet follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-recommended"))
		{
			return TEXT("accepted strong drill-follow-up-packet recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-weak-queued"))
		{
			return TEXT("accepted weak drill-follow-up-packet queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-weak-follow-up"))
		{
			return TEXT("accepted weak drill-follow-up-packet follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-method-drill-follow-up-packet-weak-recommended"))
		{
			return TEXT("accepted weak drill-follow-up-packet recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow"))
		{
			return TEXT("successful narrow drill-follow-up-packet structure history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad"))
		{
			return TEXT("successful broad drill-follow-up-packet redirect history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-queued"))
		{
			return TEXT("accepted queued handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-follow-up"))
		{
			return TEXT("accepted follow-up handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-dashboard-recommended"))
		{
			return TEXT("accepted recommended handoff history");
		}
		if (SourceLabel == TEXT("coach-memory-queue-follow-up"))
		{
			return TEXT("queue follow-up recovery memory");
		}
		if (SourceLabel == TEXT("coach-memory-queue-recommended"))
		{
			return TEXT("queue recommended recovery memory");
		}
		if (SourceLabel == TEXT("dashboard-handoff-queued"))
		{
			return TEXT("accepted queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-deferred-first-queued"))
		{
			return TEXT("accepted deferred-first queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-follow-up"))
		{
			return TEXT("accepted follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-deferred-first-follow-up"))
		{
			return TEXT("accepted deferred-first follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-recommended"))
		{
			return TEXT("accepted recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-deferred-first-recommended"))
		{
			return TEXT("accepted deferred-first recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-queued"))
		{
			return TEXT("accepted drill-driven queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up"))
		{
			return TEXT("accepted drill-driven follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recommended"))
		{
			return TEXT("accepted drill-driven recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-queued"))
		{
			return TEXT("accepted strong drill-recovery-memory queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-queued"))
		{
			return TEXT("accepted narrow drill-recovery-structure queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-queued"))
		{
			return TEXT("accepted tight drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-queued"))
		{
			return TEXT("accepted reliable trusted tight drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-queued"))
		{
			return TEXT("accepted trusted tight drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-strong-queued"))
		{
			return TEXT("accepted strong drill-recovery-packet queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-strong-queued"))
		{
			return TEXT("accepted strong retained drill-recovery-posture queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-follow-up"))
		{
			return TEXT("accepted strong drill-recovery-memory follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-follow-up"))
		{
			return TEXT("accepted narrow drill-recovery-structure follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-follow-up"))
		{
			return TEXT("accepted tight drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-follow-up"))
		{
			return TEXT("accepted reliable trusted tight drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-follow-up"))
		{
			return TEXT("accepted trusted tight drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-strong-follow-up"))
		{
			return TEXT("accepted strong drill-recovery-packet follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-strong-follow-up"))
		{
			return TEXT("accepted strong retained drill-recovery-posture follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-recommended"))
		{
			return TEXT("accepted strong drill-recovery-memory recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-recommended"))
		{
			return TEXT("accepted narrow drill-recovery-structure recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-recommended"))
		{
			return TEXT("accepted tight drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-recommended"))
		{
			return TEXT("accepted reliable trusted tight drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-recommended"))
		{
			return TEXT("accepted trusted tight drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-strong-recommended"))
		{
			return TEXT("accepted strong drill-recovery-packet recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-strong-recommended"))
		{
			return TEXT("accepted strong retained drill-recovery-posture recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-queued"))
		{
			return TEXT("accepted weak drill-recovery-memory queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-broad-queued"))
		{
			return TEXT("accepted broad drill-recovery-structure queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-queued"))
		{
			return TEXT("accepted broad drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-queued"))
		{
			return TEXT("accepted reliable trusted broad drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-queued"))
		{
			return TEXT("accepted trusted broad drill-recovery-plan queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-weak-queued"))
		{
			return TEXT("accepted weak drill-recovery-packet queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-weak-queued"))
		{
			return TEXT("accepted weak retained drill-recovery-posture queued dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-follow-up"))
		{
			return TEXT("accepted weak drill-recovery-memory follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-broad-follow-up"))
		{
			return TEXT("accepted broad drill-recovery-structure follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-follow-up"))
		{
			return TEXT("accepted broad drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-follow-up"))
		{
			return TEXT("accepted reliable trusted broad drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-follow-up"))
		{
			return TEXT("accepted trusted broad drill-recovery-plan follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-weak-follow-up"))
		{
			return TEXT("accepted weak drill-recovery-packet follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-weak-follow-up"))
		{
			return TEXT("accepted weak retained drill-recovery-posture follow-up dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-recommended"))
		{
			return TEXT("accepted weak drill-recovery-memory recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-broad-recommended"))
		{
			return TEXT("accepted broad drill-recovery-structure recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-recommended"))
		{
			return TEXT("accepted broad drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-recommended"))
		{
			return TEXT("accepted reliable trusted broad drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-recommended"))
		{
			return TEXT("accepted trusted broad drill-recovery-plan recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-packet-weak-recommended"))
		{
			return TEXT("accepted weak drill-recovery-packet recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-posture-weak-recommended"))
		{
			return TEXT("accepted weak retained drill-recovery-posture recommended dashboard handoff");
		}
		if (SourceLabel == TEXT("dashboard-guidance-outcome-deferred-overflow-queued"))
		{
			return TEXT("accepted deferred-overflow queued outcome handoff");
		}
		if (SourceLabel == TEXT("dashboard-guidance-outcome-deferred-overflow-follow-up"))
		{
			return TEXT("accepted deferred-overflow follow-up outcome handoff");
		}
		if (SourceLabel == TEXT("dashboard-guidance-outcome-deferred-overflow-recommended"))
		{
			return TEXT("accepted deferred-overflow recommended outcome handoff");
		}
		if (SourceLabel == TEXT("queue-history-promote-pressure"))
		{
			return TEXT("queue promote-pressure history");
		}
		if (SourceLabel == TEXT("queue-history-launch-pressure"))
		{
			return TEXT("queue launch-pressure history");
		}
		if (SourceLabel == TEXT("queue-history-balanced-pressure"))
		{
			return TEXT("balanced queue-recovery history");
		}
		if (SourceLabel == TEXT("recommendation-history-broadened-launch"))
		{
			return TEXT("successful broadened-launch history");
		}
		if (SourceLabel == TEXT("recommendation-history-tightened-launch"))
		{
			return TEXT("successful tightened-launch history");
		}
		if (SourceLabel == TEXT("recommendation-history-deferred-tightened-launch"))
		{
			return TEXT("successful deferred tightened-launch history");
		}
		if (SourceLabel == TEXT("recommendation-history-deferred-first-follow-up"))
		{
			return TEXT("successful deferred-first follow-up packet history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-follow-up-strong"))
		{
			return TEXT("successful method-drill follow-up history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-follow-up-weak"))
		{
			return TEXT("weak method-drill follow-up history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-strong"))
		{
			return TEXT("successful drill-driven recovery history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-weak"))
		{
			return TEXT("weak drill-driven recovery history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong"))
		{
			return TEXT("successful retained drill-recovery-memory history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-narrow"))
		{
			return TEXT("successful narrow drill-recovery-structure history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-tight"))
		{
			return TEXT("successful tight drill-recovery-plan history");
		}
		if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-structure-plan-tight-trusted-")))
		{
			return TEXT("accepted trusted tight drill-recovery-plan dashboard handoff");
		}
		if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-structure-plan-tight-")))
		{
			return TEXT("accepted tight drill-recovery-plan dashboard handoff");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted"))
		{
			return TEXT("trusted tight drill-recovery-plan history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable"))
		{
			return TEXT("reliable trusted tight drill-recovery-plan history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned"))
		{
			return TEXT("aligned reliable trusted tight drill-recovery-plan history");
		}
		if (SourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome"))
		{
			return TEXT("successful aligned reliable trusted tight drill-recovery-plan handoff outcome history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-strong"))
		{
			return TEXT("successful retained drill-recovery-packet history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-strong"))
		{
			return TEXT("successful retained drill-recovery-posture history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak"))
		{
			return TEXT("weak retained drill-recovery-memory history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-broad"))
		{
			return TEXT("successful broad drill-recovery-structure redirect history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-broad"))
		{
			return TEXT("successful broad drill-recovery-plan redirect history");
		}
		if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-structure-plan-broad-trusted-")))
		{
			return TEXT("accepted trusted broad drill-recovery-plan dashboard handoff");
		}
		if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-structure-plan-broad-")))
		{
			return TEXT("accepted broad drill-recovery-plan dashboard handoff");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted"))
		{
			return TEXT("trusted broad drill-recovery-plan redirect history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable"))
		{
			return TEXT("reliable trusted broad drill-recovery-plan redirect history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned"))
		{
			return TEXT("aligned reliable trusted broad drill-recovery-plan redirect history");
		}
		if (SourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome"))
		{
			return TEXT("successful aligned reliable trusted broad drill-recovery-plan redirect outcome history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-weak"))
		{
			return TEXT("weak retained drill-recovery-packet history");
		}
		if (SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-weak"))
		{
			return TEXT("weak retained drill-recovery-posture history");
		}

		return SourceLabel.IsEmpty() ? TEXT("n/a") : SourceLabel;
	}

	FString DescribeLaunchBudgetBias(const int32 Bias)
	{
		if (Bias > 0)
		{
			return TEXT("broaden");
		}
		if (Bias < 0)
		{
			return TEXT("tighten");
		}

		return TEXT("steady");
	}

	bool IsTightMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-tight"));
	}

	bool IsTrustedTightMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-tight-trusted"));
	}

	bool IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-tight-trusted-reliable"));
	}

	bool IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-tight-trusted-reliable-aligned"));
	}

	bool IsBroadMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-broad"));
	}

	bool IsTrustedBroadMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-broad-trusted"));
	}

	bool IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-broad-trusted-reliable"));
	}

	bool IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("structure-plan-broad-trusted-reliable-aligned"));
	}

	FString DescribeMethodDrillRecoveryPlanSourceLabel(const FString& SourceLabel)
	{
		if (IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("aligned reliable trusted tight retained drill-recovery plan");
		}
		if (IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("aligned reliable trusted broad retained drill-recovery plan");
		}
		if (IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("reliable trusted tight retained drill-recovery plan");
		}
		if (IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("reliable trusted broad retained drill-recovery plan");
		}
		if (IsTrustedTightMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("trusted tight retained drill-recovery plan");
		}
		if (IsTrustedBroadMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("trusted broad retained drill-recovery plan");
		}
		if (IsTightMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("tight retained drill-recovery plan");
		}
		if (IsBroadMethodDrillRecoveryPlanSourceLabel(SourceLabel))
		{
			return TEXT("broad retained drill-recovery plan");
		}

		return TEXT("none");
	}

	FString DashboardHandoffSourceLabel(
		const EHyperTwistTrainingCoachHandoffKind HandoffKind,
		const bool bDeferredFirstSuppressionDriven,
		const bool bMethodDrillDriven = false,
		const EMethodDrillRecoveryMemoryBias MethodDrillRecoveryMemoryBias =
			EMethodDrillRecoveryMemoryBias::None,
		const bool bRetainedMethodDrillRecoveryPostureDriven = false,
		const bool bMethodDrillRecoveryPacketDriven = false,
		const bool bNarrowMethodDrillRecoveryStructureDriven = false,
		const bool bBroadMethodDrillRecoveryStructureDriven = false,
		const bool bTightMethodDrillRecoveryStructurePlanDriven = false,
		const bool bBroadMethodDrillRecoveryStructurePlanDriven = false,
		const bool bTrustedMethodDrillRecoveryStructurePlanDriven = false,
		const bool bReliableTrustedMethodDrillRecoveryStructurePlanDriven = false,
		const bool bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven = false,
		const bool bAlignedTightFollowUpPacketAcceptedDriven = false,
		const bool bAlignedBroadRecommendedPacketAcceptedDriven = false,
		const bool bAcceptedAlignedTightFollowUpPacketOutcomeDriven = false,
		const bool bAcceptedAlignedBroadRecommendedPacketOutcomeDriven = false,
		const bool bReliableAcceptedAlignedTightFollowUpPacketOutcomeDriven = false,
		const bool bReliableAcceptedAlignedBroadRecommendedPacketOutcomeDriven = false,
		const bool bReliableAcceptedAlignedTightFollowUpPacketOutcomeHistoryDriven = false,
		const bool bReliableAcceptedAlignedBroadRecommendedPacketOutcomeHistoryDriven = false)
	{
		if (bReliableAcceptedAlignedTightFollowUpPacketOutcomeHistoryDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-recommended");
			default:
				return FString();
			}
		}
		if (bReliableAcceptedAlignedBroadRecommendedPacketOutcomeHistoryDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-recommended");
			default:
				return FString();
			}
		}
		if (bReliableAcceptedAlignedTightFollowUpPacketOutcomeDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-recommended");
			default:
				return FString();
			}
		}
		if (bReliableAcceptedAlignedBroadRecommendedPacketOutcomeDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-recommended");
			default:
				return FString();
			}
		}
		if (bAcceptedAlignedTightFollowUpPacketOutcomeDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-recommended");
			default:
				return FString();
			}
		}
		if (bAcceptedAlignedBroadRecommendedPacketOutcomeDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-recommended");
			default:
				return FString();
			}
		}
		if (bAlignedTightFollowUpPacketAcceptedDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-tight-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-tight-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-tight-recommended");
			default:
				return FString();
			}
		}
		if (bAlignedBroadRecommendedPacketAcceptedDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-broad-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-broad-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-aligned-follow-up-packet-broad-recommended");
			default:
				return FString();
			}
		}
		if (MethodDrillRecoveryMemoryBias == EMethodDrillRecoveryMemoryBias::Strong)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				if (bTightMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-queued")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-queued"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-queued"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-queued");
				}
				if (bNarrowMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-queued");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-strong-queued");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-strong-queued")
					: TEXT("dashboard-handoff-method-drill-recovery-strong-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				if (bTightMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-follow-up")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-follow-up"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-follow-up"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-follow-up");
				}
				if (bNarrowMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-follow-up");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-strong-follow-up");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-strong-follow-up")
					: TEXT("dashboard-handoff-method-drill-recovery-strong-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				if (bTightMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-recommended")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-reliable-recommended"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-trusted-recommended"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-tight-recommended");
				}
				if (bNarrowMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-narrow-recommended");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-strong-recommended");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-strong-recommended")
					: TEXT("dashboard-handoff-method-drill-recovery-strong-recommended");
			default:
				return FString();
			}
		}
		if (MethodDrillRecoveryMemoryBias == EMethodDrillRecoveryMemoryBias::Weak)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				if (bBroadMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-queued")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-queued"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-queued"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-queued");
				}
				if (bBroadMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-broad-queued");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-weak-queued");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-weak-queued")
					: TEXT("dashboard-handoff-method-drill-recovery-weak-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				if (bBroadMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-follow-up")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-follow-up"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-follow-up"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-follow-up");
				}
				if (bBroadMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-broad-follow-up");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-weak-follow-up");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-weak-follow-up")
					: TEXT("dashboard-handoff-method-drill-recovery-weak-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				if (bBroadMethodDrillRecoveryStructurePlanDriven)
				{
					return bTrustedMethodDrillRecoveryStructurePlanDriven
						? (bReliableTrustedMethodDrillRecoveryStructurePlanDriven
							? (bReliableTrustedMethodDrillRecoveryStructurePlanAlignmentDriven
								? TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-recommended")
								: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-reliable-recommended"))
							: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-trusted-recommended"))
						: TEXT("dashboard-handoff-method-drill-recovery-structure-plan-broad-recommended");
				}
				if (bBroadMethodDrillRecoveryStructureDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-structure-broad-recommended");
				}
				if (bMethodDrillRecoveryPacketDriven)
				{
					return TEXT("dashboard-handoff-method-drill-recovery-packet-weak-recommended");
				}
				return bRetainedMethodDrillRecoveryPostureDriven
					? TEXT("dashboard-handoff-method-drill-recovery-posture-weak-recommended")
					: TEXT("dashboard-handoff-method-drill-recovery-weak-recommended");
			default:
				return FString();
			}
		}
		if (bMethodDrillDriven)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-method-drill-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-method-drill-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-method-drill-recommended");
			default:
				return FString();
			}
		}

		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return bDeferredFirstSuppressionDriven
				? TEXT("dashboard-handoff-deferred-first-queued")
				: TEXT("dashboard-handoff-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return bDeferredFirstSuppressionDriven
				? TEXT("dashboard-handoff-deferred-first-follow-up")
				: TEXT("dashboard-handoff-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return bDeferredFirstSuppressionDriven
				? TEXT("dashboard-handoff-deferred-first-recommended")
				: TEXT("dashboard-handoff-recommended");
		default:
			return FString();
		}
	}

	FString DashboardMethodDrillFollowUpPacketSourceLabel(
		const EHyperTwistTrainingCoachHandoffKind HandoffKind,
		const EMethodDrillRecoveryMemoryBias PacketBias)
	{
		if (PacketBias == EMethodDrillRecoveryMemoryBias::Strong)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-recommended");
			default:
				return FString();
			}
		}
		if (PacketBias == EMethodDrillRecoveryMemoryBias::Weak)
		{
			switch (HandoffKind)
			{
			case EHyperTwistTrainingCoachHandoffKind::Queue:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-queued");
			case EHyperTwistTrainingCoachHandoffKind::FollowUp:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-follow-up");
			case EHyperTwistTrainingCoachHandoffKind::Recommended:
				return TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-recommended");
			default:
				return FString();
			}
		}

		return FString();
	}

	const FHyperTwistCoachSignal* FindCoachSignalById(
		const TArray<FHyperTwistCoachSignal>& Signals,
		const TCHAR* SignalId)
	{
		return Signals.FindByPredicate(
			[SignalId](const FHyperTwistCoachSignal& Signal)
			{
				return Signal.SignalId == SignalId;
			}
		);
	}

	UTextBlock* AddTextRow(
		UWidgetTree* WidgetTree,
		UVerticalBox* Parent,
		const FName WidgetName,
		const int32 PaddingBottom)
	{
		UTextBlock* TextBlock = WidgetTree->ConstructWidget<UTextBlock>(UTextBlock::StaticClass(), WidgetName);
		if (TextBlock == nullptr)
		{
			return nullptr;
		}

		if (UVerticalBoxSlot* Slot = Parent->AddChildToVerticalBox(TextBlock))
		{
			Slot->SetPadding(FMargin(0.0f, 0.0f, 0.0f, static_cast<float>(PaddingBottom)));
		}
		TextBlock->SetAutoWrapText(true);
		return TextBlock;
	}

	UButton* AddButton(
		UWidgetTree* WidgetTree,
		UHorizontalBox* Parent,
		const FName ButtonName,
		const FName LabelName,
		const FString& LabelText,
		UTextBlock*& OutLabel)
	{
		UButton* Button = WidgetTree->ConstructWidget<UButton>(UButton::StaticClass(), ButtonName);
		if (Button == nullptr)
		{
			return nullptr;
		}

		OutLabel = WidgetTree->ConstructWidget<UTextBlock>(UTextBlock::StaticClass(), LabelName);
		if (OutLabel != nullptr)
		{
			OutLabel->SetText(FText::FromString(LabelText));
			if (UButtonSlot* ButtonSlot = Cast<UButtonSlot>(Button->AddChild(OutLabel)))
			{
				ButtonSlot->SetPadding(FMargin(8.0f, 4.0f));
				ButtonSlot->SetHorizontalAlignment(HAlign_Center);
				ButtonSlot->SetVerticalAlignment(VAlign_Center);
			}
		}

		if (UHorizontalBoxSlot* Slot = Parent->AddChildToHorizontalBox(Button))
		{
			Slot->SetPadding(FMargin(0.0f, 0.0f, 8.0f, 0.0f));
		}

		return Button;
	}

	UEditableTextBox* AddEditableTextBox(
		UWidgetTree* WidgetTree,
		UHorizontalBox* Parent,
		const FName WidgetName)
	{
		UEditableTextBox* TextBox = WidgetTree->ConstructWidget<UEditableTextBox>(
			UEditableTextBox::StaticClass(),
			WidgetName
		);
		if (TextBox == nullptr)
		{
			return nullptr;
		}

		if (UHorizontalBoxSlot* Slot = Parent->AddChildToHorizontalBox(TextBox))
		{
			Slot->SetPadding(FMargin(0.0f, 0.0f, 8.0f, 0.0f));
			Slot->SetSize(FSlateChildSize(ESlateSizeRule::Fill));
		}
		return TextBox;
	}

	float ScoreDeferredEntryForPromotion(
		const FHyperTwistTrainingCoachSessionQueueStateEntry& Entry,
		const FHyperTwistTrainingCoachPanelState& CoachPanelState)
	{
		float Score = FMath::Clamp(Entry.PriorityScore * 0.02f, 0.0f, 2.0f);
		if (!CoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			&& Entry.SourceLabel == CoachPanelState.PreferredGuidanceSourceLabel)
		{
			Score += 2.0f;
		}

		switch (CoachPanelState.PreferredGuidanceLane)
		{
		case EHyperTwistTrainingCoachGuidanceLane::FollowUp:
			if (Entry.bRequiresFollowUp || Entry.SourceLabel == TEXT("follow-up-brief"))
			{
				Score += 8.0f;
			}
			if (Entry.bRequiresArchiveRetentionTuning || Entry.SourceLabel == TEXT("archive-policy"))
			{
				Score -= 4.0f;
			}
			break;
		case EHyperTwistTrainingCoachGuidanceLane::Recommended:
			if (Entry.SourceLabel == TEXT("primary-brief"))
			{
				Score += 7.0f;
			}
			if (Entry.bRequiresArchiveRetentionTuning || Entry.SourceLabel == TEXT("archive-policy"))
			{
				Score -= 1.5f;
			}
			break;
		default:
			break;
		}

		if (Entry.bPinned)
		{
			Score += 0.5f;
		}

		return Score;
	}

	FClosureRecoveryDashboardBias DeriveClosureRecoveryDashboardBias(
		const TArray<FHyperTwistCoachDashboardClosureRecoveryEntry>& Entries,
		const int32 MaxEntriesToInspect = 6)
	{
		FClosureRecoveryDashboardBias Bias;
		int32 InspectedEntries = 0;
		for (int32 Index = Entries.Num() - 1;
			Index >= 0 && InspectedEntries < MaxEntriesToInspect;
			--Index)
		{
			const FHyperTwistCoachDashboardClosureRecoveryEntry& Entry = Entries[Index];
			if (!Entry.IsStructurallyValid())
			{
				continue;
			}

			Bias.bHasSignal = true;
			if (Entry.bFollowUpContinuationFromRecoveryHistory
				|| Entry.HistoricalFollowUpContinuationCount
					> Entry.HistoricalBorderlineFollowUpSuppressionCount)
			{
				Bias.ContinuationBias += 2;
			}
			if (Entry.bBorderlineFollowUpSuppressedByRecoveryHistory
				|| Entry.HistoricalBorderlineFollowUpSuppressionCount
					> Entry.HistoricalFollowUpContinuationCount)
			{
				Bias.SuppressionBias += 2;
			}

			if (Entry.ActiveSignalId == TEXT("closure_history_follow_up_continuation"))
			{
				Bias.ContinuationBias += Entry.bActiveSignalPromoted ? 2 : 1;
			}
			else if (Entry.ActiveSignalId == TEXT("closure_history_recommended_suppression"))
			{
				Bias.SuppressionBias += Entry.bActiveSignalPromoted ? 2 : 1;
			}

			++InspectedEntries;
		}

		return Bias;
	}

	FHandoffHistoryDashboardBias DeriveHandoffHistoryDashboardBias(
		const TArray<FHyperTwistCoachDashboardHandoffHistoryEntry>& Entries,
		const int32 MaxEntriesToInspect = 8)
	{
		FHandoffHistoryDashboardBias Bias;
		if (Entries.Num() <= 0)
		{
			return Bias;
		}

		const int32 StartIndex = FMath::Max(0, Entries.Num() - MaxEntriesToInspect);
		FHyperTwistCoachDashboardHandoffHistoryEntry PreviousEntry;
		bool bHasPreviousEntry = false;
		if (StartIndex > 0 && Entries.IsValidIndex(StartIndex - 1) && Entries[StartIndex - 1].IsStructurallyValid())
		{
			PreviousEntry = Entries[StartIndex - 1];
			bHasPreviousEntry = true;
		}

		for (int32 Index = StartIndex; Index < Entries.Num(); ++Index)
		{
			const FHyperTwistCoachDashboardHandoffHistoryEntry& Entry = Entries[Index];
			if (!Entry.IsStructurallyValid())
			{
				continue;
			}

			const int32 PreviousQueuedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedQueuedHandoffCount : 0;
			const int32 PreviousFollowUpCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedFollowUpHandoffCount : 0;
			const int32 PreviousRecommendedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedRecommendedHandoffCount : 0;
			const int32 PreviousDeferredOverflowQueuedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedDeferredOverflowQueuedHandoffCount : 0;
			const int32 PreviousDeferredOverflowFollowUpCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedDeferredOverflowFollowUpHandoffCount : 0;
			const int32 PreviousDeferredOverflowRecommendedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedDeferredOverflowRecommendedHandoffCount : 0;
			const int32 PreviousMethodDrillQueuedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedMethodDrillQueuedHandoffCount : 0;
			const int32 PreviousMethodDrillFollowUpCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedMethodDrillFollowUpHandoffCount : 0;
			const int32 PreviousMethodDrillRecommendedCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedMethodDrillRecommendedHandoffCount : 0;
			const int32 PreviousAlignedTightFollowUpOutcomeCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedAlignedTightFollowUpOutcomeHandoffCount : 0;
			const int32 PreviousAlignedBroadRecommendedOutcomeCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount : 0;
			const int32 PreviousAlignedTightFollowUpPacketCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedAlignedTightFollowUpPacketHandoffCount : 0;
			const int32 PreviousAlignedBroadRecommendedPacketCount =
				bHasPreviousEntry ? PreviousEntry.AcceptedAlignedBroadRecommendedPacketHandoffCount : 0;
			const int32 PreviousReliableAcceptedAlignedTightPacketCount =
				bHasPreviousEntry
					? PreviousEntry.ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
					: 0;
			const int32 PreviousReliableAcceptedAlignedBroadPacketCount =
				bHasPreviousEntry
					? PreviousEntry.ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
					: 0;

			const int32 QueuedDelta =
				FMath::Max(0, Entry.AcceptedQueuedHandoffCount - PreviousQueuedCount);
			const int32 FollowUpDelta =
				FMath::Max(0, Entry.AcceptedFollowUpHandoffCount - PreviousFollowUpCount);
			const int32 RecommendedDelta =
				FMath::Max(0, Entry.AcceptedRecommendedHandoffCount - PreviousRecommendedCount);
			const int32 DeferredOverflowQueuedDelta = FMath::Max(
				0,
				Entry.AcceptedDeferredOverflowQueuedHandoffCount - PreviousDeferredOverflowQueuedCount
			);
			const int32 DeferredOverflowFollowUpDelta = FMath::Max(
				0,
				Entry.AcceptedDeferredOverflowFollowUpHandoffCount - PreviousDeferredOverflowFollowUpCount
			);
			const int32 DeferredOverflowRecommendedDelta = FMath::Max(
				0,
				Entry.AcceptedDeferredOverflowRecommendedHandoffCount
					- PreviousDeferredOverflowRecommendedCount
			);
			const int32 MethodDrillQueuedDelta = FMath::Max(
				0,
				Entry.AcceptedMethodDrillQueuedHandoffCount - PreviousMethodDrillQueuedCount
			);
			const int32 MethodDrillFollowUpDelta = FMath::Max(
				0,
				Entry.AcceptedMethodDrillFollowUpHandoffCount - PreviousMethodDrillFollowUpCount
			);
			const int32 MethodDrillRecommendedDelta = FMath::Max(
				0,
				Entry.AcceptedMethodDrillRecommendedHandoffCount - PreviousMethodDrillRecommendedCount
			);
			const int32 AlignedTightFollowUpOutcomeDelta = FMath::Max(
				0,
				Entry.AcceptedAlignedTightFollowUpOutcomeHandoffCount
					- PreviousAlignedTightFollowUpOutcomeCount
			);
			const int32 AlignedBroadRecommendedOutcomeDelta = FMath::Max(
				0,
				Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount
					- PreviousAlignedBroadRecommendedOutcomeCount
			);
			const int32 AlignedTightFollowUpPacketDelta = FMath::Max(
				0,
				Entry.AcceptedAlignedTightFollowUpPacketHandoffCount
					- PreviousAlignedTightFollowUpPacketCount
			);
			const int32 AlignedBroadRecommendedPacketDelta = FMath::Max(
				0,
				Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount
					- PreviousAlignedBroadRecommendedPacketCount
			);
			const int32 ReliableAcceptedAlignedTightPacketDelta = FMath::Max(
				0,
				Entry.ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
					- PreviousReliableAcceptedAlignedTightPacketCount
			);
			const int32 ReliableAcceptedAlignedBroadPacketDelta = FMath::Max(
				0,
				Entry.ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
					- PreviousReliableAcceptedAlignedBroadPacketCount
			);

			if (QueuedDelta > 0)
			{
				Bias.QueueAcceptedDeltaCount += QueuedDelta;
				Bias.QueueScore += QueuedDelta * 3;
				Bias.bHasAcceptedSignal = true;
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					Bias.ReliableTrustedTightQueueAcceptedDeltaCount += QueuedDelta;
					Bias.QueueScore += QueuedDelta * 2;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					Bias.ReliableTrustedBroadQueueAcceptedDeltaCount += QueuedDelta;
					++Bias.QueueScore;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedTightQueueAcceptedDeltaCount += QueuedDelta;
					Bias.QueueScore += QueuedDelta * 3;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedBroadQueueAcceptedDeltaCount += QueuedDelta;
					++Bias.QueueScore;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
			}
			if (FollowUpDelta > 0)
			{
				Bias.FollowUpAcceptedDeltaCount += FollowUpDelta;
				Bias.FollowUpScore += FollowUpDelta * 3;
				Bias.bHasAcceptedSignal = true;
				if (AlignedTightFollowUpOutcomeDelta > 0)
				{
					Bias.AlignedTightFollowUpOutcomeAcceptedDeltaCount
						+= AlignedTightFollowUpOutcomeDelta;
					Bias.FollowUpScore += AlignedTightFollowUpOutcomeDelta * 4;
					Bias.bHasAlignedGuidanceOutcomeAcceptedSignal = true;
				}
				if (AlignedTightFollowUpPacketDelta > 0)
				{
					Bias.AlignedTightFollowUpPacketAcceptedDeltaCount +=
						AlignedTightFollowUpPacketDelta;
					Bias.FollowUpScore += AlignedTightFollowUpPacketDelta * 4;
					Bias.bHasAlignedPacketAcceptedSignal = true;
				}
				if (ReliableAcceptedAlignedTightPacketDelta > 0)
				{
					Bias.ReliableAcceptedAlignedTightFollowUpPacketAcceptedDeltaCount +=
						ReliableAcceptedAlignedTightPacketDelta;
					Bias.FollowUpScore += ReliableAcceptedAlignedTightPacketDelta * 5;
					Bias.bHasAlignedPacketAcceptedSignal = true;
				}
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					Bias.ReliableTrustedTightFollowUpAcceptedDeltaCount += FollowUpDelta;
					Bias.FollowUpScore += FollowUpDelta * 2;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					Bias.ReliableTrustedBroadFollowUpAcceptedDeltaCount += FollowUpDelta;
					++Bias.FollowUpScore;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedTightFollowUpAcceptedDeltaCount += FollowUpDelta;
					Bias.FollowUpScore += FollowUpDelta * 3;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedBroadFollowUpAcceptedDeltaCount += FollowUpDelta;
					++Bias.FollowUpScore;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
			}
			if (RecommendedDelta > 0)
			{
				Bias.RecommendedAcceptedDeltaCount += RecommendedDelta;
				Bias.RecommendedScore += RecommendedDelta * 3;
				Bias.bHasAcceptedSignal = true;
				if (AlignedBroadRecommendedOutcomeDelta > 0)
				{
					Bias.AlignedBroadRecommendedOutcomeAcceptedDeltaCount
						+= AlignedBroadRecommendedOutcomeDelta;
					Bias.RecommendedScore += AlignedBroadRecommendedOutcomeDelta * 4;
					Bias.bHasAlignedGuidanceOutcomeAcceptedSignal = true;
				}
				if (AlignedBroadRecommendedPacketDelta > 0)
				{
					Bias.AlignedBroadRecommendedPacketAcceptedDeltaCount +=
						AlignedBroadRecommendedPacketDelta;
					Bias.RecommendedScore += AlignedBroadRecommendedPacketDelta * 4;
					Bias.bHasAlignedPacketAcceptedSignal = true;
				}
				if (ReliableAcceptedAlignedBroadPacketDelta > 0)
				{
					Bias.ReliableAcceptedAlignedBroadRecommendedPacketAcceptedDeltaCount +=
						ReliableAcceptedAlignedBroadPacketDelta;
					Bias.RecommendedScore += ReliableAcceptedAlignedBroadPacketDelta * 5;
					Bias.bHasAlignedPacketAcceptedSignal = true;
				}
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					Bias.ReliableTrustedTightRecommendedAcceptedDeltaCount += RecommendedDelta;
					++Bias.RecommendedScore;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					Bias.ReliableTrustedBroadRecommendedAcceptedDeltaCount += RecommendedDelta;
					Bias.RecommendedScore += RecommendedDelta * 2;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedTightRecommendedAcceptedDeltaCount += RecommendedDelta;
					++Bias.RecommendedScore;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					Bias.ReliableAlignedTrustedBroadRecommendedAcceptedDeltaCount += RecommendedDelta;
					Bias.RecommendedScore += RecommendedDelta * 3;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
			}
			if (DeferredOverflowQueuedDelta > 0)
			{
				Bias.DeferredOverflowQueueAcceptedDeltaCount += DeferredOverflowQueuedDelta;
				Bias.QueueScore += DeferredOverflowQueuedDelta * 2;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasDeferredOverflowAcceptedSignal = true;
			}
			if (DeferredOverflowFollowUpDelta > 0)
			{
				Bias.DeferredOverflowFollowUpAcceptedDeltaCount += DeferredOverflowFollowUpDelta;
				Bias.FollowUpScore += DeferredOverflowFollowUpDelta * 2;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasDeferredOverflowAcceptedSignal = true;
			}
			if (DeferredOverflowRecommendedDelta > 0)
			{
				Bias.DeferredOverflowRecommendedAcceptedDeltaCount += DeferredOverflowRecommendedDelta;
				Bias.RecommendedScore += DeferredOverflowRecommendedDelta * 2;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasDeferredOverflowAcceptedSignal = true;
			}
			if (MethodDrillQueuedDelta > 0)
			{
				Bias.MethodDrillQueueAcceptedDeltaCount += MethodDrillQueuedDelta;
				Bias.QueueScore += MethodDrillQueuedDelta * 2;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasMethodDrillAcceptedSignal = true;
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					Bias.StrongRetainedMethodDrillQueueAcceptedDeltaCount += MethodDrillQueuedDelta;
					Bias.QueueScore += MethodDrillQueuedDelta * 2;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					Bias.WeakRetainedMethodDrillQueueAcceptedDeltaCount += MethodDrillQueuedDelta;
					++Bias.QueueScore;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
			}
			if (MethodDrillFollowUpDelta > 0)
			{
				Bias.MethodDrillFollowUpAcceptedDeltaCount += MethodDrillFollowUpDelta;
				Bias.FollowUpScore += MethodDrillFollowUpDelta * 3;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasMethodDrillAcceptedSignal = true;
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					Bias.StrongRetainedMethodDrillFollowUpAcceptedDeltaCount += MethodDrillFollowUpDelta;
					Bias.FollowUpScore += MethodDrillFollowUpDelta * 3;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					Bias.WeakRetainedMethodDrillFollowUpAcceptedDeltaCount += MethodDrillFollowUpDelta;
					++Bias.FollowUpScore;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
			}
			if (MethodDrillRecommendedDelta > 0)
			{
				Bias.MethodDrillRecommendedAcceptedDeltaCount += MethodDrillRecommendedDelta;
				Bias.RecommendedScore += MethodDrillRecommendedDelta * 2;
				Bias.bHasAcceptedSignal = true;
				Bias.bHasMethodDrillAcceptedSignal = true;
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					Bias.StrongRetainedMethodDrillRecommendedAcceptedDeltaCount
						+= MethodDrillRecommendedDelta;
					++Bias.RecommendedScore;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					Bias.WeakRetainedMethodDrillRecommendedAcceptedDeltaCount
						+= MethodDrillRecommendedDelta;
					Bias.RecommendedScore += MethodDrillRecommendedDelta * 3;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
			}

			if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("queue"), ESearchCase::IgnoreCase))
			{
				++Bias.QueueRecommendationCount;
				++Bias.QueueScore;
				Bias.bHasRecommendationSignal = true;
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					++Bias.ReliableTrustedTightQueueRecommendationCount;
					Bias.QueueScore += 2;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					++Bias.ReliableTrustedBroadQueueRecommendationCount;
					++Bias.QueueScore;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedTightQueueRecommendationCount;
					Bias.QueueScore += 3;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedBroadQueueRecommendationCount;
					++Bias.QueueScore;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
				if (Entry.bUsedMethodDrillWeighting)
				{
					++Bias.MethodDrillQueueRecommendationCount;
					Bias.QueueScore += 2;
					Bias.bHasMethodDrillRecommendationSignal = true;
				}
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					++Bias.StrongRetainedMethodDrillQueueRecommendationCount;
					Bias.QueueScore += 2;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					++Bias.WeakRetainedMethodDrillQueueRecommendationCount;
					++Bias.QueueScore;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedDeferredFirstSuppressionSignal)
				{
					++Bias.DeferredFirstQueueRecommendationCount;
					Bias.QueueScore += 3;
					Bias.bHasDeferredFirstSuppressionRecommendationSignal = true;
				}
			}
			else if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("follow-up"), ESearchCase::IgnoreCase))
			{
				++Bias.FollowUpRecommendationCount;
				++Bias.FollowUpScore;
				Bias.bHasRecommendationSignal = true;
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					++Bias.ReliableTrustedTightFollowUpRecommendationCount;
					Bias.FollowUpScore += 2;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					++Bias.ReliableTrustedBroadFollowUpRecommendationCount;
					++Bias.FollowUpScore;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedTightFollowUpRecommendationCount;
					Bias.FollowUpScore += 3;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedBroadFollowUpRecommendationCount;
					++Bias.FollowUpScore;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
				if (Entry.bUsedMethodDrillWeighting)
				{
					++Bias.MethodDrillFollowUpRecommendationCount;
					Bias.FollowUpScore += 3;
					Bias.bHasMethodDrillRecommendationSignal = true;
				}
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					++Bias.StrongRetainedMethodDrillFollowUpRecommendationCount;
					Bias.FollowUpScore += 3;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					++Bias.WeakRetainedMethodDrillFollowUpRecommendationCount;
					++Bias.FollowUpScore;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedDeferredFirstSuppressionSignal)
				{
					++Bias.DeferredFirstFollowUpRecommendationCount;
					Bias.FollowUpScore += 4;
					Bias.bHasDeferredFirstSuppressionRecommendationSignal = true;
				}
			}
			else if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("recommended"), ESearchCase::IgnoreCase))
			{
				++Bias.RecommendedRecommendationCount;
				++Bias.RecommendedScore;
				Bias.bHasRecommendationSignal = true;
				if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
				{
					++Bias.ReliableTrustedTightRecommendedRecommendationCount;
					++Bias.RecommendedScore;
					Bias.bHasReliableTrustedTightPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableTrustedBroadStructurePlanHistory)
				{
					++Bias.ReliableTrustedBroadRecommendedRecommendationCount;
					Bias.RecommendedScore += 2;
					Bias.bHasReliableTrustedBroadPlanHistorySignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedTightRecommendedRecommendationCount;
					++Bias.RecommendedScore;
					Bias.bHasReliableAlignedTrustedTightPlanOutcomeSignal = true;
				}
				if (Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
				{
					++Bias.ReliableAlignedTrustedBroadRecommendedRecommendationCount;
					Bias.RecommendedScore += 3;
					Bias.bHasReliableAlignedTrustedBroadPlanOutcomeSignal = true;
				}
				if (Entry.bUsedMethodDrillWeighting)
				{
					++Bias.MethodDrillRecommendedRecommendationCount;
					Bias.RecommendedScore += 2;
					Bias.bHasMethodDrillRecommendationSignal = true;
				}
				if (Entry.bUsedStrongRetainedMethodDrillRecoveryPosture)
				{
					++Bias.StrongRetainedMethodDrillRecommendedRecommendationCount;
					++Bias.RecommendedScore;
					Bias.bHasStrongRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedWeakRetainedMethodDrillRecoveryPosture)
				{
					++Bias.WeakRetainedMethodDrillRecommendedRecommendationCount;
					Bias.RecommendedScore += 3;
					Bias.bHasWeakRetainedMethodDrillPostureSignal = true;
				}
				if (Entry.bUsedDeferredFirstSuppressionSignal)
				{
					++Bias.DeferredFirstRecommendedRecommendationCount;
					++Bias.RecommendedScore;
					Bias.bHasDeferredFirstSuppressionRecommendationSignal = true;
				}
			}

			PreviousEntry = Entry;
			bHasPreviousEntry = true;
		}

		int32 BestScore = 0;
		int32 BestAcceptedDeltaCount = 0;
		auto ConsiderKind = [&BestScore, &BestAcceptedDeltaCount, &Bias](
			const EHandoffRecommendationKind Kind,
			const int32 Score,
			const int32 AcceptedDeltaCount)
		{
			if (Score <= 0)
			{
				return;
			}

			if (Score > BestScore
				|| (Score == BestScore && AcceptedDeltaCount > BestAcceptedDeltaCount))
			{
				BestScore = Score;
				BestAcceptedDeltaCount = AcceptedDeltaCount;
				Bias.PreferredKind = Kind;
			}
		};

		ConsiderKind(
			EHandoffRecommendationKind::Queue,
			Bias.QueueScore,
			Bias.QueueAcceptedDeltaCount);
		ConsiderKind(
			EHandoffRecommendationKind::FollowUp,
			Bias.FollowUpScore,
			Bias.FollowUpAcceptedDeltaCount);
		ConsiderKind(
			EHandoffRecommendationKind::Recommended,
			Bias.RecommendedScore,
			Bias.RecommendedAcceptedDeltaCount);
		int32 BestDeferredOverflowCount = 0;
		const auto ConsiderDeferredOverflowKind =
			[&BestDeferredOverflowCount, &Bias](
				const EHandoffRecommendationKind Kind,
				const int32 Count)
		{
			if (Count <= 0)
			{
				return;
			}

			if (Count > BestDeferredOverflowCount)
			{
				BestDeferredOverflowCount = Count;
				Bias.PreferredDeferredOverflowKind = Kind;
			}
		};
		ConsiderDeferredOverflowKind(
			EHandoffRecommendationKind::Queue,
			Bias.DeferredOverflowQueueAcceptedDeltaCount);
		ConsiderDeferredOverflowKind(
			EHandoffRecommendationKind::FollowUp,
			Bias.DeferredOverflowFollowUpAcceptedDeltaCount);
		ConsiderDeferredOverflowKind(
			EHandoffRecommendationKind::Recommended,
			Bias.DeferredOverflowRecommendedAcceptedDeltaCount);

		Bias.bHasSignal = Bias.PreferredKind != EHandoffRecommendationKind::None;
		return Bias;
	}

	int32 DeriveMethodDrillLaunchRecoveryBias(const FHandoffHistoryDashboardBias& Bias)
	{
		return Bias.MethodDrillQueueAcceptedDeltaCount * 2
			+ Bias.MethodDrillFollowUpAcceptedDeltaCount * 3
			+ Bias.MethodDrillRecommendedAcceptedDeltaCount
			+ Bias.MethodDrillQueueRecommendationCount
			+ Bias.MethodDrillFollowUpRecommendationCount * 2
			+ Bias.MethodDrillRecommendedRecommendationCount
			+ Bias.StrongRetainedMethodDrillQueueAcceptedDeltaCount * 2
			+ Bias.StrongRetainedMethodDrillFollowUpAcceptedDeltaCount * 3
			+ Bias.StrongRetainedMethodDrillRecommendedAcceptedDeltaCount
			+ Bias.StrongRetainedMethodDrillQueueRecommendationCount
			+ Bias.StrongRetainedMethodDrillFollowUpRecommendationCount * 2
			+ Bias.StrongRetainedMethodDrillRecommendedRecommendationCount;
	}

	int32 DeriveMethodDrillPromoteRecoveryBias(const FHandoffHistoryDashboardBias& Bias)
	{
		return Bias.WeakRetainedMethodDrillQueueAcceptedDeltaCount
			+ Bias.WeakRetainedMethodDrillFollowUpAcceptedDeltaCount
			+ Bias.WeakRetainedMethodDrillRecommendedAcceptedDeltaCount * 2
			+ Bias.WeakRetainedMethodDrillQueueRecommendationCount
			+ Bias.WeakRetainedMethodDrillFollowUpRecommendationCount
			+ Bias.WeakRetainedMethodDrillRecommendedRecommendationCount * 2;
	}

	FMethodDrillRecoveryPacketDashboardBias DeriveMethodDrillRecoveryPacketDashboardBias(
		const TArray<FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry>& Entries,
		const int32 MaxEntriesToInspect = 8)
	{
		FMethodDrillRecoveryPacketDashboardBias Bias;
		if (Entries.Num() <= 0)
		{
			return Bias;
		}

		const int32 StartIndex = FMath::Max(0, Entries.Num() - MaxEntriesToInspect);
		for (int32 Index = StartIndex; Index < Entries.Num(); ++Index)
		{
			const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry& Entry = Entries[Index];
			const bool bHasStructureRecoverySignal =
				Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount > 0
				|| Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount > 0;
			if (!Entry.IsStructurallyValid()
				|| Entry.GeneratedGuidancePacketKindLabel.IsEmpty()
				|| (!Entry.bUsedMethodDrillRecoveryMemoryForRecovery
					&& !Entry.bUsedMethodDrillRecoveryMemoryForHandoff
					&& !bHasStructureRecoverySignal))
			{
				continue;
			}

			int32 HistoryWeight = 1;
			if (Entry.MethodDrillRecoveryAverageOutcomeScore >= 70.0f)
			{
				++HistoryWeight;
			}
			if (Entry.MethodDrillRecoveryHistoryCount >= 4)
			{
				++HistoryWeight;
			}
			HistoryWeight = FMath::Clamp(HistoryWeight, 1, 3);

		const bool bStrongPacket =
			Entry.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture
			|| Entry.bStrongPressureDominant;
		const bool bWeakPacket =
			Entry.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture
			|| Entry.bWeakPressureDominant;
		const bool bNarrowStructureRecovery =
			Entry.bNarrowPacketStructureRecoveryDominant
			|| Entry.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount > 0;
		const bool bBroadStructureRecovery =
			Entry.bBroadPacketStructureRecoveryDominant
			|| Entry.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount > 0;
		const bool bGenericPacket =
			Entry.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory
			&& !bStrongPacket
			&& !bWeakPacket
			&& !bNarrowStructureRecovery
			&& !bBroadStructureRecovery;

			if (Entry.GeneratedGuidancePacketKindLabel.Equals(TEXT("queue-entry"), ESearchCase::IgnoreCase))
			{
				++Bias.QueueEntryHistoryCount;
				if (bStrongPacket)
				{
					Bias.StrongQueueEntryCount += HistoryWeight;
					Bias.QueueHandoffBias += HistoryWeight * 2;
					Bias.LaunchRecoveryBias += HistoryWeight;
					Bias.bHasStrongContinuationSignal = true;
					Bias.bHasSignal = true;
				}
			else if (bNarrowStructureRecovery)
			{
				Bias.StrongQueueEntryCount += HistoryWeight;
				Bias.QueueHandoffBias += HistoryWeight * 2;
				Bias.LaunchRecoveryBias += HistoryWeight * 2;
				if (Entry.bGeneratedPlanUsedTightStructureContinuationPosture)
				{
					Bias.TightContinuationPlanCount += HistoryWeight;
					Bias.QueueHandoffBias += HistoryWeight;
					Bias.LaunchRecoveryBias += HistoryWeight;
				}
				Bias.bHasStrongContinuationSignal = true;
				Bias.bHasSignal = true;
			}
				else if (bGenericPacket)
				{
					Bias.QueueHandoffBias += HistoryWeight;
					Bias.LaunchRecoveryBias += HistoryWeight;
					Bias.bHasSignal = true;
				}
			}
			else if (
				Entry.GeneratedGuidancePacketKindLabel.Equals(
					TEXT("follow-up-packet"),
					ESearchCase::IgnoreCase))
			{
				++Bias.FollowUpPacketHistoryCount;
				if (bStrongPacket)
				{
					Bias.StrongFollowUpPacketCount += HistoryWeight;
					Bias.FollowUpHandoffBias += HistoryWeight * 3;
					Bias.LaunchRecoveryBias += HistoryWeight * 2;
					Bias.bHasStrongContinuationSignal = true;
					Bias.bHasSignal = true;
				}
			else if (bNarrowStructureRecovery)
			{
				Bias.StrongFollowUpPacketCount += HistoryWeight;
				Bias.FollowUpHandoffBias += HistoryWeight * 3;
				Bias.LaunchRecoveryBias += HistoryWeight * 2;
				if (Entry.bGeneratedPlanUsedTightStructureContinuationPosture)
				{
					Bias.TightContinuationPlanCount += HistoryWeight;
					Bias.FollowUpHandoffBias += HistoryWeight;
					Bias.LaunchRecoveryBias += HistoryWeight;
				}
				Bias.bHasStrongContinuationSignal = true;
				Bias.bHasSignal = true;
			}
				else if (bGenericPacket)
				{
					Bias.FollowUpHandoffBias += HistoryWeight;
					Bias.LaunchRecoveryBias += HistoryWeight;
					Bias.bHasSignal = true;
				}
			}
			else if (
				Entry.GeneratedGuidancePacketKindLabel.Equals(
					TEXT("recommended-brief"),
					ESearchCase::IgnoreCase))
			{
				++Bias.RecommendedBriefHistoryCount;
				if (bWeakPacket)
				{
					Bias.WeakRecommendedBriefCount += HistoryWeight;
					Bias.RecommendedHandoffBias += HistoryWeight * 3;
					Bias.PromoteRecoveryBias += HistoryWeight * 2;
					Bias.bHasWeakRedirectSignal = true;
					Bias.bHasSignal = true;
				}
			else if (bBroadStructureRecovery)
			{
				Bias.WeakRecommendedBriefCount += HistoryWeight;
				Bias.RecommendedHandoffBias += HistoryWeight * 3;
				Bias.PromoteRecoveryBias += HistoryWeight * 2;
				if (Entry.bGeneratedPlanUsedBroadStructureRedirectPosture)
				{
					Bias.BroadRedirectPlanCount += HistoryWeight;
					Bias.RecommendedHandoffBias += HistoryWeight;
					Bias.PromoteRecoveryBias += HistoryWeight;
				}
				Bias.bHasWeakRedirectSignal = true;
				Bias.bHasSignal = true;
			}
				else if (bGenericPacket)
				{
					Bias.RecommendedHandoffBias += HistoryWeight;
					Bias.PromoteRecoveryBias += HistoryWeight;
					Bias.bHasSignal = true;
				}
			}
		}

		int32 BestScore = 0;
		const auto ConsiderKind = [&BestScore, &Bias](
			const EHandoffRecommendationKind Kind,
			const int32 Score)
		{
			if (Score > BestScore)
			{
				BestScore = Score;
				Bias.PreferredHandoffKind = Kind;
			}
		};
		ConsiderKind(EHandoffRecommendationKind::Queue, Bias.QueueHandoffBias);
		ConsiderKind(EHandoffRecommendationKind::FollowUp, Bias.FollowUpHandoffBias);
		ConsiderKind(EHandoffRecommendationKind::Recommended, Bias.RecommendedHandoffBias);
		return Bias;
	}

	FMethodDrillRecoveryPlanComparisonSummary DeriveMethodDrillRecoveryPlanComparisonSummary(
		const TArray<FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry>& Entries,
		const int32 MaxEntriesToInspect = 8)
	{
		FMethodDrillRecoveryPlanComparisonSummary Summary;
		if (Entries.Num() <= 0)
		{
			return Summary;
		}

		const int32 StartIndex = FMath::Max(0, Entries.Num() - MaxEntriesToInspect);
		for (int32 Index = StartIndex; Index < Entries.Num(); ++Index)
		{
			const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry& Entry = Entries[Index];
			if (!Entry.IsStructurallyValid())
			{
				continue;
			}

			if (IsTightMethodDrillRecoveryPlanSourceLabel(Entry.PreferredRecoveryActionSourceLabel))
			{
				++Summary.TightPlanSourceCount;
				Summary.bHasSignal = true;
				if (Entry.bGeneratedPlanUsedTightStructureContinuationPosture)
				{
					++Summary.TightPlanAlignedCount;
				}
				else
				{
					++Summary.TightPlanDivergedCount;
				}
				if (IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
						Entry.PreferredRecoveryActionSourceLabel))
				{
					++Summary.ReliableTrustedTightPlanSourceCount;
					if (Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture)
					{
						++Summary.ReliableTrustedTightPlanAlignedCount;
					}
					else
					{
						++Summary.ReliableTrustedTightPlanDivergedCount;
					}
					if (IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
							Entry.PreferredRecoveryActionSourceLabel))
					{
						++Summary.ReliableAlignedTrustedTightPlanSourceCount;
						if (Entry.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture)
						{
							++Summary.ReliableAlignedTrustedTightPlanAlignedCount;
						}
						else
						{
							++Summary.ReliableAlignedTrustedTightPlanDivergedCount;
						}
					}
				}
			}
			else if (IsBroadMethodDrillRecoveryPlanSourceLabel(
				Entry.PreferredRecoveryActionSourceLabel))
			{
				++Summary.BroadPlanSourceCount;
				Summary.bHasSignal = true;
				if (Entry.bGeneratedPlanUsedBroadStructureRedirectPosture)
				{
					++Summary.BroadPlanAlignedCount;
				}
				else
				{
					++Summary.BroadPlanDivergedCount;
				}
				if (IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
						Entry.PreferredRecoveryActionSourceLabel))
				{
					++Summary.ReliableTrustedBroadPlanSourceCount;
					if (Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture)
					{
						++Summary.ReliableTrustedBroadPlanAlignedCount;
					}
					else
					{
						++Summary.ReliableTrustedBroadPlanDivergedCount;
					}
					if (IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
							Entry.PreferredRecoveryActionSourceLabel))
					{
						++Summary.ReliableAlignedTrustedBroadPlanSourceCount;
						if (Entry.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture)
						{
							++Summary.ReliableAlignedTrustedBroadPlanAlignedCount;
						}
						else
						{
							++Summary.ReliableAlignedTrustedBroadPlanDivergedCount;
						}
					}
				}
			}
		}

		return Summary;
	}

	FString DescribeMethodDrillRecoveryPlanAlignment(
		const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry& Entry)
	{
		if (IsTightMethodDrillRecoveryPlanSourceLabel(Entry.PreferredRecoveryActionSourceLabel))
		{
			if (IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
					Entry.PreferredRecoveryActionSourceLabel))
			{
				return Entry.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture
					? TEXT("aligned reliable-tight continuation")
					: (Entry.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture
						? TEXT("diverged to aligned reliable-broad redirect")
						: (Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture
							? TEXT("diverged to reliable broad redirect")
							: TEXT("aligned reliable-tight source, plan unresolved")));
			}
			if (IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
					Entry.PreferredRecoveryActionSourceLabel))
			{
				return Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture
					? TEXT("aligned reliable tight continuation")
					: (Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture
						? TEXT("diverged to reliable broad redirect")
						: (Entry.bGeneratedPlanUsedBroadStructureRedirectPosture
							? TEXT("diverged to broad redirect")
							: TEXT("reliable tight source, plan unresolved")));
			}
			return Entry.bGeneratedPlanUsedTightStructureContinuationPosture
				? TEXT("aligned tight continuation")
				: (Entry.bGeneratedPlanUsedBroadStructureRedirectPosture
					? TEXT("diverged to broad redirect")
					: TEXT("source tight, plan unresolved"));
		}
		if (IsBroadMethodDrillRecoveryPlanSourceLabel(Entry.PreferredRecoveryActionSourceLabel))
		{
			if (IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
					Entry.PreferredRecoveryActionSourceLabel))
			{
				return Entry.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture
					? TEXT("aligned reliable-broad redirect")
					: (Entry.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture
						? TEXT("diverged to aligned reliable-tight continuation")
						: (Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture
							? TEXT("diverged to reliable tight continuation")
							: TEXT("aligned reliable-broad source, plan unresolved")));
			}
			if (IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
					Entry.PreferredRecoveryActionSourceLabel))
			{
				return Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture
					? TEXT("aligned reliable broad redirect")
					: (Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture
						? TEXT("diverged to reliable tight continuation")
						: (Entry.bGeneratedPlanUsedTightStructureContinuationPosture
							? TEXT("diverged to tight continuation")
							: TEXT("reliable broad source, plan unresolved")));
			}
			return Entry.bGeneratedPlanUsedBroadStructureRedirectPosture
				? TEXT("aligned broad redirect")
				: (Entry.bGeneratedPlanUsedTightStructureContinuationPosture
					? TEXT("diverged to tight continuation")
					: TEXT("source broad, plan unresolved"));
		}

		return TEXT("no plan-source label");
	}

	FString DescribeMethodDrillRecoveryPlanComparisonPreference(
		const FMethodDrillRecoveryPlanComparisonSummary& Summary)
	{
		const int32 TightScore = Summary.TightPlanAlignedCount - Summary.TightPlanDivergedCount;
		const int32 BroadScore = Summary.BroadPlanAlignedCount - Summary.BroadPlanDivergedCount;
		const int32 ReliableTightScore =
			Summary.ReliableTrustedTightPlanAlignedCount
			- Summary.ReliableTrustedTightPlanDivergedCount;
		const int32 ReliableBroadScore =
			Summary.ReliableTrustedBroadPlanAlignedCount
			- Summary.ReliableTrustedBroadPlanDivergedCount;
		const int32 ReliableAlignedTightScore =
			Summary.ReliableAlignedTrustedTightPlanAlignedCount
			- Summary.ReliableAlignedTrustedTightPlanDivergedCount;
		const int32 ReliableAlignedBroadScore =
			Summary.ReliableAlignedTrustedBroadPlanAlignedCount
			- Summary.ReliableAlignedTrustedBroadPlanDivergedCount;
		if (ReliableAlignedTightScore > ReliableAlignedBroadScore
			&& ReliableAlignedTightScore > 0
			&& Summary.ReliableAlignedTrustedTightPlanSourceCount > 0)
		{
			return TEXT("aligned reliable tight continuation");
		}
		if (ReliableAlignedBroadScore > ReliableAlignedTightScore
			&& ReliableAlignedBroadScore > 0
			&& Summary.ReliableAlignedTrustedBroadPlanSourceCount > 0)
		{
			return TEXT("aligned reliable broad redirect");
		}
		if (ReliableTightScore > ReliableBroadScore
			&& ReliableTightScore > 0
			&& Summary.ReliableTrustedTightPlanSourceCount > 0)
		{
			return TEXT("reliable tight continuation");
		}
		if (ReliableBroadScore > ReliableTightScore
			&& ReliableBroadScore > 0
			&& Summary.ReliableTrustedBroadPlanSourceCount > 0)
		{
			return TEXT("reliable broad redirect");
		}
		if (TightScore > BroadScore && Summary.TightPlanSourceCount > 0)
		{
			return TEXT("tight continuation");
		}
		if (BroadScore > TightScore && Summary.BroadPlanSourceCount > 0)
		{
			return TEXT("broad redirect");
		}
		if (Summary.bHasSignal)
		{
			return TEXT("mixed");
		}

		return TEXT("none");
	}

	int32 DeriveMethodDrillRecoveryPlanTightTrust(
		const FMethodDrillRecoveryPlanComparisonSummary& Summary)
	{
		return Summary.TightPlanAlignedCount - Summary.TightPlanDivergedCount
			+ Summary.ReliableTrustedTightPlanAlignedCount
			- Summary.ReliableTrustedTightPlanDivergedCount
			+ (Summary.ReliableAlignedTrustedTightPlanAlignedCount * 2)
			- Summary.ReliableAlignedTrustedTightPlanDivergedCount;
	}

	int32 DeriveMethodDrillRecoveryPlanBroadTrust(
		const FMethodDrillRecoveryPlanComparisonSummary& Summary)
	{
		return Summary.BroadPlanAlignedCount - Summary.BroadPlanDivergedCount
			+ Summary.ReliableTrustedBroadPlanAlignedCount
			- Summary.ReliableTrustedBroadPlanDivergedCount
			+ (Summary.ReliableAlignedTrustedBroadPlanAlignedCount * 2)
			- Summary.ReliableAlignedTrustedBroadPlanDivergedCount;
	}

	bool PrefersMethodDrillRecoveryPlanTightContinuation(
		const FMethodDrillRecoveryPlanComparisonSummary& Summary)
	{
		const int32 TightTrust = DeriveMethodDrillRecoveryPlanTightTrust(Summary);
		const int32 BroadTrust = DeriveMethodDrillRecoveryPlanBroadTrust(Summary);
		return Summary.TightPlanSourceCount > 0
			&& TightTrust > 0
			&& TightTrust > BroadTrust;
	}

	bool PrefersMethodDrillRecoveryPlanBroadRedirect(
		const FMethodDrillRecoveryPlanComparisonSummary& Summary)
	{
		const int32 TightTrust = DeriveMethodDrillRecoveryPlanTightTrust(Summary);
		const int32 BroadTrust = DeriveMethodDrillRecoveryPlanBroadTrust(Summary);
		return Summary.BroadPlanSourceCount > 0
			&& BroadTrust > 0
			&& BroadTrust > TightTrust;
	}

	void CollectMethodDrillRecoveryOutcomeIndices(
		const TArray<FHyperTwistCoachDashboardQueueRecoveryOutcome>& Outcomes,
		TArray<int32>& OutIndices)
	{
		OutIndices.Reset();
		for (int32 Index = 0; Index < Outcomes.Num(); ++Index)
		{
			const FHyperTwistCoachDashboardQueueRecoveryOutcome& Outcome = Outcomes[Index];
			if (Outcome.IsStructurallyValid()
				&& (Outcome.bUsedMethodDrillHandoffSignal
					|| Outcome.bUsedNarrowMethodDrillPacketStructureRecovery
					|| Outcome.bUsedBroadMethodDrillPacketStructureRecovery
					|| Outcome.bUsedReliableTrustedTightStructurePlanRecovery
					|| Outcome.bUsedReliableTrustedBroadStructurePlanRecovery))
			{
				OutIndices.Add(Index);
			}
		}
	}

	EMethodDrillRecoveryMemoryBias DeriveRetainedMethodDrillRecoveryMemoryBias(
		const TArray<FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry>& Entries,
		const bool bForRecovery)
	{
		int32 StrongCount = 0;
		int32 WeakCount = 0;
		for (const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry& Entry : Entries)
		{
			if (!Entry.IsStructurallyValid())
			{
				continue;
			}

			const bool bEntryApplies = bForRecovery
				? Entry.bUsedMethodDrillRecoveryMemoryForRecovery
				: Entry.bUsedMethodDrillRecoveryMemoryForHandoff;
			if (!bEntryApplies)
			{
				continue;
			}

			if (Entry.bStrongPressureDominant)
			{
				StrongCount += 1;
			}
			else if (Entry.bWeakPressureDominant)
			{
				WeakCount += 1;
			}
		}

		if (StrongCount > WeakCount && StrongCount > 0)
		{
			return EMethodDrillRecoveryMemoryBias::Strong;
		}
		if (WeakCount > StrongCount && WeakCount > 0)
		{
			return EMethodDrillRecoveryMemoryBias::Weak;
		}

		return EMethodDrillRecoveryMemoryBias::None;
	}
}

void UHyperTwistCoachDashboardWidget::NativeConstruct()
{
	EnsureDefaultDashboardBuilt();
	Super::NativeConstruct();
	RefreshCoachDashboardView();
}

void UHyperTwistCoachDashboardWidget::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
{
	Super::NativeTick(MyGeometry, InDeltaTime);

	if (bRefreshLiveAttemptClockOnTick && bHasLiveAttemptTimer)
	{
		RefreshLiveAttemptClock();
		UpdateDashboardPresentation();
	}
}

void UHyperTwistCoachDashboardWidget::RefreshCoachDashboardView()
{
	RefreshTrainingState();
	RefreshLiveAttemptClock();
	RecordQueueSuppressionSnapshot();
	RecordClosureRecoverySnapshot();
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	SyncSelectedGuidanceDecisionHistoryEntry();
	SyncSelectedHandoffHistoryEntry();
	SyncSelectedTemplateLaunchHistoryEntry();
	SyncSelectedQueueSuppressionHistoryEntry();
	SyncSelectedClosureRecoveryHistoryEntry();
	SyncSelectedMethodDrillFollowUpHistoryEntry();
	SyncSelectedMethodDrillRecoveryOutcomeEntry();
	SyncSelectedMethodDrillRecoveryMemoryHistoryEntry();
	SyncPreferredGuidancePreviewLane(false);
	UpdateDashboardPresentation();
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::ExecutePrimaryCoachAction()
{
	const FHyperTwistTrainingRunState RunState = StartPrimaryCoachAction(DefaultCoachMaxCases, FString());

	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
	return RunState;
}

bool UHyperTwistCoachDashboardWidget::DeferDisplayedQueueEntryByDefaultWindow()
{
	const bool bSucceeded = DeferDisplayedCoachQueueEntry(
		BuildDefaultDeferredUntilUtc(),
		TEXT("dashboard-defer"),
		true
	);
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
	return bSucceeded;
}

bool UHyperTwistCoachDashboardWidget::PromoteFirstDeferredQueueEntry(
	const FString& StartActionSourceLabel
)
{
	FString DeferredEntryId;
	if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
		SelectedEntry != nullptr
		&& SelectedEntry->EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Deferred)
	{
		DeferredEntryId = SelectedEntry->EntryId;
	}
	else
	{
		DeferredEntryId = FindFirstDeferredQueueEntryId();
	}
	if (DeferredEntryId.IsEmpty())
	{
		return false;
	}

	const bool bSucceeded = PromoteCoachQueueEntry(DeferredEntryId, StartActionSourceLabel);
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
	return bSucceeded;
}

bool UHyperTwistCoachDashboardWidget::ApplyQueueRecoveryPosture()
{
	if (bHasLiveAttemptTimer)
	{
		return false;
	}

	const float BeforePressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	const int32 BeforeDeferredEventCount = CachedCoachQueueExecutionSummary.DeferredEventCount;
	const bool bBeforeBlockedFollowUp = CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	const bool bBeforeOutstandingDeferred = CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork;
	const bool bBeforeCompletionGap = CachedCoachQueueExecutionSummary.bHasCompletionGap;
	const FString SourceLabel = CachedCoachPanelState.PreferredGuidanceSourceLabel;
	const FHyperTwistCoachDashboardQueueRecoveryWeighting QueueRecoveryWeighting = BuildQueueRecoveryWeighting();

	const FString DeferredEntryId = FindFirstDeferredQueueEntryId();
	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const FHyperTwistCoachSignal* DeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"));
	const bool bHasDeferredFirstSuppressionSignal =
		DeferredFirstSuppressionSignal != nullptr;
	const bool bPrefersFollowUp =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp;
	const bool bPrefersRecommended =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended;
	const bool bUpstreamPrefersLaunchRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryAction
		== EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
	const bool bCanLaunchQueueRecovery =
		CachedCoachPanelState.bCanStartQueuedRun
		|| (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const bool bPreferDeferredFirstPromote =
		bHasDeferredFirstSuppressionSignal
		&& bPrefersFollowUp
		&& !DeferredEntryId.IsEmpty();
	const bool bPreferLaunchBeforePromote =
		!DeferredEntryId.IsEmpty()
		&& bCanLaunchQueueRecovery
		&& !bPreferDeferredFirstPromote
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && bUpstreamPrefersLaunchRecovery));
	const bool bUseMethodDrillRecoverySignal =
		!bHasDeferredFirstSuppressionSignal
		&& QueueRecoveryWeighting.bHasMethodDrillSignal
		&& QueueRecoveryWeighting.MethodDrillLaunchBiasCount
			>= QueueRecoveryWeighting.MethodDrillPromoteBiasCount
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && bUpstreamPrefersLaunchRecovery));
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		RetainedMethodDrillRecoveryMemoryBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveRetainedMethodDrillRecoveryMemoryBias(
				MethodDrillRecoveryMemoryHistoryEntries,
				true
			);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPacketDashboardBias
		MethodDrillRecoveryPacketQueueBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPacketDashboardBias(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		MethodDrillRecoveryPacketLaunchBias =
			MethodDrillRecoveryPacketQueueBias.bHasStrongContinuationSignal
				&& (!MethodDrillRecoveryPacketQueueBias.bHasWeakRedirectSignal
					|| MethodDrillRecoveryPacketQueueBias.LaunchRecoveryBias
						>= MethodDrillRecoveryPacketQueueBias.PromoteRecoveryBias)
				? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
				: (MethodDrillRecoveryPacketQueueBias.bHasWeakRedirectSignal
					? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
					: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None);
	const bool bUseStrongRetainedMethodDrillRecoveryPosture =
		!bHasDeferredFirstSuppressionSignal
		&& QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchCount > 0
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && bUpstreamPrefersLaunchRecovery))
		&& (QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchReducedCount > 0
			|| QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchCount
				>= QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteCount);
	const bool bUseWeakRetainedMethodDrillRecoveryPosture =
		!bHasDeferredFirstSuppressionSignal
		&& !DeferredEntryId.IsEmpty()
		&& QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteCount > 0
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && !bUpstreamPrefersLaunchRecovery))
		&& (QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteReducedCount > 0
			|| QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteCount
				>= QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchCount);
	const bool bUseMethodDrillRecoveryPacketSignal =
		!bHasDeferredFirstSuppressionSignal
		&& MethodDrillRecoveryPacketQueueBias.bHasSignal
		&& MethodDrillRecoveryPacketLaunchBias
			!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None;
	const bool bUseNarrowMethodDrillPacketStructureRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
		== TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow");
	const bool bUseBroadMethodDrillPacketStructureRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
		== TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
		const bool bUseTightMethodDrillRecoveryStructurePlan =
			HyperTwistCoachDashboardWidgetInternal::IsTightMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (MethodDrillRecoveryPacketLaunchBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
			&& MethodDrillRecoveryPacketQueueBias.TightContinuationPlanCount > 0
			&& MethodDrillRecoveryPacketQueueBias.TightContinuationPlanCount
				>= MethodDrillRecoveryPacketQueueBias.BroadRedirectPlanCount);
		const bool bUseBroadMethodDrillRecoveryStructurePlan =
			HyperTwistCoachDashboardWidgetInternal::IsBroadMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (MethodDrillRecoveryPacketLaunchBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
			&& MethodDrillRecoveryPacketQueueBias.BroadRedirectPlanCount > 0
				&& MethodDrillRecoveryPacketQueueBias.BroadRedirectPlanCount
					>= MethodDrillRecoveryPacketQueueBias.TightContinuationPlanCount);
		const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPlanComparisonSummary
			MethodDrillRecoveryPlanComparisonSummary =
				HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanComparisonSummary(
					MethodDrillRecoveryMemoryHistoryEntries
				);
		const int32 MethodDrillRecoveryPlanTightTrust =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanTightTrust(
				MethodDrillRecoveryPlanComparisonSummary);
		const int32 MethodDrillRecoveryPlanBroadTrust =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanBroadTrust(
				MethodDrillRecoveryPlanComparisonSummary);
		const bool bUseTrustedTightMethodDrillRecoveryStructurePlan =
			bUseTightMethodDrillRecoveryStructurePlan
			&& (HyperTwistCoachDashboardWidgetInternal::IsTrustedTightMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
				|| HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanTightContinuation(
					MethodDrillRecoveryPlanComparisonSummary));
		const bool bUseTrustedBroadMethodDrillRecoveryStructurePlan =
			bUseBroadMethodDrillRecoveryStructurePlan
			&& (HyperTwistCoachDashboardWidgetInternal::IsTrustedBroadMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
				|| HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanBroadRedirect(
					MethodDrillRecoveryPlanComparisonSummary));
		const bool bUseReliableTrustedTightMethodDrillRecoveryStructurePlan =
			bUseTrustedTightMethodDrillRecoveryStructurePlan
			&& (HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
				|| (MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanSourceCount > 0
					&& MethodDrillRecoveryPlanTightTrust > 0
					&& MethodDrillRecoveryPlanTightTrust >= MethodDrillRecoveryPlanBroadTrust));
		const bool bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan =
			bUseTrustedBroadMethodDrillRecoveryStructurePlan
			&& (HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
				|| (MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanSourceCount > 0
					&& MethodDrillRecoveryPlanBroadTrust > 0
					&& MethodDrillRecoveryPlanBroadTrust >= MethodDrillRecoveryPlanTightTrust));
		const bool bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan =
			bUseReliableTrustedTightMethodDrillRecoveryStructurePlan
			&& MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanSourceCount > 0
			&& MethodDrillRecoveryPlanTightTrust > 0
			&& MethodDrillRecoveryPlanTightTrust >= MethodDrillRecoveryPlanBroadTrust;
		const bool bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan =
			bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan
			&& MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanSourceCount > 0
			&& MethodDrillRecoveryPlanBroadTrust > 0
			&& MethodDrillRecoveryPlanBroadTrust >= MethodDrillRecoveryPlanTightTrust;

	auto StartRunAndRefresh = [this](const FHyperTwistTrainingRunState& RunState)
	{
		SyncRetainedRunRecap();
		SyncSelectedQueueEntry();
		SyncSelectedAttempt();
		UpdateDashboardPresentation();
		return RunState.Session.IsStructurallyValid();
	};
	auto RecordAndFinalizeOutcome = [
		this,
		&SourceLabel,
		BeforePressureScore,
		BeforeDeferredEventCount,
		bBeforeBlockedFollowUp,
		bBeforeOutstandingDeferred,
		bBeforeCompletionGap,
		bHasDeferredFirstSuppressionSignal,
		bPrefersFollowUp,
		bUseMethodDrillRecoverySignal,
		bUseNarrowMethodDrillPacketStructureRecovery,
		bUseBroadMethodDrillPacketStructureRecovery,
		bUseStrongRetainedMethodDrillRecoveryPosture,
		bUseWeakRetainedMethodDrillRecoveryPosture,
		bUseReliableTrustedTightMethodDrillRecoveryStructurePlan,
		bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan,
		bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan,
		bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan
	](
		const TCHAR* AppliedActionLabel,
		const FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind ActionKind,
		const bool bSucceeded)
	{
		RecordQueueRecoveryOutcome(
			SourceLabel,
			AppliedActionLabel,
			ActionKind,
			BeforePressureScore,
			BeforeDeferredEventCount,
			bBeforeBlockedFollowUp,
			bBeforeOutstandingDeferred,
			bBeforeCompletionGap,
			bHasDeferredFirstSuppressionSignal && bPrefersFollowUp,
			bUseMethodDrillRecoverySignal,
			bUseNarrowMethodDrillPacketStructureRecovery
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
			bUseBroadMethodDrillPacketStructureRecovery
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred,
			bUseStrongRetainedMethodDrillRecoveryPosture
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
			bUseWeakRetainedMethodDrillRecoveryPosture
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred,
			bUseReliableTrustedTightMethodDrillRecoveryStructurePlan
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
			bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred,
			bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
			bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan
				&& ActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred,
			bSucceeded
		);
		UpdateDashboardPresentation();
		return bSucceeded;
	};
	auto BuildRecoveryLaunchSourceLabel =
		[
			bHasDeferredFirstSuppressionSignal,
			bUseMethodDrillRecoverySignal,
			RetainedMethodDrillRecoveryMemoryBias,
			MethodDrillRecoveryPacketLaunchBias,
			bUseStrongRetainedMethodDrillRecoveryPosture,
		bUseMethodDrillRecoveryPacketSignal,
		bUseNarrowMethodDrillPacketStructureRecovery,
		bUseBroadMethodDrillPacketStructureRecovery,
		bUseTightMethodDrillRecoveryStructurePlan,
		bUseBroadMethodDrillRecoveryStructurePlan,
		bUseTrustedTightMethodDrillRecoveryStructurePlan,
		bUseTrustedBroadMethodDrillRecoveryStructurePlan,
		bUseReliableTrustedTightMethodDrillRecoveryStructurePlan,
		bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan,
		bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan,
		bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan
	](
			const EHyperTwistTrainingCoachHandoffKind HandoffKind)
	{
		if (bHasDeferredFirstSuppressionSignal)
		{
			return HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
				HandoffKind,
				true
			);
		}
		if (bUseStrongRetainedMethodDrillRecoveryPosture)
		{
			return HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
				HandoffKind,
				false,
				false,
				HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong,
				true,
				bUseMethodDrillRecoveryPacketSignal,
				bUseNarrowMethodDrillPacketStructureRecovery,
				false,
				bUseTightMethodDrillRecoveryStructurePlan,
				false,
				bUseTrustedTightMethodDrillRecoveryStructurePlan,
				bUseReliableTrustedTightMethodDrillRecoveryStructurePlan,
				bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan
			);
		}
		if (bUseMethodDrillRecoveryPacketSignal)
		{
			return HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
				HandoffKind,
				false,
				false,
				MethodDrillRecoveryPacketLaunchBias,
				false,
				true,
				bUseNarrowMethodDrillPacketStructureRecovery,
				bUseBroadMethodDrillPacketStructureRecovery,
				bUseTightMethodDrillRecoveryStructurePlan,
				bUseBroadMethodDrillRecoveryStructurePlan,
				bUseTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseTrustedBroadMethodDrillRecoveryStructurePlan,
				bUseReliableTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan,
				bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan
			);
		}
		if (bUseMethodDrillRecoverySignal)
		{
			const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
				EffectiveRecoverySourceBias =
					RetainedMethodDrillRecoveryMemoryBias
						!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None
						? RetainedMethodDrillRecoveryMemoryBias
						: MethodDrillRecoveryPacketLaunchBias;
			return HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
				HandoffKind,
				false,
				EffectiveRecoverySourceBias
					== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None,
				EffectiveRecoverySourceBias,
				false,
				bUseMethodDrillRecoveryPacketSignal,
				bUseNarrowMethodDrillPacketStructureRecovery,
				bUseBroadMethodDrillPacketStructureRecovery,
				bUseTightMethodDrillRecoveryStructurePlan,
				bUseBroadMethodDrillRecoveryStructurePlan,
				bUseTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseTrustedBroadMethodDrillRecoveryStructurePlan,
				bUseReliableTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseReliableTrustedBroadMethodDrillRecoveryStructurePlan,
				bUseReliableAlignedTrustedTightMethodDrillRecoveryStructurePlan
					|| bUseReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlan
			);
		}

		return FString();
	};
	auto ResolveDeferredRecoveryHandoffKind =
		[this](const FString& EntryId) -> EHyperTwistTrainingCoachHandoffKind
	{
		const FHyperTwistTrainingCoachSessionQueueStateEntry* MatchingEntry =
			CachedCoachSessionQueueState.Entries.FindByPredicate(
				[&EntryId](const FHyperTwistTrainingCoachSessionQueueStateEntry& Candidate)
				{
					return Candidate.EntryId == EntryId;
				});
		if (MatchingEntry == nullptr)
		{
			return EHyperTwistTrainingCoachHandoffKind::Queue;
		}
		if (MatchingEntry->bRequiresFollowUp
			|| MatchingEntry->SourceLabel == TEXT("follow-up-brief"))
		{
			return EHyperTwistTrainingCoachHandoffKind::FollowUp;
		}
		if (MatchingEntry->SourceLabel == TEXT("primary-brief"))
		{
			return EHyperTwistTrainingCoachHandoffKind::Recommended;
		}
		return EHyperTwistTrainingCoachHandoffKind::Queue;
	};
	auto TryPromoteRecovery = [&]() -> bool
	{
		if (DeferredEntryId.IsEmpty())
		{
			return false;
		}

		const FString PromoteActionSourceLabel =
			BuildRecoveryLaunchSourceLabel(ResolveDeferredRecoveryHandoffKind(DeferredEntryId));
		const bool bSucceeded = PromoteFirstDeferredQueueEntry(PromoteActionSourceLabel);
		return RecordAndFinalizeOutcome(
			TEXT("promote-deferred-recovery"),
			FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred,
			bSucceeded
		);
	};
	auto TryLaunchRecovery = [&]() -> bool
	{
		if (bQueueRecoveryMemorySource && CachedCoachPanelState.bCanStartQueuedRun)
		{
			const bool bQueueMatchesPreference =
				(!bPrefersFollowUp && !bPrefersRecommended)
				|| (bPrefersFollowUp
					&& CachedCoachPanelState.NextQueueSourceLabel == TEXT("follow-up-brief"))
				|| (bPrefersRecommended
					&& CachedCoachPanelState.NextQueueSourceLabel == TEXT("primary-brief"));
			if (bQueueMatchesPreference)
			{
				const FString StartActionSourceLabel =
					bHasDeferredFirstSuppressionSignal && bPrefersFollowUp
						? HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
							EHyperTwistTrainingCoachHandoffKind::Queue,
							true)
						: BuildRecoveryLaunchSourceLabel(
							EHyperTwistTrainingCoachHandoffKind::Queue);
				const bool bSucceeded = StartRunAndRefresh(
					StartNextQueuedCoachRun(DefaultCoachMaxCases, StartActionSourceLabel));
				return RecordAndFinalizeOutcome(
					TEXT("launch-queued-recovery"),
					FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
					bSucceeded
				);
			}
		}

		if (bPrefersFollowUp
			&& CachedCoachPanelState.bCanStartCoachFollowUpRun
			&& CachedCoachPanelState.bHasFollowUpGuidance)
		{
			const FString StartActionSourceLabel = BuildRecoveryLaunchSourceLabel(
				EHyperTwistTrainingCoachHandoffKind::FollowUp
			);
			const bool bSucceeded = StartRunAndRefresh(
				StartCoachFollowUpRun(DefaultCoachMaxCases, StartActionSourceLabel));
			return RecordAndFinalizeOutcome(
				TEXT("launch-follow-up-recovery"),
				FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
				bSucceeded
			);
		}
		if (bPrefersRecommended && CachedCoachPanelState.bCanStartCoachRecommendedRun)
		{
			const FString StartActionSourceLabel = BuildRecoveryLaunchSourceLabel(
				EHyperTwistTrainingCoachHandoffKind::Recommended
			);
			const bool bSucceeded = StartRunAndRefresh(
				StartCoachRecommendedRun(DefaultCoachMaxCases, StartActionSourceLabel));
			return RecordAndFinalizeOutcome(
				TEXT("launch-recommended-recovery"),
				FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
				bSucceeded
			);
		}
		if (CachedCoachPanelState.bCanStartQueuedRun)
		{
			const FString StartActionSourceLabel =
				bHasDeferredFirstSuppressionSignal && bPrefersFollowUp
					? HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
						EHyperTwistTrainingCoachHandoffKind::Queue,
						true)
					: BuildRecoveryLaunchSourceLabel(
						EHyperTwistTrainingCoachHandoffKind::Queue);
			const bool bSucceeded = StartRunAndRefresh(
				StartNextQueuedCoachRun(DefaultCoachMaxCases, StartActionSourceLabel));
			return RecordAndFinalizeOutcome(
				TEXT("launch-queued-fallback"),
				FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
				bSucceeded
			);
		}
		if (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
		{
			const FString StartActionSourceLabel = BuildRecoveryLaunchSourceLabel(
				EHyperTwistTrainingCoachHandoffKind::FollowUp
			);
			const bool bSucceeded = StartRunAndRefresh(
				StartCoachFollowUpRun(DefaultCoachMaxCases, StartActionSourceLabel));
			return RecordAndFinalizeOutcome(
				TEXT("launch-follow-up-fallback"),
				FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
				bSucceeded
			);
		}
		if (CachedCoachPanelState.bCanStartCoachRecommendedRun)
		{
			const FString StartActionSourceLabel = BuildRecoveryLaunchSourceLabel(
				EHyperTwistTrainingCoachHandoffKind::Recommended
			);
			const bool bSucceeded = StartRunAndRefresh(
				StartCoachRecommendedRun(DefaultCoachMaxCases, StartActionSourceLabel));
			return RecordAndFinalizeOutcome(
				TEXT("launch-recommended-fallback"),
				FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
				bSucceeded
			);
		}

		const FHyperTwistTrainingRunState FallbackRunState = ExecutePrimaryCoachAction();
		const bool bSucceeded = FallbackRunState.Session.IsStructurallyValid();
		return RecordAndFinalizeOutcome(
			TEXT("launch-primary-fallback"),
			FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery,
			bSucceeded
		);
	};

	if (bPreferLaunchBeforePromote)
	{
		const bool bLaunchSucceeded = TryLaunchRecovery();
		if (bLaunchSucceeded)
		{
			return true;
		}
		if (!DeferredEntryId.IsEmpty())
		{
			return TryPromoteRecovery();
		}
		return false;
	}

	if (!DeferredEntryId.IsEmpty())
	{
		return TryPromoteRecovery();
	}

	return TryLaunchRecovery();
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousQueueEntry()
{
	if (CachedCoachSessionQueueState.Entries.Num() <= 0)
	{
		SelectedQueueEntryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedQueueEntryIndex == INDEX_NONE)
	{
		SyncSelectedQueueEntry();
		return SelectedQueueEntryIndex != INDEX_NONE;
	}

	SelectedQueueEntryIndex =
		(SelectedQueueEntryIndex - 1 + CachedCoachSessionQueueState.Entries.Num())
		% CachedCoachSessionQueueState.Entries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextQueueEntry()
{
	if (CachedCoachSessionQueueState.Entries.Num() <= 0)
	{
		SelectedQueueEntryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedQueueEntryIndex == INDEX_NONE)
	{
		SyncSelectedQueueEntry();
		return SelectedQueueEntryIndex != INDEX_NONE;
	}

	SelectedQueueEntryIndex = (SelectedQueueEntryIndex + 1) % CachedCoachSessionQueueState.Entries.Num();
	UpdateDashboardPresentation();
	return true;
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::StartSelectedQueueEntry()
{
	if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
		SelectedEntry != nullptr)
	{
		FHyperTwistTrainingRunState RunState =
			StartCoachQueueEntry(SelectedEntry->EntryId, DefaultCoachMaxCases);
		SyncRetainedRunRecap();
		SyncSelectedQueueEntry();
		SyncSelectedAttempt();
		UpdateDashboardPresentation();
		return RunState;
	}

	return FHyperTwistTrainingRunState();
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousAttemptReview()
{
	if (CachedRunState.Attempts.Num() <= 0)
	{
		SelectedAttemptIndex = INDEX_NONE;
		LastObservedAttemptCount = 0;
		return false;
	}

	if (SelectedAttemptIndex == INDEX_NONE)
	{
		SyncSelectedAttempt();
		return SelectedAttemptIndex != INDEX_NONE;
	}

	SelectedAttemptIndex =
		(SelectedAttemptIndex - 1 + CachedRunState.Attempts.Num()) % CachedRunState.Attempts.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextAttemptReview()
{
	if (CachedRunState.Attempts.Num() <= 0)
	{
		SelectedAttemptIndex = INDEX_NONE;
		LastObservedAttemptCount = 0;
		return false;
	}

	if (SelectedAttemptIndex == INDEX_NONE)
	{
		SyncSelectedAttempt();
		return SelectedAttemptIndex != INDEX_NONE;
	}

	SelectedAttemptIndex = (SelectedAttemptIndex + 1) % CachedRunState.Attempts.Num();
	UpdateDashboardPresentation();
	return true;
}

FHyperTwistTrainingDeck UHyperTwistCoachDashboardWidget::PreviewRecommendedCoachDeck()
{
	const FHyperTwistTrainingDeck Deck = BuildActiveCoachRecommendedDeck(DefaultCoachMaxCases);
	ActiveGuidancePreviewLane = Deck.IsStructurallyValid()
		? EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		: EHyperTwistCoachDashboardGuidancePreviewLane::None;
	SyncSelectedGuidancePreviewCase();
	UpdateDashboardPresentation();
	return Deck;
}

FHyperTwistTrainingDeck UHyperTwistCoachDashboardWidget::PreviewFollowUpCoachDeck()
{
	const FHyperTwistTrainingDeck Deck = BuildActiveCoachFollowUpDeck(DefaultCoachMaxCases);
	ActiveGuidancePreviewLane = Deck.IsStructurallyValid()
		? EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
		: EHyperTwistCoachDashboardGuidancePreviewLane::None;
	SyncSelectedGuidancePreviewCase();
	UpdateDashboardPresentation();
	return Deck;
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::StartPreferredActiveSessionTemplateRun()
{
	if (bHasLiveAttemptTimer || CachedRunState.Session.IsStructurallyValid())
	{
		UpdateDashboardPresentation();
		return FHyperTwistTrainingRunState();
	}

	FHyperTwistTrainingTemplateLaunchSelectionProvenance LaunchSelectionProvenance;
	const FHyperTwistTrainingSessionTemplate* PreferredTemplate =
		FindPreferredDashboardTemplateLaunch(&LaunchSelectionProvenance);
	if (PreferredTemplate == nullptr)
	{
		UpdateDashboardPresentation();
		return FHyperTwistTrainingRunState();
	}

	const FHyperTwistTrainingSessionTemplate LaunchedTemplate = *PreferredTemplate;
	if (!LaunchSelectionProvenance.IsStructurallyValid())
	{
		LaunchSelectionProvenance =
			HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchPrimarySelectionProvenance(
				LaunchedTemplate
			);
	}
	const FString ResolvedUserId = LaunchedTemplate.UserId.IsEmpty()
		? DefaultUserId
		: LaunchedTemplate.UserId;
	const FString LaunchSessionId = FString::Printf(
		TEXT("%s_template_%s_%s"),
		*DefaultSessionId,
		*LaunchedTemplate.TemplateId,
		*FGuid::NewGuid().ToString(EGuidFormats::Digits)
	);
	LastStepResult = FHyperTwistTrainingRunStepResult();
	const FHyperTwistTrainingRunState RunState = StartTrainingRunFromTemplate(
		LaunchedTemplate.TemplateId,
		ResolvedUserId,
		LaunchSessionId
	);
	if (RunState.Session.IsStructurallyValid())
	{
		if (LaunchSelectionProvenance.IsStructurallyValid())
		{
			if (UHyperTwistTrainingSubsystem* TrainingSubsystem =
				UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
			{
				if (TrainingSubsystem->RecordActiveRunTemplateLaunchSelectionProvenance(
					LaunchSelectionProvenance))
				{
					RefreshTrainingState();
				}
			}
		}

		FHyperTwistTrainingTemplateLaunchProvenance EffectiveLaunchProvenance =
			CachedRunState.Session.TrainingSessionId == RunState.Session.TrainingSessionId
				&& CachedRunState.TemplateLaunchProvenance.IsStructurallyValid()
					? CachedRunState.TemplateLaunchProvenance
					: RunState.TemplateLaunchProvenance;
		if (!EffectiveLaunchProvenance.IsStructurallyValid())
		{
			EffectiveLaunchProvenance =
				HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchProvenance(LaunchedTemplate);
		}
		if (LaunchSelectionProvenance.IsStructurallyValid()
			&& EffectiveLaunchProvenance.IsStructurallyValid()
			&& !EffectiveLaunchProvenance.SelectionProvenance.IsStructurallyValid())
		{
			EffectiveLaunchProvenance.SelectionProvenance = LaunchSelectionProvenance;
		}

		CaptureActiveTemplateLaunchContext(
			RunState.Session.TrainingSessionId,
			EffectiveLaunchProvenance
		);
	}
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
	return RunState;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousGuidancePreviewCase()
{
	const FHyperTwistTrainingDeck* Deck = GetActiveGuidancePreviewDeck();
	if (Deck == nullptr || Deck->Cases.Num() <= 0)
	{
		SelectedGuidancePreviewCaseIndex = INDEX_NONE;
		return false;
	}

	if (SelectedGuidancePreviewCaseIndex == INDEX_NONE)
	{
		SyncSelectedGuidancePreviewCase();
		return SelectedGuidancePreviewCaseIndex != INDEX_NONE;
	}

	SelectedGuidancePreviewCaseIndex =
		(SelectedGuidancePreviewCaseIndex - 1 + Deck->Cases.Num()) % Deck->Cases.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextGuidancePreviewCase()
{
	const FHyperTwistTrainingDeck* Deck = GetActiveGuidancePreviewDeck();
	if (Deck == nullptr || Deck->Cases.Num() <= 0)
	{
		SelectedGuidancePreviewCaseIndex = INDEX_NONE;
		return false;
	}

	if (SelectedGuidancePreviewCaseIndex == INDEX_NONE)
	{
		SyncSelectedGuidancePreviewCase();
		return SelectedGuidancePreviewCaseIndex != INDEX_NONE;
	}

	SelectedGuidancePreviewCaseIndex =
		(SelectedGuidancePreviewCaseIndex + 1) % Deck->Cases.Num();
	UpdateDashboardPresentation();
	return true;
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::StartActiveGuidancePreviewDeckRun()
{
	const FHyperTwistTrainingDeck* Deck = GetActiveGuidancePreviewDeck();
	if (Deck == nullptr || !Deck->IsStructurallyValid())
	{
		UpdateDashboardPresentation();
		return FHyperTwistTrainingRunState();
	}

	const FString SessionSuffix =
		ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		? TEXT("_preview_recommended")
		: (ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? TEXT("_preview_follow_up")
			: TEXT("_preview"));
	const FString SessionId = DefaultSessionId + SessionSuffix;
	const FHyperTwistTrainingRunState RunState = StartTrainingRunFromDeck(
		*Deck,
		DefaultUserId,
		SessionId,
		DefaultMode
	);
	CaptureActiveGuidanceLaunchContext(
		RunState.Session.IsStructurallyValid() ? RunState.Session.TrainingSessionId : SessionId,
		*Deck,
		false,
		SelectedGuidancePreviewCaseIndex >= 0 && SelectedGuidancePreviewCaseIndex < Deck->Cases.Num()
			? Deck->Cases[SelectedGuidancePreviewCaseIndex].CaseId
			: FString()
	);
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
	return RunState;
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::StartSelectedGuidancePreviewCaseRun()
{
	const FHyperTwistTrainingDeck Deck = BuildSelectedGuidancePreviewCaseDeck();
	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	if (!Deck.IsStructurallyValid())
	{
		UpdateDashboardPresentation();
		return FHyperTwistTrainingRunState();
	}

	const FString SessionSuffix =
		ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		? TEXT("_preview_case_recommended")
		: (ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? TEXT("_preview_case_follow_up")
			: TEXT("_preview_case"));
	const FString SessionId = DefaultSessionId + SessionSuffix;
	const FHyperTwistTrainingRunState RunState = StartTrainingRunFromDeck(
		Deck,
		DefaultUserId,
		SessionId,
		DefaultMode
	);
	CaptureActiveGuidanceLaunchContext(
		RunState.Session.IsStructurallyValid() ? RunState.Session.TrainingSessionId : SessionId,
		ActivePreviewDeck != nullptr && ActivePreviewDeck->IsStructurallyValid() ? *ActivePreviewDeck : Deck,
		true,
		Deck.Cases.Num() > 0 ? Deck.Cases[0].CaseId : FString()
	);
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
	return RunState;
}

FHyperTwistTrainingRunState UHyperTwistCoachDashboardWidget::RestartRetainedRunRecapDeck()
{
	if (!RetainedRunRecapDeck.IsStructurallyValid())
	{
		UpdateDashboardPresentation();
		return FHyperTwistTrainingRunState();
	}

	const FString BaseSessionId = RetainedRunRecapSessionId.IsEmpty()
		? DefaultSessionId
		: RetainedRunRecapSessionId;
	const FString RestartSessionId = FString::Printf(
		TEXT("%s_repeat_%s"),
		*BaseSessionId,
		*FGuid::NewGuid().ToString(EGuidFormats::Digits)
	);
	const FString RestartUserId = RetainedRunRecapUserId.IsEmpty()
		? DefaultUserId
		: RetainedRunRecapUserId;

	const FHyperTwistTrainingRunState RunState = StartTrainingRunFromDeck(
		RetainedRunRecapDeck,
		RestartUserId,
		RestartSessionId,
		RetainedRunRecapMode
	);
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
	return RunState;
}

void UHyperTwistCoachDashboardWidget::ClearRetainedRunRecap()
{
	bHasRetainedRunRecap = false;
	RetainedRunRecapSummary = FHyperTwistTrainingSessionSummary();
	RetainedRunRecapDeck = FHyperTwistTrainingDeck();
	RetainedRunRecapUserId.Reset();
	RetainedRunRecapSessionId.Reset();
	RetainedRunRecapMode = EHyperTwistTrainingDeliveryMode::Timer;
	bHasRetainedTemplateLaunch = false;
	RetainedTemplateLaunchSessionId.Reset();
	RetainedTemplateLaunchProvenance = FHyperTwistTrainingTemplateLaunchProvenance();
	bHasRetainedGuidanceComparison = false;
	RetainedGuidanceComparisonSessionId.Reset();
	RetainedGuidanceComparisonLane = EHyperTwistCoachDashboardGuidancePreviewLane::None;
	bRetainedGuidanceComparisonSingleCase = false;
	RetainedGuidanceComparisonBrief = FHyperTwistCoachBrief();
	RetainedGuidanceComparisonDeck = FHyperTwistTrainingDeck();
	RetainedGuidanceComparisonSelectedCaseId.Reset();
	UpdateDashboardPresentation();
}

FHyperTwistTrainingRunStepResult UHyperTwistCoachDashboardWidget::SubmitSyntheticCurrentAttempt(
	const EHyperTwistTrainingAttemptResult Result,
	const int32 TimeMs
)
{
	if (!CachedRunState.Session.IsStructurallyValid() || !CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid())
	{
		return FHyperTwistTrainingRunStepResult();
	}

	FHyperTwistTrainingAttempt Attempt;
	Attempt.AttemptId = FString::Printf(
		TEXT("attempt_%s_%s"),
		*CachedRunState.Session.TrainingSessionId,
		*FGuid::NewGuid().ToString(EGuidFormats::Digits)
	);
	Attempt.TrainingSessionId = CachedRunState.Session.TrainingSessionId;
	Attempt.CaseId = CachedRunState.CurrentSelection.TrainingCase.CaseId;
	Attempt.Result = Result;
	Attempt.TotalTimeMs = FMath::Max(TimeMs, 0);
	Attempt.ExecutionTimeMs = FMath::Max(TimeMs, 0);
	Attempt.TimingBreakdown.RawSolveTimeMs = FMath::Max(TimeMs, 0);
	Attempt.TimingBreakdown.FinalTimeMs = FMath::Max(TimeMs, 0);
	Attempt.TimingBreakdown.bDidNotFinish =
		Result == EHyperTwistTrainingAttemptResult::Timeout
		|| Result == EHyperTwistTrainingAttemptResult::DNF
		|| Result == EHyperTwistTrainingAttemptResult::Aborted;
	if (Result == EHyperTwistTrainingAttemptResult::DNF)
	{
		Attempt.TimingBreakdown.ManualPenalty = EHyperTwistTrainingPenalty::DNF;
		Attempt.TimingBreakdown.AppliedPenalty = EHyperTwistTrainingPenalty::DNF;
	}
	Attempt.ReplayId = CachedRunState.ReplayPacket.ReplayId;
	Attempt.CompletedAtUtc = FDateTime::UtcNow().ToIso8601();

	const FHyperTwistTrainingRunStepResult StepResult = SubmitTrainingAttempt(Attempt, TimeMs);
	SyncRetainedRunRecap();
	SyncSelectedAttempt();
	return StepResult;
}

bool UHyperTwistCoachDashboardWidget::ContinueCurrentRunFlow()
{
	bool bSucceeded = false;
	if (HyperTwistCoachDashboardWidgetInternal::IsGeneratedModeLaunchDeck(CachedRunState))
	{
		FHyperTwistTrainingRunState RunState;
		FString BlockedReason;
		bSucceeded = TryExecuteActiveImportedGeneratedModeLaunchRequest(RunState, BlockedReason);
		if (bSucceeded)
		{
			LastStepResult = FHyperTwistTrainingRunStepResult();
		}

		RefreshTrainingState();
		SyncRetainedRunRecap();
		SyncSelectedQueueEntry();
		SyncSelectedAttempt();
		UpdateDashboardPresentation();
	}
	else if (CachedRunState.Session.IsStructurallyValid() && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid())
	{
		if (CachedRunState.Session.Mode == EHyperTwistTrainingDeliveryMode::RecognitionAssisted)
		{
			FString RecognitionOpenError;
			if (!OpenActiveRecognitionSession(RecognitionOpenError) || !CachedRecognitionSessionState.bSessionOpen)
			{
				RefreshTrainingState();
				SyncRetainedRunRecap();
				SyncSelectedQueueEntry();
				SyncSelectedAttempt();
				UpdateDashboardPresentation();
				return false;
			}
		}
		bSucceeded = StartLiveAttemptTimer();
	}
	else if (CachedCoachPanelState.bCanStartQueuedRun
		|| CachedCoachPanelState.bCanStartCoachFollowUpRun
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun)
	{
		const FHyperTwistTrainingRunState RunState = ExecutePrimaryCoachAction();
		bSucceeded = RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid();
	}
	if (!bSucceeded)
	{
		UpdateDashboardPresentation();
	}
	return bSucceeded;
}

bool UHyperTwistCoachDashboardWidget::ApplyGuidanceOutcomeAction()
{
	if (IsCoachLoopActionabilityClosed())
	{
		UpdateDashboardPresentation();
		return false;
	}

	const EHyperTwistCoachDashboardOutcomeAction BaseAction = DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting GuidanceDecisionWeighting =
		BuildGuidanceDecisionWeighting(BaseAction);
	const EHyperTwistCoachDashboardOutcomeAction Action =
		GuidanceDecisionWeighting.bHasOverride
			? GuidanceDecisionWeighting.WeightedAction
			: BaseAction;
	const bool bCanRestartAboveCompletedRun =
		!CachedRunState.Session.IsStructurallyValid()
		|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
		|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted;
	if (bHasLiveAttemptTimer || Action == EHyperTwistCoachDashboardOutcomeAction::None || !bCanRestartAboveCompletedRun)
	{
		UpdateDashboardPresentation();
		return false;
	}

	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	if (!ResolveDisplayedGuidanceComparisonContext(
		DisplayedRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase))
	{
		UpdateDashboardPresentation();
		return false;
	}

	const FString ActionSessionIdBase = FString::Printf(
		TEXT("%s_outcome_%s"),
		*DefaultSessionId,
		*FGuid::NewGuid().ToString(EGuidFormats::Digits)
	);

	switch (Action)
	{
	case EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase:
		{
			const FHyperTwistTrainingDeck SelectedCaseDeck = BuildGuidanceOutcomeSelectedCaseDeck();
			if (!SelectedCaseDeck.IsStructurallyValid() || DisplayedGuidanceComparisonDeck == nullptr)
			{
				UpdateDashboardPresentation();
				return false;
			}

			const FHyperTwistTrainingRunState RunState = StartTrainingRunFromDeck(
				SelectedCaseDeck,
				DefaultUserId,
				ActionSessionIdBase + TEXT("_selected_case"),
				DefaultMode
			);
			CaptureActiveGuidanceLaunchContext(
				RunState.Session.IsStructurallyValid() ? RunState.Session.TrainingSessionId : ActionSessionIdBase,
				*DisplayedGuidanceComparisonDeck,
				true,
				DisplayedGuidanceComparisonSelectedCaseId
			);
			if (RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid())
			{
				RecordGuidanceOutcomeDecision(
					Action,
					EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase,
					*DisplayedRunRecap,
					*DisplayedGuidanceComparisonBrief,
					*DisplayedGuidanceComparisonDeck,
					DisplayedGuidanceComparisonSelectedCaseId,
					bDisplayedGuidanceComparisonSingleCase,
					RunState.ActiveDeck.Cases.Num(),
					TEXT("selected-case guidance stayed tight")
				);
			}
			SyncRetainedRunRecap();
			SyncSelectedQueueEntry();
			SyncSelectedAttempt();
			UpdateDashboardPresentation();
			return RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid();
		}
	case EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck:
	case EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck:
		{
			if (DisplayedGuidanceComparisonDeck == nullptr || !DisplayedGuidanceComparisonDeck->IsStructurallyValid())
			{
				UpdateDashboardPresentation();
				return false;
			}

			const FString SessionSuffix = Action == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
				? TEXT("_broaden_preview")
				: TEXT("_repeat_preview");
			const FHyperTwistTrainingRunState RunState = StartTrainingRunFromDeck(
				*DisplayedGuidanceComparisonDeck,
				DefaultUserId,
				ActionSessionIdBase + SessionSuffix,
				DefaultMode
			);
			CaptureActiveGuidanceLaunchContext(
				RunState.Session.IsStructurallyValid() ? RunState.Session.TrainingSessionId : ActionSessionIdBase,
				*DisplayedGuidanceComparisonDeck,
				false,
				DisplayedGuidanceComparisonSelectedCaseId
			);
			if (RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid())
			{
				RecordGuidanceOutcomeDecision(
					Action,
					Action,
					*DisplayedRunRecap,
					*DisplayedGuidanceComparisonBrief,
					*DisplayedGuidanceComparisonDeck,
					DisplayedGuidanceComparisonSelectedCaseId,
					bDisplayedGuidanceComparisonSingleCase,
					RunState.ActiveDeck.Cases.Num(),
					Action == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
						? TEXT("guidance broadened back into the preview deck")
						: TEXT("preview-deck guidance kept the current scope steady")
				);
			}
			SyncRetainedRunRecap();
			SyncSelectedQueueEntry();
			SyncSelectedAttempt();
			UpdateDashboardPresentation();
			return RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid();
		}
	case EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance:
		{
			FHyperTwistTrainingRunState RunState;
			FString StartActionSourceLabel;
			if (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
			{
				StartActionSourceLabel = GuidanceDecisionWeighting.bUsedDeferredOverflowSignal
					? TEXT("dashboard-guidance-outcome-deferred-overflow-follow-up")
					: TEXT("dashboard-handoff-follow-up");
				RunState = StartCoachFollowUpRun(DefaultCoachMaxCases, StartActionSourceLabel);
			}
			else if (CachedCoachPanelState.bCanStartQueuedRun)
			{
				StartActionSourceLabel = GuidanceDecisionWeighting.bUsedDeferredOverflowSignal
					? TEXT("dashboard-guidance-outcome-deferred-overflow-queued")
					: TEXT("dashboard-handoff-queued");
				RunState = StartNextQueuedCoachRun(DefaultCoachMaxCases, StartActionSourceLabel);
			}
			else if (CachedCoachPanelState.bCanStartCoachRecommendedRun)
			{
				StartActionSourceLabel = GuidanceDecisionWeighting.bUsedDeferredOverflowSignal
					? TEXT("dashboard-guidance-outcome-deferred-overflow-recommended")
					: TEXT("dashboard-handoff-recommended");
				RunState = StartCoachRecommendedRun(DefaultCoachMaxCases, StartActionSourceLabel);
			}
			else
			{
				UpdateDashboardPresentation();
				return false;
			}

			if (RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid())
			{
				RecordGuidanceOutcomeDecision(
					Action,
					EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance,
					*DisplayedRunRecap,
					*DisplayedGuidanceComparisonBrief,
					*DisplayedGuidanceComparisonDeck,
					DisplayedGuidanceComparisonSelectedCaseId,
					bDisplayedGuidanceComparisonSingleCase,
					RunState.ActiveDeck.Cases.Num(),
					CachedCoachPanelState.LaunchBudgetReasonLine
				);
			}
			SyncRetainedRunRecap();
			SyncSelectedQueueEntry();
			SyncSelectedAttempt();
			UpdateDashboardPresentation();
			return RunState.Session.IsStructurallyValid() && RunState.ActiveDeck.IsStructurallyValid();
		}
	default:
		UpdateDashboardPresentation();
		return false;
	}
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousGuidanceDecisionHistoryEntry()
{
	if (GuidanceDecisionHistoryEntries.Num() <= 0)
	{
		SelectedGuidanceDecisionIndex = INDEX_NONE;
		return false;
	}

	if (SelectedGuidanceDecisionIndex == INDEX_NONE)
	{
		SyncSelectedGuidanceDecisionHistoryEntry();
		return SelectedGuidanceDecisionIndex != INDEX_NONE;
	}

	SelectedGuidanceDecisionIndex =
		(SelectedGuidanceDecisionIndex - 1 + GuidanceDecisionHistoryEntries.Num()) % GuidanceDecisionHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextGuidanceDecisionHistoryEntry()
{
	if (GuidanceDecisionHistoryEntries.Num() <= 0)
	{
		SelectedGuidanceDecisionIndex = INDEX_NONE;
		return false;
	}

	if (SelectedGuidanceDecisionIndex == INDEX_NONE)
	{
		SyncSelectedGuidanceDecisionHistoryEntry();
		return SelectedGuidanceDecisionIndex != INDEX_NONE;
	}

	SelectedGuidanceDecisionIndex =
		(SelectedGuidanceDecisionIndex + 1) % GuidanceDecisionHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousHandoffHistoryEntry()
{
	if (HandoffHistoryEntries.Num() <= 0)
	{
		SelectedHandoffHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedHandoffHistoryIndex == INDEX_NONE)
	{
		SyncSelectedHandoffHistoryEntry();
		return SelectedHandoffHistoryIndex != INDEX_NONE;
	}

	SelectedHandoffHistoryIndex =
		(SelectedHandoffHistoryIndex - 1 + HandoffHistoryEntries.Num()) % HandoffHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextHandoffHistoryEntry()
{
	if (HandoffHistoryEntries.Num() <= 0)
	{
		SelectedHandoffHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedHandoffHistoryIndex == INDEX_NONE)
	{
		SyncSelectedHandoffHistoryEntry();
		return SelectedHandoffHistoryIndex != INDEX_NONE;
	}

	SelectedHandoffHistoryIndex =
		(SelectedHandoffHistoryIndex + 1) % HandoffHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousTemplateLaunchHistoryEntry()
{
	if (TemplateLaunchHistoryEntries.Num() <= 0)
	{
		SelectedTemplateLaunchHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedTemplateLaunchHistoryIndex == INDEX_NONE)
	{
		SyncSelectedTemplateLaunchHistoryEntry();
		return SelectedTemplateLaunchHistoryIndex != INDEX_NONE;
	}

	SelectedTemplateLaunchHistoryIndex =
		(SelectedTemplateLaunchHistoryIndex - 1 + TemplateLaunchHistoryEntries.Num())
		% TemplateLaunchHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextTemplateLaunchHistoryEntry()
{
	if (TemplateLaunchHistoryEntries.Num() <= 0)
	{
		SelectedTemplateLaunchHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedTemplateLaunchHistoryIndex == INDEX_NONE)
	{
		SyncSelectedTemplateLaunchHistoryEntry();
		return SelectedTemplateLaunchHistoryIndex != INDEX_NONE;
	}

	SelectedTemplateLaunchHistoryIndex =
		(SelectedTemplateLaunchHistoryIndex + 1) % TemplateLaunchHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousQueueSuppressionHistoryEntry()
{
	if (QueueSuppressionHistoryEntries.Num() <= 0)
	{
		SelectedQueueSuppressionIndex = INDEX_NONE;
		return false;
	}

	if (SelectedQueueSuppressionIndex == INDEX_NONE)
	{
		SyncSelectedQueueSuppressionHistoryEntry();
		return SelectedQueueSuppressionIndex != INDEX_NONE;
	}

	SelectedQueueSuppressionIndex =
		(SelectedQueueSuppressionIndex - 1 + QueueSuppressionHistoryEntries.Num())
		% QueueSuppressionHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextQueueSuppressionHistoryEntry()
{
	if (QueueSuppressionHistoryEntries.Num() <= 0)
	{
		SelectedQueueSuppressionIndex = INDEX_NONE;
		return false;
	}

	if (SelectedQueueSuppressionIndex == INDEX_NONE)
	{
		SyncSelectedQueueSuppressionHistoryEntry();
		return SelectedQueueSuppressionIndex != INDEX_NONE;
	}

	SelectedQueueSuppressionIndex =
		(SelectedQueueSuppressionIndex + 1) % QueueSuppressionHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousClosureRecoveryHistoryEntry()
{
	if (ClosureRecoveryHistoryEntries.Num() <= 0)
	{
		SelectedClosureRecoveryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedClosureRecoveryIndex == INDEX_NONE)
	{
		SyncSelectedClosureRecoveryHistoryEntry();
		return SelectedClosureRecoveryIndex != INDEX_NONE;
	}

	SelectedClosureRecoveryIndex =
		(SelectedClosureRecoveryIndex - 1 + ClosureRecoveryHistoryEntries.Num())
		% ClosureRecoveryHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextClosureRecoveryHistoryEntry()
{
	if (ClosureRecoveryHistoryEntries.Num() <= 0)
	{
		SelectedClosureRecoveryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedClosureRecoveryIndex == INDEX_NONE)
	{
		SyncSelectedClosureRecoveryHistoryEntry();
		return SelectedClosureRecoveryIndex != INDEX_NONE;
	}

	SelectedClosureRecoveryIndex =
		(SelectedClosureRecoveryIndex + 1) % ClosureRecoveryHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

FHyperTwistTrainingCoachDashboardQueueRecoveryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueRecoveryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueRecoveryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Queue recovery status");

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bQueueRecoveryFollowUp =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp;
	const bool bQueueRecoveryRecommended =
		CachedCoachPanelState.PreferredGuidanceLane
		== EHyperTwistTrainingCoachGuidanceLane::Recommended;
	const FString QueueRecoveryLaneLabel =
		bQueueRecoveryFollowUp
			? TEXT("follow-up")
			: (bQueueRecoveryRecommended ? TEXT("recommended") : TEXT("none"));
	const FString QueueRecoverySourceDescription =
		CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const FString QueueRecoveryUpstreamActionLabel =
		CachedCoachPanelState.PreferredQueueRecoveryAction
			== EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred
			? TEXT("prefer promote-deferred recovery")
			: (CachedCoachPanelState.PreferredQueueRecoveryAction
					== EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery
				? TEXT("prefer launch-recovery")
				: TEXT("no upstream preference"));
	const FHyperTwistCoachDashboardQueueRecoveryWeighting QueueRecoveryWeighting =
		BuildQueueRecoveryWeighting();
	const FString QueueRecoveryWeightingLabel =
		QueueRecoveryWeighting.PreferredActionKind
			== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred
			? TEXT("prefer promote-deferred recovery")
			: (QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT("prefer launch-recovery")
				: TEXT("no learned preference"));
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		QueueRecoveryMethodDrillMemoryBias =
			HyperTwistCoachDashboardWidgetInternal::ResolveMethodDrillRecoveryMemoryBias(
				QueueRecoveryWeighting.MethodDrillUpstreamHistoryCount,
				QueueRecoveryWeighting.MethodDrillUpstreamStrongCount,
				QueueRecoveryWeighting.MethodDrillUpstreamWeakCount,
				QueueRecoveryWeighting.MethodDrillUpstreamAverageOutcomeScore);
	const FHyperTwistCoachSignal* QueueDeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"));
	const bool bHasDeferredFirstQueueSuppressionSignal =
		QueueDeferredFirstSuppressionSignal != nullptr;
	const bool bCanLaunchQueueRecovery =
		CachedCoachPanelState.bCanStartQueuedRun
		|| (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const bool bPreferLaunchRecoveryAction =
		!FindFirstDeferredQueueEntryId().IsEmpty()
		&& bCanLaunchQueueRecovery
		&& !(bHasDeferredFirstQueueSuppressionSignal && bQueueRecoveryFollowUp)
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid()
				&& CachedCoachPanelState.PreferredQueueRecoveryAction
					== EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery));
	const bool bHasQueueRecoveryFriction =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals
		|| CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals
		|| CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview
		|| CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork
		|| CachedCoachQueueExecutionSummary.bHasCompletionGap;
	const bool bHasClosedLoopIdleCoachActionability = IsCoachLoopActionabilityClosed();
	const bool bShouldPresentClosedLoopIdleDashboard =
		bHasClosedLoopIdleCoachActionability
		&& (bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind
				!= EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedQueueRecoveryStatusLine.IsEmpty()
		? DisplayedQueueRecoveryStatusLine
		: TEXT("Recovery: not yet displayed.");
	Surface.RecoveryLaneLabel = QueueRecoveryLaneLabel;
	Surface.RecoverySourceDescription = QueueRecoverySourceDescription;
	Surface.CurrentActionLabel = CachedCoachPanelState.PrimaryActionLabel.IsEmpty()
		? TEXT("n/a")
		: CachedCoachPanelState.PrimaryActionLabel;
	Surface.SuggestedModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedCoachPanelState.SuggestedMode);
	Surface.SuggestedSelectionPolicyLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			CachedCoachPanelState.SuggestedSelectionPolicy);
	Surface.UpstreamActionLabel = QueueRecoveryUpstreamActionLabel;
	Surface.LearnedPreferenceLabel = QueueRecoveryWeightingLabel;
	Surface.RetainedRecoveryStanceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
			QueueRecoveryMethodDrillMemoryBias);
	Surface.PreferredRecoveryAction = CachedCoachPanelState.PreferredQueueRecoveryAction;
	Surface.bQueueRecoveryMemorySource = bQueueRecoveryMemorySource;
	Surface.bFollowUpLane = bQueueRecoveryFollowUp;
	Surface.bRecommendedLane = bQueueRecoveryRecommended;
	Surface.bHasDeferredFirstSuppressionSignal = bHasDeferredFirstQueueSuppressionSignal;
	Surface.bHasQueueRecoveryFriction = bHasQueueRecoveryFriction;
	Surface.bCanLaunchQueueRecovery = bCanLaunchQueueRecovery;
	Surface.bPreferLaunchRecoveryAction = bPreferLaunchRecoveryAction;
	Surface.bHasMethodDrillMemorySignal = QueueRecoveryWeighting.bHasMethodDrillMemorySignal;
	Surface.bHasClosedLoopIdleCoachActionability = bHasClosedLoopIdleCoachActionability;
	Surface.bShouldPresentClosedLoopIdleDashboard = bShouldPresentClosedLoopIdleDashboard;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryOutcomeHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery outcome history band");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryStatusInspectSurface StatusSurface =
		GetDisplayedMethodDrillRecoveryOutcomeHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryDetailInspectSurface DetailSurface =
		GetDisplayedMethodDrillRecoveryOutcomeHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface();

	Surface.HistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill recovery outcome history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.HistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill recovery outcome history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.HistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill recovery outcome history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.HistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill recovery outcome history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.SelectedEntryOrdinal = StatusSurface.SelectedEntryOrdinal.IsEmpty()
		? (NavigationSurface.SelectedEntryOrdinal.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedEntryOrdinal)
		: StatusSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = StatusSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : StatusSurface.RecordedAtUtc;
	Surface.AppliedActionLabel = !StatusSurface.AppliedActionLabel.IsEmpty()
		? StatusSurface.AppliedActionLabel
		: (NavigationSurface.AppliedActionLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.AppliedActionLabel);
	Surface.VerdictLine = !StatusSurface.VerdictLine.IsEmpty()
		? StatusSurface.VerdictLine
		: (NavigationSurface.VerdictLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.VerdictLine);
	Surface.SourceDescription = !StatusSurface.SourceDescription.IsEmpty()
		? StatusSurface.SourceDescription
		: (NavigationSurface.SourceDescription.IsEmpty() ? TEXT("n/a") : NavigationSurface.SourceDescription);
	Surface.PacketStructureRecoveryLine = StatusSurface.PacketStructureRecoveryLine.IsEmpty()
		? TEXT("none")
		: StatusSurface.PacketStructureRecoveryLine;
	Surface.RetainedPostureLine = StatusSurface.RetainedPostureLine.IsEmpty()
		? TEXT("n/a")
		: StatusSurface.RetainedPostureLine;
	Surface.ReliablePlanRecoveryLine = StatusSurface.ReliablePlanRecoveryLine.IsEmpty()
		? TEXT("none")
		: StatusSurface.ReliablePlanRecoveryLine;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Drill Recovery") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Drill Recovery") : NavigationSurface.NextLabel;
	Surface.SelectedHistoryIndex = StatusSurface.SelectedHistoryIndex;
	Surface.HistoryEntryCount = StatusSurface.HistoryEntryCount;
	Surface.BeforePressureScore = DetailSurface.BeforePressureScore;
	Surface.AfterPressureScore = DetailSurface.AfterPressureScore;
	Surface.BeforeDeferredEventCount = DetailSurface.BeforeDeferredEventCount;
	Surface.AfterDeferredEventCount = DetailSurface.AfterDeferredEventCount;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bSucceeded = DetailSurface.bSucceeded;
	Surface.bReducedFriction = DetailSurface.bReducedFriction;
	Surface.bShiftedFriction = DetailSurface.bShiftedFriction;
	Surface.bUsedDeferredFirstSuppressionSignal = DetailSurface.bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillHandoffSignal = DetailSurface.bUsedMethodDrillHandoffSignal;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill-recovery-outcome band: selected %s | action %s | verdict %s | navigation %s/%s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.AppliedActionLabel,
		*Surface.VerdictLine,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | source %s | packet recovery %s | retained posture %s | reliable plan %s | before/after pressure %.2f/%.2f | before/after deferred %d/%d | latest %s"),
		*Surface.HistoryStatusLine,
		*Surface.HistoryDetailLine,
		*Surface.HistoryNavigationStatusLine,
		*Surface.HistoryNavigationDetailLine,
		*Surface.SourceDescription,
		*Surface.PacketStructureRecoveryLine,
		*Surface.RetainedPostureLine,
		*Surface.ReliablePlanRecoveryLine,
		Surface.BeforePressureScore,
		Surface.AfterPressureScore,
		Surface.BeforeDeferredEventCount,
		Surface.AfterDeferredEventCount,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceDecisionHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Decision-history band");

	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryStatusInspectSurface StatusSurface =
		GetDisplayedGuidanceDecisionHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryDetailInspectSurface DetailSurface =
		GetDisplayedGuidanceDecisionHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedGuidanceDecisionHistoryNavigationInspectSurface();

	Surface.GuidanceDecisionHistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Decision history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.GuidanceDecisionHistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Decision history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.GuidanceDecisionHistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Decision history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.GuidanceDecisionHistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Decision history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.WeightingStatusLine = !StatusSurface.WeightingStatusLine.IsEmpty()
		? StatusSurface.WeightingStatusLine
		: (NavigationSurface.WeightingStatusLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.WeightingStatusLine);
	Surface.WeightingDetailLine = DetailSurface.WeightingDetailLine.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.WeightingDetailLine;
	Surface.SelectedEntryOrdinal = StatusSurface.SelectedEntryOrdinal.IsEmpty()
		? (NavigationSurface.SelectedEntryOrdinal.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedEntryOrdinal)
		: StatusSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = StatusSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : StatusSurface.RecordedAtUtc;
	Surface.GuidanceLaneLabel = !StatusSurface.GuidanceLaneLabel.IsEmpty()
		? StatusSurface.GuidanceLaneLabel
		: (NavigationSurface.GuidanceLaneLabel.IsEmpty() ? TEXT("none") : NavigationSurface.GuidanceLaneLabel);
	Surface.ScopeLabel = !StatusSurface.ScopeLabel.IsEmpty()
		? StatusSurface.ScopeLabel
		: (NavigationSurface.ScopeLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.ScopeLabel);
	Surface.BriefHeadline = DetailSurface.BriefHeadline.IsEmpty() ? TEXT("n/a") : DetailSurface.BriefHeadline;
	Surface.RecommendedActionLabel = !StatusSurface.RecommendedActionLabel.IsEmpty()
		? StatusSurface.RecommendedActionLabel
		: (NavigationSurface.RecommendedActionLabel.IsEmpty() ? TEXT("none") : NavigationSurface.RecommendedActionLabel);
	Surface.AppliedActionLabel = !StatusSurface.AppliedActionLabel.IsEmpty()
		? StatusSurface.AppliedActionLabel
		: (NavigationSurface.AppliedActionLabel.IsEmpty() ? TEXT("none") : NavigationSurface.AppliedActionLabel);
	Surface.SelectedCaseId = DetailSurface.SelectedCaseId.IsEmpty() ? TEXT("n/a") : DetailSurface.SelectedCaseId;
	Surface.LaunchBudgetReasonLine = DetailSurface.LaunchBudgetReasonLine.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.LaunchBudgetReasonLine;
	Surface.BaseActionLabel = DetailSurface.BaseActionLabel.IsEmpty() ? TEXT("none") : DetailSurface.BaseActionLabel;
	Surface.WeightedActionLabel = DetailSurface.WeightedActionLabel.IsEmpty() ? TEXT("none") : DetailSurface.WeightedActionLabel;
	Surface.LastAppliedActionLabel = !StatusSurface.LastAppliedActionLabel.IsEmpty()
		? StatusSurface.LastAppliedActionLabel
		: (NavigationSurface.LastAppliedActionLabel.IsEmpty() ? TEXT("none") : NavigationSurface.LastAppliedActionLabel);
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Decision") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Decision") : NavigationSurface.NextLabel;
	Surface.SelectedEntryIndex = StatusSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = StatusSurface.HistoryEntryCount;
	Surface.MatchingDecisionCount = StatusSurface.MatchingDecisionCount;
	Surface.RepeatSelectedCaseCount = DetailSurface.RepeatSelectedCaseCount;
	Surface.RepeatPreviewDeckCount = DetailSurface.RepeatPreviewDeckCount;
	Surface.BroadenPreviewDeckCount = DetailSurface.BroadenPreviewDeckCount;
	Surface.RedirectCoachGuidanceCount = DetailSurface.RedirectCoachGuidanceCount;
	Surface.CompletedAttemptCount = DetailSurface.CompletedAttemptCount;
	Surface.TotalMistakes = DetailSurface.TotalMistakes;
	Surface.LaunchedCaseCount = DetailSurface.LaunchedCaseCount;
	Surface.ReferenceCaseCount = DetailSurface.ReferenceCaseCount;
	Surface.SuccessRate = DetailSurface.SuccessRate;
	Surface.AverageSuccessRate = DetailSurface.AverageSuccessRate;
	Surface.AverageLaunchCaseCount = DetailSurface.AverageLaunchCaseCount;
	Surface.BroadenedLaunchAverageSuccessRate = DetailSurface.BroadenedLaunchAverageSuccessRate;
	Surface.TightenedLaunchAverageSuccessRate = DetailSurface.TightenedLaunchAverageSuccessRate;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bHasWeighting = StatusSurface.bHasWeighting || DetailSurface.bHasWeighting || NavigationSurface.bHasWeighting;
	Surface.bClosedLoopIdleActionability = StatusSurface.bClosedLoopIdleActionability || DetailSurface.bClosedLoopIdleActionability || NavigationSurface.bClosedLoopIdleActionability;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bSingleCaseScope = DetailSurface.bSingleCaseScope;
	Surface.bBroadenedLaunchScope = DetailSurface.bBroadenedLaunchScope;
	Surface.bTightenedLaunchScope = DetailSurface.bTightenedLaunchScope;
	Surface.bHasWeightingOverride = DetailSurface.bHasWeightingOverride;
	Surface.bUsedClosureHistorySignal = DetailSurface.bUsedClosureHistorySignal;
	Surface.bUsedDeferredOverflowSignal = DetailSurface.bUsedDeferredOverflowSignal;
	Surface.bUsedReliableAlignedPlanOutcomeSignal = DetailSurface.bUsedReliableAlignedPlanOutcomeSignal;
	Surface.StatusLine = FString::Printf(
		TEXT("Decision-history band: selected %s | lane %s | scope %s | weighting %s | navigation %s/%s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.GuidanceLaneLabel,
		*Surface.ScopeLabel,
		Surface.bHasWeighting ? TEXT("yes") : TEXT("no"),
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | recommended %s | applied %s | base %s | weighted %s | case %s | recorded %s | latest %s"),
		*Surface.GuidanceDecisionHistoryStatusLine,
		*Surface.GuidanceDecisionHistoryDetailLine,
		*Surface.GuidanceDecisionHistoryNavigationStatusLine,
		*Surface.GuidanceDecisionHistoryNavigationDetailLine,
		*Surface.RecommendedActionLabel,
		*Surface.AppliedActionLabel,
		*Surface.BaseActionLabel,
		*Surface.WeightedActionLabel,
		*Surface.SelectedCaseId,
		*Surface.RecordedAtUtc,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryMemoryHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery memory history band");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryStatusInspectSurface StatusSurface =
		GetDisplayedMethodDrillRecoveryMemoryHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryDetailInspectSurface DetailSurface =
		GetDisplayedMethodDrillRecoveryMemoryHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillRecoveryMemoryHistoryNavigationInspectSurface();

	Surface.HistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill recovery memory history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.HistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill recovery memory history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.HistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill recovery memory history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.HistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill recovery memory history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.SelectedEntryOrdinal = StatusSurface.SelectedEntryOrdinal.IsEmpty()
		? (NavigationSurface.SelectedEntryOrdinal.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedEntryOrdinal)
		: StatusSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = StatusSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : StatusSurface.RecordedAtUtc;
	Surface.PreferredRecoveryActionLabel = !StatusSurface.PreferredRecoveryActionLabel.IsEmpty()
		? StatusSurface.PreferredRecoveryActionLabel
		: (NavigationSurface.PreferredRecoveryActionLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.PreferredRecoveryActionLabel);
	Surface.PreferredRecoveryActionSourceDescription =
		!StatusSurface.PreferredRecoveryActionSourceDescription.IsEmpty()
			? StatusSurface.PreferredRecoveryActionSourceDescription
			: (NavigationSurface.PreferredRecoveryActionSourceDescription.IsEmpty()
				? TEXT("n/a")
				: NavigationSurface.PreferredRecoveryActionSourceDescription);
	Surface.RecommendedHandoffKindLabel = !StatusSurface.RecommendedHandoffKindLabel.IsEmpty()
		? StatusSurface.RecommendedHandoffKindLabel
		: (NavigationSurface.RecommendedHandoffKindLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.RecommendedHandoffKindLabel);
	Surface.DominantBiasLine = !StatusSurface.DominantBiasLine.IsEmpty()
		? StatusSurface.DominantBiasLine
		: (NavigationSurface.DominantBiasLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.DominantBiasLine);
	Surface.GeneratedGuidancePacketKindLabel = !StatusSurface.GeneratedGuidancePacketKindLabel.IsEmpty()
		? StatusSurface.GeneratedGuidancePacketKindLabel
		: (NavigationSurface.GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.GeneratedGuidancePacketKindLabel);
	Surface.GeneratedPlanPostureLabel = !StatusSurface.GeneratedPlanPostureLabel.IsEmpty()
		? StatusSurface.GeneratedPlanPostureLabel
		: (NavigationSurface.GeneratedPlanPostureLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.GeneratedPlanPostureLabel);
	Surface.PlanSourceLine = DetailSurface.PlanSourceLine.IsEmpty() ? TEXT("none") : DetailSurface.PlanSourceLine;
	Surface.PlanAlignmentLine = DetailSurface.PlanAlignmentLine.IsEmpty() ? TEXT("n/a") : DetailSurface.PlanAlignmentLine;
	Surface.ComparisonPreferenceLine = DetailSurface.ComparisonPreferenceLine.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.ComparisonPreferenceLine;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Drill Memory") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Drill Memory") : NavigationSurface.NextLabel;
	Surface.SelectedEntryIndex = StatusSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = StatusSurface.HistoryEntryCount;
	Surface.GeneratedGuidancePacketFocusCaseCount = DetailSurface.GeneratedGuidancePacketFocusCaseCount;
	Surface.MethodDrillRecoveryHistoryCount = DetailSurface.MethodDrillRecoveryHistoryCount;
	Surface.MethodDrillRecoveryAverageOutcomeScore = DetailSurface.MethodDrillRecoveryAverageOutcomeScore;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bStrongPressureDominant = DetailSurface.bStrongPressureDominant;
	Surface.bWeakPressureDominant = DetailSurface.bWeakPressureDominant;
	Surface.bUsedMethodDrillRecoveryMemoryForRecovery = DetailSurface.bUsedMethodDrillRecoveryMemoryForRecovery;
	Surface.bUsedMethodDrillRecoveryMemoryForHandoff = DetailSurface.bUsedMethodDrillRecoveryMemoryForHandoff;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill-recovery-memory band: selected %s | recovery %s | handoff %s | packet %s | navigation %s/%s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.RecommendedHandoffKindLabel,
		*Surface.GeneratedGuidancePacketKindLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | bias %s | plan source %s | plan align %s | comparison %s | focus cases %d | recovery history %d avg %.1f | latest %s"),
		*Surface.HistoryStatusLine,
		*Surface.HistoryDetailLine,
		*Surface.HistoryNavigationStatusLine,
		*Surface.HistoryNavigationDetailLine,
		*Surface.DominantBiasLine,
		*Surface.PlanSourceLine,
		*Surface.PlanAlignmentLine,
		*Surface.ComparisonPreferenceLine,
		Surface.GeneratedGuidancePacketFocusCaseCount,
		Surface.MethodDrillRecoveryHistoryCount,
		Surface.MethodDrillRecoveryAverageOutcomeScore,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueRecoveryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueRecoveryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueRecoveryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Queue recovery detail");

	const bool bHasPrimaryQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedPrimaryQueueCreation
		&& !CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason.IsEmpty();
	const bool bHasFollowUpQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedFollowUpQueueCreation
		&& !CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason.IsEmpty();
	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bHasClosedLoopIdleCoachActionability = IsCoachLoopActionabilityClosed();
	const bool bShouldPresentClosedLoopIdleDashboard =
		bHasClosedLoopIdleCoachActionability
		&& (bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind
				!= EHyperTwistTrainingCoachHandoffKind::None);
	const FString QueueRecoveryActionSourceDescription =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel);

	Surface.DetailLine = !DisplayedQueueRecoveryDetailLine.IsEmpty()
		? DisplayedQueueRecoveryDetailLine
		: TEXT("Recovery detail: not yet displayed.");
	Surface.SuppressionLine = !DisplayedQueueSuppressionDetailLine.IsEmpty()
		? DisplayedQueueSuppressionDetailLine
		: TEXT("Suppression: none");
	Surface.CombinedLine = FString::Printf(
		TEXT("%s || %s"),
		*Surface.DetailLine,
		*Surface.SuppressionLine);
	Surface.DominantDeferralReasonLabel =
		CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel;
	Surface.RecoveryActionSourceDescription = QueueRecoveryActionSourceDescription;
	Surface.ReschedulePressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	Surface.DeferredEventCount = CachedCoachQueueExecutionSummary.DeferredEventCount;
	Surface.PromotedEventCount = CachedCoachQueueExecutionSummary.PromotedEventCount;
	Surface.ManualRescheduleEventCount =
		CachedCoachQueueExecutionSummary.ManualRescheduleEventCount;
	Surface.bHasPrimaryQueueSuppression = bHasPrimaryQueueSuppression;
	Surface.bHasFollowUpQueueSuppression = bHasFollowUpQueueSuppression;
	Surface.bHasBlockedFollowUpDeferrals =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	Surface.bHasArchiveAwareDeferrals =
		CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals;
	Surface.bNeedsManualRescheduleReview =
		CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview;
	Surface.bHasOutstandingDeferredWork =
		CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork;
	Surface.bHasCompletionGap = CachedCoachQueueExecutionSummary.bHasCompletionGap;
	Surface.bShouldPresentClosedLoopIdleDashboard = bShouldPresentClosedLoopIdleDashboard;
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSuppressionSummaryInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueSuppressionSummaryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSuppressionSummaryInspectSurface Surface;
	Surface.Headline = TEXT("Queue suppression summary");

	const bool bHasPrimaryQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedPrimaryQueueCreation
		&& !CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason.IsEmpty();
	const bool bHasFollowUpQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedFollowUpQueueCreation
		&& !CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason.IsEmpty();

	Surface.StatusLine = !DisplayedQueueSuppressionDetailLine.IsEmpty()
		? DisplayedQueueSuppressionDetailLine
		: TEXT("Suppression: no recovery-driven queue entries are currently being omitted");
	Surface.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Surface.GuidanceLaneLabel = HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
		Surface.PreferredGuidanceLane);
	Surface.PreferredRecoveryAction = CachedCoachPanelState.PreferredQueueRecoveryAction;
	Surface.PreferredRecoveryActionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			Surface.PreferredRecoveryAction);
	Surface.DominantDeferralReasonLabel =
		CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel;
	Surface.PrimarySuppressionReason = bHasPrimaryQueueSuppression
		? CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason
		: TEXT("not suppressed");
	Surface.FollowUpSuppressionReason = bHasFollowUpQueueSuppression
		? CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason
		: TEXT("not suppressed");
	Surface.TotalQueueEntryCount = CachedCoachSessionQueueState.TotalEntryCount;
	Surface.ReadyQueueEntryCount = CachedCoachSessionQueueState.ReadyEntryCount;
	Surface.DeferredQueueEntryCount = CachedCoachSessionQueueState.DeferredEntryCount;
	Surface.ReschedulePressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	Surface.bHasPrimaryQueueSuppression = bHasPrimaryQueueSuppression;
	Surface.bHasFollowUpQueueSuppression = bHasFollowUpQueueSuppression;
	Surface.bHasAnyQueueSuppression =
		bHasPrimaryQueueSuppression || bHasFollowUpQueueSuppression;
	Surface.bHasBlockedFollowUpDeferrals =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	Surface.bHasArchiveAwareDeferrals =
		CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals;
	Surface.bNeedsManualRescheduleReview =
		CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview;
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSuppressionDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueSuppressionDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSuppressionDetailInspectSurface Surface;
	Surface.Headline = TEXT("Queue suppression detail");

	const bool bHasPrimaryQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedPrimaryQueueCreation
		&& !CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason.IsEmpty();
	const bool bHasFollowUpQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedFollowUpQueueCreation
		&& !CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason.IsEmpty();
	const FString SuppressionLine = !DisplayedQueueSuppressionDetailLine.IsEmpty()
		? DisplayedQueueSuppressionDetailLine
		: TEXT("Suppression: no recovery-driven queue entries are currently being omitted");

	Surface.QueueId = CachedCoachSchedulePolicySummary.QueueId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.QueueId;
	Surface.NextDeferredEntryId = CachedCoachSchedulePolicySummary.NextDeferredEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachSchedulePolicySummary.NextDeferredEntryId;
	Surface.NextManualRescheduleEntryId =
		CachedCoachSchedulePolicySummary.NextManualRescheduleEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachSchedulePolicySummary.NextManualRescheduleEntryId;
	Surface.EarliestDeferredUntilUtc =
		CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc;
	Surface.DominantDeferralReasonLabel =
		CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel;
	Surface.PrimarySuppressionReason = bHasPrimaryQueueSuppression
		? CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason
		: TEXT("not suppressed");
	Surface.FollowUpSuppressionReason = bHasFollowUpQueueSuppression
		? CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason
		: TEXT("not suppressed");
	Surface.ManualRescheduleEntryCount =
		CachedCoachSchedulePolicySummary.ManualRescheduleEntryCount;
	Surface.ArchiveAwareDeferredEntryCount =
		CachedCoachSchedulePolicySummary.ArchiveAwareDeferredEntryCount;
	Surface.BlockedFollowUpDeferredEntryCount =
		CachedCoachSchedulePolicySummary.BlockedFollowUpDeferredEntryCount;
	Surface.DeferredEventCount = CachedCoachQueueExecutionSummary.DeferredEventCount;
	Surface.PromotedEventCount = CachedCoachQueueExecutionSummary.PromotedEventCount;
	Surface.ManualRescheduleEventCount =
		CachedCoachQueueExecutionSummary.ManualRescheduleEventCount;
	Surface.ReschedulePressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	Surface.bHasPrimaryQueueSuppression = bHasPrimaryQueueSuppression;
	Surface.bHasFollowUpQueueSuppression = bHasFollowUpQueueSuppression;
	Surface.bHasOutstandingDeferredWork =
		CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork;
	Surface.bHasCompletionGap = CachedCoachQueueExecutionSummary.bHasCompletionGap;
	Surface.bHasArchiveAwareDeferrals =
		CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals;
	Surface.bHasBlockedFollowUpDeferrals =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	Surface.bNeedsManualRescheduleReview =
		CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview;
	Surface.DetailLine = FString::Printf(
		TEXT("%s | Dominant reason: %s | Queue: %s | Next deferred: %s | Next manual: %s | Earliest deferred: %s | Deferred events %d | Promoted %d | Manual reschedules %d | Manual reschedule entries %d | Archive-aware deferred %d | Blocked follow-up deferred %d | Pressure %.2f | Outstanding deferred %s | Completion gap %s"),
		*SuppressionLine,
		*Surface.DominantDeferralReasonLabel,
		*Surface.QueueId,
		*Surface.NextDeferredEntryId,
		*Surface.NextManualRescheduleEntryId,
		*Surface.EarliestDeferredUntilUtc,
		Surface.DeferredEventCount,
		Surface.PromotedEventCount,
		Surface.ManualRescheduleEventCount,
		Surface.ManualRescheduleEntryCount,
		Surface.ArchiveAwareDeferredEntryCount,
		Surface.BlockedFollowUpDeferredEntryCount,
		Surface.ReschedulePressureScore,
		Surface.bHasOutstandingDeferredWork ? TEXT("yes") : TEXT("no"),
		Surface.bHasCompletionGap ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueRecoveryOutcomeInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueRecoveryOutcomeInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueRecoveryOutcomeInspectSurface Surface;
	Surface.Headline = TEXT("Queue recovery outcome");
	Surface.RetainedOutcomeHistoryCount = QueueRecoveryOutcomeHistory.Num();
	Surface.bHasOutcome = bHasQueueRecoveryOutcome && QueueRecoveryOutcome.IsStructurallyValid();
	if (!Surface.bHasOutcome)
	{
		Surface.StatusLine = TEXT("Outcome: no queue-recovery action has been applied yet.");
		Surface.DetailLine =
			TEXT("Outcome detail: apply a queue-recovery action to compare before/after pressure, deferred count, blocked follow-up state, and completion-gap state.");
		return Surface;
	}

	Surface.RecordedAtUtc = QueueRecoveryOutcome.RecordedAtUtc;
	Surface.SourceLabel = QueueRecoveryOutcome.SourceLabel;
	Surface.SourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			QueueRecoveryOutcome.SourceLabel);
	Surface.AppliedActionLabel = QueueRecoveryOutcome.AppliedActionLabel;
	Surface.AppliedAction =
		HyperTwistCoachDashboardWidgetInternal::ToQueueRecoveryAction(
			QueueRecoveryOutcome.ActionKind);
	Surface.BeforePressureScore = QueueRecoveryOutcome.BeforePressureScore;
	Surface.AfterPressureScore = QueueRecoveryOutcome.AfterPressureScore;
	Surface.BeforeDeferredEventCount = QueueRecoveryOutcome.BeforeDeferredEventCount;
	Surface.AfterDeferredEventCount = QueueRecoveryOutcome.AfterDeferredEventCount;
	Surface.bSucceeded = QueueRecoveryOutcome.bSucceeded;
	Surface.bReducedFriction = QueueRecoveryOutcome.bReducedFriction;
	Surface.bShiftedFriction = QueueRecoveryOutcome.bShiftedFriction;
	Surface.bBeforeBlockedFollowUp = QueueRecoveryOutcome.bBeforeBlockedFollowUp;
	Surface.bAfterBlockedFollowUp = QueueRecoveryOutcome.bAfterBlockedFollowUp;
	Surface.bBeforeOutstandingDeferred = QueueRecoveryOutcome.bBeforeOutstandingDeferred;
	Surface.bAfterOutstandingDeferred = QueueRecoveryOutcome.bAfterOutstandingDeferred;
	Surface.bBeforeCompletionGap = QueueRecoveryOutcome.bBeforeCompletionGap;
	Surface.bAfterCompletionGap = QueueRecoveryOutcome.bAfterCompletionGap;
	Surface.bUsedDeferredFirstSuppressionSignal =
		QueueRecoveryOutcome.bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillHandoffSignal = QueueRecoveryOutcome.bUsedMethodDrillHandoffSignal;
	Surface.bUsedNarrowMethodDrillPacketStructureRecovery =
		QueueRecoveryOutcome.bUsedNarrowMethodDrillPacketStructureRecovery;
	Surface.bUsedBroadMethodDrillPacketStructureRecovery =
		QueueRecoveryOutcome.bUsedBroadMethodDrillPacketStructureRecovery;
	Surface.bUsedStrongRetainedMethodDrillRecoveryPosture =
		QueueRecoveryOutcome.bUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bUsedWeakRetainedMethodDrillRecoveryPosture =
		QueueRecoveryOutcome.bUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bUsedReliableTrustedTightStructurePlanRecovery =
		QueueRecoveryOutcome.bUsedReliableTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableTrustedBroadStructurePlanRecovery =
		QueueRecoveryOutcome.bUsedReliableTrustedBroadStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedTightStructurePlanRecovery =
		QueueRecoveryOutcome.bUsedReliableAlignedTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedBroadStructurePlanRecovery =
		QueueRecoveryOutcome.bUsedReliableAlignedTrustedBroadStructurePlanRecovery;
	Surface.PacketStructureRecoveryLine =
		QueueRecoveryOutcome.bUsedNarrowMethodDrillPacketStructureRecovery
			? TEXT("narrow continuation")
			: (QueueRecoveryOutcome.bUsedBroadMethodDrillPacketStructureRecovery
				? TEXT("broad redirect")
				: TEXT("none"));
	Surface.RetainedPostureLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
			QueueRecoveryOutcome.bUsedStrongRetainedMethodDrillRecoveryPosture,
			QueueRecoveryOutcome.bUsedWeakRetainedMethodDrillRecoveryPosture);
	Surface.ReliablePlanRecoveryLine =
		QueueRecoveryOutcome.bUsedReliableAlignedTrustedTightStructurePlanRecovery
			? TEXT("aligned reliable tight continuation")
			: (QueueRecoveryOutcome.bUsedReliableAlignedTrustedBroadStructurePlanRecovery
				? TEXT("aligned reliable broad redirect")
				: (QueueRecoveryOutcome.bUsedReliableTrustedTightStructurePlanRecovery
					? TEXT("trusted tight continuation")
					: (QueueRecoveryOutcome.bUsedReliableTrustedBroadStructurePlanRecovery
						? TEXT("trusted broad redirect")
						: TEXT("none"))));
	Surface.StatusLine = !QueueRecoveryOutcome.bSucceeded
		? FString::Printf(
			TEXT("Outcome: %s failed | Source: %s"),
			*QueueRecoveryOutcome.AppliedActionLabel,
			QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel)
		: (QueueRecoveryOutcome.bReducedFriction
			? FString::Printf(
				TEXT("Outcome: %s reduced queue friction | Source: %s"),
				*QueueRecoveryOutcome.AppliedActionLabel,
				QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel)
			: (QueueRecoveryOutcome.bShiftedFriction
				? FString::Printf(
					TEXT("Outcome: %s shifted queue friction without a full reduction | Source: %s"),
					*QueueRecoveryOutcome.AppliedActionLabel,
					QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel)
				: FString::Printf(
					TEXT("Outcome: %s applied with no immediate friction change | Source: %s"),
					*QueueRecoveryOutcome.AppliedActionLabel,
					QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel)));
	Surface.DetailLine = FString::Printf(
		TEXT("Recorded: %s | Pressure %.2f -> %.2f | Deferred %d -> %d | Blocked follow-up %s -> %s | Outstanding deferred %s -> %s | Completion gap %s -> %s | deferred-first weighted: %s | drill-weighted: %s | packet-structure recovery: %s | retained posture: %s | reliable trusted plan recovery: %s"),
		*QueueRecoveryOutcome.RecordedAtUtc,
		QueueRecoveryOutcome.BeforePressureScore,
		QueueRecoveryOutcome.AfterPressureScore,
		QueueRecoveryOutcome.BeforeDeferredEventCount,
		QueueRecoveryOutcome.AfterDeferredEventCount,
		QueueRecoveryOutcome.bBeforeBlockedFollowUp ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bAfterBlockedFollowUp ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bBeforeOutstandingDeferred ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bAfterOutstandingDeferred ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bBeforeCompletionGap ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bAfterCompletionGap ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
		QueueRecoveryOutcome.bUsedMethodDrillHandoffSignal ? TEXT("yes") : TEXT("no"),
		*Surface.PacketStructureRecoveryLine,
		*Surface.RetainedPostureLine,
		*Surface.ReliablePlanRecoveryLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSuppressionHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedQueueSuppressionHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSuppressionHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Queue suppression history");
	Surface.SelectedEntryIndex = SelectedQueueSuppressionIndex;
	Surface.HistoryEntryCount = QueueSuppressionHistoryEntries.Num();
	const FHyperTwistCoachDashboardQueueSuppressionEntry* SelectedEntry =
		SelectedQueueSuppressionIndex >= 0
		&& SelectedQueueSuppressionIndex < QueueSuppressionHistoryEntries.Num()
			? &QueueSuppressionHistoryEntries[SelectedQueueSuppressionIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Suppression history: no retained recovery-driven queue suppressions recorded yet.");
		Surface.DetailLine =
			TEXT("Suppression detail: when recovery-driven queue gating omits a competing follow-up or recommended lane, that omission will be retained here for later review.");
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.PreferredGuidanceLane = SelectedEntry->PreferredGuidanceLane;
	Surface.PreferredRecoveryAction = SelectedEntry->PreferredRecoveryAction;
	Surface.SelectedLaneLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
			SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredRecoveryActionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->PreferredRecoveryAction);
	Surface.DominantDeferralReasonLabel = SelectedEntry->DominantDeferralReasonLabel;
	Surface.PrimaryQueueSuppressionReason = SelectedEntry->PrimaryQueueSuppressionReason;
	Surface.FollowUpQueueSuppressionReason = SelectedEntry->FollowUpQueueSuppressionReason;
	Surface.TotalQueueEntryCount = SelectedEntry->TotalQueueEntryCount;
	Surface.ReadyQueueEntryCount = SelectedEntry->ReadyQueueEntryCount;
	Surface.PressureScore = SelectedEntry->PressureScore;
	Surface.bSuppressedPrimaryQueueCreation = SelectedEntry->bSuppressedPrimaryQueueCreation;
	Surface.bSuppressedFollowUpQueueCreation = SelectedEntry->bSuppressedFollowUpQueueCreation;
	Surface.StatusLine = FString::Printf(
		TEXT("Suppression history: %d entries | selected %d/%d | Lane: %s | Recovery: %s | Recorded: %s"),
		QueueSuppressionHistoryEntries.Num(),
		SelectedQueueSuppressionIndex + 1,
		QueueSuppressionHistoryEntries.Num(),
		*Surface.SelectedLaneLabel,
		*Surface.PreferredRecoveryActionLabel,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Queue total %d | Ready %d | Pressure %.2f | Dominant reason: %s | Primary: %s | Follow-up: %s"),
		SelectedEntry->TotalQueueEntryCount,
		SelectedEntry->ReadyQueueEntryCount,
		SelectedEntry->PressureScore,
		SelectedEntry->DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: *SelectedEntry->DominantDeferralReasonLabel,
		SelectedEntry->PrimaryQueueSuppressionReason.IsEmpty()
			? TEXT("not suppressed")
			: *SelectedEntry->PrimaryQueueSuppressionReason,
		SelectedEntry->FollowUpQueueSuppressionReason.IsEmpty()
			? TEXT("not suppressed")
			: *SelectedEntry->FollowUpQueueSuppressionReason);
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSuppressionHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueSuppressionHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSuppressionHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Queue suppression history navigation");

	const FHyperTwistCoachDashboardQueueSuppressionEntry* SelectedEntry =
		SelectedQueueSuppressionIndex >= 0
		&& SelectedQueueSuppressionIndex < QueueSuppressionHistoryEntries.Num()
			? &QueueSuppressionHistoryEntries[SelectedQueueSuppressionIndex]
			: nullptr;
	const bool bNavigationEnabled = QueueSuppressionHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousQueueSuppressionNavigationLabel.IsEmpty()
		? DisplayedPreviousQueueSuppressionNavigationLabel
		: TEXT("Prev Suppression");
	Surface.NextLabel = !DisplayedNextQueueSuppressionNavigationLabel.IsEmpty()
		? DisplayedNextQueueSuppressionNavigationLabel
		: TEXT("Next Suppression");
	Surface.SelectedEntryIndex = SelectedQueueSuppressionIndex;
	Surface.HistoryEntryCount = QueueSuppressionHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedQueueSuppressionIndex == QueueSuppressionHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.SelectedLaneLabel = TEXT("none");
		Surface.PreferredRecoveryActionLabel = TEXT("n/a");
		Surface.DominantDeferralReasonLabel = TEXT("n/a");
		Surface.StatusLine =
			TEXT("Suppression history navigation: no retained recovery-driven queue suppressions recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedQueueSuppressionIndex + 1,
		QueueSuppressionHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.SelectedLaneLabel = HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
		SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredRecoveryActionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->PreferredRecoveryAction);
	Surface.DominantDeferralReasonLabel = SelectedEntry->DominantDeferralReasonLabel.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->DominantDeferralReasonLabel;
	Surface.StatusLine = FString::Printf(
		TEXT("Suppression history navigation: selected %s | Lane: %s | Recovery: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.SelectedLaneLabel,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | dominant reason: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.DominantDeferralReasonLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSuppressionBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueSuppressionBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSuppressionBandInspectSurface Surface;
	Surface.Headline = TEXT("Queue-suppression band");

	const FHyperTwistTrainingCoachDashboardQueueSuppressionSummaryInspectSurface SummarySurface =
		GetDisplayedQueueSuppressionSummaryInspectSurface();
	const FHyperTwistTrainingCoachDashboardQueueSuppressionDetailInspectSurface DetailSurface =
		GetDisplayedQueueSuppressionDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardQueueSuppressionHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedQueueSuppressionHistoryNavigationInspectSurface();

	Surface.QueueSuppressionSummaryLine = SummarySurface.StatusLine.IsEmpty()
		? TEXT("Queue suppression summary: unavailable.")
		: SummarySurface.StatusLine;
	Surface.QueueSuppressionDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Queue suppression detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.QueueSuppressionNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Queue suppression navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.QueueSuppressionNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Queue suppression navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.GuidanceLaneLabel = SummarySurface.GuidanceLaneLabel.IsEmpty()
		? TEXT("none")
		: SummarySurface.GuidanceLaneLabel;
	Surface.PreferredRecoveryActionLabel = !NavigationSurface.PreferredRecoveryActionLabel.IsEmpty()
		? NavigationSurface.PreferredRecoveryActionLabel
		: (SummarySurface.PreferredRecoveryActionLabel.IsEmpty()
			? TEXT("n/a")
			: SummarySurface.PreferredRecoveryActionLabel);
	Surface.DominantDeferralReasonLabel = !NavigationSurface.DominantDeferralReasonLabel.IsEmpty()
		? NavigationSurface.DominantDeferralReasonLabel
		: (DetailSurface.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: DetailSurface.DominantDeferralReasonLabel);
	Surface.PrimarySuppressionReason = SummarySurface.PrimarySuppressionReason.IsEmpty()
		? TEXT("not suppressed")
		: SummarySurface.PrimarySuppressionReason;
	Surface.FollowUpSuppressionReason = SummarySurface.FollowUpSuppressionReason.IsEmpty()
		? TEXT("not suppressed")
		: SummarySurface.FollowUpSuppressionReason;
	Surface.QueueId = DetailSurface.QueueId.IsEmpty() ? TEXT("n/a") : DetailSurface.QueueId;
	Surface.NextDeferredEntryId = DetailSurface.NextDeferredEntryId.IsEmpty()
		? TEXT("none")
		: DetailSurface.NextDeferredEntryId;
	Surface.NextManualRescheduleEntryId = DetailSurface.NextManualRescheduleEntryId.IsEmpty()
		? TEXT("none")
		: DetailSurface.NextManualRescheduleEntryId;
	Surface.EarliestDeferredUntilUtc = DetailSurface.EarliestDeferredUntilUtc.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.EarliestDeferredUntilUtc;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty()
		? TEXT("Prev Suppression")
		: NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty()
		? TEXT("Next Suppression")
		: NavigationSurface.NextLabel;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = NavigationSurface.RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: NavigationSurface.RecordedAtUtc;
	Surface.SelectedLaneLabel = NavigationSurface.SelectedLaneLabel.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedLaneLabel;
	Surface.SelectedEntryIndex = NavigationSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = NavigationSurface.HistoryEntryCount;
	Surface.TotalQueueEntryCount = SummarySurface.TotalQueueEntryCount;
	Surface.ReadyQueueEntryCount = SummarySurface.ReadyQueueEntryCount;
	Surface.DeferredQueueEntryCount = SummarySurface.DeferredQueueEntryCount;
	Surface.ManualRescheduleEntryCount = DetailSurface.ManualRescheduleEntryCount;
	Surface.ArchiveAwareDeferredEntryCount = DetailSurface.ArchiveAwareDeferredEntryCount;
	Surface.BlockedFollowUpDeferredEntryCount = DetailSurface.BlockedFollowUpDeferredEntryCount;
	Surface.DeferredEventCount = DetailSurface.DeferredEventCount;
	Surface.PromotedEventCount = DetailSurface.PromotedEventCount;
	Surface.ManualRescheduleEventCount = DetailSurface.ManualRescheduleEventCount;
	Surface.ReschedulePressureScore = DetailSurface.ReschedulePressureScore;
	Surface.PreferredGuidanceLane = SummarySurface.PreferredGuidanceLane;
	Surface.PreferredRecoveryAction = SummarySurface.PreferredRecoveryAction;
	Surface.bHasPrimaryQueueSuppression = SummarySurface.bHasPrimaryQueueSuppression;
	Surface.bHasFollowUpQueueSuppression = SummarySurface.bHasFollowUpQueueSuppression;
	Surface.bHasAnyQueueSuppression = SummarySurface.bHasAnyQueueSuppression;
	Surface.bHasBlockedFollowUpDeferrals = DetailSurface.bHasBlockedFollowUpDeferrals;
	Surface.bHasArchiveAwareDeferrals = DetailSurface.bHasArchiveAwareDeferrals;
	Surface.bNeedsManualRescheduleReview = DetailSurface.bNeedsManualRescheduleReview;
	Surface.bHasOutstandingDeferredWork = DetailSurface.bHasOutstandingDeferredWork;
	Surface.bHasCompletionGap = DetailSurface.bHasCompletionGap;
	Surface.bHasSelectedEntry = NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.StatusLine = FString::Printf(
		TEXT("Queue-suppression band: lane %s | recovery %s | selected %s | suppression %s | navigation %s/%s"),
		*Surface.GuidanceLaneLabel,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.SelectedEntryOrdinal,
		Surface.bHasAnyQueueSuppression ? TEXT("active") : TEXT("idle"),
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | queue %s | dominant reason %s | primary %s | follow-up %s | total %d | deferred %d | pressure %.2f | recorded %s | latest %s"),
		*Surface.QueueSuppressionSummaryLine,
		*Surface.QueueSuppressionDetailLine,
		*Surface.QueueSuppressionNavigationStatusLine,
		*Surface.QueueSuppressionNavigationDetailLine,
		*Surface.QueueId,
		*Surface.DominantDeferralReasonLabel,
		*Surface.PrimarySuppressionReason,
		*Surface.FollowUpSuppressionReason,
		Surface.TotalQueueEntryCount,
		Surface.DeferredQueueEntryCount,
		Surface.ReschedulePressureScore,
		*Surface.RecordedAtUtc,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardClosureRecoveryHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedClosureRecoveryHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardClosureRecoveryHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Closure recovery history");
	Surface.SelectedEntryIndex = SelectedClosureRecoveryIndex;
	Surface.HistoryEntryCount = ClosureRecoveryHistoryEntries.Num();
	const FHyperTwistCoachDashboardClosureRecoveryEntry* SelectedEntry =
		SelectedClosureRecoveryIndex >= 0
		&& SelectedClosureRecoveryIndex < ClosureRecoveryHistoryEntries.Num()
			? &ClosureRecoveryHistoryEntries[SelectedClosureRecoveryIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Closure history: no retained closure-recovery shifts recorded yet.");
		Surface.DetailLine =
			TEXT("Closure history detail: retained keep-vs-suppress shifts will accumulate here as recovery history changes the closure posture over time.");
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.PreferredGuidanceLane = SelectedEntry->PreferredGuidanceLane;
	Surface.SelectedLaneLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
			SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredGuidanceSourceLabel = SelectedEntry->PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			SelectedEntry->PreferredGuidanceSourceLabel);
	Surface.ClosurePolicyLine = SelectedEntry->ClosurePolicyLine;
	Surface.ActiveSignalId = SelectedEntry->ActiveSignalId;
	Surface.ActiveSignalHeadline = SelectedEntry->ActiveSignalHeadline;
	Surface.ActiveSignalDetail = SelectedEntry->ActiveSignalDetail;
	Surface.HistoricalFollowUpContinuationCount =
		SelectedEntry->HistoricalFollowUpContinuationCount;
	Surface.HistoricalBorderlineFollowUpSuppressionCount =
		SelectedEntry->HistoricalBorderlineFollowUpSuppressionCount;
	Surface.ActiveSignalScore = SelectedEntry->ActiveSignalScore;
	Surface.bFollowUpContinuationFromRecoveryHistory =
		SelectedEntry->bFollowUpContinuationFromRecoveryHistory;
	Surface.bBorderlineFollowUpSuppressedByRecoveryHistory =
		SelectedEntry->bBorderlineFollowUpSuppressedByRecoveryHistory;
	Surface.bHasActiveSignal =
		!SelectedEntry->ActiveSignalId.IsEmpty()
		|| !SelectedEntry->ActiveSignalHeadline.IsEmpty()
		|| !SelectedEntry->ActiveSignalDetail.IsEmpty();
	Surface.bActiveSignalPromoted = SelectedEntry->bActiveSignalPromoted;
	Surface.StatusLine = FString::Printf(
		TEXT("Closure history: %d entries | selected %d/%d | Lane: %s | Recorded: %s"),
		ClosureRecoveryHistoryEntries.Num(),
		SelectedClosureRecoveryIndex + 1,
		ClosureRecoveryHistoryEntries.Num(),
		*Surface.SelectedLaneLabel,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Policy: %s | keep %d | suppress %d | continuation active: %s | borderline suppression active: %s | source: %s | promoted: %s | signal: %s%s%s"),
		SelectedEntry->ClosurePolicyLine.IsEmpty() ? TEXT("n/a") : *SelectedEntry->ClosurePolicyLine,
		SelectedEntry->HistoricalFollowUpContinuationCount,
		SelectedEntry->HistoricalBorderlineFollowUpSuppressionCount,
		SelectedEntry->bFollowUpContinuationFromRecoveryHistory ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bBorderlineFollowUpSuppressedByRecoveryHistory ? TEXT("yes") : TEXT("no"),
		*Surface.PreferredGuidanceSourceDescription,
		SelectedEntry->bActiveSignalPromoted ? TEXT("yes") : TEXT("no"),
		SelectedEntry->ActiveSignalHeadline.IsEmpty() ? TEXT("n/a") : *SelectedEntry->ActiveSignalHeadline,
		SelectedEntry->ActiveSignalDetail.IsEmpty() ? TEXT("") : TEXT(" || detail: "),
		SelectedEntry->ActiveSignalDetail.IsEmpty() ? TEXT("") : *SelectedEntry->ActiveSignalDetail);
	return Surface;
}

FHyperTwistTrainingCoachDashboardClosureRecoveryHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedClosureRecoveryHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardClosureRecoveryHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Closure recovery history navigation");

	const FHyperTwistCoachDashboardClosureRecoveryEntry* SelectedEntry =
		SelectedClosureRecoveryIndex >= 0
		&& SelectedClosureRecoveryIndex < ClosureRecoveryHistoryEntries.Num()
			? &ClosureRecoveryHistoryEntries[SelectedClosureRecoveryIndex]
			: nullptr;
	const bool bNavigationEnabled = ClosureRecoveryHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousClosureRecoveryNavigationLabel.IsEmpty()
		? DisplayedPreviousClosureRecoveryNavigationLabel
		: TEXT("Prev Closure");
	Surface.NextLabel = !DisplayedNextClosureRecoveryNavigationLabel.IsEmpty()
		? DisplayedNextClosureRecoveryNavigationLabel
		: TEXT("Next Closure");
	Surface.SelectedEntryIndex = SelectedClosureRecoveryIndex;
	Surface.HistoryEntryCount = ClosureRecoveryHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedClosureRecoveryIndex == ClosureRecoveryHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.SelectedLaneLabel = TEXT("none");
		Surface.PreferredGuidanceSourceLabel = TEXT("none");
		Surface.PreferredGuidanceSourceDescription =
			HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(TEXT(""));
		Surface.StatusLine =
			TEXT("Closure history navigation: no retained closure-recovery shifts recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedClosureRecoveryIndex + 1,
		ClosureRecoveryHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.SelectedLaneLabel = HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
		SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredGuidanceSourceLabel = SelectedEntry->PreferredGuidanceSourceLabel.IsEmpty()
		? TEXT("none")
		: SelectedEntry->PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			SelectedEntry->PreferredGuidanceSourceLabel);
	Surface.StatusLine = FString::Printf(
		TEXT("Closure history navigation: selected %s | Lane: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.SelectedLaneLabel,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | source: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.PreferredGuidanceSourceDescription,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedMethodDrillRecoveryOutcomeHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery outcome history");

	TArray<int32> MethodDrillRecoveryHistoryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryHistoryIndices);
	const int32 SelectedHistoryPosition =
		MethodDrillRecoveryHistoryIndices.IndexOfByKey(SelectedMethodDrillRecoveryOutcomeIndex);
	const FHyperTwistCoachDashboardQueueRecoveryOutcome* SelectedOutcome =
		SelectedMethodDrillRecoveryOutcomeIndex >= 0
		&& SelectedMethodDrillRecoveryOutcomeIndex < QueueRecoveryOutcomeHistory.Num()
			? &QueueRecoveryOutcomeHistory[SelectedMethodDrillRecoveryOutcomeIndex]
			: nullptr;
	Surface.HistoryEntryCount = MethodDrillRecoveryHistoryIndices.Num();
	Surface.SelectedHistoryIndex = SelectedHistoryPosition;
	Surface.bHasSelectedEntry =
		SelectedOutcome != nullptr
		&& SelectedOutcome->IsStructurallyValid()
		&& SelectedHistoryPosition != INDEX_NONE;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Drill recovery history: no retained drill-weighted queue-recovery outcomes recorded yet.");
		Surface.DetailLine =
			TEXT("Drill recovery detail: when drill-weighted queue recovery actions are applied, their retained before/after friction outcomes will accumulate here for later comparison against generic recovery.");
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedOutcome->RecordedAtUtc;
	Surface.SourceLabel = SelectedOutcome->SourceLabel;
	Surface.SourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			SelectedOutcome->SourceLabel);
	Surface.AppliedActionLabel = SelectedOutcome->AppliedActionLabel;
	Surface.AppliedAction =
		HyperTwistCoachDashboardWidgetInternal::ToQueueRecoveryAction(
			SelectedOutcome->ActionKind);
	Surface.BeforePressureScore = SelectedOutcome->BeforePressureScore;
	Surface.AfterPressureScore = SelectedOutcome->AfterPressureScore;
	Surface.BeforeDeferredEventCount = SelectedOutcome->BeforeDeferredEventCount;
	Surface.AfterDeferredEventCount = SelectedOutcome->AfterDeferredEventCount;
	Surface.bSucceeded = SelectedOutcome->bSucceeded;
	Surface.bReducedFriction = SelectedOutcome->bReducedFriction;
	Surface.bShiftedFriction = SelectedOutcome->bShiftedFriction;
	Surface.bBeforeBlockedFollowUp = SelectedOutcome->bBeforeBlockedFollowUp;
	Surface.bAfterBlockedFollowUp = SelectedOutcome->bAfterBlockedFollowUp;
	Surface.bBeforeOutstandingDeferred = SelectedOutcome->bBeforeOutstandingDeferred;
	Surface.bAfterOutstandingDeferred = SelectedOutcome->bAfterOutstandingDeferred;
	Surface.bBeforeCompletionGap = SelectedOutcome->bBeforeCompletionGap;
	Surface.bAfterCompletionGap = SelectedOutcome->bAfterCompletionGap;
	Surface.bUsedDeferredFirstSuppressionSignal =
		SelectedOutcome->bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillHandoffSignal = SelectedOutcome->bUsedMethodDrillHandoffSignal;
	Surface.bUsedNarrowMethodDrillPacketStructureRecovery =
		SelectedOutcome->bUsedNarrowMethodDrillPacketStructureRecovery;
	Surface.bUsedBroadMethodDrillPacketStructureRecovery =
		SelectedOutcome->bUsedBroadMethodDrillPacketStructureRecovery;
	Surface.bUsedStrongRetainedMethodDrillRecoveryPosture =
		SelectedOutcome->bUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bUsedWeakRetainedMethodDrillRecoveryPosture =
		SelectedOutcome->bUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bUsedReliableTrustedTightStructurePlanRecovery =
		SelectedOutcome->bUsedReliableTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableTrustedBroadStructurePlanRecovery =
		SelectedOutcome->bUsedReliableTrustedBroadStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedTightStructurePlanRecovery =
		SelectedOutcome->bUsedReliableAlignedTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedBroadStructurePlanRecovery =
		SelectedOutcome->bUsedReliableAlignedTrustedBroadStructurePlanRecovery;
	Surface.VerdictLine = !SelectedOutcome->bSucceeded
		? TEXT("failed")
		: (SelectedOutcome->bReducedFriction
			? TEXT("reduced friction")
			: (SelectedOutcome->bShiftedFriction
				? TEXT("shifted friction")
				: TEXT("no immediate change")));
	Surface.PacketStructureRecoveryLine =
		SelectedOutcome->bUsedNarrowMethodDrillPacketStructureRecovery
			? TEXT("narrow continuation")
			: (SelectedOutcome->bUsedBroadMethodDrillPacketStructureRecovery
				? TEXT("broad redirect")
				: TEXT("none"));
	Surface.RetainedPostureLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
			SelectedOutcome->bUsedStrongRetainedMethodDrillRecoveryPosture,
			SelectedOutcome->bUsedWeakRetainedMethodDrillRecoveryPosture);
	Surface.ReliablePlanRecoveryLine =
		SelectedOutcome->bUsedReliableAlignedTrustedTightStructurePlanRecovery
			? TEXT("aligned reliable tight continuation")
			: (SelectedOutcome->bUsedReliableAlignedTrustedBroadStructurePlanRecovery
				? TEXT("aligned reliable broad redirect")
				: (SelectedOutcome->bUsedReliableTrustedTightStructurePlanRecovery
					? TEXT("trusted tight continuation")
					: (SelectedOutcome->bUsedReliableTrustedBroadStructurePlanRecovery
						? TEXT("trusted broad redirect")
						: TEXT("none"))));
	Surface.StatusLine = FString::Printf(
		TEXT("Drill recovery history: %d entries | selected %d/%d | %s | %s | Packet recovery: %s | Stance: %s | Recorded: %s"),
		MethodDrillRecoveryHistoryIndices.Num(),
		SelectedHistoryPosition + 1,
		MethodDrillRecoveryHistoryIndices.Num(),
		*SelectedOutcome->AppliedActionLabel,
		*Surface.VerdictLine,
		*Surface.PacketStructureRecoveryLine,
		*Surface.RetainedPostureLine,
		*SelectedOutcome->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Source: %s | Pressure %.2f -> %.2f | Deferred %d -> %d | Blocked follow-up %s -> %s | Outstanding deferred %s -> %s | Completion gap %s -> %s | deferred-first weighted: %s | packet-structure recovery: %s | retained posture: %s"),
		*Surface.SourceDescription,
		SelectedOutcome->BeforePressureScore,
		SelectedOutcome->AfterPressureScore,
		SelectedOutcome->BeforeDeferredEventCount,
		SelectedOutcome->AfterDeferredEventCount,
		SelectedOutcome->bBeforeBlockedFollowUp ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bAfterBlockedFollowUp ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bBeforeOutstandingDeferred ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bAfterOutstandingDeferred ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bBeforeCompletionGap ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bAfterCompletionGap ? TEXT("yes") : TEXT("no"),
		SelectedOutcome->bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
		*Surface.PacketStructureRecoveryLine,
		*Surface.RetainedPostureLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryOutcomeHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery outcome history status");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillRecoveryOutcomeHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedMethodDrillRecoveryOutcomeHistoryStatusLine.IsEmpty()
		? DisplayedMethodDrillRecoveryOutcomeHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.AppliedActionLabel = !HistorySurface.AppliedActionLabel.IsEmpty()
		? HistorySurface.AppliedActionLabel
		: (NavigationSurface.AppliedActionLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.AppliedActionLabel);
	Surface.VerdictLine = !HistorySurface.VerdictLine.IsEmpty()
		? HistorySurface.VerdictLine
		: (NavigationSurface.VerdictLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.VerdictLine);
	Surface.SourceDescription = !HistorySurface.SourceDescription.IsEmpty()
		? HistorySurface.SourceDescription
		: (NavigationSurface.SourceDescription.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.SourceDescription);
	Surface.PacketStructureRecoveryLine = HistorySurface.PacketStructureRecoveryLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.PacketStructureRecoveryLine;
	Surface.RetainedPostureLine = HistorySurface.RetainedPostureLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RetainedPostureLine;
	Surface.ReliablePlanRecoveryLine = HistorySurface.ReliablePlanRecoveryLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.ReliablePlanRecoveryLine;
	Surface.SelectedHistoryIndex = HistorySurface.SelectedHistoryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryOutcomeHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery outcome history detail");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillRecoveryOutcomeHistoryInspectSurface();

	Surface.DetailLine = !DisplayedMethodDrillRecoveryOutcomeHistoryDetailLine.IsEmpty()
		? DisplayedMethodDrillRecoveryOutcomeHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.SourceLabel = HistorySurface.SourceLabel.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceLabel;
	Surface.SourceDescription =
		HistorySurface.SourceDescription.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceDescription;
	Surface.AppliedActionLabel =
		HistorySurface.AppliedActionLabel.IsEmpty() ? TEXT("n/a") : HistorySurface.AppliedActionLabel;
	Surface.VerdictLine = HistorySurface.VerdictLine.IsEmpty() ? TEXT("n/a") : HistorySurface.VerdictLine;
	Surface.PacketStructureRecoveryLine = HistorySurface.PacketStructureRecoveryLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.PacketStructureRecoveryLine;
	Surface.RetainedPostureLine = HistorySurface.RetainedPostureLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RetainedPostureLine;
	Surface.ReliablePlanRecoveryLine = HistorySurface.ReliablePlanRecoveryLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.ReliablePlanRecoveryLine;
	Surface.SelectedHistoryIndex = HistorySurface.SelectedHistoryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.BeforePressureScore = HistorySurface.BeforePressureScore;
	Surface.AfterPressureScore = HistorySurface.AfterPressureScore;
	Surface.BeforeDeferredEventCount = HistorySurface.BeforeDeferredEventCount;
	Surface.AfterDeferredEventCount = HistorySurface.AfterDeferredEventCount;
	Surface.AppliedAction = HistorySurface.AppliedAction;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSucceeded = HistorySurface.bSucceeded;
	Surface.bReducedFriction = HistorySurface.bReducedFriction;
	Surface.bShiftedFriction = HistorySurface.bShiftedFriction;
	Surface.bBeforeBlockedFollowUp = HistorySurface.bBeforeBlockedFollowUp;
	Surface.bAfterBlockedFollowUp = HistorySurface.bAfterBlockedFollowUp;
	Surface.bBeforeOutstandingDeferred = HistorySurface.bBeforeOutstandingDeferred;
	Surface.bAfterOutstandingDeferred = HistorySurface.bAfterOutstandingDeferred;
	Surface.bBeforeCompletionGap = HistorySurface.bBeforeCompletionGap;
	Surface.bAfterCompletionGap = HistorySurface.bAfterCompletionGap;
	Surface.bUsedDeferredFirstSuppressionSignal =
		HistorySurface.bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillHandoffSignal = HistorySurface.bUsedMethodDrillHandoffSignal;
	Surface.bUsedNarrowMethodDrillPacketStructureRecovery =
		HistorySurface.bUsedNarrowMethodDrillPacketStructureRecovery;
	Surface.bUsedBroadMethodDrillPacketStructureRecovery =
		HistorySurface.bUsedBroadMethodDrillPacketStructureRecovery;
	Surface.bUsedStrongRetainedMethodDrillRecoveryPosture =
		HistorySurface.bUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bUsedWeakRetainedMethodDrillRecoveryPosture =
		HistorySurface.bUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bUsedReliableTrustedTightStructurePlanRecovery =
		HistorySurface.bUsedReliableTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableTrustedBroadStructurePlanRecovery =
		HistorySurface.bUsedReliableTrustedBroadStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedTightStructurePlanRecovery =
		HistorySurface.bUsedReliableAlignedTrustedTightStructurePlanRecovery;
	Surface.bUsedReliableAlignedTrustedBroadStructurePlanRecovery =
		HistorySurface.bUsedReliableAlignedTrustedBroadStructurePlanRecovery;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryOutcomeHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery outcome history navigation");

	TArray<int32> MethodDrillRecoveryHistoryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryHistoryIndices);
	const int32 SelectedHistoryPosition =
		MethodDrillRecoveryHistoryIndices.IndexOfByKey(SelectedMethodDrillRecoveryOutcomeIndex);
	const FHyperTwistCoachDashboardQueueRecoveryOutcome* SelectedOutcome =
		SelectedMethodDrillRecoveryOutcomeIndex >= 0
		&& SelectedMethodDrillRecoveryOutcomeIndex < QueueRecoveryOutcomeHistory.Num()
			? &QueueRecoveryOutcomeHistory[SelectedMethodDrillRecoveryOutcomeIndex]
			: nullptr;
	const bool bNavigationEnabled = MethodDrillRecoveryHistoryIndices.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousMethodDrillRecoveryNavigationLabel.IsEmpty()
		? DisplayedPreviousMethodDrillRecoveryNavigationLabel
		: TEXT("Prev Drill Recovery");
	Surface.NextLabel = !DisplayedNextMethodDrillRecoveryNavigationLabel.IsEmpty()
		? DisplayedNextMethodDrillRecoveryNavigationLabel
		: TEXT("Next Drill Recovery");
	Surface.SelectedHistoryIndex = SelectedHistoryPosition;
	Surface.HistoryEntryCount = MethodDrillRecoveryHistoryIndices.Num();
	Surface.bHasSelectedEntry =
		SelectedOutcome != nullptr
		&& SelectedOutcome->IsStructurallyValid()
		&& SelectedHistoryPosition != INDEX_NONE;
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedHistoryPosition == MethodDrillRecoveryHistoryIndices.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.AppliedActionLabel = TEXT("n/a");
		Surface.VerdictLine = TEXT("n/a");
		Surface.SourceDescription = TEXT("n/a");
		Surface.StatusLine =
			TEXT("Drill recovery navigation: no retained drill-weighted queue-recovery outcomes recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedHistoryPosition + 1,
		MethodDrillRecoveryHistoryIndices.Num());
	Surface.RecordedAtUtc = SelectedOutcome->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedOutcome->RecordedAtUtc;
	Surface.AppliedActionLabel = SelectedOutcome->AppliedActionLabel.IsEmpty()
		? TEXT("n/a")
		: SelectedOutcome->AppliedActionLabel;
	Surface.VerdictLine = !SelectedOutcome->bSucceeded
		? TEXT("failed")
		: (SelectedOutcome->bReducedFriction
			? TEXT("reduced friction")
			: (SelectedOutcome->bShiftedFriction
				? TEXT("shifted friction")
				: TEXT("no immediate change")));
	Surface.SourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			SelectedOutcome->SourceLabel);
	Surface.StatusLine = FString::Printf(
		TEXT("Drill recovery navigation: selected %s | %s | %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.AppliedActionLabel,
		*Surface.VerdictLine,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | source: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.SourceDescription,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedMethodDrillRecoveryMemoryHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery memory history");
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPlanComparisonSummary PlanComparisonSummary =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanComparisonSummary(
			MethodDrillRecoveryMemoryHistoryEntries);
	const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry* SelectedEntry =
		SelectedMethodDrillRecoveryMemoryHistoryIndex >= 0
		&& SelectedMethodDrillRecoveryMemoryHistoryIndex
			< MethodDrillRecoveryMemoryHistoryEntries.Num()
			? &MethodDrillRecoveryMemoryHistoryEntries[SelectedMethodDrillRecoveryMemoryHistoryIndex]
			: nullptr;
	Surface.SelectedEntryIndex = SelectedMethodDrillRecoveryMemoryHistoryIndex;
	Surface.HistoryEntryCount = MethodDrillRecoveryMemoryHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Drill recovery memory history: no retained upstream drill-recovery memory shifts recorded yet.");
		Surface.DetailLine =
			TEXT("Drill recovery memory detail: retained upstream strong-vs-weak drill-recovery pressure, resulting generated packet lane, and resulting plan-source vs generated-plan alignment will accumulate here for later comparison.");
		return Surface;
	}

	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias MemoryBias =
		SelectedEntry->bStrongPressureDominant
			? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
			: (SelectedEntry->bWeakPressureDominant
				? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
				: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None);
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.PreferredRecoveryAction = SelectedEntry->PreferredRecoveryAction;
	Surface.PreferredRecoveryActionLabel =
		SelectedEntry->PreferredRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::None
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->PreferredRecoveryAction);
	Surface.PreferredRecoveryActionSourceLabel =
		SelectedEntry->PreferredRecoveryActionSourceLabel;
	Surface.PreferredRecoveryActionSourceDescription =
		SelectedEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedEntry->PreferredRecoveryActionSourceLabel);
	Surface.RecommendedHandoffKindLabel = SelectedEntry->RecommendedHandoffKindLabel;
	Surface.QueueRecoveryStatusLine = SelectedEntry->QueueRecoveryStatusLine;
	Surface.HandoffRecommendationStatusLine =
		SelectedEntry->HandoffRecommendationStatusLine;
	Surface.GeneratedGuidancePacketKindLabel =
		SelectedEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->GeneratedGuidancePacketKindLabel;
	Surface.GeneratedGuidancePacketSourceLabel =
		SelectedEntry->GeneratedGuidancePacketSourceLabel;
	Surface.GeneratedGuidancePacketSourceDescription =
		SelectedEntry->GeneratedGuidancePacketSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedEntry->GeneratedGuidancePacketSourceLabel);
	Surface.GeneratedGuidancePacketHeadline =
		SelectedEntry->GeneratedGuidancePacketHeadline.IsEmpty()
			? TEXT("n/a")
			: SelectedEntry->GeneratedGuidancePacketHeadline;
	Surface.GeneratedGuidancePacketActionLabel =
		SelectedEntry->GeneratedGuidancePacketActionLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedEntry->GeneratedGuidancePacketActionLabel;
	Surface.GeneratedGuidancePacketFocusCaseCount =
		SelectedEntry->GeneratedGuidancePacketFocusCaseCount;
	Surface.GeneratedPlanSuggestedMode = SelectedEntry->GeneratedPlanSuggestedMode;
	Surface.GeneratedPlanModeLabel =
		SelectedEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->GeneratedPlanSuggestedMode);
	Surface.GeneratedPlanSuggestedSelectionPolicy =
		SelectedEntry->GeneratedPlanSuggestedSelectionPolicy;
	Surface.GeneratedPlanSelectionLabel =
		SelectedEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->GeneratedPlanSuggestedSelectionPolicy);
	Surface.GeneratedPlanPostureLabel =
		SelectedEntry->GeneratedPlanPostureLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedEntry->GeneratedPlanPostureLabel;
	Surface.DominantPressureLine =
		SelectedEntry->bStrongPressureDominant
			? TEXT("strong")
			: (SelectedEntry->bWeakPressureDominant ? TEXT("weak") : TEXT("balanced"));
	Surface.StructureBiasLine =
		SelectedEntry->bNarrowPacketStructureRecoveryDominant
			? TEXT("narrow continuation")
			: (SelectedEntry->bBroadPacketStructureRecoveryDominant
				? TEXT("broad redirect")
				: TEXT("none"));
	Surface.ReliablePlanLine = [&]() -> FString
	{
		if (SelectedEntry->bReliableAlignedTrustedTightStructurePlanOutcomeDominant)
		{
			return TEXT("aligned reliable trusted tight launched-plan continuation");
		}
		if (SelectedEntry->bReliableAlignedTrustedBroadStructurePlanOutcomeDominant)
		{
			return TEXT("aligned reliable trusted broad launched-plan redirect");
		}
		if (SelectedEntry->bReliableAlignedTrustedTightStructurePlanDominant)
		{
			return TEXT("aligned reliable trusted tight continuation");
		}
		if (SelectedEntry->bReliableAlignedTrustedBroadStructurePlanDominant)
		{
			return TEXT("aligned reliable trusted broad redirect");
		}
		if (SelectedEntry->bReliableTrustedTightStructurePlanDominant)
		{
			return TEXT("reliable trusted tight continuation");
		}
		if (SelectedEntry->bReliableTrustedBroadStructurePlanDominant)
		{
			return TEXT("reliable trusted broad redirect");
		}
		return TEXT("none");
	}();
	Surface.MemoryBiasLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
			MemoryBias);
	Surface.PlanSourceLine =
		SelectedEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanSourceLabel(
				SelectedEntry->PreferredRecoveryActionSourceLabel);
	Surface.PlanAlignmentLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanAlignment(
			*SelectedEntry);
	Surface.ComparisonPreferenceLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanComparisonPreference(
			PlanComparisonSummary);
	Surface.GeneratedPacketStanceLine =
		SelectedEntry->bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture
			? TEXT("strong retained drill-recovery continuation")
			: (SelectedEntry->bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture
				? TEXT("weak retained drill-recovery redirect")
				: (SelectedEntry->bGeneratedPacketUsedGenericMethodDrillRecoveryMemory
					? TEXT("generic drill-recovery memory")
					: TEXT("none")));
	Surface.MethodDrillRecoveryHistoryCount = SelectedEntry->MethodDrillRecoveryHistoryCount;
	Surface.StrongMethodDrillRecoveryHistoryCount =
		SelectedEntry->StrongMethodDrillRecoveryHistoryCount;
	Surface.WeakMethodDrillRecoveryHistoryCount =
		SelectedEntry->WeakMethodDrillRecoveryHistoryCount;
	Surface.NarrowMethodDrillPacketStructureRecoveryLaunchCount =
		SelectedEntry->NarrowMethodDrillPacketStructureRecoveryLaunchCount;
	Surface.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount =
		SelectedEntry->NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount;
	Surface.BroadMethodDrillPacketStructureRecoveryPromoteCount =
		SelectedEntry->BroadMethodDrillPacketStructureRecoveryPromoteCount;
	Surface.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount =
		SelectedEntry->BroadMethodDrillPacketStructureRecoveryPromoteReducedCount;
	Surface.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->TrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Surface.MethodDrillRecoveryAverageOutcomeScore =
		SelectedEntry->MethodDrillRecoveryAverageOutcomeScore;
	Surface.bStrongPressureDominant = SelectedEntry->bStrongPressureDominant;
	Surface.bWeakPressureDominant = SelectedEntry->bWeakPressureDominant;
	Surface.bNarrowPacketStructureRecoveryDominant =
		SelectedEntry->bNarrowPacketStructureRecoveryDominant;
	Surface.bBroadPacketStructureRecoveryDominant =
		SelectedEntry->bBroadPacketStructureRecoveryDominant;
	Surface.bReliableTrustedTightStructurePlanDominant =
		SelectedEntry->bReliableTrustedTightStructurePlanDominant;
	Surface.bReliableTrustedBroadStructurePlanDominant =
		SelectedEntry->bReliableTrustedBroadStructurePlanDominant;
	Surface.bReliableAlignedTrustedTightStructurePlanDominant =
		SelectedEntry->bReliableAlignedTrustedTightStructurePlanDominant;
	Surface.bReliableAlignedTrustedBroadStructurePlanDominant =
		SelectedEntry->bReliableAlignedTrustedBroadStructurePlanDominant;
	Surface.bReliableAlignedTrustedTightStructurePlanOutcomeDominant =
		SelectedEntry->bReliableAlignedTrustedTightStructurePlanOutcomeDominant;
	Surface.bReliableAlignedTrustedBroadStructurePlanOutcomeDominant =
		SelectedEntry->bReliableAlignedTrustedBroadStructurePlanOutcomeDominant;
	Surface.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture =
		SelectedEntry->bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture =
		SelectedEntry->bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory =
		SelectedEntry->bGeneratedPacketUsedGenericMethodDrillRecoveryMemory;
	Surface.bGeneratedPlanUsedTightStructureContinuationPosture =
		SelectedEntry->bGeneratedPlanUsedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedBroadStructureRedirectPosture =
		SelectedEntry->bGeneratedPlanUsedBroadStructureRedirectPosture;
	Surface.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture =
		SelectedEntry->bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture =
		SelectedEntry->bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture;
	Surface.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture =
		SelectedEntry->bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture =
		SelectedEntry->bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture;
	Surface.bUsedMethodDrillRecoveryMemoryForRecovery =
		SelectedEntry->bUsedMethodDrillRecoveryMemoryForRecovery;
	Surface.bUsedMethodDrillRecoveryMemoryForHandoff =
		SelectedEntry->bUsedMethodDrillRecoveryMemoryForHandoff;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill recovery memory history: %d entries | selected %d/%d | %s | %s | Packet: %s | Stance: %s | Plan source: %s | Plan align: %s | Reliable stance: %s | Plan: %s | Recorded: %s"),
		MethodDrillRecoveryMemoryHistoryEntries.Num(),
		SelectedMethodDrillRecoveryMemoryHistoryIndex + 1,
		MethodDrillRecoveryMemoryHistoryEntries.Num(),
		*Surface.PreferredRecoveryActionLabel,
		*SelectedEntry->RecommendedHandoffKindLabel,
		*Surface.GeneratedGuidancePacketKindLabel,
		*Surface.MemoryBiasLine,
		*Surface.PlanSourceLine,
		*Surface.PlanAlignmentLine,
		*Surface.ReliablePlanLine,
		*Surface.GeneratedPlanPostureLabel,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Source: %s | Strong/weak/history %d/%d/%d avg %.1f | Structure recovery narrow %d/%d broad %d/%d | Trusted plan history tight/broad %d/%d avg %.1f/%.1f | Aligned reliable plan outcome history tight/broad %d/%d avg %.1f/%.1f | Aligned reliable plan history tight/broad %d/%d avg %.1f/%.1f | Reliable trusted plan history tight/broad %d/%d avg %.1f/%.1f | Dominant pressure: %s | Structure bias: %s | Reliable stance: %s | Stance: %s | Recovery memory tipped: %s | Handoff memory tipped: %s | Packet kind: %s | Packet source: %s | Packet headline: %s | Packet action: %s | Packet focus %d | Plan mode: %s | Plan selection: %s | Plan posture: %s | Plan source: %s | Plan alignment: %s | Plan comparison tight aligned/diverged %d/%d broad aligned/diverged %d/%d aligned reliable tight aligned/diverged %d/%d aligned reliable broad aligned/diverged %d/%d reliable tight aligned/diverged %d/%d reliable broad aligned/diverged %d/%d | Plan preferred: %s | Tight/broad structure plan: %s/%s | Packet stance: %s | Recovery posture: %s | Handoff posture: %s"),
		*Surface.PreferredRecoveryActionSourceDescription,
		SelectedEntry->StrongMethodDrillRecoveryHistoryCount,
		SelectedEntry->WeakMethodDrillRecoveryHistoryCount,
		SelectedEntry->MethodDrillRecoveryHistoryCount,
		SelectedEntry->MethodDrillRecoveryAverageOutcomeScore,
		SelectedEntry->NarrowMethodDrillPacketStructureRecoveryLaunchCount,
		SelectedEntry->NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount,
		SelectedEntry->BroadMethodDrillPacketStructureRecoveryPromoteCount,
		SelectedEntry->BroadMethodDrillPacketStructureRecoveryPromoteReducedCount,
		SelectedEntry->TrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		SelectedEntry->TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore,
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore,
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		SelectedEntry->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		SelectedEntry->ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
		SelectedEntry->ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		SelectedEntry->ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
		*Surface.DominantPressureLine,
		*Surface.StructureBiasLine,
		*Surface.ReliablePlanLine,
		*Surface.MemoryBiasLine,
		SelectedEntry->bUsedMethodDrillRecoveryMemoryForRecovery ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bUsedMethodDrillRecoveryMemoryForHandoff ? TEXT("yes") : TEXT("no"),
		*Surface.GeneratedGuidancePacketKindLabel,
		*Surface.GeneratedGuidancePacketSourceDescription,
		*Surface.GeneratedGuidancePacketHeadline,
		*Surface.GeneratedGuidancePacketActionLabel,
		SelectedEntry->GeneratedGuidancePacketFocusCaseCount,
		*Surface.GeneratedPlanModeLabel,
		*Surface.GeneratedPlanSelectionLabel,
		*Surface.GeneratedPlanPostureLabel,
		*Surface.PlanSourceLine,
		*Surface.PlanAlignmentLine,
		PlanComparisonSummary.TightPlanAlignedCount,
		PlanComparisonSummary.TightPlanDivergedCount,
		PlanComparisonSummary.BroadPlanAlignedCount,
		PlanComparisonSummary.BroadPlanDivergedCount,
		PlanComparisonSummary.ReliableAlignedTrustedTightPlanAlignedCount,
		PlanComparisonSummary.ReliableAlignedTrustedTightPlanDivergedCount,
		PlanComparisonSummary.ReliableAlignedTrustedBroadPlanAlignedCount,
		PlanComparisonSummary.ReliableAlignedTrustedBroadPlanDivergedCount,
		PlanComparisonSummary.ReliableTrustedTightPlanAlignedCount,
		PlanComparisonSummary.ReliableTrustedTightPlanDivergedCount,
		PlanComparisonSummary.ReliableTrustedBroadPlanAlignedCount,
		PlanComparisonSummary.ReliableTrustedBroadPlanDivergedCount,
		*Surface.ComparisonPreferenceLine,
		SelectedEntry->bGeneratedPlanUsedTightStructureContinuationPosture
			? TEXT("yes")
			: TEXT("no"),
		SelectedEntry->bGeneratedPlanUsedBroadStructureRedirectPosture
			? TEXT("yes")
			: TEXT("no"),
		*Surface.GeneratedPacketStanceLine,
		*SelectedEntry->QueueRecoveryStatusLine,
		*SelectedEntry->HandoffRecommendationStatusLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryMemoryHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery memory history status");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillRecoveryMemoryHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillRecoveryMemoryHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedMethodDrillRecoveryMemoryHistoryStatusLine.IsEmpty()
		? DisplayedMethodDrillRecoveryMemoryHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.PreferredRecoveryActionLabel = !HistorySurface.PreferredRecoveryActionLabel.IsEmpty()
		? HistorySurface.PreferredRecoveryActionLabel
		: (NavigationSurface.PreferredRecoveryActionLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.PreferredRecoveryActionLabel);
	Surface.PreferredRecoveryActionSourceDescription =
		!HistorySurface.PreferredRecoveryActionSourceDescription.IsEmpty()
			? HistorySurface.PreferredRecoveryActionSourceDescription
			: (NavigationSurface.PreferredRecoveryActionSourceDescription.IsEmpty()
				? TEXT("n/a")
				: NavigationSurface.PreferredRecoveryActionSourceDescription);
	Surface.RecommendedHandoffKindLabel = !HistorySurface.RecommendedHandoffKindLabel.IsEmpty()
		? HistorySurface.RecommendedHandoffKindLabel
		: (NavigationSurface.RecommendedHandoffKindLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.RecommendedHandoffKindLabel);
	Surface.DominantBiasLine = !NavigationSurface.DominantBiasLine.IsEmpty()
		? NavigationSurface.DominantBiasLine
		: (HistorySurface.MemoryBiasLine.IsEmpty() ? TEXT("n/a") : HistorySurface.MemoryBiasLine);
	Surface.GeneratedGuidancePacketKindLabel = !HistorySurface.GeneratedGuidancePacketKindLabel.IsEmpty()
		? HistorySurface.GeneratedGuidancePacketKindLabel
		: (NavigationSurface.GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.GeneratedGuidancePacketKindLabel);
	Surface.GeneratedPlanPostureLabel = !HistorySurface.GeneratedPlanPostureLabel.IsEmpty()
		? HistorySurface.GeneratedPlanPostureLabel
		: (NavigationSurface.GeneratedPlanPostureLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.GeneratedPlanPostureLabel);
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryMemoryHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery memory history detail");

	const FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillRecoveryMemoryHistoryInspectSurface();

	Surface.DetailLine = !DisplayedMethodDrillRecoveryMemoryHistoryDetailLine.IsEmpty()
		? DisplayedMethodDrillRecoveryMemoryHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.PreferredRecoveryActionLabel = HistorySurface.PreferredRecoveryActionLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.PreferredRecoveryActionLabel;
	Surface.PreferredRecoveryActionSourceLabel =
		HistorySurface.PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("none")
			: HistorySurface.PreferredRecoveryActionSourceLabel;
	Surface.PreferredRecoveryActionSourceDescription =
		HistorySurface.PreferredRecoveryActionSourceDescription.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.PreferredRecoveryActionSourceDescription;
	Surface.RecommendedHandoffKindLabel = HistorySurface.RecommendedHandoffKindLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RecommendedHandoffKindLabel;
	Surface.QueueRecoveryStatusLine = HistorySurface.QueueRecoveryStatusLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.QueueRecoveryStatusLine;
	Surface.HandoffRecommendationStatusLine = HistorySurface.HandoffRecommendationStatusLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.HandoffRecommendationStatusLine;
	Surface.GeneratedGuidancePacketKindLabel = HistorySurface.GeneratedGuidancePacketKindLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.GeneratedGuidancePacketKindLabel;
	Surface.GeneratedGuidancePacketSourceLabel = HistorySurface.GeneratedGuidancePacketSourceLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.GeneratedGuidancePacketSourceLabel;
	Surface.GeneratedGuidancePacketSourceDescription =
		HistorySurface.GeneratedGuidancePacketSourceDescription.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.GeneratedGuidancePacketSourceDescription;
	Surface.GeneratedGuidancePacketHeadline = HistorySurface.GeneratedGuidancePacketHeadline.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.GeneratedGuidancePacketHeadline;
	Surface.GeneratedGuidancePacketActionLabel = HistorySurface.GeneratedGuidancePacketActionLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.GeneratedGuidancePacketActionLabel;
	Surface.GeneratedPlanModeLabel = HistorySurface.GeneratedPlanModeLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.GeneratedPlanModeLabel;
	Surface.GeneratedPlanSelectionLabel = HistorySurface.GeneratedPlanSelectionLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.GeneratedPlanSelectionLabel;
	Surface.GeneratedPlanPostureLabel = HistorySurface.GeneratedPlanPostureLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.GeneratedPlanPostureLabel;
	Surface.DominantPressureLine = HistorySurface.DominantPressureLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.DominantPressureLine;
	Surface.StructureBiasLine = HistorySurface.StructureBiasLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.StructureBiasLine;
	Surface.ReliablePlanLine = HistorySurface.ReliablePlanLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.ReliablePlanLine;
	Surface.MemoryBiasLine = HistorySurface.MemoryBiasLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.MemoryBiasLine;
	Surface.PlanSourceLine = HistorySurface.PlanSourceLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.PlanSourceLine;
	Surface.PlanAlignmentLine = HistorySurface.PlanAlignmentLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.PlanAlignmentLine;
	Surface.ComparisonPreferenceLine = HistorySurface.ComparisonPreferenceLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.ComparisonPreferenceLine;
	Surface.GeneratedPacketStanceLine = HistorySurface.GeneratedPacketStanceLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.GeneratedPacketStanceLine;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.GeneratedGuidancePacketFocusCaseCount = HistorySurface.GeneratedGuidancePacketFocusCaseCount;
	Surface.MethodDrillRecoveryHistoryCount = HistorySurface.MethodDrillRecoveryHistoryCount;
	Surface.StrongMethodDrillRecoveryHistoryCount = HistorySurface.StrongMethodDrillRecoveryHistoryCount;
	Surface.WeakMethodDrillRecoveryHistoryCount = HistorySurface.WeakMethodDrillRecoveryHistoryCount;
	Surface.NarrowMethodDrillPacketStructureRecoveryLaunchCount =
		HistorySurface.NarrowMethodDrillPacketStructureRecoveryLaunchCount;
	Surface.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount =
		HistorySurface.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount;
	Surface.BroadMethodDrillPacketStructureRecoveryPromoteCount =
		HistorySurface.BroadMethodDrillPacketStructureRecoveryPromoteCount;
	Surface.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount =
		HistorySurface.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount;
	Surface.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		HistorySurface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		HistorySurface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		HistorySurface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		HistorySurface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		HistorySurface.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		HistorySurface.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Surface.MethodDrillRecoveryAverageOutcomeScore = HistorySurface.MethodDrillRecoveryAverageOutcomeScore;
	Surface.PreferredRecoveryAction = HistorySurface.PreferredRecoveryAction;
	Surface.GeneratedPlanSuggestedMode = HistorySurface.GeneratedPlanSuggestedMode;
	Surface.GeneratedPlanSuggestedSelectionPolicy = HistorySurface.GeneratedPlanSuggestedSelectionPolicy;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bStrongPressureDominant = HistorySurface.bStrongPressureDominant;
	Surface.bWeakPressureDominant = HistorySurface.bWeakPressureDominant;
	Surface.bNarrowPacketStructureRecoveryDominant = HistorySurface.bNarrowPacketStructureRecoveryDominant;
	Surface.bBroadPacketStructureRecoveryDominant = HistorySurface.bBroadPacketStructureRecoveryDominant;
	Surface.bReliableTrustedTightStructurePlanDominant = HistorySurface.bReliableTrustedTightStructurePlanDominant;
	Surface.bReliableTrustedBroadStructurePlanDominant = HistorySurface.bReliableTrustedBroadStructurePlanDominant;
	Surface.bReliableAlignedTrustedTightStructurePlanDominant = HistorySurface.bReliableAlignedTrustedTightStructurePlanDominant;
	Surface.bReliableAlignedTrustedBroadStructurePlanDominant = HistorySurface.bReliableAlignedTrustedBroadStructurePlanDominant;
	Surface.bReliableAlignedTrustedTightStructurePlanOutcomeDominant =
		HistorySurface.bReliableAlignedTrustedTightStructurePlanOutcomeDominant;
	Surface.bReliableAlignedTrustedBroadStructurePlanOutcomeDominant =
		HistorySurface.bReliableAlignedTrustedBroadStructurePlanOutcomeDominant;
	Surface.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture =
		HistorySurface.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture =
		HistorySurface.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory =
		HistorySurface.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory;
	Surface.bGeneratedPlanUsedTightStructureContinuationPosture =
		HistorySurface.bGeneratedPlanUsedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedBroadStructureRedirectPosture =
		HistorySurface.bGeneratedPlanUsedBroadStructureRedirectPosture;
	Surface.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture =
		HistorySurface.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture =
		HistorySurface.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture;
	Surface.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture =
		HistorySurface.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture;
	Surface.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture =
		HistorySurface.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture;
	Surface.bUsedMethodDrillRecoveryMemoryForRecovery = HistorySurface.bUsedMethodDrillRecoveryMemoryForRecovery;
	Surface.bUsedMethodDrillRecoveryMemoryForHandoff = HistorySurface.bUsedMethodDrillRecoveryMemoryForHandoff;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillRecoveryMemoryHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillRecoveryMemoryHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill recovery memory history navigation");

	const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry* SelectedEntry =
		SelectedMethodDrillRecoveryMemoryHistoryIndex >= 0
		&& SelectedMethodDrillRecoveryMemoryHistoryIndex
			< MethodDrillRecoveryMemoryHistoryEntries.Num()
			? &MethodDrillRecoveryMemoryHistoryEntries[SelectedMethodDrillRecoveryMemoryHistoryIndex]
			: nullptr;
	const bool bNavigationEnabled = MethodDrillRecoveryMemoryHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousMethodDrillRecoveryMemoryNavigationLabel.IsEmpty()
		? DisplayedPreviousMethodDrillRecoveryMemoryNavigationLabel
		: TEXT("Prev Drill Memory");
	Surface.NextLabel = !DisplayedNextMethodDrillRecoveryMemoryNavigationLabel.IsEmpty()
		? DisplayedNextMethodDrillRecoveryMemoryNavigationLabel
		: TEXT("Next Drill Memory");
	Surface.SelectedEntryIndex = SelectedMethodDrillRecoveryMemoryHistoryIndex;
	Surface.HistoryEntryCount = MethodDrillRecoveryMemoryHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedMethodDrillRecoveryMemoryHistoryIndex
			== MethodDrillRecoveryMemoryHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.PreferredRecoveryActionLabel = TEXT("n/a");
		Surface.PreferredRecoveryActionSourceDescription = TEXT("n/a");
		Surface.RecommendedHandoffKindLabel = TEXT("n/a");
		Surface.DominantBiasLine = TEXT("n/a");
		Surface.GeneratedGuidancePacketKindLabel = TEXT("n/a");
		Surface.GeneratedPlanPostureLabel = TEXT("n/a");
		Surface.StatusLine =
			TEXT("Drill recovery memory navigation: no retained upstream drill-recovery memory shifts recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias MemoryBias =
		SelectedEntry->bStrongPressureDominant
			? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
			: (SelectedEntry->bWeakPressureDominant
				? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
				: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None);
	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedMethodDrillRecoveryMemoryHistoryIndex + 1,
		MethodDrillRecoveryMemoryHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.PreferredRecoveryActionLabel =
		SelectedEntry->PreferredRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::None
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->PreferredRecoveryAction);
	Surface.PreferredRecoveryActionSourceDescription =
		SelectedEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedEntry->PreferredRecoveryActionSourceLabel);
	Surface.RecommendedHandoffKindLabel = SelectedEntry->RecommendedHandoffKindLabel.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecommendedHandoffKindLabel;
	Surface.DominantBiasLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
			MemoryBias);
	Surface.GeneratedGuidancePacketKindLabel =
		SelectedEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->GeneratedGuidancePacketKindLabel;
	Surface.GeneratedPlanPostureLabel = SelectedEntry->GeneratedPlanPostureLabel.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->GeneratedPlanPostureLabel;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill recovery memory navigation: selected %s | %s | %s | Packet: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.RecommendedHandoffKindLabel,
		*Surface.GeneratedGuidancePacketKindLabel,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | source: %s | bias: %s | plan: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.PreferredRecoveryActionSourceDescription,
		*Surface.DominantBiasLine,
		*Surface.GeneratedPlanPostureLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedMethodDrillFollowUpHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill follow-up history");
	Surface.SelectedEntryIndex = SelectedMethodDrillFollowUpHistoryIndex;
	Surface.HistoryEntryCount = MethodDrillFollowUpHistoryEntries.Num();

	const FHyperTwistCoachDashboardMethodDrillFollowUpWeighting Weighting =
		BuildMethodDrillFollowUpWeighting();
	Surface.MatchingHistoryCount = Weighting.MatchingHistoryCount;
	Surface.UpstreamPacketStructureHistoryCount = Weighting.UpstreamPacketStructureHistoryCount;
	Surface.UpstreamNarrowPacketStructureHistoryCount =
		Weighting.UpstreamNarrowPacketStructureHistoryCount;
	Surface.UpstreamBroadPacketStructureHistoryCount =
		Weighting.UpstreamBroadPacketStructureHistoryCount;
	Surface.StrongOutcomeCount = Weighting.StrongOutcomeCount;
	Surface.WeakOutcomeCount = Weighting.WeakOutcomeCount;
	Surface.ContinueNarrowBias = Weighting.ContinueNarrowBias;
	Surface.RedirectCoachBias = Weighting.RedirectCoachBias;
	Surface.StrongPacketContinuationCount = Weighting.StrongPacketContinuationCount;
	Surface.WeakPacketRedirectCount = Weighting.WeakPacketRedirectCount;
	Surface.QueueEntryFirstStructureCount = Weighting.QueueEntryFirstStructureCount;
	Surface.FollowUpPacketFirstStructureCount = Weighting.FollowUpPacketFirstStructureCount;
	Surface.RecommendedBriefFirstStructureCount = Weighting.RecommendedBriefFirstStructureCount;
	Surface.RecommendedRedirectStructureCount = Weighting.RecommendedRedirectStructureCount;
	Surface.AverageSuccessRate = Weighting.AverageSuccessRate;
	Surface.AverageMistakes = Weighting.AverageMistakes;
	Surface.UpstreamNarrowPacketStructureAverageOutcomeScore =
		Weighting.UpstreamNarrowPacketStructureAverageOutcomeScore;
	Surface.UpstreamBroadPacketStructureAverageOutcomeScore =
		Weighting.UpstreamBroadPacketStructureAverageOutcomeScore;
	Surface.bHasHistoryWeighting = Weighting.IsStructurallyValid();
	Surface.bPreferDrillFollowUp = Weighting.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = Weighting.bPreferCoachHandoff;
	Surface.bHasUpstreamStructureSignal = Weighting.bHasUpstreamStructureSignal;
	Surface.bUsedUpstreamNarrowStructureSignal = Weighting.bUsedUpstreamNarrowStructureSignal;
	Surface.bUsedUpstreamBroadStructureSignal = Weighting.bUsedUpstreamBroadStructureSignal;
	Surface.OutcomePreferenceLine = !Weighting.IsStructurallyValid()
		? TEXT("no retained drill follow-up history yet")
		: (Weighting.bPreferDrillFollowUp
			? (Weighting.bUsedUpstreamNarrowStructureSignal
				? TEXT("retained drill-follow-up packet structure history favors staying narrow with drill follow-up")
				: TEXT("retained drill history favors staying narrow with drill follow-up"))
			: (Weighting.bPreferCoachHandoff
				? (Weighting.bUsedUpstreamBroadStructureSignal
					? TEXT("retained drill-follow-up packet structure history favors handing control back to broader coach guidance")
					: TEXT("retained drill history favors handing control back to broader coach guidance"))
				: TEXT("retained drill history is balanced")));

	const FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry* SelectedEntry =
		SelectedMethodDrillFollowUpHistoryIndex >= 0
		&& SelectedMethodDrillFollowUpHistoryIndex < MethodDrillFollowUpHistoryEntries.Num()
			? &MethodDrillFollowUpHistoryEntries[SelectedMethodDrillFollowUpHistoryIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Drill follow-up history: no retained drill follow-up outcomes recorded yet.");
		Surface.DetailLine =
			TEXT("Drill follow-up history detail: once drill-derived follow-up runs complete, their recap outcomes will accumulate here and feed later drill-vs-handoff judgment.");
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.SourceRunId = SelectedEntry->SourceRunId;
	Surface.SourceDrillId = SelectedEntry->SourceDrillId;
	Surface.SourceSessionId = SelectedEntry->SourceSessionId;
	Surface.StageLabel =
		SelectedEntry->StageLabel.IsEmpty() ? TEXT("n/a") : SelectedEntry->StageLabel;
	Surface.DiagnosticState = SelectedEntry->DiagnosticState;
	Surface.DiagnosticStateLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->DiagnosticState);
	Surface.RecommendedReviewGrade = SelectedEntry->RecommendedReviewGrade;
	Surface.RecommendedReviewGradeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->RecommendedReviewGrade);
	Surface.TemplateKind = SelectedEntry->TemplateKind;
	Surface.TemplateKindLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->TemplateKind);
	Surface.SuggestedMode = SelectedEntry->SuggestedMode;
	Surface.SuggestedModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedMode);
	Surface.SuggestedSelectionPolicy = SelectedEntry->SuggestedSelectionPolicy;
	Surface.SuggestedSelectionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedSelectionPolicy);
	Surface.PacketStructureLabel =
		SelectedEntry->PacketStructureLabel.IsEmpty()
			? TEXT("default")
			: SelectedEntry->PacketStructureLabel;
	Surface.PacketLaneLabel =
		SelectedEntry->PacketLaneLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->PacketLaneLabel;
	Surface.PacketStanceLabel =
		SelectedEntry->PacketStanceLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->PacketStanceLabel;
	Surface.FocusCaseCount = SelectedEntry->FocusCaseCount;
	Surface.LaunchedCaseCount = SelectedEntry->LaunchedCaseCount;
	Surface.CompletedAttemptCount = SelectedEntry->CompletedAttemptCount;
	Surface.TotalMistakes = SelectedEntry->TotalMistakes;
	Surface.SuccessRate = SelectedEntry->SuccessRate;
	Surface.bBoundaryPending = SelectedEntry->bBoundaryPending;
	Surface.bBoundaryRepeatBurden = SelectedEntry->bBoundaryRepeatBurden;
	Surface.bBoundaryAssistance = SelectedEntry->bBoundaryAssistance;
	Surface.bPacketProvenStrongContinuation =
		SelectedEntry->bPacketProvenStrongContinuation;
	Surface.bPacketProvenWeakRedirect = SelectedEntry->bPacketProvenWeakRedirect;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill follow-up history: %d entries | selected %d/%d | Stage: %s | review %s | Recorded: %s"),
		MethodDrillFollowUpHistoryEntries.Num(),
		SelectedMethodDrillFollowUpHistoryIndex + 1,
		MethodDrillFollowUpHistoryEntries.Num(),
		*Surface.StageLabel,
		*Surface.RecommendedReviewGradeLabel,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("State: %s | template: %s | mode: %s | selection: %s | focus %d | launched %d | success %.2f | attempts %d | mistakes %d | packet structure: %s | packet lane: %s | packet stance: %s | pending: %s | repeat burden: %s | assistance: %s"),
		*Surface.DiagnosticStateLabel,
		*Surface.TemplateKindLabel,
		*Surface.SuggestedModeLabel,
		*Surface.SuggestedSelectionLabel,
		SelectedEntry->FocusCaseCount,
		SelectedEntry->LaunchedCaseCount,
		SelectedEntry->SuccessRate,
		SelectedEntry->CompletedAttemptCount,
		SelectedEntry->TotalMistakes,
		*Surface.PacketStructureLabel,
		*Surface.PacketLaneLabel,
		*Surface.PacketStanceLabel,
		SelectedEntry->bBoundaryPending ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bBoundaryRepeatBurden ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bBoundaryAssistance ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillFollowUpHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill follow-up history status");

	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillFollowUpHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillFollowUpHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedMethodDrillFollowUpHistoryStatusLine.IsEmpty()
		? DisplayedMethodDrillFollowUpHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.StageLabel = !HistorySurface.StageLabel.IsEmpty()
		? HistorySurface.StageLabel
		: (NavigationSurface.StageLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.StageLabel);
	Surface.RecommendedReviewGradeLabel = !HistorySurface.RecommendedReviewGradeLabel.IsEmpty()
		? HistorySurface.RecommendedReviewGradeLabel
		: (NavigationSurface.RecommendedReviewGradeLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.RecommendedReviewGradeLabel);
	Surface.SuggestedModeLabel = !HistorySurface.SuggestedModeLabel.IsEmpty()
		? HistorySurface.SuggestedModeLabel
		: (NavigationSurface.SuggestedModeLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.SuggestedModeLabel);
	Surface.PacketStructureLabel = !HistorySurface.PacketStructureLabel.IsEmpty()
		? HistorySurface.PacketStructureLabel
		: (NavigationSurface.PacketStructureLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.PacketStructureLabel);
	Surface.PacketStanceLabel = !HistorySurface.PacketStanceLabel.IsEmpty()
		? HistorySurface.PacketStanceLabel
		: (NavigationSurface.PacketStanceLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.PacketStanceLabel);
	Surface.OutcomePreferenceLine = !NavigationSurface.OutcomePreferenceLine.IsEmpty()
		? NavigationSurface.OutcomePreferenceLine
		: (HistorySurface.OutcomePreferenceLine.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.OutcomePreferenceLine);
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.MatchingHistoryCount = HistorySurface.MatchingHistoryCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	Surface.bHasHistoryWeighting =
		NavigationSurface.bHasHistoryWeighting || HistorySurface.bHasHistoryWeighting;
	Surface.bPreferDrillFollowUp =
		NavigationSurface.bPreferDrillFollowUp || HistorySurface.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff =
		NavigationSurface.bPreferCoachHandoff || HistorySurface.bPreferCoachHandoff;
	Surface.bHasUpstreamStructureSignal =
		NavigationSurface.bHasUpstreamStructureSignal
		|| HistorySurface.bHasUpstreamStructureSignal;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillFollowUpHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill follow-up history detail");

	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryInspectSurface HistorySurface =
		GetSelectedMethodDrillFollowUpHistoryInspectSurface();

	Surface.DetailLine = !DisplayedMethodDrillFollowUpHistoryDetailLine.IsEmpty()
		? DisplayedMethodDrillFollowUpHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.SourceRunId = HistorySurface.SourceRunId.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceRunId;
	Surface.SourceDrillId =
		HistorySurface.SourceDrillId.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceDrillId;
	Surface.SourceSessionId =
		HistorySurface.SourceSessionId.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceSessionId;
	Surface.DiagnosticStateLabel = HistorySurface.DiagnosticStateLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.DiagnosticStateLabel;
	Surface.TemplateKindLabel =
		HistorySurface.TemplateKindLabel.IsEmpty() ? TEXT("n/a") : HistorySurface.TemplateKindLabel;
	Surface.SuggestedSelectionLabel = HistorySurface.SuggestedSelectionLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.SuggestedSelectionLabel;
	Surface.OutcomePreferenceLine = HistorySurface.OutcomePreferenceLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.OutcomePreferenceLine;
	Surface.PacketStructureLabel = HistorySurface.PacketStructureLabel.IsEmpty()
		? TEXT("default")
		: HistorySurface.PacketStructureLabel;
	Surface.PacketLaneLabel =
		HistorySurface.PacketLaneLabel.IsEmpty() ? TEXT("none") : HistorySurface.PacketLaneLabel;
	Surface.PacketStanceLabel = HistorySurface.PacketStanceLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.PacketStanceLabel;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.MatchingHistoryCount = HistorySurface.MatchingHistoryCount;
	Surface.FocusCaseCount = HistorySurface.FocusCaseCount;
	Surface.LaunchedCaseCount = HistorySurface.LaunchedCaseCount;
	Surface.CompletedAttemptCount = HistorySurface.CompletedAttemptCount;
	Surface.TotalMistakes = HistorySurface.TotalMistakes;
	Surface.SuccessRate = HistorySurface.SuccessRate;
	Surface.AverageSuccessRate = HistorySurface.AverageSuccessRate;
	Surface.AverageMistakes = HistorySurface.AverageMistakes;
	Surface.UpstreamNarrowPacketStructureAverageOutcomeScore =
		HistorySurface.UpstreamNarrowPacketStructureAverageOutcomeScore;
	Surface.UpstreamBroadPacketStructureAverageOutcomeScore =
		HistorySurface.UpstreamBroadPacketStructureAverageOutcomeScore;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bHasHistoryWeighting = HistorySurface.bHasHistoryWeighting;
	Surface.bBoundaryPending = HistorySurface.bBoundaryPending;
	Surface.bBoundaryRepeatBurden = HistorySurface.bBoundaryRepeatBurden;
	Surface.bBoundaryAssistance = HistorySurface.bBoundaryAssistance;
	Surface.bPacketProvenStrongContinuation = HistorySurface.bPacketProvenStrongContinuation;
	Surface.bPacketProvenWeakRedirect = HistorySurface.bPacketProvenWeakRedirect;
	Surface.bPreferDrillFollowUp = HistorySurface.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = HistorySurface.bPreferCoachHandoff;
	Surface.bHasUpstreamStructureSignal = HistorySurface.bHasUpstreamStructureSignal;
	Surface.bUsedUpstreamNarrowStructureSignal = HistorySurface.bUsedUpstreamNarrowStructureSignal;
	Surface.bUsedUpstreamBroadStructureSignal = HistorySurface.bUsedUpstreamBroadStructureSignal;
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillFollowUpHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill follow-up history navigation");

	const FHyperTwistCoachDashboardMethodDrillFollowUpWeighting Weighting =
		BuildMethodDrillFollowUpWeighting();
	const FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry* SelectedEntry =
		SelectedMethodDrillFollowUpHistoryIndex >= 0
		&& SelectedMethodDrillFollowUpHistoryIndex < MethodDrillFollowUpHistoryEntries.Num()
			? &MethodDrillFollowUpHistoryEntries[SelectedMethodDrillFollowUpHistoryIndex]
			: nullptr;
	const bool bNavigationEnabled = MethodDrillFollowUpHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousMethodDrillFollowUpNavigationLabel.IsEmpty()
		? DisplayedPreviousMethodDrillFollowUpNavigationLabel
		: TEXT("Prev Drill Follow-Up");
	Surface.NextLabel = !DisplayedNextMethodDrillFollowUpNavigationLabel.IsEmpty()
		? DisplayedNextMethodDrillFollowUpNavigationLabel
		: TEXT("Next Drill Follow-Up");
	Surface.SelectedEntryIndex = SelectedMethodDrillFollowUpHistoryIndex;
	Surface.HistoryEntryCount = MethodDrillFollowUpHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedMethodDrillFollowUpHistoryIndex
			== MethodDrillFollowUpHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	Surface.bHasHistoryWeighting = Weighting.IsStructurallyValid();
	Surface.bPreferDrillFollowUp = Weighting.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = Weighting.bPreferCoachHandoff;
	Surface.bHasUpstreamStructureSignal = Weighting.bHasUpstreamStructureSignal;
	Surface.OutcomePreferenceLine = !Weighting.IsStructurallyValid()
		? TEXT("no retained drill follow-up history yet")
		: (Weighting.bPreferDrillFollowUp
			? (Weighting.bUsedUpstreamNarrowStructureSignal
				? TEXT("retained drill-follow-up packet structure history favors staying narrow with drill follow-up")
				: TEXT("retained drill history favors staying narrow with drill follow-up"))
			: (Weighting.bPreferCoachHandoff
				? (Weighting.bUsedUpstreamBroadStructureSignal
					? TEXT("retained drill-follow-up packet structure history favors handing control back to broader coach guidance")
					: TEXT("retained drill history favors handing control back to broader coach guidance"))
				: TEXT("retained drill history is balanced")));

	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.StageLabel = TEXT("n/a");
		Surface.DiagnosticStateLabel = TEXT("n/a");
		Surface.RecommendedReviewGradeLabel = TEXT("n/a");
		Surface.SuggestedModeLabel = TEXT("n/a");
		Surface.PacketStructureLabel = TEXT("n/a");
		Surface.PacketStanceLabel = TEXT("n/a");
		Surface.StatusLine =
			TEXT("Drill follow-up navigation: no retained drill follow-up outcomes recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | preference: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.OutcomePreferenceLine);
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedMethodDrillFollowUpHistoryIndex + 1,
		MethodDrillFollowUpHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.StageLabel =
		SelectedEntry->StageLabel.IsEmpty() ? TEXT("n/a") : SelectedEntry->StageLabel;
	Surface.DiagnosticStateLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->DiagnosticState);
	Surface.RecommendedReviewGradeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->RecommendedReviewGrade);
	Surface.SuggestedModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedMode);
	Surface.PacketStructureLabel =
		SelectedEntry->PacketStructureLabel.IsEmpty()
			? TEXT("default")
			: SelectedEntry->PacketStructureLabel;
	Surface.PacketStanceLabel =
		SelectedEntry->PacketStanceLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->PacketStanceLabel;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill follow-up navigation: selected %s | Stage: %s | review %s | packet: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.StageLabel,
		*Surface.RecommendedReviewGradeLabel,
		*Surface.PacketStructureLabel,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | state: %s | mode: %s | preference: %s | stance: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.DiagnosticStateLabel,
		*Surface.SuggestedModeLabel,
		*Surface.OutcomePreferenceLine,
		*Surface.PacketStanceLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillFollowUpHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Method-drill follow-up history band");

	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryStatusInspectSurface StatusSurface =
		GetDisplayedMethodDrillFollowUpHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryDetailInspectSurface DetailSurface =
		GetDisplayedMethodDrillFollowUpHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedMethodDrillFollowUpHistoryNavigationInspectSurface();

	Surface.HistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill follow-up history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.HistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill follow-up history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.HistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Method-drill follow-up history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.HistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Method-drill follow-up history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.SelectedEntryOrdinal = StatusSurface.SelectedEntryOrdinal.IsEmpty()
		? (NavigationSurface.SelectedEntryOrdinal.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedEntryOrdinal)
		: StatusSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = StatusSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : StatusSurface.RecordedAtUtc;
	Surface.StageLabel = !StatusSurface.StageLabel.IsEmpty()
		? StatusSurface.StageLabel
		: (NavigationSurface.StageLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.StageLabel);
	Surface.DiagnosticStateLabel = DetailSurface.DiagnosticStateLabel.IsEmpty()
		? (NavigationSurface.DiagnosticStateLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.DiagnosticStateLabel)
		: DetailSurface.DiagnosticStateLabel;
	Surface.RecommendedReviewGradeLabel = !StatusSurface.RecommendedReviewGradeLabel.IsEmpty()
		? StatusSurface.RecommendedReviewGradeLabel
		: (NavigationSurface.RecommendedReviewGradeLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.RecommendedReviewGradeLabel);
	Surface.SuggestedModeLabel = !StatusSurface.SuggestedModeLabel.IsEmpty()
		? StatusSurface.SuggestedModeLabel
		: (NavigationSurface.SuggestedModeLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.SuggestedModeLabel);
	Surface.SuggestedSelectionLabel = DetailSurface.SuggestedSelectionLabel.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.SuggestedSelectionLabel;
	Surface.OutcomePreferenceLine = !StatusSurface.OutcomePreferenceLine.IsEmpty()
		? StatusSurface.OutcomePreferenceLine
		: (NavigationSurface.OutcomePreferenceLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.OutcomePreferenceLine);
	Surface.PacketStructureLabel = !StatusSurface.PacketStructureLabel.IsEmpty()
		? StatusSurface.PacketStructureLabel
		: (NavigationSurface.PacketStructureLabel.IsEmpty() ? TEXT("default") : NavigationSurface.PacketStructureLabel);
	Surface.PacketLaneLabel = DetailSurface.PacketLaneLabel.IsEmpty() ? TEXT("none") : DetailSurface.PacketLaneLabel;
	Surface.PacketStanceLabel = !StatusSurface.PacketStanceLabel.IsEmpty()
		? StatusSurface.PacketStanceLabel
		: (NavigationSurface.PacketStanceLabel.IsEmpty() ? TEXT("none") : NavigationSurface.PacketStanceLabel);
	Surface.SourceRunId = DetailSurface.SourceRunId.IsEmpty() ? TEXT("n/a") : DetailSurface.SourceRunId;
	Surface.SourceDrillId = DetailSurface.SourceDrillId.IsEmpty() ? TEXT("n/a") : DetailSurface.SourceDrillId;
	Surface.SourceSessionId = DetailSurface.SourceSessionId.IsEmpty() ? TEXT("n/a") : DetailSurface.SourceSessionId;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Drill Follow-Up") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Drill Follow-Up") : NavigationSurface.NextLabel;
	Surface.SelectedEntryIndex = StatusSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = StatusSurface.HistoryEntryCount;
	Surface.MatchingHistoryCount = StatusSurface.MatchingHistoryCount;
	Surface.FocusCaseCount = DetailSurface.FocusCaseCount;
	Surface.LaunchedCaseCount = DetailSurface.LaunchedCaseCount;
	Surface.CompletedAttemptCount = DetailSurface.CompletedAttemptCount;
	Surface.TotalMistakes = DetailSurface.TotalMistakes;
	Surface.SuccessRate = DetailSurface.SuccessRate;
	Surface.AverageSuccessRate = DetailSurface.AverageSuccessRate;
	Surface.AverageMistakes = DetailSurface.AverageMistakes;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bHasHistoryWeighting = StatusSurface.bHasHistoryWeighting || DetailSurface.bHasHistoryWeighting || NavigationSurface.bHasHistoryWeighting;
	Surface.bPreferDrillFollowUp = StatusSurface.bPreferDrillFollowUp || DetailSurface.bPreferDrillFollowUp || NavigationSurface.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = StatusSurface.bPreferCoachHandoff || DetailSurface.bPreferCoachHandoff || NavigationSurface.bPreferCoachHandoff;
	Surface.bHasUpstreamStructureSignal = StatusSurface.bHasUpstreamStructureSignal || DetailSurface.bHasUpstreamStructureSignal || NavigationSurface.bHasUpstreamStructureSignal;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill-follow-up-history band: selected %s | stage %s | review %s | navigation %s/%s | weighting %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.StageLabel,
		*Surface.RecommendedReviewGradeLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bHasHistoryWeighting ? TEXT("yes") : TEXT("no"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | source drill %s | mode %s | selection %s | packet %s/%s/%s | focus %d | launched %d | success %.2f | latest %s"),
		*Surface.HistoryStatusLine,
		*Surface.HistoryDetailLine,
		*Surface.HistoryNavigationStatusLine,
		*Surface.HistoryNavigationDetailLine,
		*Surface.SourceDrillId,
		*Surface.SuggestedModeLabel,
		*Surface.SuggestedSelectionLabel,
		*Surface.PacketStructureLabel,
		*Surface.PacketLaneLabel,
		*Surface.PacketStanceLabel,
		Surface.FocusCaseCount,
		Surface.LaunchedCaseCount,
		Surface.SuccessRate,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedHandoffHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Handoff history");
	Surface.SelectedEntryIndex = SelectedHandoffHistoryIndex;
	Surface.HistoryEntryCount = HandoffHistoryEntries.Num();

	const FHyperTwistCoachDashboardHandoffHistoryEntry* SelectedEntry =
		SelectedHandoffHistoryIndex >= 0
		&& SelectedHandoffHistoryIndex < HandoffHistoryEntries.Num()
			? &HandoffHistoryEntries[SelectedHandoffHistoryIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Handoff history: no retained handoff-pattern shifts recorded yet.");
		Surface.DetailLine =
			TEXT("Handoff history detail: retained recommendation shifts and accepted queued/follow-up/recommended handoff patterns will accumulate here over time.");
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.RecommendedHandoffKindLabel =
		SelectedEntry->RecommendedHandoffKindLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->RecommendedHandoffKindLabel;
	Surface.RecommendationStatusLine = SelectedEntry->RecommendationStatusLine;
	Surface.RecommendationDetailLine =
		SelectedEntry->RecommendationDetailLine.IsEmpty()
			? SelectedEntry->RecommendationStatusLine
			: SelectedEntry->RecommendationDetailLine;
	Surface.QueueSourceLabel =
		SelectedEntry->QueueSourceLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedEntry->QueueSourceLabel;
	Surface.PreferredGuidanceLane = SelectedEntry->PreferredGuidanceLane;
	Surface.PreferredLaneLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
			SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredGuidanceSourceLabel = SelectedEntry->PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription =
		SelectedEntry->PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedEntry->PreferredGuidanceSourceLabel);
	Surface.PreferredRecoveryAction = SelectedEntry->PreferredRecoveryAction;
	Surface.PreferredRecoveryActionLabel =
		SelectedEntry->PreferredRecoveryAction
				== EHyperTwistTrainingQueueRecoveryAction::None
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->PreferredRecoveryAction);
	Surface.PreferredRecoveryActionSourceLabel =
		SelectedEntry->PreferredRecoveryActionSourceLabel;
	Surface.PreferredRecoveryActionSourceDescription =
		SelectedEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedEntry->PreferredRecoveryActionSourceLabel);
	Surface.RetainedPostureLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
			SelectedEntry->bUsedStrongRetainedMethodDrillRecoveryPosture,
			SelectedEntry->bUsedWeakRetainedMethodDrillRecoveryPosture);
	Surface.ReliablePlanLine = [&]() -> FString
	{
		if (SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted tight launched-plan continuation");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted broad launched-plan redirect");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanHistory)
		{
			return TEXT("aligned trusted tight continuation");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanHistory)
		{
			return TEXT("aligned trusted broad redirect");
		}
		if (SelectedEntry->bUsedReliableTrustedTightStructurePlanHistory)
		{
			return TEXT("trusted tight continuation");
		}
		if (SelectedEntry->bUsedReliableTrustedBroadStructurePlanHistory)
		{
			return TEXT("trusted broad redirect");
		}
		return TEXT("none");
	}();
	Surface.AcceptedQueuedHandoffCount = SelectedEntry->AcceptedQueuedHandoffCount;
	Surface.AcceptedFollowUpHandoffCount = SelectedEntry->AcceptedFollowUpHandoffCount;
	Surface.AcceptedRecommendedHandoffCount =
		SelectedEntry->AcceptedRecommendedHandoffCount;
	Surface.AcceptedDeferredOverflowQueuedHandoffCount =
		SelectedEntry->AcceptedDeferredOverflowQueuedHandoffCount;
	Surface.AcceptedDeferredOverflowFollowUpHandoffCount =
		SelectedEntry->AcceptedDeferredOverflowFollowUpHandoffCount;
	Surface.AcceptedDeferredOverflowRecommendedHandoffCount =
		SelectedEntry->AcceptedDeferredOverflowRecommendedHandoffCount;
	Surface.AcceptedMethodDrillQueuedHandoffCount =
		SelectedEntry->AcceptedMethodDrillQueuedHandoffCount;
	Surface.AcceptedMethodDrillFollowUpHandoffCount =
		SelectedEntry->AcceptedMethodDrillFollowUpHandoffCount;
	Surface.AcceptedMethodDrillRecommendedHandoffCount =
		SelectedEntry->AcceptedMethodDrillRecommendedHandoffCount;
	Surface.AcceptedAlignedTightFollowUpOutcomeHandoffCount =
		SelectedEntry->AcceptedAlignedTightFollowUpOutcomeHandoffCount;
	Surface.AcceptedAlignedBroadRecommendedOutcomeHandoffCount =
		SelectedEntry->AcceptedAlignedBroadRecommendedOutcomeHandoffCount;
	Surface.AcceptedAlignedTightFollowUpPacketHandoffCount =
		SelectedEntry->AcceptedAlignedTightFollowUpPacketHandoffCount;
	Surface.AcceptedAlignedBroadRecommendedPacketHandoffCount =
		SelectedEntry->AcceptedAlignedBroadRecommendedPacketHandoffCount;
	Surface.ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount =
		SelectedEntry->ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount;
	Surface.ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount =
		SelectedEntry->ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount;
	Surface.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeAverageScore;
	Surface.ClosureContinuationBias = SelectedEntry->ClosureContinuationBias;
	Surface.ClosureSuppressionBias = SelectedEntry->ClosureSuppressionBias;
	Surface.bQueueReady = SelectedEntry->bQueueReady;
	Surface.bFollowUpReady = SelectedEntry->bFollowUpReady;
	Surface.bRecommendedReady = SelectedEntry->bRecommendedReady;
	Surface.bUsedDeferredFirstSuppressionSignal =
		SelectedEntry->bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillWeighting = SelectedEntry->bUsedMethodDrillWeighting;
	Surface.bUsedStrongRetainedMethodDrillRecoveryPosture =
		SelectedEntry->bUsedStrongRetainedMethodDrillRecoveryPosture;
	Surface.bUsedWeakRetainedMethodDrillRecoveryPosture =
		SelectedEntry->bUsedWeakRetainedMethodDrillRecoveryPosture;
	Surface.bUsedReliableTrustedTightStructurePlanHistory =
		SelectedEntry->bUsedReliableTrustedTightStructurePlanHistory;
	Surface.bUsedReliableTrustedBroadStructurePlanHistory =
		SelectedEntry->bUsedReliableTrustedBroadStructurePlanHistory;
	Surface.bUsedReliableAlignedTrustedTightStructurePlanHistory =
		SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanHistory;
	Surface.bUsedReliableAlignedTrustedBroadStructurePlanHistory =
		SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanHistory;
	Surface.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory =
		SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory;
	Surface.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory =
		SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory;
	Surface.StatusLine = FString::Printf(
		TEXT("Handoff history: %d entries | selected %d/%d | Recommendation: %s | Stance: %s | Reliable plan: %s | Recorded: %s"),
		HandoffHistoryEntries.Num(),
		SelectedHandoffHistoryIndex + 1,
		HandoffHistoryEntries.Num(),
		*Surface.RecommendedHandoffKindLabel,
		*Surface.RetainedPostureLine,
		*Surface.ReliablePlanLine,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Accepted queued/follow-up/recommended: %d/%d/%d | aligned guidance accepted follow-up/recommended: %d/%d | aligned packet accepted follow-up/recommended: %d/%d | reliable accepted aligned packet handoff follow-up/recommended: %d/%d | deferred-overflow queued/follow-up/recommended: %d/%d/%d | drill-driven queued/follow-up/recommended: %d/%d/%d | aligned reliable handoff outcomes tight/broad %d/%d avg %.1f/%.1f | deferred-first suppression recommendation used: %s | drill weighting used: %s | reliable trusted plan: %s | retained posture: %s | queue source: %s | preferred lane: %s | memory source: %s | recovery action: %s | recovery source: %s | closure continuation bias %d | closure suppression bias %d | readiness queue/follow-up/recommended: %s/%s/%s || %s"),
		SelectedEntry->AcceptedQueuedHandoffCount,
		SelectedEntry->AcceptedFollowUpHandoffCount,
		SelectedEntry->AcceptedRecommendedHandoffCount,
		SelectedEntry->AcceptedAlignedTightFollowUpOutcomeHandoffCount,
		SelectedEntry->AcceptedAlignedBroadRecommendedOutcomeHandoffCount,
		SelectedEntry->AcceptedAlignedTightFollowUpPacketHandoffCount,
		SelectedEntry->AcceptedAlignedBroadRecommendedPacketHandoffCount,
		SelectedEntry->ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount,
		SelectedEntry->ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount,
		SelectedEntry->AcceptedDeferredOverflowQueuedHandoffCount,
		SelectedEntry->AcceptedDeferredOverflowFollowUpHandoffCount,
		SelectedEntry->AcceptedDeferredOverflowRecommendedHandoffCount,
		SelectedEntry->AcceptedMethodDrillQueuedHandoffCount,
		SelectedEntry->AcceptedMethodDrillFollowUpHandoffCount,
		SelectedEntry->AcceptedMethodDrillRecommendedHandoffCount,
		SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
		SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
		SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeAverageScore,
		SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
		SelectedEntry->bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bUsedMethodDrillWeighting ? TEXT("yes") : TEXT("no"),
		*Surface.ReliablePlanLine,
		*Surface.RetainedPostureLine,
		*Surface.QueueSourceLabel,
		*Surface.PreferredLaneLine,
		*Surface.PreferredGuidanceSourceDescription,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.PreferredRecoveryActionSourceDescription,
		SelectedEntry->ClosureContinuationBias,
		SelectedEntry->ClosureSuppressionBias,
		SelectedEntry->bQueueReady ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bFollowUpReady ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bRecommendedReady ? TEXT("yes") : TEXT("no"),
		*Surface.RecommendationDetailLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedHandoffHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Handoff history status");

	const FHyperTwistTrainingCoachDashboardHandoffHistoryInspectSurface HistorySurface =
		GetSelectedHandoffHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardHandoffHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedHandoffHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedHandoffHistoryStatusLine.IsEmpty()
		? DisplayedHandoffHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.RecommendedHandoffKindLabel = HistorySurface.RecommendedHandoffKindLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.RecommendedHandoffKindLabel;
	Surface.RetainedPostureLine = HistorySurface.RetainedPostureLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RetainedPostureLine;
	Surface.ReliablePlanLine = HistorySurface.ReliablePlanLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.ReliablePlanLine;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedHandoffHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Handoff history detail");

	const FHyperTwistTrainingCoachDashboardHandoffHistoryInspectSurface HistorySurface =
		GetSelectedHandoffHistoryInspectSurface();

	Surface.DetailLine = !DisplayedHandoffHistoryDetailLine.IsEmpty()
		? DisplayedHandoffHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.RecommendationDetailLine = HistorySurface.RecommendationDetailLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RecommendationDetailLine;
	Surface.QueueSourceLabel =
		HistorySurface.QueueSourceLabel.IsEmpty() ? TEXT("n/a") : HistorySurface.QueueSourceLabel;
	Surface.PreferredLaneLine =
		HistorySurface.PreferredLaneLine.IsEmpty() ? TEXT("none") : HistorySurface.PreferredLaneLine;
	Surface.PreferredGuidanceSourceDescription =
		HistorySurface.PreferredGuidanceSourceDescription.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.PreferredGuidanceSourceDescription;
	Surface.PreferredRecoveryActionLabel =
		HistorySurface.PreferredRecoveryActionLabel.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.PreferredRecoveryActionLabel;
	Surface.PreferredRecoveryActionSourceDescription =
		HistorySurface.PreferredRecoveryActionSourceDescription.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.PreferredRecoveryActionSourceDescription;
	Surface.ReliablePlanLine = HistorySurface.ReliablePlanLine.IsEmpty()
		? TEXT("none")
		: HistorySurface.ReliablePlanLine;
	Surface.RetainedPostureLine = HistorySurface.RetainedPostureLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.RetainedPostureLine;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.AcceptedQueuedHandoffCount = HistorySurface.AcceptedQueuedHandoffCount;
	Surface.AcceptedFollowUpHandoffCount = HistorySurface.AcceptedFollowUpHandoffCount;
	Surface.AcceptedRecommendedHandoffCount =
		HistorySurface.AcceptedRecommendedHandoffCount;
	Surface.ClosureContinuationBias = HistorySurface.ClosureContinuationBias;
	Surface.ClosureSuppressionBias = HistorySurface.ClosureSuppressionBias;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bQueueReady = HistorySurface.bQueueReady;
	Surface.bFollowUpReady = HistorySurface.bFollowUpReady;
	Surface.bRecommendedReady = HistorySurface.bRecommendedReady;
	Surface.bUsedDeferredFirstSuppressionSignal =
		HistorySurface.bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillWeighting = HistorySurface.bUsedMethodDrillWeighting;
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedHandoffHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Handoff history navigation");

	const FHyperTwistCoachDashboardHandoffHistoryEntry* SelectedEntry =
		SelectedHandoffHistoryIndex >= 0
		&& SelectedHandoffHistoryIndex < HandoffHistoryEntries.Num()
			? &HandoffHistoryEntries[SelectedHandoffHistoryIndex]
			: nullptr;
	const bool bNavigationEnabled = HandoffHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousHandoffHistoryNavigationLabel.IsEmpty()
		? DisplayedPreviousHandoffHistoryNavigationLabel
		: TEXT("Prev Handoff");
	Surface.NextLabel = !DisplayedNextHandoffHistoryNavigationLabel.IsEmpty()
		? DisplayedNextHandoffHistoryNavigationLabel
		: TEXT("Next Handoff");
	Surface.SelectedEntryIndex = SelectedHandoffHistoryIndex;
	Surface.HistoryEntryCount = HandoffHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedHandoffHistoryIndex == HandoffHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.RecommendedHandoffKindLabel = TEXT("none");
		Surface.RecommendationDetailLine = TEXT("n/a");
		Surface.QueueSourceLabel = TEXT("n/a");
		Surface.PreferredLaneLine = TEXT("none");
		Surface.PreferredRecoveryActionLabel = TEXT("n/a");
		Surface.RetainedPostureLine = TEXT("n/a");
		Surface.ReliablePlanLine = TEXT("none");
		Surface.StatusLine =
			TEXT("Handoff navigation: no retained handoff-pattern shifts recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedHandoffHistoryIndex + 1,
		HandoffHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.RecommendedHandoffKindLabel =
		SelectedEntry->RecommendedHandoffKindLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->RecommendedHandoffKindLabel;
	Surface.RecommendationDetailLine =
		SelectedEntry->RecommendationDetailLine.IsEmpty()
			? (SelectedEntry->RecommendationStatusLine.IsEmpty()
				? TEXT("n/a")
				: SelectedEntry->RecommendationStatusLine)
			: SelectedEntry->RecommendationDetailLine;
	Surface.QueueSourceLabel = SelectedEntry->QueueSourceLabel.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->QueueSourceLabel;
	Surface.PreferredLaneLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
			SelectedEntry->PreferredGuidanceLane);
	Surface.PreferredRecoveryActionLabel =
		SelectedEntry->PreferredRecoveryAction
				== EHyperTwistTrainingQueueRecoveryAction::None
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->PreferredRecoveryAction);
	Surface.RetainedPostureLine =
		HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
			SelectedEntry->bUsedStrongRetainedMethodDrillRecoveryPosture,
			SelectedEntry->bUsedWeakRetainedMethodDrillRecoveryPosture);
	Surface.ReliablePlanLine = [&]() -> FString
	{
		if (SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted tight launched-plan continuation");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted broad launched-plan redirect");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedTightStructurePlanHistory)
		{
			return TEXT("aligned trusted tight continuation");
		}
		if (SelectedEntry->bUsedReliableAlignedTrustedBroadStructurePlanHistory)
		{
			return TEXT("aligned trusted broad redirect");
		}
		if (SelectedEntry->bUsedReliableTrustedTightStructurePlanHistory)
		{
			return TEXT("trusted tight continuation");
		}
		if (SelectedEntry->bUsedReliableTrustedBroadStructurePlanHistory)
		{
			return TEXT("trusted broad redirect");
		}
		return TEXT("none");
	}();
	Surface.bQueueReady = SelectedEntry->bQueueReady;
	Surface.bFollowUpReady = SelectedEntry->bFollowUpReady;
	Surface.bRecommendedReady = SelectedEntry->bRecommendedReady;
	Surface.StatusLine = FString::Printf(
		TEXT("Handoff navigation: selected %s | Recommendation: %s | Lane: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.RecommendedHandoffKindLabel,
		*Surface.PreferredLaneLine,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | recovery: %s | posture: %s | reliable plan: %s | readiness queue/follow-up/recommended: %s/%s/%s | queue source: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.PreferredRecoveryActionLabel,
		*Surface.RetainedPostureLine,
		*Surface.ReliablePlanLine,
		Surface.bQueueReady ? TEXT("yes") : TEXT("no"),
		Surface.bFollowUpReady ? TEXT("yes") : TEXT("no"),
		Surface.bRecommendedReady ? TEXT("yes") : TEXT("no"),
		*Surface.QueueSourceLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedGuidanceDecisionHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Decision history");
	Surface.SelectedEntryIndex = SelectedGuidanceDecisionIndex;
	Surface.HistoryEntryCount = GuidanceDecisionHistoryEntries.Num();
	Surface.bClosedLoopIdleActionability = IsCoachLoopActionabilityClosed();

	const auto BuildDecisionActionLabel =
		[this](const EHyperTwistCoachDashboardOutcomeAction Action) -> FString
	{
		return Action == EHyperTwistCoachDashboardOutcomeAction::None
			? TEXT("none")
			: BuildGuidanceOutcomeActionLabel(Action);
	};

	const EHyperTwistCoachDashboardOutcomeAction BaseAction = DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting Weighting =
		BuildGuidanceDecisionWeighting(BaseAction);
	Surface.bHasWeighting = Weighting.IsStructurallyValid();
	Surface.MatchingDecisionCount = Weighting.MatchingDecisionCount;
	Surface.RepeatSelectedCaseCount = Weighting.RepeatSelectedCaseCount;
	Surface.RepeatPreviewDeckCount = Weighting.RepeatPreviewDeckCount;
	Surface.BroadenPreviewDeckCount = Weighting.BroadenPreviewDeckCount;
	Surface.RedirectCoachGuidanceCount = Weighting.RedirectCoachGuidanceCount;
	Surface.BroadenedLaunchCount = Weighting.BroadenedLaunchCount;
	Surface.TightenedLaunchCount = Weighting.TightenedLaunchCount;
	Surface.ClosureContinuationBias = Weighting.ClosureContinuationBias;
	Surface.ClosureSuppressionBias = Weighting.ClosureSuppressionBias;
	Surface.DeferredOverflowContinuationBias = Weighting.DeferredOverflowContinuationBias;
	Surface.DeferredOverflowCaseCount = Weighting.DeferredOverflowCaseCount;
	Surface.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightContinuationDecisionCount =
		Weighting.ReliableAlignedTrustedTightContinuationDecisionCount;
	Surface.ReliableAlignedTrustedBroadRedirectDecisionCount =
		Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount;
	Surface.AverageSuccessRate = Weighting.AverageSuccessRate;
	Surface.AverageLaunchCaseCount = Weighting.AverageLaunchCaseCount;
	Surface.BroadenedLaunchAverageSuccessRate =
		Weighting.BroadenedLaunchAverageSuccessRate;
	Surface.TightenedLaunchAverageSuccessRate =
		Weighting.TightenedLaunchAverageSuccessRate;
	Surface.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore;
	Surface.bHasWeightingOverride = Weighting.bHasOverride;
	Surface.bUsedClosureHistorySignal = Weighting.bUsedClosureHistorySignal;
	Surface.bUsedDeferredOverflowSignal = Weighting.bUsedDeferredOverflowSignal;
	Surface.bUsedReliableAlignedPlanOutcomeSignal =
		Weighting.bUsedReliableAlignedPlanOutcomeSignal;
	Surface.BaseActionLabel = BuildDecisionActionLabel(Weighting.BaseAction);
	Surface.WeightedActionLabel = BuildDecisionActionLabel(Weighting.WeightedAction);
	Surface.LastAppliedActionLabel = BuildDecisionActionLabel(Weighting.LastAppliedAction);
	Surface.WeightingStatusLine = Weighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Weighting: %d matching decisions | Base: %s | Weighted: %s | Last applied: %s"),
			Weighting.MatchingDecisionCount,
			*BuildGuidanceOutcomeActionLabel(Weighting.BaseAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.WeightedAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.LastAppliedAction))
		: TEXT("Weighting: no matching authored decision history yet; the current outcome action is recap-derived only.");
	Surface.WeightingDetailLine = Weighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Decision weighting for this lane/scope: repeat case %d | repeat deck %d | broaden %d | redirect %d | Avg success %.2f | Avg launch cases %.2f | broadened launches %d (avg %.2f) | tightened launches %d (avg %.2f) | Closure continue bias %d | Closure suppress bias %d | Deferred overflow bias %d | Deferred overflow cases %d | %s"),
			Weighting.RepeatSelectedCaseCount,
			Weighting.RepeatPreviewDeckCount,
			Weighting.BroadenPreviewDeckCount,
			Weighting.RedirectCoachGuidanceCount,
			Weighting.AverageSuccessRate,
			Weighting.AverageLaunchCaseCount,
			Weighting.BroadenedLaunchCount,
			Weighting.BroadenedLaunchAverageSuccessRate,
			Weighting.TightenedLaunchCount,
			Weighting.TightenedLaunchAverageSuccessRate,
			Weighting.ClosureContinuationBias,
			Weighting.ClosureSuppressionBias,
			Weighting.DeferredOverflowContinuationBias,
			Weighting.DeferredOverflowCaseCount,
			Weighting.bHasOverride
				? (Weighting.bUsedDeferredOverflowSignal
					? TEXT("Deferred-overflow continuation history and authored choices adjusted the current guidance-outcome action.")
					: (Weighting.bUsedClosureHistorySignal
						? TEXT("Recent closure-recovery history and authored choices adjusted the current guidance-outcome action.")
						: TEXT("Recent authored choices adjusted the current guidance-outcome action.")))
				: TEXT("Recent authored choices reinforced the recap-derived guidance-outcome action."))
		: TEXT("Weighting detail: apply outcome actions on the same guidance lane and scope to let the dashboard bias future recommendations.");
	if (Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| Weighting.ReliableAlignedTrustedTightContinuationDecisionCount > 0
		|| Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount > 0)
	{
		Surface.WeightingDetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f, continuation decisions %d) | broad history %d (avg %.2f, redirect decisions %d)%s"),
			Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			Weighting.ReliableAlignedTrustedTightContinuationDecisionCount,
			Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount,
			Weighting.bUsedReliableAlignedPlanOutcomeSignal
				? TEXT(" | Aligned launched-plan trust adjusted the current guidance-outcome action.")
				: TEXT(""));
	}
	if (Surface.bClosedLoopIdleActionability)
	{
		Surface.WeightingStatusLine =
			TEXT("Weighting: retained outcome history remains inspectable, but no live guidance-outcome action is active.");
		Surface.WeightingDetailLine =
			TEXT("Weighting detail: closed-loop idle preserves authored outcome history for review, but it is not surfacing another repeat, broaden, or redirect action.");
	}

	const FHyperTwistCoachDashboardDecisionHistoryEntry* SelectedEntry =
		SelectedGuidanceDecisionIndex >= 0
		&& SelectedGuidanceDecisionIndex < GuidanceDecisionHistoryEntries.Num()
			? &GuidanceDecisionHistoryEntries[SelectedGuidanceDecisionIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Decision history: no applied guidance-outcome decisions recorded yet.");
		Surface.DetailLine =
			TEXT("Decision detail: apply a guidance outcome from the dashboard to retain the authored choice history.");
		if (Surface.bClosedLoopIdleActionability)
		{
			Surface.StatusLine =
				TEXT("Decision history: no applied guidance-outcome decisions are selected; retained decision history remains inspectable in the closed-loop idle state.");
			Surface.DetailLine =
				TEXT("Decision detail: the coach-to-review loop is closed and idle, so no live guidance-outcome action is being surfaced for application.");
		}
		return Surface;
	}

	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.SourceSessionId = SelectedEntry->SourceSessionId;
	Surface.GuidanceLaneLabel =
		SelectedEntry->GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (SelectedEntry->GuidanceLane
				== EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	Surface.ScopeLabel =
		SelectedEntry->bSingleCaseScope ? TEXT("selected case") : TEXT("preview deck");
	Surface.BriefHeadline =
		SelectedEntry->BriefHeadline.IsEmpty() ? TEXT("n/a") : SelectedEntry->BriefHeadline;
	Surface.RecommendedActionLabel = SelectedEntry->RecommendedActionLabel;
	Surface.AppliedActionLabel = SelectedEntry->AppliedActionLabel;
	Surface.SelectedCaseId =
		SelectedEntry->SelectedCaseId.IsEmpty() ? TEXT("n/a") : SelectedEntry->SelectedCaseId;
	Surface.LaunchBudgetReasonLine =
		SelectedEntry->LaunchBudgetReasonLine.IsEmpty()
			? TEXT("n/a")
			: SelectedEntry->LaunchBudgetReasonLine;
	Surface.CompletedAttemptCount = SelectedEntry->CompletedAttemptCount;
	Surface.TotalMistakes = SelectedEntry->TotalMistakes;
	Surface.LaunchedCaseCount = SelectedEntry->LaunchedCaseCount;
	Surface.ReferenceCaseCount = SelectedEntry->ReferenceCaseCount;
	Surface.SuccessRate = SelectedEntry->SuccessRate;
	Surface.bSingleCaseScope = SelectedEntry->bSingleCaseScope;
	Surface.bBroadenedLaunchScope = SelectedEntry->bBroadenedLaunchScope;
	Surface.bTightenedLaunchScope = SelectedEntry->bTightenedLaunchScope;
	Surface.bUsedReliableAlignedTrustedTightPlanOutcomeHistory =
		SelectedEntry->bUsedReliableAlignedTrustedTightPlanOutcomeHistory;
	Surface.bUsedReliableAlignedTrustedBroadPlanOutcomeHistory =
		SelectedEntry->bUsedReliableAlignedTrustedBroadPlanOutcomeHistory;
	Surface.StatusLine = FString::Printf(
		TEXT("Decision history: %d entries | selected %d/%d | Lane: %s | Scope: %s | Recorded: %s"),
		GuidanceDecisionHistoryEntries.Num(),
		SelectedGuidanceDecisionIndex + 1,
		GuidanceDecisionHistoryEntries.Num(),
		*Surface.GuidanceLaneLabel,
		*Surface.ScopeLabel,
		*SelectedEntry->RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("Session: %s | Brief: %s | Recommended: %s | Applied: %s | Selected case: %s | Launch cases: %d/%d | Scope: %s | Success rate: %.2f | Completed attempts: %d | Mistakes: %d | Budget reason: %s"),
		*SelectedEntry->SourceSessionId,
		*Surface.BriefHeadline,
		*SelectedEntry->RecommendedActionLabel,
		*SelectedEntry->AppliedActionLabel,
		*Surface.SelectedCaseId,
		SelectedEntry->LaunchedCaseCount,
		SelectedEntry->ReferenceCaseCount,
		SelectedEntry->bBroadenedLaunchScope
			? TEXT("broadened")
			: (SelectedEntry->bTightenedLaunchScope
				? TEXT("tightened")
				: TEXT("steady")),
		SelectedEntry->SuccessRate,
		SelectedEntry->CompletedAttemptCount,
		SelectedEntry->TotalMistakes,
		*Surface.LaunchBudgetReasonLine);
	if (SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| SelectedEntry->bUsedReliableAlignedTrustedTightPlanOutcomeHistory
		|| SelectedEntry->bUsedReliableAlignedTrustedBroadPlanOutcomeHistory)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f) | broad history %d (avg %.2f)%s"),
			SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			SelectedEntry->ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			SelectedEntry->ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			SelectedEntry->bUsedReliableAlignedTrustedTightPlanOutcomeHistory
				? TEXT(" | This decision was taken while tight aligned launched-plan trust was active.")
				: (SelectedEntry->bUsedReliableAlignedTrustedBroadPlanOutcomeHistory
					? TEXT(" | This decision was taken while broad aligned launched-plan redirect trust was active.")
					: TEXT("")));
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedHandoffHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Handoff-history band");

	const FHyperTwistTrainingCoachDashboardHandoffHistoryStatusInspectSurface StatusSurface =
		GetDisplayedHandoffHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardHandoffHistoryDetailInspectSurface DetailSurface =
		GetDisplayedHandoffHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardHandoffHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedHandoffHistoryNavigationInspectSurface();

	Surface.HandoffHistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Handoff history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.HandoffHistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Handoff history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.HandoffHistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Handoff history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.HandoffHistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Handoff history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = NavigationSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : NavigationSurface.RecordedAtUtc;
	Surface.RecommendedHandoffKindLabel = !NavigationSurface.RecommendedHandoffKindLabel.IsEmpty()
		? NavigationSurface.RecommendedHandoffKindLabel
		: (StatusSurface.RecommendedHandoffKindLabel.IsEmpty()
			? TEXT("none")
			: StatusSurface.RecommendedHandoffKindLabel);
	Surface.RecommendationDetailLine = !NavigationSurface.RecommendationDetailLine.IsEmpty()
		? NavigationSurface.RecommendationDetailLine
		: (DetailSurface.RecommendationDetailLine.IsEmpty()
			? TEXT("n/a")
			: DetailSurface.RecommendationDetailLine);
	Surface.QueueSourceLabel = !NavigationSurface.QueueSourceLabel.IsEmpty()
		? NavigationSurface.QueueSourceLabel
		: (DetailSurface.QueueSourceLabel.IsEmpty() ? TEXT("n/a") : DetailSurface.QueueSourceLabel);
	Surface.PreferredLaneLine = !NavigationSurface.PreferredLaneLine.IsEmpty()
		? NavigationSurface.PreferredLaneLine
		: (DetailSurface.PreferredLaneLine.IsEmpty() ? TEXT("none") : DetailSurface.PreferredLaneLine);
	Surface.PreferredGuidanceSourceDescription = DetailSurface.PreferredGuidanceSourceDescription.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.PreferredGuidanceSourceDescription;
	Surface.PreferredRecoveryActionLabel = !NavigationSurface.PreferredRecoveryActionLabel.IsEmpty()
		? NavigationSurface.PreferredRecoveryActionLabel
		: (DetailSurface.PreferredRecoveryActionLabel.IsEmpty()
			? TEXT("n/a")
			: DetailSurface.PreferredRecoveryActionLabel);
	Surface.PreferredRecoveryActionSourceDescription =
		DetailSurface.PreferredRecoveryActionSourceDescription.IsEmpty()
			? TEXT("n/a")
			: DetailSurface.PreferredRecoveryActionSourceDescription;
	Surface.RetainedPostureLine = !NavigationSurface.RetainedPostureLine.IsEmpty()
		? NavigationSurface.RetainedPostureLine
		: (DetailSurface.RetainedPostureLine.IsEmpty()
			? TEXT("n/a")
			: DetailSurface.RetainedPostureLine);
	Surface.ReliablePlanLine = !NavigationSurface.ReliablePlanLine.IsEmpty()
		? NavigationSurface.ReliablePlanLine
		: (DetailSurface.ReliablePlanLine.IsEmpty()
			? TEXT("none")
			: DetailSurface.ReliablePlanLine);
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Handoff") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Handoff") : NavigationSurface.NextLabel;
	Surface.SelectedEntryIndex = NavigationSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = NavigationSurface.HistoryEntryCount;
	Surface.AcceptedQueuedHandoffCount = DetailSurface.AcceptedQueuedHandoffCount;
	Surface.AcceptedFollowUpHandoffCount = DetailSurface.AcceptedFollowUpHandoffCount;
	Surface.AcceptedRecommendedHandoffCount = DetailSurface.AcceptedRecommendedHandoffCount;
	Surface.ClosureContinuationBias = DetailSurface.ClosureContinuationBias;
	Surface.ClosureSuppressionBias = DetailSurface.ClosureSuppressionBias;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bQueueReady = DetailSurface.bQueueReady || NavigationSurface.bQueueReady;
	Surface.bFollowUpReady = DetailSurface.bFollowUpReady || NavigationSurface.bFollowUpReady;
	Surface.bRecommendedReady = DetailSurface.bRecommendedReady || NavigationSurface.bRecommendedReady;
	Surface.bUsedDeferredFirstSuppressionSignal = DetailSurface.bUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillWeighting = DetailSurface.bUsedMethodDrillWeighting;
	Surface.StatusLine = FString::Printf(
		TEXT("Handoff-history band: selected %s | kind %s | navigation %s/%s | queue ready %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.RecommendedHandoffKindLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bQueueReady ? TEXT("yes") : TEXT("no"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | queue source %s | preferred lane %s | recovery %s | retained posture %s | reliable plan %s | recorded %s | latest %s"),
		*Surface.HandoffHistoryStatusLine,
		*Surface.HandoffHistoryDetailLine,
		*Surface.HandoffHistoryNavigationStatusLine,
		*Surface.HandoffHistoryNavigationDetailLine,
		*Surface.QueueSourceLabel,
		*Surface.PreferredLaneLine,
		*Surface.PreferredRecoveryActionLabel,
		*Surface.RetainedPostureLine,
		*Surface.ReliablePlanLine,
		*Surface.RecordedAtUtc,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceDecisionHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Decision history status");

	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryInspectSurface HistorySurface =
		GetSelectedGuidanceDecisionHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedGuidanceDecisionHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedGuidanceDecisionHistoryStatusLine.IsEmpty()
		? DisplayedGuidanceDecisionHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.GuidanceLaneLabel = !HistorySurface.GuidanceLaneLabel.IsEmpty()
		? HistorySurface.GuidanceLaneLabel
		: (NavigationSurface.GuidanceLaneLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.GuidanceLaneLabel);
	Surface.ScopeLabel = !HistorySurface.ScopeLabel.IsEmpty()
		? HistorySurface.ScopeLabel
		: (NavigationSurface.ScopeLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.ScopeLabel);
	Surface.RecommendedActionLabel = !HistorySurface.RecommendedActionLabel.IsEmpty()
		? HistorySurface.RecommendedActionLabel
		: (NavigationSurface.RecommendedActionLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.RecommendedActionLabel);
	Surface.AppliedActionLabel = !HistorySurface.AppliedActionLabel.IsEmpty()
		? HistorySurface.AppliedActionLabel
		: (NavigationSurface.AppliedActionLabel.IsEmpty()
			? TEXT("none")
			: NavigationSurface.AppliedActionLabel);
	Surface.WeightingStatusLine = !NavigationSurface.WeightingStatusLine.IsEmpty()
		? NavigationSurface.WeightingStatusLine
		: (HistorySurface.WeightingStatusLine.IsEmpty()
			? TEXT("n/a")
			: HistorySurface.WeightingStatusLine);
	Surface.LastAppliedActionLabel = !NavigationSurface.LastAppliedActionLabel.IsEmpty()
		? NavigationSurface.LastAppliedActionLabel
		: (HistorySurface.LastAppliedActionLabel.IsEmpty()
			? TEXT("none")
			: HistorySurface.LastAppliedActionLabel);
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.MatchingDecisionCount = HistorySurface.MatchingDecisionCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	Surface.bHasWeighting = NavigationSurface.bHasWeighting || HistorySurface.bHasWeighting;
	Surface.bClosedLoopIdleActionability =
		NavigationSurface.bClosedLoopIdleActionability
		|| HistorySurface.bClosedLoopIdleActionability;
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceDecisionHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Decision history detail");

	const FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryInspectSurface HistorySurface =
		GetSelectedGuidanceDecisionHistoryInspectSurface();

	Surface.DetailLine = !DisplayedGuidanceDecisionHistoryDetailLine.IsEmpty()
		? DisplayedGuidanceDecisionHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.WeightingDetailLine = HistorySurface.WeightingDetailLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.WeightingDetailLine;
	Surface.SourceSessionId =
		HistorySurface.SourceSessionId.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceSessionId;
	Surface.BriefHeadline =
		HistorySurface.BriefHeadline.IsEmpty() ? TEXT("n/a") : HistorySurface.BriefHeadline;
	Surface.SelectedCaseId =
		HistorySurface.SelectedCaseId.IsEmpty() ? TEXT("n/a") : HistorySurface.SelectedCaseId;
	Surface.LaunchBudgetReasonLine = HistorySurface.LaunchBudgetReasonLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.LaunchBudgetReasonLine;
	Surface.BaseActionLabel =
		HistorySurface.BaseActionLabel.IsEmpty() ? TEXT("none") : HistorySurface.BaseActionLabel;
	Surface.WeightedActionLabel = HistorySurface.WeightedActionLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.WeightedActionLabel;
	Surface.LastAppliedActionLabel = HistorySurface.LastAppliedActionLabel.IsEmpty()
		? TEXT("none")
		: HistorySurface.LastAppliedActionLabel;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.MatchingDecisionCount = HistorySurface.MatchingDecisionCount;
	Surface.RepeatSelectedCaseCount = HistorySurface.RepeatSelectedCaseCount;
	Surface.RepeatPreviewDeckCount = HistorySurface.RepeatPreviewDeckCount;
	Surface.BroadenPreviewDeckCount = HistorySurface.BroadenPreviewDeckCount;
	Surface.RedirectCoachGuidanceCount = HistorySurface.RedirectCoachGuidanceCount;
	Surface.CompletedAttemptCount = HistorySurface.CompletedAttemptCount;
	Surface.TotalMistakes = HistorySurface.TotalMistakes;
	Surface.LaunchedCaseCount = HistorySurface.LaunchedCaseCount;
	Surface.ReferenceCaseCount = HistorySurface.ReferenceCaseCount;
	Surface.SuccessRate = HistorySurface.SuccessRate;
	Surface.AverageSuccessRate = HistorySurface.AverageSuccessRate;
	Surface.AverageLaunchCaseCount = HistorySurface.AverageLaunchCaseCount;
	Surface.BroadenedLaunchAverageSuccessRate =
		HistorySurface.BroadenedLaunchAverageSuccessRate;
	Surface.TightenedLaunchAverageSuccessRate =
		HistorySurface.TightenedLaunchAverageSuccessRate;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bHasWeighting = HistorySurface.bHasWeighting;
	Surface.bSingleCaseScope = HistorySurface.bSingleCaseScope;
	Surface.bBroadenedLaunchScope = HistorySurface.bBroadenedLaunchScope;
	Surface.bTightenedLaunchScope = HistorySurface.bTightenedLaunchScope;
	Surface.bHasWeightingOverride = HistorySurface.bHasWeightingOverride;
	Surface.bUsedClosureHistorySignal = HistorySurface.bUsedClosureHistorySignal;
	Surface.bUsedDeferredOverflowSignal = HistorySurface.bUsedDeferredOverflowSignal;
	Surface.bUsedReliableAlignedPlanOutcomeSignal =
		HistorySurface.bUsedReliableAlignedPlanOutcomeSignal;
	Surface.bClosedLoopIdleActionability = HistorySurface.bClosedLoopIdleActionability;
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceDecisionHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Decision history navigation");
	Surface.bClosedLoopIdleActionability = IsCoachLoopActionabilityClosed();

	const auto BuildDecisionActionLabel =
		[this](const EHyperTwistCoachDashboardOutcomeAction Action) -> FString
	{
		return Action == EHyperTwistCoachDashboardOutcomeAction::None
			? TEXT("none")
			: BuildGuidanceOutcomeActionLabel(Action);
	};

	const EHyperTwistCoachDashboardOutcomeAction BaseAction = DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting Weighting =
		BuildGuidanceDecisionWeighting(BaseAction);
	const FHyperTwistCoachDashboardDecisionHistoryEntry* SelectedEntry =
		SelectedGuidanceDecisionIndex >= 0
		&& SelectedGuidanceDecisionIndex < GuidanceDecisionHistoryEntries.Num()
			? &GuidanceDecisionHistoryEntries[SelectedGuidanceDecisionIndex]
			: nullptr;
	const bool bNavigationEnabled = GuidanceDecisionHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousGuidanceDecisionNavigationLabel.IsEmpty()
		? DisplayedPreviousGuidanceDecisionNavigationLabel
		: TEXT("Prev Decision");
	Surface.NextLabel = !DisplayedNextGuidanceDecisionNavigationLabel.IsEmpty()
		? DisplayedNextGuidanceDecisionNavigationLabel
		: TEXT("Next Decision");
	Surface.SelectedEntryIndex = SelectedGuidanceDecisionIndex;
	Surface.HistoryEntryCount = GuidanceDecisionHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedGuidanceDecisionIndex == GuidanceDecisionHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	Surface.bHasWeighting = Weighting.IsStructurallyValid();
	Surface.WeightingStatusLine = Weighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Weighting: %d matching decisions | Base: %s | Weighted: %s | Last applied: %s"),
			Weighting.MatchingDecisionCount,
			*BuildGuidanceOutcomeActionLabel(Weighting.BaseAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.WeightedAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.LastAppliedAction))
		: TEXT("Weighting: no matching authored decision history yet; the current outcome action is recap-derived only.");
	if (Surface.bClosedLoopIdleActionability)
	{
		Surface.WeightingStatusLine =
			TEXT("Weighting: retained outcome history remains inspectable, but no live guidance-outcome action is active.");
	}
	Surface.LastAppliedActionLabel = BuildDecisionActionLabel(Weighting.LastAppliedAction);

	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.GuidanceLaneLabel = TEXT("none");
		Surface.ScopeLabel = TEXT("n/a");
		Surface.RecommendedActionLabel = TEXT("none");
		Surface.AppliedActionLabel = TEXT("none");
		Surface.StatusLine =
			TEXT("Decision navigation: no applied guidance-outcome decisions recorded yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | last applied: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.LastAppliedActionLabel);
		if (Surface.bClosedLoopIdleActionability)
		{
			Surface.StatusLine =
				TEXT("Decision navigation: no applied guidance-outcome decisions are selected; retained decision history remains inspectable in the closed-loop idle state.");
			Surface.DetailLine = FString::Printf(
				TEXT("%s: %s | %s: %s | last applied: %s | selected latest: no"),
				*Surface.PreviousLabel,
				Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
				*Surface.NextLabel,
				Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
				*Surface.LastAppliedActionLabel);
		}
		return Surface;
	}

	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedGuidanceDecisionIndex + 1,
		GuidanceDecisionHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.GuidanceLaneLabel =
		SelectedEntry->GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (SelectedEntry->GuidanceLane
				== EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	Surface.ScopeLabel =
		SelectedEntry->bSingleCaseScope ? TEXT("selected case") : TEXT("preview deck");
	Surface.RecommendedActionLabel =
		SelectedEntry->RecommendedActionLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->RecommendedActionLabel;
	Surface.AppliedActionLabel =
		SelectedEntry->AppliedActionLabel.IsEmpty()
			? TEXT("none")
			: SelectedEntry->AppliedActionLabel;
	Surface.StatusLine = FString::Printf(
		TEXT("Decision navigation: selected %s | Lane: %s | Scope: %s | Recorded: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.GuidanceLaneLabel,
		*Surface.ScopeLabel,
		*Surface.RecordedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | recommended: %s | applied: %s | last applied: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.RecommendedActionLabel,
		*Surface.AppliedActionLabel,
		*Surface.LastAppliedActionLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryInspectSurface
UHyperTwistCoachDashboardWidget::GetSelectedTemplateLaunchHistoryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryInspectSurface Surface;
	Surface.Headline = TEXT("Template launch history");
	Surface.SelectedEntryIndex = SelectedTemplateLaunchHistoryIndex;
	Surface.HistoryEntryCount = TemplateLaunchHistoryEntries.Num();

	const FHyperTwistCoachDashboardTemplateLaunchHistoryEntry* SelectedEntry =
		SelectedTemplateLaunchHistoryIndex >= 0
		&& SelectedTemplateLaunchHistoryIndex < TemplateLaunchHistoryEntries.Num()
			? &TemplateLaunchHistoryEntries[SelectedTemplateLaunchHistoryIndex]
			: nullptr;
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	if (!Surface.bHasSelectedEntry)
	{
		Surface.StatusLine =
			TEXT("Template launch history: no completed template-backed runs retained yet.");
		Surface.DetailLine =
			TEXT("Template launch history detail: completed runs started through the dashboard template lane will accumulate here with template id, template kind, and source review-plan provenance.");
		return Surface;
	}

	const FHyperTwistTrainingTemplateLaunchScopedStats* SelectedStats =
		FindCachedTemplateLaunchScopedStats(
			SelectedEntry->TemplateId,
			SelectedEntry->UserId);
	Surface.bHasScopedStats =
		SelectedStats != nullptr && SelectedStats->IsStructurallyValid();
	Surface.bHasSelectionProvenance =
		SelectedEntry->SelectionProvenance.IsStructurallyValid();
	Surface.SelectionProvenance = Surface.bHasSelectionProvenance
		? SelectedEntry->SelectionProvenance
		: FHyperTwistTrainingTemplateLaunchSelectionProvenance();
	Surface.AnalyticsOutcomeLine =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
			SelectedStats);
	Surface.AnalyticsDetailLine =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsDetailFragment(
			SelectedStats);
	Surface.SelectionDetailLine =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			Surface.bHasSelectionProvenance ? &SelectedEntry->SelectionProvenance : nullptr);
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc;
	Surface.CompletedAtUtc =
		SelectedEntry->CompletedAtUtc.IsEmpty() ? TEXT("n/a") : SelectedEntry->CompletedAtUtc;
	Surface.SourceSessionId = SelectedEntry->SourceSessionId;
	Surface.TemplateId =
		SelectedEntry->TemplateId.IsEmpty() ? TEXT("n/a") : SelectedEntry->TemplateId;
	Surface.TemplateTitle =
		SelectedEntry->TemplateTitle.IsEmpty() ? TEXT("n/a") : SelectedEntry->TemplateTitle;
	Surface.UserId = SelectedEntry->UserId.IsEmpty() ? TEXT("n/a") : SelectedEntry->UserId;
	Surface.FocusDeckId =
		SelectedEntry->FocusDeckId.IsEmpty() ? TEXT("n/a") : SelectedEntry->FocusDeckId;
	Surface.SourceReviewPlanId =
		SelectedEntry->SourceReviewPlanId.IsEmpty()
			? TEXT("none")
			: SelectedEntry->SourceReviewPlanId;
	Surface.TemplateKind = SelectedEntry->TemplateKind;
	Surface.TemplateKindLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->TemplateKind);
	Surface.SessionState = SelectedEntry->SessionState;
	Surface.SessionStateLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SessionState);
	Surface.SuggestedMode = SelectedEntry->SuggestedMode;
	Surface.SuggestedModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedMode);
	Surface.SuggestedSelectionPolicy = SelectedEntry->SuggestedSelectionPolicy;
	Surface.SuggestedSelectionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedSelectionPolicy);
	Surface.RecommendedCaseCount = SelectedEntry->RecommendedCaseCount;
	Surface.FocusCaseCount = SelectedEntry->FocusCaseCount;
	Surface.CompletedAttemptCount = SelectedEntry->CompletedAttemptCount;
	Surface.TotalMistakes = SelectedEntry->TotalMistakes;
	Surface.SuccessRate = SelectedEntry->SuccessRate;
	Surface.bPreferReviewRun = SelectedEntry->bPreferReviewRun;
	Surface.bCoachReview = SelectedEntry->bCoachReview;
	Surface.bPreferShortReviewSet = SelectedEntry->bPreferShortReviewSet;
	Surface.StatusLine = FString::Printf(
		TEXT("Template launch history: %d entries | selected %d/%d | Template: %s | State: %s | Completed: %s | Aggregate: %s"),
		TemplateLaunchHistoryEntries.Num(),
		SelectedTemplateLaunchHistoryIndex + 1,
		TemplateLaunchHistoryEntries.Num(),
		*Surface.TemplateId,
		*Surface.SessionStateLabel,
		*Surface.CompletedAtUtc,
		*Surface.AnalyticsOutcomeLine);
	Surface.DetailLine = FString::Printf(
		TEXT("Title: %s | kind: %s | mode: %s | selection: %s | deck: %s | user: %s | source plan: %s | recommended %d | focus %d | attempts %d | success %.2f | mistakes %d | review-backed: %s | coach-review: %s | short set: %s | Aggregate detail: %s"),
		*Surface.TemplateTitle,
		*Surface.TemplateKindLabel,
		*Surface.SuggestedModeLabel,
		*Surface.SuggestedSelectionLabel,
		*Surface.FocusDeckId,
		*Surface.UserId,
		*Surface.SourceReviewPlanId,
		SelectedEntry->RecommendedCaseCount,
		SelectedEntry->FocusCaseCount,
		SelectedEntry->CompletedAttemptCount,
		SelectedEntry->SuccessRate,
		SelectedEntry->TotalMistakes,
		SelectedEntry->bPreferReviewRun ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bCoachReview ? TEXT("yes") : TEXT("no"),
		SelectedEntry->bPreferShortReviewSet ? TEXT("yes") : TEXT("no"),
		*Surface.AnalyticsDetailLine);
	if (!Surface.SelectionDetailLine.IsEmpty())
	{
		Surface.DetailLine += TEXT(" | ");
		Surface.DetailLine += Surface.SelectionDetailLine;
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchHistoryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Template launch history status");

	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryInspectSurface HistorySurface =
		GetSelectedTemplateLaunchHistoryInspectSurface();
	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedTemplateLaunchHistoryNavigationInspectSurface();

	Surface.StatusLine = !DisplayedTemplateLaunchHistoryStatusLine.IsEmpty()
		? DisplayedTemplateLaunchHistoryStatusLine
		: HistorySurface.StatusLine;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc =
		HistorySurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.RecordedAtUtc;
	Surface.CompletedAtUtc =
		HistorySurface.CompletedAtUtc.IsEmpty() ? TEXT("n/a") : HistorySurface.CompletedAtUtc;
	Surface.TemplateId = HistorySurface.TemplateId.IsEmpty() ? TEXT("n/a") : HistorySurface.TemplateId;
	Surface.SessionStateLabel = HistorySurface.SessionStateLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.SessionStateLabel;
	Surface.AnalyticsOutcomeLine = HistorySurface.AnalyticsOutcomeLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.AnalyticsOutcomeLine;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	Surface.bHasScopedStats = HistorySurface.bHasScopedStats;
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchHistoryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Template launch history detail");

	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryInspectSurface HistorySurface =
		GetSelectedTemplateLaunchHistoryInspectSurface();

	Surface.DetailLine = !DisplayedTemplateLaunchHistoryDetailLine.IsEmpty()
		? DisplayedTemplateLaunchHistoryDetailLine
		: HistorySurface.DetailLine;
	Surface.SelectionDetailLine = HistorySurface.SelectionDetailLine.IsEmpty()
		? TEXT("")
		: HistorySurface.SelectionDetailLine;
	Surface.AnalyticsDetailLine = HistorySurface.AnalyticsDetailLine.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.AnalyticsDetailLine;
	Surface.SourceSessionId =
		HistorySurface.SourceSessionId.IsEmpty() ? TEXT("n/a") : HistorySurface.SourceSessionId;
	Surface.SourceReviewPlanId = HistorySurface.SourceReviewPlanId.IsEmpty()
		? TEXT("none")
		: HistorySurface.SourceReviewPlanId;
	Surface.TemplateId = HistorySurface.TemplateId.IsEmpty() ? TEXT("n/a") : HistorySurface.TemplateId;
	Surface.TemplateTitle =
		HistorySurface.TemplateTitle.IsEmpty() ? TEXT("n/a") : HistorySurface.TemplateTitle;
	Surface.UserId = HistorySurface.UserId.IsEmpty() ? TEXT("n/a") : HistorySurface.UserId;
	Surface.FocusDeckId =
		HistorySurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : HistorySurface.FocusDeckId;
	Surface.TemplateKindLabel = HistorySurface.TemplateKindLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.TemplateKindLabel;
	Surface.SuggestedModeLabel = HistorySurface.SuggestedModeLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.SuggestedModeLabel;
	Surface.SuggestedSelectionLabel = HistorySurface.SuggestedSelectionLabel.IsEmpty()
		? TEXT("n/a")
		: HistorySurface.SuggestedSelectionLabel;
	Surface.SelectedEntryIndex = HistorySurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = HistorySurface.HistoryEntryCount;
	Surface.RecommendedCaseCount = HistorySurface.RecommendedCaseCount;
	Surface.FocusCaseCount = HistorySurface.FocusCaseCount;
	Surface.CompletedAttemptCount = HistorySurface.CompletedAttemptCount;
	Surface.TotalMistakes = HistorySurface.TotalMistakes;
	Surface.SuccessRate = HistorySurface.SuccessRate;
	Surface.bHasSelectedEntry = HistorySurface.bHasSelectedEntry;
	Surface.bHasScopedStats = HistorySurface.bHasScopedStats;
	Surface.bHasSelectionProvenance = HistorySurface.bHasSelectionProvenance;
	Surface.bPreferReviewRun = HistorySurface.bPreferReviewRun;
	Surface.bCoachReview = HistorySurface.bCoachReview;
	Surface.bPreferShortReviewSet = HistorySurface.bPreferShortReviewSet;
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchHistoryNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Template launch history navigation");

	const FHyperTwistCoachDashboardTemplateLaunchHistoryEntry* SelectedEntry =
		SelectedTemplateLaunchHistoryIndex >= 0
		&& SelectedTemplateLaunchHistoryIndex < TemplateLaunchHistoryEntries.Num()
			? &TemplateLaunchHistoryEntries[SelectedTemplateLaunchHistoryIndex]
			: nullptr;
	const FHyperTwistTrainingTemplateLaunchScopedStats* SelectedStats =
		SelectedEntry != nullptr
			? FindCachedTemplateLaunchScopedStats(
				SelectedEntry->TemplateId,
				SelectedEntry->UserId)
			: nullptr;
	const bool bNavigationEnabled = TemplateLaunchHistoryEntries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousTemplateLaunchNavigationLabel.IsEmpty()
		? DisplayedPreviousTemplateLaunchNavigationLabel
		: TEXT("Prev Template Launch");
	Surface.NextLabel = !DisplayedNextTemplateLaunchNavigationLabel.IsEmpty()
		? DisplayedNextTemplateLaunchNavigationLabel
		: TEXT("Next Template Launch");
	Surface.SelectedEntryIndex = SelectedTemplateLaunchHistoryIndex;
	Surface.HistoryEntryCount = TemplateLaunchHistoryEntries.Num();
	Surface.bHasSelectedEntry =
		SelectedEntry != nullptr && SelectedEntry->IsStructurallyValid();
	Surface.bSelectedEntryIsLatest =
		Surface.bHasSelectedEntry
		&& SelectedTemplateLaunchHistoryIndex == TemplateLaunchHistoryEntries.Num() - 1;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	if (!Surface.bHasSelectedEntry)
	{
		Surface.SelectedEntryOrdinal = TEXT("none");
		Surface.RecordedAtUtc = TEXT("n/a");
		Surface.CompletedAtUtc = TEXT("n/a");
		Surface.TemplateId = TEXT("n/a");
		Surface.SessionStateLabel = TEXT("n/a");
		Surface.AnalyticsOutcomeLine = TEXT("n/a");
		Surface.SelectionDetailLine = TEXT("");
		Surface.SuggestedModeLabel = TEXT("n/a");
		Surface.SuggestedSelectionLabel = TEXT("n/a");
		Surface.StatusLine =
			TEXT("Template launch navigation: no completed template-backed runs retained yet.");
		Surface.DetailLine = FString::Printf(
			TEXT("%s: %s | %s: %s | selected latest: no"),
			*Surface.PreviousLabel,
			Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
			*Surface.NextLabel,
			Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
		return Surface;
	}

	Surface.bHasScopedStats =
		SelectedStats != nullptr && SelectedStats->IsStructurallyValid();
	Surface.bHasSelectionProvenance =
		SelectedEntry->SelectionProvenance.IsStructurallyValid();
	Surface.SelectedEntryOrdinal = FString::Printf(
		TEXT("%d/%d"),
		SelectedTemplateLaunchHistoryIndex + 1,
		TemplateLaunchHistoryEntries.Num());
	Surface.RecordedAtUtc = SelectedEntry->RecordedAtUtc.IsEmpty()
		? TEXT("n/a")
		: SelectedEntry->RecordedAtUtc;
	Surface.CompletedAtUtc =
		SelectedEntry->CompletedAtUtc.IsEmpty() ? TEXT("n/a") : SelectedEntry->CompletedAtUtc;
	Surface.TemplateId =
		SelectedEntry->TemplateId.IsEmpty() ? TEXT("n/a") : SelectedEntry->TemplateId;
	Surface.SessionStateLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SessionState);
	Surface.AnalyticsOutcomeLine =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
			SelectedStats);
	Surface.SelectionDetailLine =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			Surface.bHasSelectionProvenance ? &SelectedEntry->SelectionProvenance : nullptr);
	Surface.SuggestedModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedMode);
	Surface.SuggestedSelectionLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			SelectedEntry->SuggestedSelectionPolicy);
	Surface.StatusLine = FString::Printf(
		TEXT("Template launch navigation: selected %s | Template: %s | State: %s | Completed: %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.TemplateId,
		*Surface.SessionStateLabel,
		*Surface.CompletedAtUtc);
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | aggregate: %s | mode: %s | selection: %s | selected latest: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.AnalyticsOutcomeLine,
		*Surface.SuggestedModeLabel,
		*Surface.SuggestedSelectionLabel,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	if (!Surface.SelectionDetailLine.IsEmpty())
	{
		Surface.DetailLine += TEXT(" | ");
		Surface.DetailLine += Surface.SelectionDetailLine;
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchHistoryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryBandInspectSurface Surface;
	Surface.Headline = TEXT("Template-launch-history band");

	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryStatusInspectSurface StatusSurface =
		GetDisplayedTemplateLaunchHistoryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryDetailInspectSurface DetailSurface =
		GetDisplayedTemplateLaunchHistoryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardTemplateLaunchHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedTemplateLaunchHistoryNavigationInspectSurface();

	Surface.TemplateLaunchHistoryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Template launch history status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.TemplateLaunchHistoryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Template launch history detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.TemplateLaunchHistoryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Template launch history navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.TemplateLaunchHistoryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Template launch history navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.SelectionDetailLine = !DetailSurface.SelectionDetailLine.IsEmpty()
		? DetailSurface.SelectionDetailLine
		: NavigationSurface.SelectionDetailLine;
	Surface.AnalyticsDetailLine = DetailSurface.AnalyticsDetailLine.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.AnalyticsDetailLine;
	Surface.AnalyticsOutcomeLine = !StatusSurface.AnalyticsOutcomeLine.IsEmpty()
		? StatusSurface.AnalyticsOutcomeLine
		: (NavigationSurface.AnalyticsOutcomeLine.IsEmpty() ? TEXT("n/a") : NavigationSurface.AnalyticsOutcomeLine);
	Surface.SelectedEntryOrdinal = StatusSurface.SelectedEntryOrdinal.IsEmpty()
		? (NavigationSurface.SelectedEntryOrdinal.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedEntryOrdinal)
		: StatusSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = StatusSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : StatusSurface.RecordedAtUtc;
	Surface.CompletedAtUtc = StatusSurface.CompletedAtUtc.IsEmpty()
		? (NavigationSurface.CompletedAtUtc.IsEmpty() ? TEXT("n/a") : NavigationSurface.CompletedAtUtc)
		: StatusSurface.CompletedAtUtc;
	Surface.SourceSessionId = DetailSurface.SourceSessionId.IsEmpty() ? TEXT("n/a") : DetailSurface.SourceSessionId;
	Surface.SourceReviewPlanId = DetailSurface.SourceReviewPlanId.IsEmpty() ? TEXT("none") : DetailSurface.SourceReviewPlanId;
	Surface.TemplateId = StatusSurface.TemplateId.IsEmpty()
		? (NavigationSurface.TemplateId.IsEmpty() ? TEXT("n/a") : NavigationSurface.TemplateId)
		: StatusSurface.TemplateId;
	Surface.TemplateTitle = DetailSurface.TemplateTitle.IsEmpty() ? TEXT("n/a") : DetailSurface.TemplateTitle;
	Surface.UserId = DetailSurface.UserId.IsEmpty() ? TEXT("n/a") : DetailSurface.UserId;
	Surface.FocusDeckId = DetailSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : DetailSurface.FocusDeckId;
	Surface.TemplateKindLabel = DetailSurface.TemplateKindLabel.IsEmpty() ? TEXT("n/a") : DetailSurface.TemplateKindLabel;
	Surface.SessionStateLabel = StatusSurface.SessionStateLabel.IsEmpty()
		? (NavigationSurface.SessionStateLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.SessionStateLabel)
		: StatusSurface.SessionStateLabel;
	Surface.SuggestedModeLabel = DetailSurface.SuggestedModeLabel.IsEmpty()
		? (NavigationSurface.SuggestedModeLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.SuggestedModeLabel)
		: DetailSurface.SuggestedModeLabel;
	Surface.SuggestedSelectionLabel = DetailSurface.SuggestedSelectionLabel.IsEmpty()
		? (NavigationSurface.SuggestedSelectionLabel.IsEmpty() ? TEXT("n/a") : NavigationSurface.SuggestedSelectionLabel)
		: DetailSurface.SuggestedSelectionLabel;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Template Launch") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Template Launch") : NavigationSurface.NextLabel;
	Surface.SelectedEntryIndex = StatusSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = StatusSurface.HistoryEntryCount;
	Surface.RecommendedCaseCount = DetailSurface.RecommendedCaseCount;
	Surface.FocusCaseCount = DetailSurface.FocusCaseCount;
	Surface.CompletedAttemptCount = DetailSurface.CompletedAttemptCount;
	Surface.TotalMistakes = DetailSurface.TotalMistakes;
	Surface.SuccessRate = DetailSurface.SuccessRate;
	Surface.bHasSelectedEntry = StatusSurface.bHasSelectedEntry || DetailSurface.bHasSelectedEntry || NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = StatusSurface.bSelectedEntryIsLatest || NavigationSurface.bSelectedEntryIsLatest;
	Surface.bHasScopedStats = StatusSurface.bHasScopedStats || DetailSurface.bHasScopedStats || NavigationSurface.bHasScopedStats;
	Surface.bHasSelectionProvenance = DetailSurface.bHasSelectionProvenance || NavigationSurface.bHasSelectionProvenance;
	Surface.bPreferReviewRun = DetailSurface.bPreferReviewRun;
	Surface.bCoachReview = DetailSurface.bCoachReview;
	Surface.bPreferShortReviewSet = DetailSurface.bPreferShortReviewSet;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.StatusLine = FString::Printf(
		TEXT("Template-launch-history band: selected %s | template %s | state %s | navigation %s/%s | scoped stats %s"),
		*Surface.SelectedEntryOrdinal,
		*Surface.TemplateId,
		*Surface.SessionStateLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bHasScopedStats ? TEXT("yes") : TEXT("no"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | title %s | mode %s | selection %s | outcome %s | completed %s | latest %s"),
		*Surface.TemplateLaunchHistoryStatusLine,
		*Surface.TemplateLaunchHistoryDetailLine,
		*Surface.TemplateLaunchHistoryNavigationStatusLine,
		*Surface.TemplateLaunchHistoryNavigationDetailLine,
		*Surface.TemplateTitle,
		*Surface.SuggestedModeLabel,
		*Surface.SuggestedSelectionLabel,
		*Surface.AnalyticsOutcomeLine,
		*Surface.CompletedAtUtc,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceComparisonInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceComparisonInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceComparisonInspectSurface Surface;
	Surface.Headline = TEXT("Guidance comparison");
	Surface.bClosedLoopIdleActionability = IsCoachLoopActionabilityClosed();

	const auto BuildLaneLabel =
		[](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};
	const auto BuildDeckLabel =
		[](const FHyperTwistTrainingDeck* Deck) -> FString
	{
		if (Deck == nullptr || !Deck->IsStructurallyValid())
		{
			return TEXT("n/a");
		}

		return Deck->Title.IsEmpty() ? Deck->DeckId : Deck->Title;
	};

	const bool bHasCurrentRunRecap = CachedRunState.Session.IsStructurallyValid()
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	const FHyperTwistTrainingDeck* DisplayedRunRecapDeck = bHasCurrentRunRecap
		? &CachedRunState.ActiveDeck
		: (bHasRetainedRunRecap ? &RetainedRunRecapDeck : nullptr);
	const EHyperTwistTrainingDeliveryMode DisplayedRunRecapMode = bHasCurrentRunRecap
		? CachedRunState.Session.Mode
		: RetainedRunRecapMode;
	const bool bHasDisplayedRunRecap = DisplayedRunRecap != nullptr
		&& !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	Surface.bHasDisplayedRunRecap = bHasDisplayedRunRecap;
	Surface.RunRecapSourceLabel = bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: TEXT("none");
	Surface.TrainingSessionId = bHasDisplayedRunRecap
		? DisplayedRunRecap->TrainingSessionId
		: TEXT("n/a");
	Surface.ActualDeckLabel = BuildDeckLabel(DisplayedRunRecapDeck);
	Surface.ActualModeLabel =
		bHasDisplayedRunRecap
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecapMode)
			: TEXT("n/a");
	Surface.ActualSelectionLabel =
		DisplayedRunRecapDeck != nullptr && DisplayedRunRecapDeck->IsStructurallyValid()
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedRunRecapDeck->SelectionPolicy)
			: TEXT("n/a");
	Surface.LastCaseId =
		bHasDisplayedRunRecap && !DisplayedRunRecap->LastCaseId.IsEmpty()
			? DisplayedRunRecap->LastCaseId
			: TEXT("n/a");
	Surface.CompletedAttemptCount =
		bHasDisplayedRunRecap ? DisplayedRunRecap->CompletedAttemptCount : 0;
	Surface.FailureCount = bHasDisplayedRunRecap ? DisplayedRunRecap->FailureCount : 0;
	Surface.TimeoutCount = bHasDisplayedRunRecap ? DisplayedRunRecap->TimeoutCount : 0;
	Surface.DNFCount = bHasDisplayedRunRecap ? DisplayedRunRecap->DNFCount : 0;
	Surface.TotalMistakes = bHasDisplayedRunRecap ? DisplayedRunRecap->TotalMistakes : 0;
	Surface.SuccessRate = bHasDisplayedRunRecap ? DisplayedRunRecap->SuccessRate : 0.0f;

	const FHyperTwistTrainingSessionSummary* DisplayedGuidanceComparisonRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	Surface.bHasComparisonContext = ResolveDisplayedGuidanceComparisonContext(
		DisplayedGuidanceComparisonRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase);
	Surface.bHasDisplayedGuidanceBrief = DisplayedGuidanceComparisonBrief != nullptr;
	Surface.bHasDisplayedGuidanceDeck =
		DisplayedGuidanceComparisonDeck != nullptr
		&& DisplayedGuidanceComparisonDeck->IsStructurallyValid();
	Surface.bSingleCaseScope = bDisplayedGuidanceComparisonSingleCase;
	Surface.ScopeLabel = Surface.bHasComparisonContext
		? (Surface.bSingleCaseScope ? TEXT("selected case") : TEXT("full preview deck"))
		: TEXT("none");

	EHyperTwistCoachDashboardGuidancePreviewLane DisplayedGuidanceComparisonLane =
		EHyperTwistCoachDashboardGuidancePreviewLane::None;
	if (DisplayedGuidanceComparisonBrief == &ActiveGuidanceLaunchBrief)
	{
		DisplayedGuidanceComparisonLane = ActiveGuidanceLaunchLane;
	}
	else if (DisplayedGuidanceComparisonBrief == &RetainedGuidanceComparisonBrief)
	{
		DisplayedGuidanceComparisonLane = RetainedGuidanceComparisonLane;
	}

	Surface.GuidanceLaneLabel = BuildLaneLabel(DisplayedGuidanceComparisonLane);
	Surface.BriefHeadline =
		DisplayedGuidanceComparisonBrief != nullptr
			&& !DisplayedGuidanceComparisonBrief->Headline.IsEmpty()
			? DisplayedGuidanceComparisonBrief->Headline
			: TEXT("n/a");
	Surface.PrimaryActionLabel =
		DisplayedGuidanceComparisonBrief != nullptr
			&& !DisplayedGuidanceComparisonBrief->PrimaryActionLabel.IsEmpty()
			? DisplayedGuidanceComparisonBrief->PrimaryActionLabel
			: TEXT("n/a");
	Surface.PreviewDeckLabel = BuildDeckLabel(DisplayedGuidanceComparisonDeck);
	Surface.ExpectedModeLabel =
		DisplayedGuidanceComparisonBrief != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedGuidanceComparisonBrief->SuggestedMode)
			: TEXT("n/a");
	Surface.ExpectedSelectionLabel =
		DisplayedGuidanceComparisonBrief != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedGuidanceComparisonBrief->SuggestedSelectionPolicy)
			: TEXT("n/a");
	Surface.FocusLaneLabel =
		DisplayedGuidanceComparisonBrief != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedGuidanceComparisonBrief->FocusLane)
			: TEXT("n/a");
	Surface.SelectedCaseId =
		!DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
			? DisplayedGuidanceComparisonSelectedCaseId
			: TEXT("n/a");
	Surface.ExpectedCaseCount =
		DisplayedGuidanceComparisonDeck != nullptr ? DisplayedGuidanceComparisonDeck->Cases.Num() : 0;
	Surface.FocusCaseCount =
		DisplayedGuidanceComparisonBrief != nullptr
			? DisplayedGuidanceComparisonBrief->FocusCaseIds.Num()
			: 0;
	Surface.bSelectedCaseMatchesLastCase =
		bHasDisplayedRunRecap
		&& !DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
		&& DisplayedRunRecap->LastCaseId == DisplayedGuidanceComparisonSelectedCaseId;

	Surface.StatusLine = Surface.bHasComparisonContext
		? FString::Printf(
			TEXT("Comparison: %s recap vs %s preview | Scope: %s | Focus lane: %s | Expected cases: %d | Completed attempts: %d | Success rate: %.2f"),
			*Surface.RunRecapSourceLabel,
			*Surface.GuidanceLaneLabel,
			Surface.bSingleCaseScope ? TEXT("selected case") : TEXT("full preview deck"),
			*Surface.FocusLaneLabel,
			Surface.ExpectedCaseCount,
			Surface.CompletedAttemptCount,
			Surface.SuccessRate)
		: TEXT("Comparison: complete a run launched from previewed guidance to compare the recap against the original coach intent.");
	Surface.DetailLine = Surface.bHasComparisonContext
		? FString::Printf(
			TEXT("Launch brief: %s | Action: %s | Preview deck: %s | Actual deck: %s | Mode expected/actual: %s / %s | Selection expected/actual: %s / %s | Selected case: %s | Last case matched: %s | Focus cases: %d | Last case: %s"),
			*Surface.BriefHeadline,
			*Surface.PrimaryActionLabel,
			*Surface.PreviewDeckLabel,
			*Surface.ActualDeckLabel,
			*Surface.ExpectedModeLabel,
			*Surface.ActualModeLabel,
			*Surface.ExpectedSelectionLabel,
			*Surface.ActualSelectionLabel,
			*Surface.SelectedCaseId,
			Surface.bSelectedCaseMatchesLastCase ? TEXT("yes") : TEXT("no"),
			Surface.FocusCaseCount,
			*Surface.LastCaseId)
		: TEXT("Comparison detail: no preview-launched recap is currently selected.");
	if (Surface.bClosedLoopIdleActionability
		&& !Surface.bHasComparisonContext)
	{
		Surface.StatusLine =
			TEXT("Comparison: retained comparison history remains inspectable, but no preview-launched recap is currently selected in the closed-loop idle state.");
		Surface.DetailLine =
			TEXT("Comparison detail: the coach-to-review loop is closed and idle, so no live recommended or follow-up comparison target remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceOutcomeInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceOutcomeInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceOutcomeInspectSurface Surface;
	Surface.Headline = TEXT("Guidance outcome");
	Surface.bClosedLoopIdleActionability = IsCoachLoopActionabilityClosed();

	const auto BuildLaneLabel =
		[](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};
	const auto BuildDecisionActionLabel =
		[this](const EHyperTwistCoachDashboardOutcomeAction Action) -> FString
	{
		return Action == EHyperTwistCoachDashboardOutcomeAction::None
			? TEXT("none")
			: BuildGuidanceOutcomeActionLabel(Action);
	};

	const bool bHasCurrentRunRecap = CachedRunState.Session.IsStructurallyValid()
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	Surface.bHasDisplayedRunRecap =
		DisplayedRunRecap != nullptr && !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	Surface.RunRecapSourceLabel = Surface.bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: TEXT("none");
	Surface.TrainingSessionId = Surface.bHasDisplayedRunRecap
		? DisplayedRunRecap->TrainingSessionId
		: TEXT("n/a");

	const FHyperTwistTrainingSessionSummary* DisplayedGuidanceComparisonRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	Surface.bHasComparisonContext = ResolveDisplayedGuidanceComparisonContext(
		DisplayedGuidanceComparisonRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase);
	Surface.bHasDisplayedGuidanceBrief = DisplayedGuidanceComparisonBrief != nullptr;
	Surface.bHasDisplayedGuidanceDeck =
		DisplayedGuidanceComparisonDeck != nullptr
		&& DisplayedGuidanceComparisonDeck->IsStructurallyValid();
	Surface.bSingleCaseScope = bDisplayedGuidanceComparisonSingleCase;

	EHyperTwistCoachDashboardGuidancePreviewLane DisplayedGuidanceComparisonLane =
		EHyperTwistCoachDashboardGuidancePreviewLane::None;
	if (DisplayedGuidanceComparisonBrief == &ActiveGuidanceLaunchBrief)
	{
		DisplayedGuidanceComparisonLane = ActiveGuidanceLaunchLane;
	}
	else if (DisplayedGuidanceComparisonBrief == &RetainedGuidanceComparisonBrief)
	{
		DisplayedGuidanceComparisonLane = RetainedGuidanceComparisonLane;
	}

	Surface.GuidanceLaneLabel = BuildLaneLabel(DisplayedGuidanceComparisonLane);
	Surface.ScopeLabel = Surface.bHasComparisonContext
		? (Surface.bSingleCaseScope ? TEXT("selected case") : TEXT("preview deck"))
		: TEXT("none");
	Surface.BriefHeadline =
		DisplayedGuidanceComparisonBrief != nullptr
			&& !DisplayedGuidanceComparisonBrief->Headline.IsEmpty()
			? DisplayedGuidanceComparisonBrief->Headline
			: TEXT("n/a");
	Surface.SelectedCaseId =
		!DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
			? DisplayedGuidanceComparisonSelectedCaseId
			: TEXT("n/a");
	Surface.ExpectedCaseCount =
		DisplayedGuidanceComparisonDeck != nullptr ? DisplayedGuidanceComparisonDeck->Cases.Num() : 0;
	Surface.CompletedAttemptCount =
		DisplayedRunRecap != nullptr ? DisplayedRunRecap->CompletedAttemptCount : 0;
	Surface.NonSuccessCount =
		DisplayedRunRecap != nullptr
			? (DisplayedRunRecap->FailureCount
				+ DisplayedRunRecap->TimeoutCount
				+ DisplayedRunRecap->DNFCount)
			: 0;
	Surface.TotalMistakes = DisplayedRunRecap != nullptr ? DisplayedRunRecap->TotalMistakes : 0;
	Surface.SuccessRate = DisplayedRunRecap != nullptr ? DisplayedRunRecap->SuccessRate : 0.0f;

	Surface.StatusLine =
		TEXT("Outcome: complete a run launched from previewed guidance to derive a repeat, broaden, or redirect verdict.");
	Surface.DetailLine =
		TEXT("Outcome detail: no preview-launched recap is currently selected.");
	if (DisplayedRunRecap != nullptr
		&& DisplayedGuidanceComparisonBrief != nullptr
		&& DisplayedGuidanceComparisonDeck != nullptr
		&& DisplayedRunRecap->CompletedAttemptCount > 0)
	{
		if (Surface.bSingleCaseScope)
		{
			if (DisplayedRunRecap->SuccessRate >= 0.85f
				&& DisplayedRunRecap->TimeoutCount == 0
				&& DisplayedRunRecap->DNFCount == 0
				&& DisplayedRunRecap->TotalMistakes <= 1)
			{
				Surface.StatusLine =
					TEXT("Outcome: broaden guidance. The selected case looks stable enough to expand back to the wider preview deck.");
				Surface.DetailLine = FString::Printf(
					TEXT("Recommendation: move from the single-case launch into the broader %s preview deck or the next coach-directed handoff. Success rate %.2f across %d completed attempts with %d mistakes."),
					*Surface.GuidanceLaneLabel,
					DisplayedRunRecap->SuccessRate,
					DisplayedRunRecap->CompletedAttemptCount,
					DisplayedRunRecap->TotalMistakes);
			}
			else if (DisplayedRunRecap->SuccessRate >= 0.5f)
			{
				Surface.StatusLine =
					TEXT("Outcome: stabilize, then broaden. The selected case is moving, but it is not yet clean enough for a wider shift.");
				Surface.DetailLine = FString::Printf(
					TEXT("Recommendation: repeat the selected preview case or a very small scope before broadening. Success rate %.2f with %d non-success outcomes and %d mistakes."),
					DisplayedRunRecap->SuccessRate,
					Surface.NonSuccessCount,
					DisplayedRunRecap->TotalMistakes);
			}
			else
			{
				Surface.StatusLine =
					TEXT("Outcome: repeat selected focus. The previewed case is still weak enough that broadening would be premature.");
				Surface.DetailLine = FString::Printf(
					TEXT("Recommendation: stay on the selected preview case until the recap is cleaner. Success rate %.2f with %d non-success outcomes and %d mistakes."),
					DisplayedRunRecap->SuccessRate,
					Surface.NonSuccessCount,
					DisplayedRunRecap->TotalMistakes);
			}
		}
		else if (DisplayedRunRecap->SuccessRate >= 0.8f
			&& Surface.NonSuccessCount <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 4)
			&& DisplayedRunRecap->TotalMistakes <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 2))
		{
			Surface.StatusLine =
				TEXT("Outcome: change guidance. The full preview deck looks stable enough to move on from this exact focus.");
			Surface.DetailLine = FString::Printf(
				TEXT("Recommendation: use follow-up, queued, or recommended coach handoff rather than repeating the same deck. Success rate %.2f across %d completed attempts with %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				DisplayedRunRecap->CompletedAttemptCount,
				DisplayedRunRecap->TotalMistakes);
		}
		else if (DisplayedRunRecap->SuccessRate >= 0.55f)
		{
			Surface.StatusLine =
				TEXT("Outcome: repeat and stabilize. The deck is moving, but not cleanly enough to abandon this scope.");
			Surface.DetailLine = FString::Printf(
				TEXT("Recommendation: repeat the preview deck or stay near this focus before changing guidance. Success rate %.2f with %d non-success outcomes and %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				Surface.NonSuccessCount,
				DisplayedRunRecap->TotalMistakes);
		}
		else
		{
			Surface.StatusLine =
				TEXT("Outcome: narrow or redirect guidance. The broad preview scope is still too unstable.");
			Surface.DetailLine = FString::Printf(
				TEXT("Recommendation: narrow back to a smaller focus case set or switch guidance lanes before repeating the full deck. Success rate %.2f with %d non-success outcomes and %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				Surface.NonSuccessCount,
				DisplayedRunRecap->TotalMistakes);
		}
	}

	const EHyperTwistCoachDashboardOutcomeAction BaseGuidanceOutcomeAction =
		DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting GuidanceDecisionWeighting =
		BuildGuidanceDecisionWeighting(BaseGuidanceOutcomeAction);
	const EHyperTwistCoachDashboardOutcomeAction GuidanceOutcomeAction =
		GuidanceDecisionWeighting.WeightedAction != EHyperTwistCoachDashboardOutcomeAction::None
			? GuidanceDecisionWeighting.WeightedAction
			: BaseGuidanceOutcomeAction;
	Surface.BaseActionLabel = BuildDecisionActionLabel(BaseGuidanceOutcomeAction);
	Surface.WeightedActionLabel =
		BuildDecisionActionLabel(GuidanceDecisionWeighting.WeightedAction);
	Surface.bHasWeightingOverride = GuidanceDecisionWeighting.bHasOverride;
	Surface.bUsedClosureHistorySignal =
		GuidanceDecisionWeighting.bUsedClosureHistorySignal;
	Surface.bUsedDeferredOverflowSignal =
		GuidanceDecisionWeighting.bUsedDeferredOverflowSignal;
	if (GuidanceDecisionWeighting.bUsedClosureHistorySignal)
	{
		Surface.StatusLine += TEXT(" Closure-recovery history adjusted this recommendation.");
	}
	if (GuidanceDecisionWeighting.bUsedDeferredOverflowSignal)
	{
		Surface.StatusLine +=
			TEXT(" Deferred-overflow continuation history adjusted this recommendation.");
	}

	Surface.bCanRedirectAction =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		|| CachedCoachPanelState.bCanStartQueuedRun
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	Surface.bCanApplyAction =
		GuidanceOutcomeAction != EHyperTwistCoachDashboardOutcomeAction::None
		&& !bHasLiveAttemptTimer
		&& (!bHasActiveRun
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted)
		&& (GuidanceOutcomeAction != EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			|| Surface.bCanRedirectAction);
	Surface.ActionLabel = BuildGuidanceOutcomeActionLabel(GuidanceOutcomeAction);
	if (Surface.bClosedLoopIdleActionability)
	{
		Surface.StatusLine =
			TEXT("Outcome: retained comparison history remains inspectable, but the coach-to-review loop is closed and idle.");
		Surface.DetailLine =
			TEXT("Outcome detail: no live repeat, broaden, or redirect action remains while the closed-loop idle boundary holds.");
		Surface.ActionLabel = TEXT("Loop Idle");
		Surface.bCanApplyAction = false;
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDecisionWeightingInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceDecisionWeightingInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDecisionWeightingInspectSurface Surface;
	Surface.Headline = TEXT("Decision weighting");
	Surface.bClosedLoopIdleActionability = IsCoachLoopActionabilityClosed();

	const auto BuildLaneLabel =
		[](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};
	const auto BuildDecisionActionLabel =
		[this](const EHyperTwistCoachDashboardOutcomeAction Action) -> FString
	{
		return Action == EHyperTwistCoachDashboardOutcomeAction::None
			? TEXT("none")
			: BuildGuidanceOutcomeActionLabel(Action);
	};

	const bool bHasCurrentRunRecap = CachedRunState.Session.IsStructurallyValid()
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	Surface.bHasDisplayedRunRecap =
		DisplayedRunRecap != nullptr && !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	Surface.RunRecapSourceLabel = Surface.bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: TEXT("none");
	Surface.TrainingSessionId = Surface.bHasDisplayedRunRecap
		? DisplayedRunRecap->TrainingSessionId
		: TEXT("n/a");

	const FHyperTwistTrainingSessionSummary* DisplayedGuidanceComparisonRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	Surface.bHasComparisonContext = ResolveDisplayedGuidanceComparisonContext(
		DisplayedGuidanceComparisonRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase);
	Surface.bHasDisplayedGuidanceBrief = DisplayedGuidanceComparisonBrief != nullptr;
	Surface.bHasDisplayedGuidanceDeck =
		DisplayedGuidanceComparisonDeck != nullptr
		&& DisplayedGuidanceComparisonDeck->IsStructurallyValid();
	Surface.bSingleCaseScope = bDisplayedGuidanceComparisonSingleCase;

	EHyperTwistCoachDashboardGuidancePreviewLane DisplayedGuidanceComparisonLane =
		EHyperTwistCoachDashboardGuidancePreviewLane::None;
	if (DisplayedGuidanceComparisonBrief == &ActiveGuidanceLaunchBrief)
	{
		DisplayedGuidanceComparisonLane = ActiveGuidanceLaunchLane;
	}
	else if (DisplayedGuidanceComparisonBrief == &RetainedGuidanceComparisonBrief)
	{
		DisplayedGuidanceComparisonLane = RetainedGuidanceComparisonLane;
	}

	Surface.GuidanceLaneLabel = BuildLaneLabel(DisplayedGuidanceComparisonLane);
	Surface.ScopeLabel = Surface.bHasComparisonContext
		? (Surface.bSingleCaseScope ? TEXT("selected case") : TEXT("preview deck"))
		: TEXT("none");
	Surface.BriefHeadline =
		DisplayedGuidanceComparisonBrief != nullptr
			&& !DisplayedGuidanceComparisonBrief->Headline.IsEmpty()
			? DisplayedGuidanceComparisonBrief->Headline
			: TEXT("n/a");
	Surface.SelectedCaseId =
		!DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
			? DisplayedGuidanceComparisonSelectedCaseId
			: TEXT("n/a");

	const EHyperTwistCoachDashboardOutcomeAction BaseAction = DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting Weighting =
		BuildGuidanceDecisionWeighting(BaseAction);
	const EHyperTwistCoachDashboardOutcomeAction ResolvedAction =
		Weighting.WeightedAction != EHyperTwistCoachDashboardOutcomeAction::None
			? Weighting.WeightedAction
			: BaseAction;
	Surface.ResolvedActionLabel = BuildGuidanceOutcomeActionLabel(ResolvedAction);
	Surface.BaseActionLabel = BuildDecisionActionLabel(Weighting.BaseAction);
	Surface.WeightedActionLabel = BuildDecisionActionLabel(Weighting.WeightedAction);
	Surface.LastAppliedActionLabel = BuildDecisionActionLabel(Weighting.LastAppliedAction);
	Surface.MatchingDecisionCount = Weighting.MatchingDecisionCount;
	Surface.RepeatSelectedCaseCount = Weighting.RepeatSelectedCaseCount;
	Surface.RepeatPreviewDeckCount = Weighting.RepeatPreviewDeckCount;
	Surface.BroadenPreviewDeckCount = Weighting.BroadenPreviewDeckCount;
	Surface.RedirectCoachGuidanceCount = Weighting.RedirectCoachGuidanceCount;
	Surface.BroadenedLaunchCount = Weighting.BroadenedLaunchCount;
	Surface.TightenedLaunchCount = Weighting.TightenedLaunchCount;
	Surface.ClosureContinuationBias = Weighting.ClosureContinuationBias;
	Surface.ClosureSuppressionBias = Weighting.ClosureSuppressionBias;
	Surface.DeferredOverflowContinuationBias =
		Weighting.DeferredOverflowContinuationBias;
	Surface.DeferredOverflowCaseCount = Weighting.DeferredOverflowCaseCount;
	Surface.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightContinuationDecisionCount =
		Weighting.ReliableAlignedTrustedTightContinuationDecisionCount;
	Surface.ReliableAlignedTrustedBroadRedirectDecisionCount =
		Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount;
	Surface.AverageSuccessRate = Weighting.AverageSuccessRate;
	Surface.AverageLaunchCaseCount = Weighting.AverageLaunchCaseCount;
	Surface.BroadenedLaunchAverageSuccessRate =
		Weighting.BroadenedLaunchAverageSuccessRate;
	Surface.TightenedLaunchAverageSuccessRate =
		Weighting.TightenedLaunchAverageSuccessRate;
	Surface.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore;
	Surface.bHasWeighting = Weighting.IsStructurallyValid();
	Surface.bHasWeightingOverride = Weighting.bHasOverride;
	Surface.bUsedClosureHistorySignal = Weighting.bUsedClosureHistorySignal;
	Surface.bUsedDeferredOverflowSignal = Weighting.bUsedDeferredOverflowSignal;
	Surface.bUsedReliableAlignedPlanOutcomeSignal =
		Weighting.bUsedReliableAlignedPlanOutcomeSignal;

	Surface.StatusLine = Weighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Weighting: %d matching decisions | Base: %s | Weighted: %s | Last applied: %s"),
			Weighting.MatchingDecisionCount,
			*BuildGuidanceOutcomeActionLabel(Weighting.BaseAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.WeightedAction),
			*BuildGuidanceOutcomeActionLabel(Weighting.LastAppliedAction))
		: TEXT("Weighting: no matching authored decision history yet; the current outcome action is recap-derived only.");
	Surface.DetailLine = Weighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Decision weighting for this lane/scope: repeat case %d | repeat deck %d | broaden %d | redirect %d | Avg success %.2f | Avg launch cases %.2f | broadened launches %d (avg %.2f) | tightened launches %d (avg %.2f) | Closure continue bias %d | Closure suppress bias %d | Deferred overflow bias %d | Deferred overflow cases %d | %s"),
			Weighting.RepeatSelectedCaseCount,
			Weighting.RepeatPreviewDeckCount,
			Weighting.BroadenPreviewDeckCount,
			Weighting.RedirectCoachGuidanceCount,
			Weighting.AverageSuccessRate,
			Weighting.AverageLaunchCaseCount,
			Weighting.BroadenedLaunchCount,
			Weighting.BroadenedLaunchAverageSuccessRate,
			Weighting.TightenedLaunchCount,
			Weighting.TightenedLaunchAverageSuccessRate,
			Weighting.ClosureContinuationBias,
			Weighting.ClosureSuppressionBias,
			Weighting.DeferredOverflowContinuationBias,
			Weighting.DeferredOverflowCaseCount,
			Weighting.bHasOverride
				? (Weighting.bUsedDeferredOverflowSignal
					? TEXT("Deferred-overflow continuation history and authored choices adjusted the current guidance-outcome action.")
					: (Weighting.bUsedClosureHistorySignal
						? TEXT("Recent closure-recovery history and authored choices adjusted the current guidance-outcome action.")
						: TEXT("Recent authored choices adjusted the current guidance-outcome action.")))
				: TEXT("Recent authored choices reinforced the recap-derived guidance-outcome action."))
		: TEXT("Weighting detail: apply outcome actions on the same guidance lane and scope to let the dashboard bias future recommendations.");
	if (Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| Weighting.ReliableAlignedTrustedTightContinuationDecisionCount > 0
		|| Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f, continuation decisions %d) | broad history %d (avg %.2f, redirect decisions %d)%s"),
			Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			Weighting.ReliableAlignedTrustedTightContinuationDecisionCount,
			Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount,
			Weighting.bUsedReliableAlignedPlanOutcomeSignal
				? TEXT(" | Aligned launched-plan trust adjusted the current guidance-outcome action.")
				: TEXT(""));
	}
	if (Surface.bClosedLoopIdleActionability)
	{
		Surface.ResolvedActionLabel = TEXT("Loop Idle");
		Surface.StatusLine =
			TEXT("Weighting: retained outcome history remains inspectable, but no live guidance-outcome action is active.");
		Surface.DetailLine =
			TEXT("Weighting detail: closed-loop idle preserves authored outcome history for review, but it is not surfacing another repeat, broaden, or redirect action.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewSelectionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreviewSelectionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewSelectionInspectSurface Surface;
	Surface.Headline = TEXT("Preview selection");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.bHasActivePreviewDeck = ActivePreviewDeck != nullptr;
	Surface.bHasSelectedCase = SelectedGuidancePreviewCase != nullptr;
	Surface.DeckId =
		ActivePreviewDeck != nullptr && !ActivePreviewDeck->DeckId.IsEmpty()
			? ActivePreviewDeck->DeckId
			: TEXT("n/a");
	Surface.DeckTitle =
		ActivePreviewDeck != nullptr && !ActivePreviewDeck->Title.IsEmpty()
			? ActivePreviewDeck->Title
			: TEXT("n/a");
	Surface.DeckLabel =
		ActivePreviewDeck != nullptr
			? (ActivePreviewDeck->Title.IsEmpty() ? Surface.DeckId : ActivePreviewDeck->Title)
			: TEXT("n/a");
	Surface.SelectionPolicyLabel =
		ActivePreviewDeck != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				ActivePreviewDeck->SelectionPolicy)
			: TEXT("n/a");
	Surface.DifficultyBand =
		ActivePreviewDeck != nullptr && !ActivePreviewDeck->DifficultyBand.IsEmpty()
			? ActivePreviewDeck->DifficultyBand
			: TEXT("n/a");
	Surface.SubsetId =
		ActivePreviewDeck != nullptr && !ActivePreviewDeck->SubsetId.IsEmpty()
			? ActivePreviewDeck->SubsetId
			: TEXT("n/a");
	Surface.SelectedCaseId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->CaseId.IsEmpty()
			? SelectedGuidancePreviewCase->CaseId
			: TEXT("n/a");
	Surface.SelectedCasePromptLabel =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->PromptLabel.IsEmpty()
			? SelectedGuidancePreviewCase->PromptLabel
			: TEXT("n/a");
	Surface.SelectedCaseIndex = SelectedGuidancePreviewCaseIndex;
	Surface.TotalCaseCount = ActivePreviewDeck != nullptr ? ActivePreviewDeck->Cases.Num() : 0;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine =
		SelectedGuidancePreviewCase != nullptr && ActivePreviewDeck != nullptr
			? FString::Printf(
				TEXT("Active preview: %s | case %d/%d | deck %s"),
				*Surface.ActivePreviewLaneLabel,
				SelectedGuidancePreviewCaseIndex + 1,
				ActivePreviewDeck->Cases.Num(),
				*Surface.DeckLabel)
			: FString::Printf(
				TEXT("Active preview: %s | build a coach deck preview to inspect specific cases"),
				*Surface.ActivePreviewLaneLabel);
	Surface.DetailLine =
		ActivePreviewDeck != nullptr
			? FString::Printf(
				TEXT("Preview selection detail: deck %s | selection %s | difficulty %s | subset %s | selected prompt %s"),
				*Surface.DeckLabel,
				*Surface.SelectionPolicyLabel,
				*Surface.DifficultyBand,
				*Surface.SubsetId,
				*Surface.SelectedCasePromptLabel)
			: TEXT("Preview selection detail: no active preview deck is currently surfaced.");
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Active preview: none | the coach-to-review loop is closed and idle.");
		Surface.DetailLine =
			TEXT("Preview selection detail: retained coach memory remains inspectable, but no live preview deck remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewCaseDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreviewCaseDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewCaseDetailInspectSurface Surface;
	Surface.Headline = TEXT("Preview case");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.DeckLabel =
		ActivePreviewDeck != nullptr
			? (ActivePreviewDeck->Title.IsEmpty() ? ActivePreviewDeck->DeckId : ActivePreviewDeck->Title)
			: TEXT("n/a");
	Surface.CaseId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->CaseId.IsEmpty()
			? SelectedGuidancePreviewCase->CaseId
			: TEXT("n/a");
	Surface.PromptLabel =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->PromptLabel.IsEmpty()
			? SelectedGuidancePreviewCase->PromptLabel
			: TEXT("n/a");
	Surface.PromptKindLabel =
		SelectedGuidancePreviewCase != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedGuidancePreviewCase->PromptKind)
			: TEXT("n/a");
	Surface.SubsetId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->SubsetId.IsEmpty()
			? SelectedGuidancePreviewCase->SubsetId
			: TEXT("n/a");
	Surface.ScrambleNotation =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->ScrambleNotation.IsEmpty()
			? SelectedGuidancePreviewCase->ScrambleNotation
			: TEXT("n/a");
	Surface.CanonicalNotation =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->CanonicalNotation.IsEmpty()
			? SelectedGuidancePreviewCase->CanonicalNotation
			: TEXT("n/a");
	Surface.TimeTargetMs =
		SelectedGuidancePreviewCase != nullptr ? SelectedGuidancePreviewCase->TimeTargetMs : 0;
	Surface.SelectedCaseIndex = SelectedGuidancePreviewCaseIndex;
	Surface.TotalCaseCount = ActivePreviewDeck != nullptr ? ActivePreviewDeck->Cases.Num() : 0;
	Surface.bHasActivePreviewDeck = ActivePreviewDeck != nullptr;
	Surface.bHasSelectedCase = SelectedGuidancePreviewCase != nullptr;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine =
		SelectedGuidancePreviewCase != nullptr
			? FString::Printf(
				TEXT("Preview case: %s | Prompt: %s | Kind: %s | Subset: %s | Target: %d ms | Scramble: %s | Canonical: %s"),
				*Surface.CaseId,
				*Surface.PromptLabel,
				*Surface.PromptKindLabel,
				*Surface.SubsetId,
				Surface.TimeTargetMs,
				*Surface.ScrambleNotation,
				*Surface.CanonicalNotation)
			: TEXT("Preview case: none selected yet.");
	Surface.DetailLine =
		SelectedGuidancePreviewCase != nullptr
			? FString::Printf(
				TEXT("Preview case detail: lane %s | deck %s | selected %d/%d"),
				*Surface.ActivePreviewLaneLabel,
				*Surface.DeckLabel,
				SelectedGuidancePreviewCaseIndex + 1,
				Surface.TotalCaseCount)
			: TEXT("Preview case detail: move the preview case selector or build a preview deck to inspect a surfaced case.");
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Preview case: no active guidance preview remains in the closed-loop idle state.");
		Surface.DetailLine =
			TEXT("Preview case detail: retained coach memory remains inspectable, but no live preview case remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewCaseNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreviewCaseNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewCaseNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Preview case navigation");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	const bool bNavigationEnabled = ActivePreviewDeck != nullptr && ActivePreviewDeck->Cases.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousGuidanceCaseNavigationLabel.IsEmpty()
		? DisplayedPreviousGuidanceCaseNavigationLabel
		: TEXT("Prev Guidance Case");
	Surface.NextLabel = !DisplayedNextGuidanceCaseNavigationLabel.IsEmpty()
		? DisplayedNextGuidanceCaseNavigationLabel
		: TEXT("Next Guidance Case");
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.DeckLabel =
		ActivePreviewDeck != nullptr
			? (ActivePreviewDeck->Title.IsEmpty() ? ActivePreviewDeck->DeckId : ActivePreviewDeck->Title)
			: TEXT("n/a");
	Surface.SelectedCaseId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->CaseId.IsEmpty()
			? SelectedGuidancePreviewCase->CaseId
			: TEXT("n/a");
	Surface.SelectedCasePromptLabel =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->PromptLabel.IsEmpty()
			? SelectedGuidancePreviewCase->PromptLabel
			: TEXT("n/a");
	Surface.SelectedCaseOrdinal =
		SelectedGuidancePreviewCase != nullptr && ActivePreviewDeck != nullptr
			? FString::Printf(TEXT("%d/%d"), SelectedGuidancePreviewCaseIndex + 1, ActivePreviewDeck->Cases.Num())
			: TEXT("none");
	Surface.SelectedCaseIndex = SelectedGuidancePreviewCaseIndex;
	Surface.TotalCaseCount = ActivePreviewDeck != nullptr ? ActivePreviewDeck->Cases.Num() : 0;
	Surface.bHasActivePreviewDeck = ActivePreviewDeck != nullptr;
	Surface.bHasSelectedCase = SelectedGuidancePreviewCase != nullptr;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine =
		SelectedGuidancePreviewCase != nullptr
			? FString::Printf(
				TEXT("Preview navigation: lane %s | selected %s | case %s | deck %s"),
				*Surface.ActivePreviewLaneLabel,
				*Surface.SelectedCaseOrdinal,
				*Surface.SelectedCaseId,
				*Surface.DeckLabel)
			: FString::Printf(
				TEXT("Preview navigation: lane %s | no active preview case is currently selected"),
				*Surface.ActivePreviewLaneLabel);
	Surface.DetailLine =
		ActivePreviewDeck != nullptr
			? FString::Printf(
				TEXT("%s: %s | %s: %s | selected prompt %s"),
				*Surface.PreviousLabel,
				Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
				*Surface.NextLabel,
				Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
				*Surface.SelectedCasePromptLabel)
			: FString::Printf(
				TEXT("%s: disabled | %s: disabled | build a preview deck before navigating guidance cases"),
				*Surface.PreviousLabel,
				*Surface.NextLabel);
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Preview navigation: no active guidance preview remains in the closed-loop idle state.");
		Surface.DetailLine =
			TEXT("Preview navigation detail: retained coach memory remains inspectable, but live preview-case navigation is inactive.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewLaunchActionControlInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreviewLaunchActionControlInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewLaunchActionControlInspectSurface Surface;
	Surface.Headline = TEXT("Preview launch action control");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	const bool bCanStartPreviewDeck =
		!bHasLiveAttemptTimer
		&& !bHasActiveRun
		&& ActivePreviewDeck != nullptr
		&& ActivePreviewDeck->IsStructurallyValid();
	const bool bCanStartPreviewCase =
		bCanStartPreviewDeck && SelectedGuidancePreviewCase != nullptr;

	Surface.StartPreviewDeckLabel = !DisplayedStartPreviewDeckActionLabel.IsEmpty()
		? DisplayedStartPreviewDeckActionLabel
		: TEXT("Start Preview Deck");
	Surface.StartSelectedPreviewCaseLabel = !DisplayedStartPreviewCaseActionLabel.IsEmpty()
		? DisplayedStartPreviewCaseActionLabel
		: TEXT("Start Selected Preview Case");
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.DeckLabel =
		ActivePreviewDeck != nullptr
			? (ActivePreviewDeck->Title.IsEmpty() ? ActivePreviewDeck->DeckId : ActivePreviewDeck->Title)
			: TEXT("n/a");
	Surface.SelectedCaseId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->CaseId.IsEmpty()
			? SelectedGuidancePreviewCase->CaseId
			: TEXT("n/a");
	Surface.SelectedCasePromptLabel =
		SelectedGuidancePreviewCase != nullptr
			&& !SelectedGuidancePreviewCase->PromptLabel.IsEmpty()
			? SelectedGuidancePreviewCase->PromptLabel
			: TEXT("n/a");
	Surface.SelectedCaseOrdinal =
		SelectedGuidancePreviewCase != nullptr && ActivePreviewDeck != nullptr
			? FString::Printf(TEXT("%d/%d"), SelectedGuidancePreviewCaseIndex + 1, ActivePreviewDeck->Cases.Num())
			: TEXT("none");
	Surface.SelectedCaseIndex = SelectedGuidancePreviewCaseIndex;
	Surface.TotalCaseCount = ActivePreviewDeck != nullptr ? ActivePreviewDeck->Cases.Num() : 0;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasActivePreviewDeck = ActivePreviewDeck != nullptr;
	Surface.bHasSelectedCase = SelectedGuidancePreviewCase != nullptr;
	Surface.bStartPreviewDeckEnabled = bCanStartPreviewDeck;
	Surface.bStartSelectedPreviewCaseEnabled = bCanStartPreviewCase;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = FString::Printf(
		TEXT("%s: %s | %s: %s | lane %s | deck %s"),
		*Surface.StartPreviewDeckLabel,
		Surface.bStartPreviewDeckEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.StartSelectedPreviewCaseLabel,
		Surface.bStartSelectedPreviewCaseEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.ActivePreviewLaneLabel,
		*Surface.DeckLabel);
	Surface.DetailLine = FString::Printf(
		TEXT("Preview launch detail: selected %s | case %s | prompt %s | live timer %s | active run %s"),
		*Surface.SelectedCaseOrdinal,
		*Surface.SelectedCaseId,
		*Surface.SelectedCasePromptLabel,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"));
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Preview launch control: no active guidance preview remains in the closed-loop idle state.");
		Surface.DetailLine =
			TEXT("Preview launch detail: retained coach memory remains inspectable, but live preview-deck and preview-case launch actions are inactive.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreviewBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewBandInspectSurface Surface;
	Surface.Headline = TEXT("Guidance preview band");

	const FHyperTwistTrainingCoachDashboardGuidancePreviewSelectionInspectSurface SelectionSurface =
		GetDisplayedGuidancePreviewSelectionInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreviewCaseDetailInspectSurface CaseDetailSurface =
		GetDisplayedGuidancePreviewCaseDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreviewCaseNavigationInspectSurface NavigationSurface =
		GetDisplayedGuidancePreviewCaseNavigationInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreviewLaunchActionControlInspectSurface ActionControlSurface =
		GetDisplayedGuidancePreviewLaunchActionControlInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface RecommendedDeckSurface =
		GetDisplayedRecommendedGuidanceDeckPreviewInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface FollowUpDeckSurface =
		GetDisplayedFollowUpGuidanceDeckPreviewInspectSurface();

	Surface.PreviewSelectionStatusLine = SelectionSurface.StatusLine.IsEmpty()
		? TEXT("Guidance preview selection: unavailable.")
		: SelectionSurface.StatusLine;
	Surface.PreviewCaseDetailStatusLine = CaseDetailSurface.StatusLine.IsEmpty()
		? TEXT("Guidance preview case detail: unavailable.")
		: CaseDetailSurface.StatusLine;
	Surface.PreviewCaseNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Guidance preview case navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.PreviewLaunchControlStatusLine = ActionControlSurface.StatusLine.IsEmpty()
		? TEXT("Guidance preview launch control: unavailable.")
		: ActionControlSurface.StatusLine;
	Surface.RecommendedDeckStatusLine = RecommendedDeckSurface.StatusLine.IsEmpty()
		? TEXT("Recommended guidance deck: unavailable.")
		: RecommendedDeckSurface.StatusLine;
	Surface.FollowUpDeckStatusLine = FollowUpDeckSurface.StatusLine.IsEmpty()
		? TEXT("Follow-up guidance deck: unavailable.")
		: FollowUpDeckSurface.StatusLine;
	Surface.ActivePreviewLaneLabel = !SelectionSurface.ActivePreviewLaneLabel.IsEmpty()
		? SelectionSurface.ActivePreviewLaneLabel
		: (ActionControlSurface.ActivePreviewLaneLabel.IsEmpty()
			? TEXT("none")
			: ActionControlSurface.ActivePreviewLaneLabel);
	Surface.DeckId = SelectionSurface.DeckId.IsEmpty() ? TEXT("n/a") : SelectionSurface.DeckId;
	Surface.DeckTitle = SelectionSurface.DeckTitle.IsEmpty() ? TEXT("n/a") : SelectionSurface.DeckTitle;
	Surface.DeckLabel = !SelectionSurface.DeckLabel.IsEmpty()
		? SelectionSurface.DeckLabel
		: (ActionControlSurface.DeckLabel.IsEmpty() ? TEXT("n/a") : ActionControlSurface.DeckLabel);
	Surface.SelectionPolicyLabel = SelectionSurface.SelectionPolicyLabel.IsEmpty()
		? TEXT("n/a")
		: SelectionSurface.SelectionPolicyLabel;
	Surface.SelectedCaseId = !SelectionSurface.SelectedCaseId.IsEmpty()
		? SelectionSurface.SelectedCaseId
		: (NavigationSurface.SelectedCaseId.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedCaseId);
	Surface.SelectedCasePromptLabel = !SelectionSurface.SelectedCasePromptLabel.IsEmpty()
		? SelectionSurface.SelectedCasePromptLabel
		: (NavigationSurface.SelectedCasePromptLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.SelectedCasePromptLabel);
	Surface.SelectedCaseOrdinal = NavigationSurface.SelectedCaseOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedCaseOrdinal;
	Surface.StartPreviewDeckLabel = ActionControlSurface.StartPreviewDeckLabel.IsEmpty()
		? TEXT("Start Preview Deck")
		: ActionControlSurface.StartPreviewDeckLabel;
	Surface.StartSelectedPreviewCaseLabel = ActionControlSurface.StartSelectedPreviewCaseLabel.IsEmpty()
		? TEXT("Start Selected Preview Case")
		: ActionControlSurface.StartSelectedPreviewCaseLabel;
	Surface.RecommendedDeckLabel = RecommendedDeckSurface.DeckLabel.IsEmpty()
		? TEXT("n/a")
		: RecommendedDeckSurface.DeckLabel;
	Surface.FollowUpDeckLabel = FollowUpDeckSurface.DeckLabel.IsEmpty()
		? TEXT("n/a")
		: FollowUpDeckSurface.DeckLabel;
	Surface.RecommendedBriefHeadline = RecommendedDeckSurface.BriefHeadline.IsEmpty()
		? TEXT("n/a")
		: RecommendedDeckSurface.BriefHeadline;
	Surface.FollowUpBriefHeadline = FollowUpDeckSurface.BriefHeadline.IsEmpty()
		? TEXT("n/a")
		: FollowUpDeckSurface.BriefHeadline;
	Surface.SelectedCaseIndex = SelectionSurface.SelectedCaseIndex;
	Surface.TotalCaseCount = SelectionSurface.TotalCaseCount;
	Surface.RecommendedCaseCount = RecommendedDeckSurface.CaseCount;
	Surface.FollowUpCaseCount = FollowUpDeckSurface.CaseCount;
	Surface.bHasActivePreviewDeck =
		SelectionSurface.bHasActivePreviewDeck
		|| CaseDetailSurface.bHasActivePreviewDeck
		|| NavigationSurface.bHasActivePreviewDeck
		|| ActionControlSurface.bHasActivePreviewDeck;
	Surface.bHasSelectedCase =
		SelectionSurface.bHasSelectedCase
		|| CaseDetailSurface.bHasSelectedCase
		|| NavigationSurface.bHasSelectedCase
		|| ActionControlSurface.bHasSelectedCase;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bStartPreviewDeckEnabled = ActionControlSurface.bStartPreviewDeckEnabled;
	Surface.bStartSelectedPreviewCaseEnabled = ActionControlSurface.bStartSelectedPreviewCaseEnabled;
	Surface.bHasRecommendedDeck = RecommendedDeckSurface.bHasDeck || RecommendedDeckSurface.bHasBrief;
	Surface.bHasFollowUpDeck = FollowUpDeckSurface.bHasDeck || FollowUpDeckSurface.bHasBrief;
	Surface.bClosedLoopIdleDashboard =
		SelectionSurface.bClosedLoopIdleDashboard
		|| CaseDetailSurface.bClosedLoopIdleDashboard
		|| NavigationSurface.bClosedLoopIdleDashboard
		|| ActionControlSurface.bClosedLoopIdleDashboard
		|| RecommendedDeckSurface.bClosedLoopIdleDashboard
		|| FollowUpDeckSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Guidance preview band: lane %s | case %s | navigation %s/%s | start deck %s | start case %s"),
		*Surface.ActivePreviewLaneLabel,
		*Surface.SelectedCaseOrdinal,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bStartPreviewDeckEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bStartSelectedPreviewCaseEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | %s | %s | deck %s | selected case %s | recommended cases %d | follow-up cases %d | active preview deck %s | closed-loop idle %s"),
		*Surface.PreviewSelectionStatusLine,
		*Surface.PreviewCaseDetailStatusLine,
		*Surface.PreviewCaseNavigationStatusLine,
		*Surface.PreviewLaunchControlStatusLine,
		*Surface.RecommendedDeckStatusLine,
		*Surface.FollowUpDeckStatusLine,
		*Surface.DeckLabel,
		*Surface.SelectedCaseId,
		Surface.RecommendedCaseCount,
		Surface.FollowUpCaseCount,
		Surface.bHasActivePreviewDeck ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillDiagnosticsInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillDiagnosticsInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillDiagnosticsInspectSurface Surface;
	Surface.Headline = TEXT("Method drill diagnostics");

	const bool bHasMethodDrillRun = CachedMethodDrillRunState.IsStructurallyValid();
	const bool bHasMethodDrillDiagnosticPacket = CachedMethodDrillDiagnosticPacket.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpTemplate = CachedMethodDrillFollowUpTemplate.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpDeck = CachedMethodDrillFollowUpDeck.IsStructurallyValid();
	const auto BuildCaseIdPreview = [](const TArray<FString>& CaseIds) -> FString
	{
		if (CaseIds.Num() <= 0)
		{
			return TEXT("none");
		}

		TArray<FString> PreviewCaseIds;
		const int32 PreviewCount = FMath::Min(CaseIds.Num(), 3);
		PreviewCaseIds.Reserve(PreviewCount + 1);
		for (int32 Index = 0; Index < PreviewCount; ++Index)
		{
			PreviewCaseIds.Add(CaseIds[Index]);
		}
		if (CaseIds.Num() > PreviewCount)
		{
			PreviewCaseIds.Add(FString::Printf(TEXT("+%d more"), CaseIds.Num() - PreviewCount));
		}
		return FString::Join(PreviewCaseIds, TEXT(", "));
	};

	const FHyperTwistTrainingMethodDrillCaseComparisonPacket* PrimaryMethodDrillCase =
		bHasMethodDrillDiagnosticPacket && CachedMethodDrillDiagnosticPacket.CasePackets.Num() > 0
			? &CachedMethodDrillDiagnosticPacket.CasePackets[0]
			: nullptr;
	const FString MethodDrillFocusPreview =
		BuildCaseIdPreview(CachedMethodDrillDiagnosticPacket.FocusCaseIds);
	const FString MethodDrillTemplateLabel =
		bHasMethodDrillFollowUpTemplate
			? (CachedMethodDrillFollowUpTemplate.Title.IsEmpty()
				? CachedMethodDrillFollowUpTemplate.TemplateId
				: CachedMethodDrillFollowUpTemplate.Title)
			: TEXT("n/a");
	const FHyperTwistCoachDashboardMethodDrillFollowUpWeighting MethodDrillFollowUpWeighting =
		BuildMethodDrillFollowUpWeighting();
	const FString MethodDrillOutcomePreferenceLine = !MethodDrillFollowUpWeighting.IsStructurallyValid()
		? TEXT("no retained drill follow-up history yet")
		: (MethodDrillFollowUpWeighting.bPreferDrillFollowUp
			? (MethodDrillFollowUpWeighting.bUsedUpstreamNarrowStructureSignal
				? TEXT("retained drill-follow-up packet structure history favors staying narrow with drill follow-up")
				: TEXT("retained drill history favors staying narrow with drill follow-up"))
			: (MethodDrillFollowUpWeighting.bPreferCoachHandoff
				? (MethodDrillFollowUpWeighting.bUsedUpstreamBroadStructureSignal
					? TEXT("retained drill-follow-up packet structure history favors handing control back to broader coach guidance")
					: TEXT("retained drill history favors handing control back to broader coach guidance"))
				: TEXT("retained drill history is balanced")));

	Surface.DrillId =
		bHasMethodDrillDiagnosticPacket && !CachedMethodDrillDiagnosticPacket.DrillId.IsEmpty()
			? CachedMethodDrillDiagnosticPacket.DrillId
			: TEXT("n/a");
	Surface.StageLabel =
		bHasMethodDrillDiagnosticPacket && !CachedMethodDrillDiagnosticPacket.StageLabel.IsEmpty()
			? CachedMethodDrillDiagnosticPacket.StageLabel
			: TEXT("n/a");
	Surface.DiagnosticStateLabel =
		bHasMethodDrillDiagnosticPacket
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.DiagnosticState)
			: TEXT("n/a");
	Surface.RecommendedReviewGradeLabel =
		bHasMethodDrillDiagnosticPacket
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.RecommendedReviewGrade)
			: TEXT("n/a");
	Surface.LifecycleStateLabel =
		bHasMethodDrillDiagnosticPacket
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.LifecycleState)
			: (bHasMethodDrillRun
				? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					CachedMethodDrillRunState.LifecycleState)
				: TEXT("n/a"));
	Surface.DrillModeLabel =
		bHasMethodDrillDiagnosticPacket
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.DrillMode)
			: TEXT("n/a");
	Surface.VisibilityPolicyLabel =
		bHasMethodDrillDiagnosticPacket
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.VisibilityPolicy)
			: TEXT("n/a");
	Surface.BoundaryReason =
		bHasMethodDrillDiagnosticPacket && !CachedMethodDrillDiagnosticPacket.BoundaryReason.IsEmpty()
			? CachedMethodDrillDiagnosticPacket.BoundaryReason
			: TEXT("n/a");
	Surface.FollowUpTemplateLabel = MethodDrillTemplateLabel;
	Surface.FollowUpTemplateKindLabel =
		bHasMethodDrillFollowUpTemplate
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillFollowUpTemplate.TemplateKind)
			: TEXT("n/a");
	Surface.FollowUpSuggestedModeLabel =
		bHasMethodDrillFollowUpTemplate
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillFollowUpTemplate.SuggestedMode)
			: TEXT("n/a");
	Surface.FollowUpSuggestedSelectionLabel =
		bHasMethodDrillFollowUpTemplate
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillFollowUpTemplate.SuggestedSelectionPolicy)
			: TEXT("n/a");
	Surface.FollowUpGuidanceLabel =
		bHasMethodDrillFollowUpTemplate && !CachedMethodDrillFollowUpTemplate.GuidanceLabel.IsEmpty()
			? CachedMethodDrillFollowUpTemplate.GuidanceLabel
			: TEXT("n/a");
	Surface.FocusCasePreview = MethodDrillFocusPreview;
	Surface.TopCaseDetailLine =
		PrimaryMethodDrillCase != nullptr
			? FString::Printf(
				TEXT("%s [%s | grade %s | attempts %d | repeats %d | reveals %d]"),
				*PrimaryMethodDrillCase->CaseId,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					PrimaryMethodDrillCase->DiagnosticState),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					PrimaryMethodDrillCase->RecommendedReviewGrade),
				PrimaryMethodDrillCase->AttemptCount,
				PrimaryMethodDrillCase->RepeatCount,
				PrimaryMethodDrillCase->RevealCount)
			: TEXT("n/a");
	Surface.OutcomePreferenceLine = MethodDrillOutcomePreferenceLine;
	Surface.FocusCaseCount =
		bHasMethodDrillDiagnosticPacket ? CachedMethodDrillDiagnosticPacket.FocusCaseIds.Num() : 0;
	Surface.PendingCaseCount =
		bHasMethodDrillDiagnosticPacket ? CachedMethodDrillDiagnosticPacket.PendingCaseCount : 0;
	Surface.AssistedCompletionCount = bHasMethodDrillDiagnosticPacket
		? CachedMethodDrillDiagnosticPacket.AssistedCompletionCount
		: 0;
	Surface.RepeatBurdenCaseCount = bHasMethodDrillDiagnosticPacket
		? CachedMethodDrillDiagnosticPacket.RepeatBurdenCaseCount
		: 0;
	Surface.DeferredCaseCount =
		bHasMethodDrillDiagnosticPacket ? CachedMethodDrillDiagnosticPacket.DeferredCaseCount : 0;
	Surface.FollowUpRecommendedCaseCount = bHasMethodDrillFollowUpTemplate
		? CachedMethodDrillFollowUpTemplate.RecommendedCaseCount
		: 0;
	Surface.MatchingHistoryCount = MethodDrillFollowUpWeighting.MatchingHistoryCount;
	Surface.StrongOutcomeCount = MethodDrillFollowUpWeighting.StrongOutcomeCount;
	Surface.WeakOutcomeCount = MethodDrillFollowUpWeighting.WeakOutcomeCount;
	Surface.bHasMethodDrillRun = bHasMethodDrillRun;
	Surface.bHasDiagnosticPacket = bHasMethodDrillDiagnosticPacket;
	Surface.bHasFollowUpTemplate = bHasMethodDrillFollowUpTemplate;
	Surface.bHasFollowUpDeck = bHasMethodDrillFollowUpDeck;
	Surface.bHasHistoryWeighting = MethodDrillFollowUpWeighting.IsStructurallyValid();
	Surface.bPreferDrillFollowUp = MethodDrillFollowUpWeighting.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = MethodDrillFollowUpWeighting.bPreferCoachHandoff;
	Surface.StatusLine = !DisplayedMethodDrillDiagnosticsStatusLine.IsEmpty()
		? DisplayedMethodDrillDiagnosticsStatusLine
		: TEXT("Method drill: no active drill diagnostics are available yet.");
	Surface.DetailLine = !DisplayedMethodDrillDiagnosticsDetailLine.IsEmpty()
		? DisplayedMethodDrillDiagnosticsDetailLine
		: TEXT("Method drill detail: a completed or resumed method-drill run will surface its owned diagnostic packet and follow-up template here.");
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillFollowUpActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillFollowUpActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillFollowUpActionInspectSurface Surface;
	Surface.Headline = TEXT("Method drill follow-up action");

	const bool bHasMethodDrillRun = CachedMethodDrillRunState.IsStructurallyValid();
	const bool bHasMethodDrillDiagnosticPacket = CachedMethodDrillDiagnosticPacket.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpTemplate = CachedMethodDrillFollowUpTemplate.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpDeck = CachedMethodDrillFollowUpDeck.IsStructurallyValid();
	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid();
	const bool bMethodDrillLifecycleClosed =
		bHasMethodDrillRun
		&& (CachedMethodDrillRunState.LifecycleState == EHyperTwistTrainingDrillLifecycleState::Completed
			|| CachedMethodDrillRunState.LifecycleState == EHyperTwistTrainingDrillLifecycleState::Aborted);
	const bool bCanLaunchMethodDrillFollowUp =
		!bHasLiveAttemptTimer
		&& !bHasActiveRun
		&& bMethodDrillLifecycleClosed
		&& bHasMethodDrillDiagnosticPacket
		&& bHasMethodDrillFollowUpTemplate
		&& bHasMethodDrillFollowUpDeck;
	const FString MethodDrillTemplateLabel =
		bHasMethodDrillFollowUpTemplate
			? (CachedMethodDrillFollowUpTemplate.Title.IsEmpty()
				? CachedMethodDrillFollowUpTemplate.TemplateId
				: CachedMethodDrillFollowUpTemplate.Title)
			: TEXT("n/a");
	const FHyperTwistCoachDashboardMethodDrillFollowUpWeighting MethodDrillFollowUpWeighting =
		BuildMethodDrillFollowUpWeighting();
	const FString MethodDrillOutcomePreferenceLine = !MethodDrillFollowUpWeighting.IsStructurallyValid()
		? TEXT("no retained drill follow-up history yet")
		: (MethodDrillFollowUpWeighting.bPreferDrillFollowUp
			? (MethodDrillFollowUpWeighting.bUsedUpstreamNarrowStructureSignal
				? TEXT("retained drill-follow-up packet structure history favors staying narrow with drill follow-up")
				: TEXT("retained drill history favors staying narrow with drill follow-up"))
			: (MethodDrillFollowUpWeighting.bPreferCoachHandoff
				? (MethodDrillFollowUpWeighting.bUsedUpstreamBroadStructureSignal
					? TEXT("retained drill-follow-up packet structure history favors handing control back to broader coach guidance")
					: TEXT("retained drill history favors handing control back to broader coach guidance"))
				: TEXT("retained drill history is balanced")));

	FString FollowUpActionLabel = TEXT("Launch Drill Follow-Up");
	if (bHasLiveAttemptTimer)
	{
		FollowUpActionLabel = TEXT("Drill Follow-Up Busy");
	}
	else if (bHasActiveRun)
	{
		FollowUpActionLabel = TEXT("Clear Run For Drill Follow-Up");
	}
	else if (bHasMethodDrillRun && !bMethodDrillLifecycleClosed)
	{
		FollowUpActionLabel = TEXT("Finish Drill Before Follow-Up");
	}
	else if (bHasMethodDrillDiagnosticPacket && CachedMethodDrillDiagnosticPacket.bNeedsFollowUpTemplate
		&& !bHasMethodDrillFollowUpTemplate)
	{
		FollowUpActionLabel = TEXT("Follow-Up Template Missing");
	}
	else if (bHasMethodDrillFollowUpTemplate && !bHasMethodDrillFollowUpDeck)
	{
		FollowUpActionLabel = TEXT("No Drill Follow-Up Deck");
	}
	else if (!bHasMethodDrillDiagnosticPacket)
	{
		FollowUpActionLabel = TEXT("No Drill Follow-Up");
	}
	if (bCanLaunchMethodDrillFollowUp && MethodDrillFollowUpWeighting.bPreferDrillFollowUp)
	{
		FollowUpActionLabel = TEXT("Launch Preferred Drill Follow-Up");
	}
	else if (bCanLaunchMethodDrillFollowUp && MethodDrillFollowUpWeighting.bPreferCoachHandoff)
	{
		FollowUpActionLabel = TEXT("Drill Follow-Up Optional");
	}

	Surface.ActionLabel = !DisplayedMethodDrillFollowUpActionLabel.IsEmpty()
		? DisplayedMethodDrillFollowUpActionLabel
		: FollowUpActionLabel;
	Surface.FollowUpTemplateLabel = MethodDrillTemplateLabel;
	Surface.OutcomePreferenceLine = MethodDrillOutcomePreferenceLine;
	Surface.MatchingHistoryCount = MethodDrillFollowUpWeighting.MatchingHistoryCount;
	Surface.bHasMethodDrillRun = bHasMethodDrillRun;
	Surface.bMethodDrillLifecycleClosed = bMethodDrillLifecycleClosed;
	Surface.bHasDiagnosticPacket = bHasMethodDrillDiagnosticPacket;
	Surface.bNeedsFollowUpTemplate =
		bHasMethodDrillDiagnosticPacket && CachedMethodDrillDiagnosticPacket.bNeedsFollowUpTemplate;
	Surface.bHasFollowUpTemplate = bHasMethodDrillFollowUpTemplate;
	Surface.bHasFollowUpDeck = bHasMethodDrillFollowUpDeck;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bCanLaunchFollowUp = bCanLaunchMethodDrillFollowUp;
	Surface.bHasHistoryWeighting = MethodDrillFollowUpWeighting.IsStructurallyValid();
	Surface.bPreferDrillFollowUp = MethodDrillFollowUpWeighting.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = MethodDrillFollowUpWeighting.bPreferCoachHandoff;
	Surface.StatusLine = FString::Printf(
		TEXT("Drill follow-up action: %s | enabled %s | diagnostic packet %s | template %s | deck %s | live timer %s | active run %s | lifecycle closed %s | history: %s"),
		*Surface.ActionLabel,
		Surface.bCanLaunchFollowUp ? TEXT("yes") : TEXT("no"),
		Surface.bHasDiagnosticPacket ? TEXT("yes") : TEXT("no"),
		Surface.bHasFollowUpTemplate ? TEXT("yes") : TEXT("no"),
		Surface.bHasFollowUpDeck ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bMethodDrillLifecycleClosed ? TEXT("yes") : TEXT("no"),
		*Surface.OutcomePreferenceLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardMethodDrillOperationalBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedMethodDrillOperationalBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardMethodDrillOperationalBandInspectSurface Surface;
	Surface.Headline = TEXT("Method drill operational band");

	const FHyperTwistTrainingCoachDashboardMethodDrillDiagnosticsInspectSurface DiagnosticsSurface =
		GetDisplayedMethodDrillDiagnosticsInspectSurface();
	const FHyperTwistTrainingCoachDashboardMethodDrillFollowUpActionInspectSurface FollowUpActionSurface =
		GetDisplayedMethodDrillFollowUpActionInspectSurface();

	Surface.DiagnosticsStatusLine = DiagnosticsSurface.StatusLine.IsEmpty()
		? TEXT("Method drill diagnostics: unavailable.")
		: DiagnosticsSurface.StatusLine;
	Surface.DiagnosticsDetailLine = DiagnosticsSurface.DetailLine.IsEmpty()
		? TEXT("Method drill diagnostics detail: unavailable.")
		: DiagnosticsSurface.DetailLine;
	Surface.FollowUpActionStatusLine = FollowUpActionSurface.StatusLine.IsEmpty()
		? TEXT("Method drill follow-up action: unavailable.")
		: FollowUpActionSurface.StatusLine;
	Surface.DrillId = DiagnosticsSurface.DrillId.IsEmpty() ? TEXT("n/a") : DiagnosticsSurface.DrillId;
	Surface.StageLabel = DiagnosticsSurface.StageLabel.IsEmpty() ? TEXT("n/a") : DiagnosticsSurface.StageLabel;
	Surface.DiagnosticStateLabel = DiagnosticsSurface.DiagnosticStateLabel.IsEmpty()
		? TEXT("n/a")
		: DiagnosticsSurface.DiagnosticStateLabel;
	Surface.RecommendedReviewGradeLabel = DiagnosticsSurface.RecommendedReviewGradeLabel.IsEmpty()
		? TEXT("n/a")
		: DiagnosticsSurface.RecommendedReviewGradeLabel;
	Surface.FollowUpTemplateLabel = !DiagnosticsSurface.FollowUpTemplateLabel.IsEmpty()
		? DiagnosticsSurface.FollowUpTemplateLabel
		: (FollowUpActionSurface.FollowUpTemplateLabel.IsEmpty()
			? TEXT("n/a")
			: FollowUpActionSurface.FollowUpTemplateLabel);
	Surface.FollowUpActionLabel = FollowUpActionSurface.ActionLabel.IsEmpty()
		? TEXT("n/a")
		: FollowUpActionSurface.ActionLabel;
	Surface.OutcomePreferenceLine = !DiagnosticsSurface.OutcomePreferenceLine.IsEmpty()
		? DiagnosticsSurface.OutcomePreferenceLine
		: (FollowUpActionSurface.OutcomePreferenceLine.IsEmpty()
			? TEXT("n/a")
			: FollowUpActionSurface.OutcomePreferenceLine);
	Surface.FocusCaseCount = DiagnosticsSurface.FocusCaseCount;
	Surface.PendingCaseCount = DiagnosticsSurface.PendingCaseCount;
	Surface.FollowUpRecommendedCaseCount = DiagnosticsSurface.FollowUpRecommendedCaseCount;
	Surface.MatchingHistoryCount = DiagnosticsSurface.MatchingHistoryCount > 0
		? DiagnosticsSurface.MatchingHistoryCount
		: FollowUpActionSurface.MatchingHistoryCount;
	Surface.bHasMethodDrillRun = DiagnosticsSurface.bHasMethodDrillRun || FollowUpActionSurface.bHasMethodDrillRun;
	Surface.bHasDiagnosticPacket = DiagnosticsSurface.bHasDiagnosticPacket || FollowUpActionSurface.bHasDiagnosticPacket;
	Surface.bHasFollowUpTemplate = DiagnosticsSurface.bHasFollowUpTemplate || FollowUpActionSurface.bHasFollowUpTemplate;
	Surface.bHasFollowUpDeck = DiagnosticsSurface.bHasFollowUpDeck || FollowUpActionSurface.bHasFollowUpDeck;
	Surface.bHasHistoryWeighting = DiagnosticsSurface.bHasHistoryWeighting || FollowUpActionSurface.bHasHistoryWeighting;
	Surface.bPreferDrillFollowUp = DiagnosticsSurface.bPreferDrillFollowUp || FollowUpActionSurface.bPreferDrillFollowUp;
	Surface.bPreferCoachHandoff = DiagnosticsSurface.bPreferCoachHandoff || FollowUpActionSurface.bPreferCoachHandoff;
	Surface.bMethodDrillLifecycleClosed = FollowUpActionSurface.bMethodDrillLifecycleClosed;
	Surface.bCanLaunchFollowUp = FollowUpActionSurface.bCanLaunchFollowUp;
	Surface.StatusLine = FString::Printf(
		TEXT("Method-drill operational band: drill %s | stage %s | review %s | follow-up %s | launch %s"),
		*Surface.DrillId,
		*Surface.StageLabel,
		*Surface.RecommendedReviewGradeLabel,
		*Surface.FollowUpActionLabel,
		Surface.bCanLaunchFollowUp ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | diagnostic state %s | template %s | focus %d | pending %d | recommended %d | matching history %d | prefer drill %s | prefer handoff %s"),
		*Surface.DiagnosticsStatusLine,
		*Surface.DiagnosticsDetailLine,
		*Surface.FollowUpActionStatusLine,
		*Surface.DiagnosticStateLabel,
		*Surface.FollowUpTemplateLabel,
		Surface.FocusCaseCount,
		Surface.PendingCaseCount,
		Surface.FollowUpRecommendedCaseCount,
		Surface.MatchingHistoryCount,
		Surface.bPreferDrillFollowUp ? TEXT("yes") : TEXT("no"),
		Surface.bPreferCoachHandoff ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceRationaleInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceRationaleInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceRationaleInspectSurface Surface;
	Surface.Headline = TEXT("Guidance rationale");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	const FHyperTwistCoachBrief* ActivePreviewBrief = GetActiveGuidancePreviewBrief();

	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.bHasActivePreviewBrief = ActivePreviewBrief != nullptr;
	Surface.SelectedCaseId =
		SelectedGuidancePreviewCase != nullptr && !SelectedGuidancePreviewCase->CaseId.IsEmpty()
			? SelectedGuidancePreviewCase->CaseId
			: TEXT("n/a");
	Surface.GuidanceSourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.LaunchBiasLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
			CachedCoachPanelState.PreferredLaunchBudgetBias);
	Surface.LaunchBiasSourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel);
	Surface.BroadenedLaunchHistoryCount =
		CachedCoachPanelState.BroadenedLaunchBudgetHistoryCount;
	Surface.TightenedLaunchHistoryCount =
		CachedCoachPanelState.TightenedLaunchBudgetHistoryCount;
	Surface.DeferredTightenedLaunchHistoryCount =
		CachedCoachPanelState.DeferredTightenedLaunchHistoryCount;
	Surface.DeferredLaunchHistoryCaseCount =
		CachedCoachPanelState.DeferredLaunchHistoryCaseCount;

	bool bSelectedPreviewCaseIsExplicitFocus = false;
	int32 SelectedPreviewCaseSignalCount = 0;
	FString SelectedPreviewCaseSignalLine = TEXT("none");
	FString SignalSummaryLine = TEXT("none");
	int32 SignalCount = 0;
	if (ActivePreviewBrief != nullptr)
	{
		SignalCount = ActivePreviewBrief->Signals.Num();
		if (SelectedGuidancePreviewCase != nullptr)
		{
			bSelectedPreviewCaseIsExplicitFocus =
				ActivePreviewBrief->FocusCaseIds.Contains(SelectedGuidancePreviewCase->CaseId);
		}

		TArray<FString> SignalSummaryParts;
		SignalSummaryParts.Reserve(FMath::Min(ActivePreviewBrief->Signals.Num(), 2));
		for (const FHyperTwistCoachSignal& Signal : ActivePreviewBrief->Signals)
		{
			if (SelectedGuidancePreviewCase != nullptr
				&& Signal.SuggestedCaseIds.Contains(SelectedGuidancePreviewCase->CaseId))
			{
				++SelectedPreviewCaseSignalCount;
				if (SelectedPreviewCaseSignalLine == TEXT("none"))
				{
					SelectedPreviewCaseSignalLine = FString::Printf(
						TEXT("%s | %s"),
						Signal.Headline.IsEmpty() ? TEXT("signal") : *Signal.Headline,
						Signal.Detail.IsEmpty() ? TEXT("no detail") : *Signal.Detail);
				}
			}

			if (SignalSummaryParts.Num() < 2)
			{
				SignalSummaryParts.Add(FString::Printf(
					TEXT("%s (%.2f)"),
					Signal.Headline.IsEmpty() ? TEXT("signal") : *Signal.Headline,
					Signal.Score));
			}
		}

		if (SignalSummaryParts.Num() > 0)
		{
			SignalSummaryLine = FString::Join(SignalSummaryParts, TEXT(" | "));
		}
	}

	Surface.SelectedPreviewCaseSignalCount = SelectedPreviewCaseSignalCount;
	Surface.SelectedPreviewCaseSignalLine = SelectedPreviewCaseSignalLine;
	Surface.TopSignalSummaryLine = SignalSummaryLine;
	Surface.SignalCount = SignalCount;
	Surface.bSelectedPreviewCaseIsExplicitFocus = bSelectedPreviewCaseIsExplicitFocus;
	Surface.bDeferredOverflowShaping =
		CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
		== TEXT("recommendation-history-deferred-tightened-launch");

	if (ActivePreviewBrief != nullptr)
	{
		Surface.PriorityLabel =
			HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				ActivePreviewBrief->Priority);
		Surface.FocusLaneLabel =
			HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				ActivePreviewBrief->FocusLane);
		Surface.SuggestedModeLabel =
			HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				ActivePreviewBrief->SuggestedMode);
		Surface.SuggestedSelectionLabel =
			HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				ActivePreviewBrief->SuggestedSelectionPolicy);
		Surface.BriefHeadline =
			ActivePreviewBrief->Headline.IsEmpty() ? TEXT("n/a") : ActivePreviewBrief->Headline;
		Surface.PrimaryActionLabel =
			ActivePreviewBrief->PrimaryActionLabel.IsEmpty()
				? TEXT("n/a")
				: ActivePreviewBrief->PrimaryActionLabel;
		Surface.FocusDeckId =
			ActivePreviewBrief->FocusDeckId.IsEmpty()
				? TEXT("n/a")
				: ActivePreviewBrief->FocusDeckId;
		Surface.FocusMethodSegmentId =
			ActivePreviewBrief->FocusMethodSegmentId.IsEmpty()
				? TEXT("n/a")
				: ActivePreviewBrief->FocusMethodSegmentId;
		Surface.FocusCaseCount = ActivePreviewBrief->FocusCaseIds.Num();
		Surface.PriorityScore = ActivePreviewBrief->PriorityScore;
		Surface.bNeedsCoachReview = ActivePreviewBrief->bNeedsCoachReview;
		Surface.bNeedsCadenceRecovery = ActivePreviewBrief->bNeedsCadenceRecovery;
		Surface.bNeedsVarietyRotation = ActivePreviewBrief->bNeedsVarietyRotation;
	}
	else
	{
		Surface.PriorityLabel = TEXT("n/a");
		Surface.FocusLaneLabel = TEXT("n/a");
		Surface.SuggestedModeLabel = TEXT("n/a");
		Surface.SuggestedSelectionLabel = TEXT("n/a");
		Surface.BriefHeadline = TEXT("n/a");
		Surface.PrimaryActionLabel = TEXT("n/a");
		Surface.FocusDeckId = TEXT("n/a");
		Surface.FocusMethodSegmentId = TEXT("n/a");
	}

	Surface.StatusLine =
		ActivePreviewBrief != nullptr
			? FString::Printf(
				TEXT("Rationale: %s lane | Priority: %s (%.2f) | Focus: %s | Mode: %s | Selection: %s"),
				*Surface.ActivePreviewLaneLabel,
				*Surface.PriorityLabel,
				Surface.PriorityScore,
				*Surface.FocusLaneLabel,
				*Surface.SuggestedModeLabel,
				*Surface.SuggestedSelectionLabel)
			: FString::Printf(
				TEXT("Rationale: %s lane | build a recommended or follow-up preview to inspect the coach rationale"),
				*Surface.ActivePreviewLaneLabel);
	Surface.DetailLine =
		ActivePreviewBrief != nullptr
			? FString::Printf(
				TEXT("Brief: %s | Action: %s | Deck: %s | Method: %s | Focus cases: %d | Review: %s | Cadence: %s | Variety: %s | Guidance source: %s | Launch bias: %s from %s | broadened/tightened history %d/%d | deferred tightened launches %d | deferred launch cases %d%s | Selected focus: %s | Matching signals: %d | Case signal: %s | Top signals: %s"),
				*Surface.BriefHeadline,
				*Surface.PrimaryActionLabel,
				*Surface.FocusDeckId,
				*Surface.FocusMethodSegmentId,
				Surface.FocusCaseCount,
				Surface.bNeedsCoachReview ? TEXT("yes") : TEXT("no"),
				Surface.bNeedsCadenceRecovery ? TEXT("yes") : TEXT("no"),
				Surface.bNeedsVarietyRotation ? TEXT("yes") : TEXT("no"),
				*Surface.GuidanceSourceLabel,
				*Surface.LaunchBiasLabel,
				*Surface.LaunchBiasSourceLabel,
				Surface.BroadenedLaunchHistoryCount,
				Surface.TightenedLaunchHistoryCount,
				Surface.DeferredTightenedLaunchHistoryCount,
				Surface.DeferredLaunchHistoryCaseCount,
				Surface.bDeferredOverflowShaping
					? TEXT(" | This preview is being shaped by remembered deferred overflow continuation.")
					: TEXT(""),
				Surface.bSelectedPreviewCaseIsExplicitFocus ? TEXT("yes") : TEXT("no"),
				Surface.SelectedPreviewCaseSignalCount,
				*Surface.SelectedPreviewCaseSignalLine,
				*Surface.TopSignalSummaryLine)
			: TEXT("Rationale detail: unavailable until a guidance preview lane is active.");

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Rationale: closed-loop idle state | no active guidance preview remains.");
		Surface.DetailLine =
			TEXT("Rationale detail: retained coach memory and history remain available for inspection, but no live preview packet is active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreferenceInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidancePreferenceInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreferenceInspectSurface Surface;
	Surface.Headline = TEXT("Guidance preference");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistCoachDashboardGuidanceLanePreference GuidanceLanePreference =
		BuildGuidanceLanePreference();
	Surface.bHasPreference = GuidanceLanePreference.IsStructurallyValid();
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.PreferredGuidanceLaneLabel =
		BuildPreviewLaneLabel(GuidanceLanePreference.PreferredLane);
	Surface.GuidancePreferenceSourceLabel = [&]() -> FString
	{
		if (GuidanceLanePreference.bHasDecisionSignal)
		{
			if (GuidanceLanePreference.bHasReliableAlignedPlanOutcomeSignal)
			{
				return GuidanceLanePreference.bHasClosureHistorySignal
					? TEXT("decision + closure-history + aligned-plan-outcome")
					: TEXT("decision + aligned-plan-outcome");
			}
			return GuidanceLanePreference.bHasClosureHistorySignal
				? TEXT("decision + closure-history")
				: TEXT("decision-informed");
		}
		if (GuidanceLanePreference.bHasReliableAlignedPlanOutcomeSignal)
		{
			return TEXT("aligned-plan-outcome + memory");
		}
		if (GuidanceLanePreference.bHasClosureHistorySignal)
		{
			return TEXT("closure-history + memory");
		}
		return CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("availability fallback")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredGuidanceSourceLabel);
	}();
	Surface.LaunchBiasLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
			CachedCoachPanelState.PreferredLaunchBudgetBias);
	Surface.LaunchBiasSourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel);
	Surface.RecommendedDecisionCount = GuidanceLanePreference.RecommendedDecisionCount;
	Surface.FollowUpDecisionCount = GuidanceLanePreference.FollowUpDecisionCount;
	Surface.RecommendedContinueBias = GuidanceLanePreference.RecommendedContinueBias;
	Surface.FollowUpContinueBias = GuidanceLanePreference.FollowUpContinueBias;
	Surface.ClosureContinuationBias = GuidanceLanePreference.ClosureContinuationBias;
	Surface.ClosureSuppressionBias = GuidanceLanePreference.ClosureSuppressionBias;
	Surface.PreferredLaunchBudgetBias = CachedCoachPanelState.PreferredLaunchBudgetBias;
	Surface.BroadenedLaunchHistoryCount =
		CachedCoachPanelState.BroadenedLaunchBudgetHistoryCount;
	Surface.TightenedLaunchHistoryCount =
		CachedCoachPanelState.TightenedLaunchBudgetHistoryCount;
	Surface.DeferredTightenedLaunchHistoryCount =
		CachedCoachPanelState.DeferredTightenedLaunchHistoryCount;
	Surface.DeferredLaunchHistoryCaseCount =
		CachedCoachPanelState.DeferredLaunchHistoryCaseCount;
	Surface.MethodDrillFollowUpHistoryCount =
		CachedCoachPanelState.MethodDrillFollowUpHistoryCount;
	Surface.StrongMethodDrillFollowUpHistoryCount =
		CachedCoachPanelState.StrongMethodDrillFollowUpHistoryCount;
	Surface.WeakMethodDrillFollowUpHistoryCount =
		CachedCoachPanelState.WeakMethodDrillFollowUpHistoryCount;
	Surface.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedTightContinuationBias =
		GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias;
	Surface.ReliableAlignedTrustedBroadRedirectBias =
		GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias;
	Surface.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount;
	Surface.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount;
	Surface.AlignedTightFollowUpPacketStructureOutcomeHistoryCount =
		CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeHistoryCount;
	Surface.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount =
		CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount;
	Surface.RecommendedAverageSuccessRate =
		GuidanceLanePreference.RecommendedAverageSuccessRate;
	Surface.FollowUpAverageSuccessRate =
		GuidanceLanePreference.FollowUpAverageSuccessRate;
	Surface.MethodDrillFollowUpAverageOutcomeScore =
		CachedCoachPanelState.MethodDrillFollowUpAverageOutcomeScore;
	Surface.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore;
	Surface.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeAverageScore =
		CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeAverageScore;
	Surface.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeAverageScore =
		CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeAverageScore;
	Surface.AlignedTightFollowUpPacketStructureOutcomeAverageScore =
		CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeAverageScore;
	Surface.AlignedBroadRecommendedPacketStructureOutcomeAverageScore =
		CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeAverageScore;
	Surface.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore;
	Surface.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore;
	Surface.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore;
	Surface.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore;
	Surface.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore =
		CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore;
	Surface.bHasDecisionSignal = GuidanceLanePreference.bHasDecisionSignal;
	Surface.bHasClosureHistorySignal = GuidanceLanePreference.bHasClosureHistorySignal;
	Surface.bHasReliableAlignedPlanOutcomeSignal =
		GuidanceLanePreference.bHasReliableAlignedPlanOutcomeSignal;
	Surface.bDeferredOverflowSteeringLane =
		CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
		== TEXT("recommendation-history-deferred-tightened-launch");
	Surface.bMethodDrillUpstreamStrongSource =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-strong")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-strong");
	Surface.bMethodDrillUpstreamWeakSource =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-weak")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-weak");
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
				CachedCoachPanelState.PreferredGuidanceSourceLabel)
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	const FString MethodDrillUpstreamMemoryLine =
		CachedCoachPanelState.MethodDrillFollowUpHistoryCount > 0
			? FString::Printf(
				TEXT(" | Upstream drill memory count %d | strong %d | weak %d | avg outcome %.1f%s%s"),
				CachedCoachPanelState.MethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.StrongMethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.WeakMethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.MethodDrillFollowUpAverageOutcomeScore,
				Surface.bMethodDrillUpstreamStrongSource
					? TEXT(" | Successful drill follow-up history is actively reinforcing narrow continuation.")
					: TEXT(""),
				Surface.bMethodDrillUpstreamWeakSource
					? TEXT(" | Weak drill follow-up history is actively pushing control back toward broader coach guidance.")
					: TEXT(""))
			: FString();

	Surface.StatusLine = GuidanceLanePreference.IsStructurallyValid()
		? FString::Printf(
			TEXT("Preference: next surfaced lane %s | Active preview: %s | Source: %s"),
			*Surface.PreferredGuidanceLaneLabel,
			*Surface.ActivePreviewLaneLabel,
			*Surface.GuidancePreferenceSourceLabel)
		: TEXT("Preference: no coach preview lane is currently available.");
	Surface.DetailLine = GuidanceLanePreference.IsStructurallyValid()
		? FString::Printf(
			TEXT("Recommended lane: %d decisions | Continue bias %d | Avg success %.2f | Closure suppress bias %d || Follow-up lane: %d decisions | Continue bias %d | Avg success %.2f | Closure continuation bias %d | Launch bias: %s from %s | broadened/tightened history %d/%d | deferred tightened launches %d | deferred launch cases %d%s | The dashboard adopts this preferred lane whenever it needs to surface the next guidance preview."),
			GuidanceLanePreference.RecommendedDecisionCount,
			GuidanceLanePreference.RecommendedContinueBias,
			GuidanceLanePreference.RecommendedAverageSuccessRate,
			GuidanceLanePreference.ClosureSuppressionBias,
			GuidanceLanePreference.FollowUpDecisionCount,
			GuidanceLanePreference.FollowUpContinueBias,
			GuidanceLanePreference.FollowUpAverageSuccessRate,
			GuidanceLanePreference.ClosureContinuationBias,
			*Surface.LaunchBiasLabel,
			*Surface.LaunchBiasSourceLabel,
			Surface.BroadenedLaunchHistoryCount,
			Surface.TightenedLaunchHistoryCount,
			Surface.DeferredTightenedLaunchHistoryCount,
			Surface.DeferredLaunchHistoryCaseCount,
			Surface.bDeferredOverflowSteeringLane
				? TEXT(" | Deferred overflow memory is actively steering the surfaced lane.")
				: TEXT(""))
		: TEXT("Preference detail: build recommended or follow-up guidance to let the dashboard choose a next surfaced lane.");
	if (!MethodDrillUpstreamMemoryLine.IsEmpty())
	{
		Surface.DetailLine += MethodDrillUpstreamMemoryLine;
	}
	if (GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f, continuation bias %d) | broad history %d (avg %.2f, redirect bias %d)%s"),
			GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias,
			GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias,
			GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias
					> GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias
				? TEXT(" | Tight launched-plan trust is currently reinforcing the follow-up lane.")
				: (GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias
						> GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias
					? TEXT(" | Broad launched-plan redirect trust is currently reinforcing the recommended lane.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount > 0
		|| CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan lane outcomes: tight->follow-up %d (avg %.2f) | broad->recommended %d (avg %.2f)%s"),
			CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount,
			CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeAverageScore,
			CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount,
			CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeAverageScore,
			HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpGuidanceSourceLabel(
					CachedCoachPanelState.PreferredGuidanceSourceLabel)
				? TEXT(" | Follow-up is currently being reinforced by aligned tight launched-plan lane outcomes.")
				: (HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedGuidanceSourceLabel(
							CachedCoachPanelState.PreferredGuidanceSourceLabel)
					? TEXT(" | Recommended is currently being reinforced by aligned broad launched-plan lane outcomes.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Aligned retained packet outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeHistoryCount,
			CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeAverageScore,
			CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount,
			CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel
					== TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
				? TEXT(" | Follow-up is currently being reinforced by retained aligned tight packet outcomes.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel
							== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
					? TEXT(" | Recommended is currently being reinforced by retained aligned broad packet outcomes.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Accepted aligned packet outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel
					== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
				? TEXT(" | Follow-up is currently being reinforced by accepted aligned tight packet outcomes.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel
							== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome")
					? TEXT(" | Recommended is currently being reinforced by accepted aligned broad packet outcomes.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Accepted aligned packet trust outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
				? TEXT(" | Follow-up is currently being reinforced by retained accepted aligned tight packet trust.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
							TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
					? TEXT(" | Recommended is currently being reinforced by retained accepted aligned broad packet trust.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet trust: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-reliable-"))
				? TEXT(" | Follow-up is currently being reinforced by reliable accepted aligned tight packet trust.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
							TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-reliable-"))
					? TEXT(" | Recommended is currently being reinforced by reliable accepted aligned broad packet trust.")
					: TEXT("")));
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
			> 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet launched-plan outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
			> 0
		|| CachedCoachPanelState
				.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount > 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet handoff completion: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
			> 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
			> 0)
	{
		Surface.DetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet exact lane outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore);
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceReasoningBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedGuidanceReasoningBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceReasoningBandInspectSurface Surface;
	Surface.Headline = TEXT("Guidance reasoning band");

	const FHyperTwistTrainingCoachDashboardGuidanceComparisonInspectSurface ComparisonSurface =
		GetDisplayedGuidanceComparisonInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceOutcomeInspectSurface OutcomeSurface =
		GetDisplayedGuidanceOutcomeInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceDecisionWeightingInspectSurface WeightingSurface =
		GetDisplayedGuidanceDecisionWeightingInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidanceRationaleInspectSurface RationaleSurface =
		GetDisplayedGuidanceRationaleInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreferenceInspectSurface PreferenceSurface =
		GetDisplayedGuidancePreferenceInspectSurface();

	Surface.ComparisonStatusLine = ComparisonSurface.StatusLine.IsEmpty()
		? TEXT("Guidance comparison: unavailable.")
		: ComparisonSurface.StatusLine;
	Surface.OutcomeStatusLine = OutcomeSurface.StatusLine.IsEmpty()
		? TEXT("Guidance outcome: unavailable.")
		: OutcomeSurface.StatusLine;
	Surface.WeightingStatusLine = WeightingSurface.StatusLine.IsEmpty()
		? TEXT("Guidance weighting: unavailable.")
		: WeightingSurface.StatusLine;
	Surface.RationaleStatusLine = RationaleSurface.StatusLine.IsEmpty()
		? TEXT("Guidance rationale: unavailable.")
		: RationaleSurface.StatusLine;
	Surface.PreferenceStatusLine = PreferenceSurface.StatusLine.IsEmpty()
		? TEXT("Guidance preference: unavailable.")
		: PreferenceSurface.StatusLine;
	Surface.RunRecapSourceLabel = !OutcomeSurface.RunRecapSourceLabel.IsEmpty()
		? OutcomeSurface.RunRecapSourceLabel
		: (ComparisonSurface.RunRecapSourceLabel.IsEmpty() ? TEXT("none") : ComparisonSurface.RunRecapSourceLabel);
	Surface.TrainingSessionId = !OutcomeSurface.TrainingSessionId.IsEmpty()
		? OutcomeSurface.TrainingSessionId
		: (ComparisonSurface.TrainingSessionId.IsEmpty() ? TEXT("n/a") : ComparisonSurface.TrainingSessionId);
	Surface.GuidanceLaneLabel = !OutcomeSurface.GuidanceLaneLabel.IsEmpty()
		? OutcomeSurface.GuidanceLaneLabel
		: (ComparisonSurface.GuidanceLaneLabel.IsEmpty() ? TEXT("none") : ComparisonSurface.GuidanceLaneLabel);
	Surface.ScopeLabel = !OutcomeSurface.ScopeLabel.IsEmpty()
		? OutcomeSurface.ScopeLabel
		: (ComparisonSurface.ScopeLabel.IsEmpty() ? TEXT("none") : ComparisonSurface.ScopeLabel);
	Surface.PreferredGuidanceLaneLabel = PreferenceSurface.PreferredGuidanceLaneLabel.IsEmpty()
		? TEXT("none")
		: PreferenceSurface.PreferredGuidanceLaneLabel;
	Surface.FocusLaneLabel = !ComparisonSurface.FocusLaneLabel.IsEmpty()
		? ComparisonSurface.FocusLaneLabel
		: (RationaleSurface.FocusLaneLabel.IsEmpty() ? TEXT("n/a") : RationaleSurface.FocusLaneLabel);
	Surface.BriefHeadline = !OutcomeSurface.BriefHeadline.IsEmpty()
		? OutcomeSurface.BriefHeadline
		: (RationaleSurface.BriefHeadline.IsEmpty() ? TEXT("n/a") : RationaleSurface.BriefHeadline);
	Surface.ActionLabel = OutcomeSurface.ActionLabel.IsEmpty() ? TEXT("n/a") : OutcomeSurface.ActionLabel;
	Surface.BaseActionLabel = !OutcomeSurface.BaseActionLabel.IsEmpty()
		? OutcomeSurface.BaseActionLabel
		: (WeightingSurface.BaseActionLabel.IsEmpty() ? TEXT("none") : WeightingSurface.BaseActionLabel);
	Surface.WeightedActionLabel = !OutcomeSurface.WeightedActionLabel.IsEmpty()
		? OutcomeSurface.WeightedActionLabel
		: (WeightingSurface.WeightedActionLabel.IsEmpty() ? TEXT("none") : WeightingSurface.WeightedActionLabel);
	Surface.ResolvedActionLabel = WeightingSurface.ResolvedActionLabel.IsEmpty()
		? TEXT("none")
		: WeightingSurface.ResolvedActionLabel;
	Surface.GuidancePreferenceSourceLabel = PreferenceSurface.GuidancePreferenceSourceLabel.IsEmpty()
		? TEXT("n/a")
		: PreferenceSurface.GuidancePreferenceSourceLabel;
	Surface.LaunchBiasLabel = PreferenceSurface.LaunchBiasLabel.IsEmpty()
		? TEXT("n/a")
		: PreferenceSurface.LaunchBiasLabel;
	Surface.LaunchBiasSourceLabel = PreferenceSurface.LaunchBiasSourceLabel.IsEmpty()
		? TEXT("n/a")
		: PreferenceSurface.LaunchBiasSourceLabel;
	Surface.SelectedCaseId = !OutcomeSurface.SelectedCaseId.IsEmpty()
		? OutcomeSurface.SelectedCaseId
		: (RationaleSurface.SelectedCaseId.IsEmpty() ? TEXT("n/a") : RationaleSurface.SelectedCaseId);
	Surface.ExpectedCaseCount = OutcomeSurface.ExpectedCaseCount;
	Surface.FocusCaseCount = !ComparisonSurface.FocusCaseCount ? RationaleSurface.FocusCaseCount : ComparisonSurface.FocusCaseCount;
	Surface.CompletedAttemptCount = OutcomeSurface.CompletedAttemptCount;
	Surface.MatchingDecisionCount = WeightingSurface.MatchingDecisionCount;
	Surface.SignalCount = RationaleSurface.SignalCount;
	Surface.SuccessRate = OutcomeSurface.SuccessRate;
	Surface.PriorityScore = RationaleSurface.PriorityScore;
	Surface.bHasComparisonContext = ComparisonSurface.bHasComparisonContext || OutcomeSurface.bHasComparisonContext || WeightingSurface.bHasComparisonContext;
	Surface.bHasWeighting = WeightingSurface.bHasWeighting;
	Surface.bHasPreference = PreferenceSurface.bHasPreference;
	Surface.bCanApplyAction = OutcomeSurface.bCanApplyAction;
	Surface.bCanRedirectAction = OutcomeSurface.bCanRedirectAction;
	Surface.bClosedLoopIdleActionability = ComparisonSurface.bClosedLoopIdleActionability || OutcomeSurface.bClosedLoopIdleActionability || WeightingSurface.bClosedLoopIdleActionability || RationaleSurface.bClosedLoopIdleDashboard || PreferenceSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Guidance reasoning band: lane %s | preferred %s | scope %s | action %s | apply %s"),
		*Surface.GuidanceLaneLabel,
		*Surface.PreferredGuidanceLaneLabel,
		*Surface.ScopeLabel,
		*Surface.ActionLabel,
		Surface.bCanApplyAction ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | %s | recap %s | session %s | selected case %s | focus %d | attempts %d | signals %d | matching decisions %d | success %.2f | launch bias %s from %s | closed-loop idle %s"),
		*Surface.ComparisonStatusLine,
		*Surface.OutcomeStatusLine,
		*Surface.WeightingStatusLine,
		*Surface.RationaleStatusLine,
		*Surface.PreferenceStatusLine,
		*Surface.RunRecapSourceLabel,
		*Surface.TrainingSessionId,
		*Surface.SelectedCaseId,
		Surface.FocusCaseCount,
		Surface.CompletedAttemptCount,
		Surface.SignalCount,
		Surface.MatchingDecisionCount,
		Surface.SuccessRate,
		*Surface.LaunchBiasLabel,
		*Surface.LaunchBiasSourceLabel,
		Surface.bClosedLoopIdleActionability ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRecommendedGuidanceDeckPreviewInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface Surface;
	Surface.Headline = TEXT("Recommended guidance");
	Surface.GuidanceLaneLabel = TEXT("recommended");

	const auto BuildDeckPreviewLine = [](const FHyperTwistTrainingDeck& Deck, const FHyperTwistCoachBrief& Brief, const TCHAR* EmptyPrefix)
	{
		if (Deck.IsStructurallyValid())
		{
			TArray<FString> PreviewCaseParts;
			const int32 PreviewCaseCount = FMath::Min(Deck.Cases.Num(), 3);
			for (int32 CaseIndex = 0; CaseIndex < PreviewCaseCount; ++CaseIndex)
			{
				const FHyperTwistTrainingCase& PreviewCase = Deck.Cases[CaseIndex];
				PreviewCaseParts.Add(
					PreviewCase.PromptLabel.IsEmpty() ? PreviewCase.CaseId : PreviewCase.PromptLabel
				);
			}
			const FString PreviewCases = PreviewCaseParts.Num() > 0
				? FString::Join(PreviewCaseParts, TEXT(" | "))
				: TEXT("none");
			return FString::Printf(
				TEXT("Deck preview: %s | Deck: %s | Cases: %d | Selection: %s | Difficulty: %s | Subset: %s | Preview: %s"),
				Deck.Title.IsEmpty() ? TEXT("n/a") : *Deck.Title,
				Deck.DeckId.IsEmpty() ? TEXT("n/a") : *Deck.DeckId,
				Deck.Cases.Num(),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(Deck.SelectionPolicy),
				Deck.DifficultyBand.IsEmpty() ? TEXT("n/a") : *Deck.DifficultyBand,
				Deck.SubsetId.IsEmpty() ? TEXT("n/a") : *Deck.SubsetId,
				*PreviewCases);
		}

		if (!Brief.UserId.IsEmpty() && !Brief.Headline.IsEmpty())
		{
			return FString::Printf(
				TEXT("%s: %s | Deck: %s | Method: %s | Focus cases: %d | Action: %s"),
				EmptyPrefix,
				*Brief.Headline,
				Brief.FocusDeckId.IsEmpty() ? TEXT("n/a") : *Brief.FocusDeckId,
				Brief.FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *Brief.FocusMethodSegmentId,
				Brief.FocusCaseIds.Num(),
				Brief.PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : *Brief.PrimaryActionLabel);
		}

		return FString::Printf(TEXT("%s: no guidance available"), EmptyPrefix);
	};

	const bool bGuidanceReadyToLaunch = CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const FHyperTwistTrainingDeck DisplayedDeck =
		bGuidanceReadyToLaunch ? CachedCoachRecommendedDeck : FHyperTwistTrainingDeck();
	const FHyperTwistCoachBrief DisplayedBrief =
		bGuidanceReadyToLaunch ? CachedCoachBrief : FHyperTwistCoachBrief();

	Surface.bGuidanceReadyToLaunch = bGuidanceReadyToLaunch;
	Surface.bHasDeck = DisplayedDeck.IsStructurallyValid();
	Surface.bHasBrief = !DisplayedBrief.UserId.IsEmpty() && !DisplayedBrief.Headline.IsEmpty();
	Surface.bUsesBriefFallback = !Surface.bHasDeck && Surface.bHasBrief;
	Surface.bActivePreviewLane =
		ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended;
	Surface.DeckId = DisplayedDeck.DeckId.IsEmpty() ? TEXT("n/a") : DisplayedDeck.DeckId;
	Surface.DeckTitle = DisplayedDeck.Title.IsEmpty() ? TEXT("n/a") : DisplayedDeck.Title;
	Surface.DeckLabel =
		DisplayedDeck.IsStructurallyValid()
			? (DisplayedDeck.Title.IsEmpty() ? Surface.DeckId : DisplayedDeck.Title)
			: TEXT("n/a");
	Surface.BriefHeadline =
		DisplayedBrief.Headline.IsEmpty() ? TEXT("n/a") : DisplayedBrief.Headline;
	Surface.PrimaryActionLabel =
		DisplayedBrief.PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : DisplayedBrief.PrimaryActionLabel;
	Surface.FocusDeckId =
		DisplayedBrief.FocusDeckId.IsEmpty() ? TEXT("n/a") : DisplayedBrief.FocusDeckId;
	Surface.FocusMethodSegmentId =
		DisplayedBrief.FocusMethodSegmentId.IsEmpty()
			? TEXT("n/a")
			: DisplayedBrief.FocusMethodSegmentId;
	Surface.SelectionPolicyLabel =
		DisplayedDeck.IsStructurallyValid()
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedDeck.SelectionPolicy)
			: TEXT("n/a");
	Surface.SuggestedModeLabel =
		Surface.bHasBrief
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedBrief.SuggestedMode)
			: TEXT("n/a");
	Surface.SuggestedSelectionLabel =
		Surface.bHasBrief
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedBrief.SuggestedSelectionPolicy)
			: TEXT("n/a");
	Surface.DifficultyBand =
		DisplayedDeck.DifficultyBand.IsEmpty() ? TEXT("n/a") : DisplayedDeck.DifficultyBand;
	Surface.SubsetId = DisplayedDeck.SubsetId.IsEmpty() ? TEXT("n/a") : DisplayedDeck.SubsetId;
	Surface.CaseCount = DisplayedDeck.Cases.Num();
	Surface.FocusCaseCount = DisplayedBrief.FocusCaseIds.Num();

	TArray<FString> PreviewCaseParts;
	const int32 PreviewCaseCount = FMath::Min(DisplayedDeck.Cases.Num(), 3);
	for (int32 CaseIndex = 0; CaseIndex < PreviewCaseCount; ++CaseIndex)
	{
		const FHyperTwistTrainingCase& PreviewCase = DisplayedDeck.Cases[CaseIndex];
		PreviewCaseParts.Add(PreviewCase.PromptLabel.IsEmpty() ? PreviewCase.CaseId : PreviewCase.PromptLabel);
	}
	Surface.PreviewCaseSummaryLine =
		PreviewCaseParts.Num() > 0 ? FString::Join(PreviewCaseParts, TEXT(" | ")) : TEXT("none");

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedRecommendedDeckPreviewLine.IsEmpty()
		? DisplayedRecommendedDeckPreviewLine
		: BuildDeckPreviewLine(DisplayedDeck, DisplayedBrief, TEXT("Recommended guidance"));
	Surface.DetailLine = Surface.bHasDeck
		? FString::Printf(
			TEXT("Recommended preview detail: deck %s | selection %s | mode %s | difficulty %s | subset %s | focus deck %s | method %s | focus cases %d | preview %s"),
			*Surface.DeckLabel,
			*Surface.SelectionPolicyLabel,
			*Surface.SuggestedModeLabel,
			*Surface.DifficultyBand,
			*Surface.SubsetId,
			*Surface.FocusDeckId,
			*Surface.FocusMethodSegmentId,
			Surface.FocusCaseCount,
			*Surface.PreviewCaseSummaryLine)
		: (Surface.bHasBrief
			? FString::Printf(
				TEXT("Recommended preview detail: %s | action %s | focus deck %s | method %s | focus cases %d"),
				*Surface.BriefHeadline,
				*Surface.PrimaryActionLabel,
				*Surface.FocusDeckId,
				*Surface.FocusMethodSegmentId,
				Surface.FocusCaseCount)
			: TEXT("Recommended preview detail: no recommended guidance is currently available."));
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Recommended guidance: no active recommended guidance; the coach-to-review loop is closed and idle.");
		Surface.DetailLine =
			TEXT("Recommended preview detail: retained coach memory remains inspectable, but no live recommended preview deck remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedFollowUpGuidanceDeckPreviewInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface Surface;
	Surface.Headline = TEXT("Follow-up guidance");
	Surface.GuidanceLaneLabel = TEXT("follow-up");

	const auto BuildDeckPreviewLine = [](const FHyperTwistTrainingDeck& Deck, const FHyperTwistCoachBrief& Brief, const TCHAR* EmptyPrefix)
	{
		if (Deck.IsStructurallyValid())
		{
			TArray<FString> PreviewCaseParts;
			const int32 PreviewCaseCount = FMath::Min(Deck.Cases.Num(), 3);
			for (int32 CaseIndex = 0; CaseIndex < PreviewCaseCount; ++CaseIndex)
			{
				const FHyperTwistTrainingCase& PreviewCase = Deck.Cases[CaseIndex];
				PreviewCaseParts.Add(
					PreviewCase.PromptLabel.IsEmpty() ? PreviewCase.CaseId : PreviewCase.PromptLabel
				);
			}
			const FString PreviewCases = PreviewCaseParts.Num() > 0
				? FString::Join(PreviewCaseParts, TEXT(" | "))
				: TEXT("none");
			return FString::Printf(
				TEXT("Deck preview: %s | Deck: %s | Cases: %d | Selection: %s | Difficulty: %s | Subset: %s | Preview: %s"),
				Deck.Title.IsEmpty() ? TEXT("n/a") : *Deck.Title,
				Deck.DeckId.IsEmpty() ? TEXT("n/a") : *Deck.DeckId,
				Deck.Cases.Num(),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(Deck.SelectionPolicy),
				Deck.DifficultyBand.IsEmpty() ? TEXT("n/a") : *Deck.DifficultyBand,
				Deck.SubsetId.IsEmpty() ? TEXT("n/a") : *Deck.SubsetId,
				*PreviewCases);
		}

		if (!Brief.UserId.IsEmpty() && !Brief.Headline.IsEmpty())
		{
			return FString::Printf(
				TEXT("%s: %s | Deck: %s | Method: %s | Focus cases: %d | Action: %s"),
				EmptyPrefix,
				*Brief.Headline,
				Brief.FocusDeckId.IsEmpty() ? TEXT("n/a") : *Brief.FocusDeckId,
				Brief.FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *Brief.FocusMethodSegmentId,
				Brief.FocusCaseIds.Num(),
				Brief.PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : *Brief.PrimaryActionLabel);
		}

		return FString::Printf(TEXT("%s: no guidance available"), EmptyPrefix);
	};

	const bool bGuidanceReadyToLaunch =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachPanelState.bHasFollowUpGuidance;
	const FHyperTwistTrainingDeck DisplayedDeck =
		bGuidanceReadyToLaunch ? CachedCoachFollowUpDeck : FHyperTwistTrainingDeck();
	const FHyperTwistCoachBrief DisplayedBrief =
		bGuidanceReadyToLaunch ? CachedCoachFollowUpBrief : FHyperTwistCoachBrief();

	Surface.bGuidanceReadyToLaunch = bGuidanceReadyToLaunch;
	Surface.bHasDeck = DisplayedDeck.IsStructurallyValid();
	Surface.bHasBrief = !DisplayedBrief.UserId.IsEmpty() && !DisplayedBrief.Headline.IsEmpty();
	Surface.bUsesBriefFallback = !Surface.bHasDeck && Surface.bHasBrief;
	Surface.bActivePreviewLane =
		ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp;
	Surface.DeckId = DisplayedDeck.DeckId.IsEmpty() ? TEXT("n/a") : DisplayedDeck.DeckId;
	Surface.DeckTitle = DisplayedDeck.Title.IsEmpty() ? TEXT("n/a") : DisplayedDeck.Title;
	Surface.DeckLabel =
		DisplayedDeck.IsStructurallyValid()
			? (DisplayedDeck.Title.IsEmpty() ? Surface.DeckId : DisplayedDeck.Title)
			: TEXT("n/a");
	Surface.BriefHeadline =
		DisplayedBrief.Headline.IsEmpty() ? TEXT("n/a") : DisplayedBrief.Headline;
	Surface.PrimaryActionLabel =
		DisplayedBrief.PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : DisplayedBrief.PrimaryActionLabel;
	Surface.FocusDeckId =
		DisplayedBrief.FocusDeckId.IsEmpty() ? TEXT("n/a") : DisplayedBrief.FocusDeckId;
	Surface.FocusMethodSegmentId =
		DisplayedBrief.FocusMethodSegmentId.IsEmpty()
			? TEXT("n/a")
			: DisplayedBrief.FocusMethodSegmentId;
	Surface.SelectionPolicyLabel =
		DisplayedDeck.IsStructurallyValid()
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedDeck.SelectionPolicy)
			: TEXT("n/a");
	Surface.SuggestedModeLabel =
		Surface.bHasBrief
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedBrief.SuggestedMode)
			: TEXT("n/a");
	Surface.SuggestedSelectionLabel =
		Surface.bHasBrief
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				DisplayedBrief.SuggestedSelectionPolicy)
			: TEXT("n/a");
	Surface.DifficultyBand =
		DisplayedDeck.DifficultyBand.IsEmpty() ? TEXT("n/a") : DisplayedDeck.DifficultyBand;
	Surface.SubsetId = DisplayedDeck.SubsetId.IsEmpty() ? TEXT("n/a") : DisplayedDeck.SubsetId;
	Surface.CaseCount = DisplayedDeck.Cases.Num();
	Surface.FocusCaseCount = DisplayedBrief.FocusCaseIds.Num();

	TArray<FString> PreviewCaseParts;
	const int32 PreviewCaseCount = FMath::Min(DisplayedDeck.Cases.Num(), 3);
	for (int32 CaseIndex = 0; CaseIndex < PreviewCaseCount; ++CaseIndex)
	{
		const FHyperTwistTrainingCase& PreviewCase = DisplayedDeck.Cases[CaseIndex];
		PreviewCaseParts.Add(PreviewCase.PromptLabel.IsEmpty() ? PreviewCase.CaseId : PreviewCase.PromptLabel);
	}
	Surface.PreviewCaseSummaryLine =
		PreviewCaseParts.Num() > 0 ? FString::Join(PreviewCaseParts, TEXT(" | ")) : TEXT("none");

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedFollowUpDeckPreviewLine.IsEmpty()
		? DisplayedFollowUpDeckPreviewLine
		: BuildDeckPreviewLine(DisplayedDeck, DisplayedBrief, TEXT("Follow-up guidance"));
	Surface.DetailLine = Surface.bHasDeck
		? FString::Printf(
			TEXT("Follow-up preview detail: deck %s | selection %s | mode %s | difficulty %s | subset %s | focus deck %s | method %s | focus cases %d | preview %s"),
			*Surface.DeckLabel,
			*Surface.SelectionPolicyLabel,
			*Surface.SuggestedModeLabel,
			*Surface.DifficultyBand,
			*Surface.SubsetId,
			*Surface.FocusDeckId,
			*Surface.FocusMethodSegmentId,
			Surface.FocusCaseCount,
			*Surface.PreviewCaseSummaryLine)
		: (Surface.bHasBrief
			? FString::Printf(
				TEXT("Follow-up preview detail: %s | action %s | focus deck %s | method %s | focus cases %d"),
				*Surface.BriefHeadline,
				*Surface.PrimaryActionLabel,
				*Surface.FocusDeckId,
				*Surface.FocusMethodSegmentId,
				Surface.FocusCaseCount)
			: TEXT("Follow-up preview detail: no follow-up guidance is currently available."));
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine =
			TEXT("Follow-up guidance: no active follow-up guidance; the coach-to-review loop is closed and idle.");
		Surface.DetailLine =
			TEXT("Follow-up preview detail: retained coach memory remains inspectable, but no live follow-up preview deck remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffRecommendationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedCoachHandoffRecommendationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffRecommendationInspectSurface Surface;
	Surface.Headline = TEXT("Handoff recommendation");

	const HyperTwistCoachDashboardWidgetInternal::FHandoffHistoryDashboardBias HandoffHistoryBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveHandoffHistoryDashboardBias(
			HandoffHistoryEntries);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPacketDashboardBias
		MethodDrillRecoveryPacketHandoffBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPacketDashboardBias(
				MethodDrillRecoveryMemoryHistoryEntries);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPlanComparisonSummary
		MethodDrillRecoveryPlanComparisonSummary =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanComparisonSummary(
				MethodDrillRecoveryMemoryHistoryEntries);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		RetainedMethodDrillRecoveryMemoryHandoffBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveRetainedMethodDrillRecoveryMemoryBias(
				MethodDrillRecoveryMemoryHistoryEntries,
				false);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		CurrentMethodDrillRecoveryMemoryBias =
			HyperTwistCoachDashboardWidgetInternal::ResolveMethodDrillRecoveryMemoryBias(
				CachedCoachPanelState.MethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.MethodDrillRecoveryAverageOutcomeScore);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		EffectiveMethodDrillRecoveryMemoryHandoffBias =
			RetainedMethodDrillRecoveryMemoryHandoffBias
				!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None
				? RetainedMethodDrillRecoveryMemoryHandoffBias
				: CurrentMethodDrillRecoveryMemoryBias;
	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const auto DescribeDisplayedHandoffKind = [](const EHyperTwistTrainingCoachHandoffKind Kind) -> FString
	{
		switch (Kind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("queue");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("recommended");
		default:
			return TEXT("none");
		}
	};

	Surface.bQueueReady = CachedCoachPanelState.bCanStartQueuedRun;
	Surface.bFollowUpReady =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachPanelState.bHasFollowUpGuidance;
	Surface.bRecommendedReady = CachedCoachPanelState.bCanStartCoachRecommendedRun;
	Surface.bCanUseCoachHandoff = !bHasLiveAttemptTimer && !bHasActiveRun;
	Surface.bHasDeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"))
		!= nullptr;
	Surface.RecommendationKindLabel =
		DescribeDisplayedHandoffKind(DisplayedCoachHandoffRecommendationKind);
	Surface.PreferredHandoffHistoryKindLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
			HandoffHistoryBias.PreferredKind);
	Surface.QueueSourceLabel =
		CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachPanelState.NextQueueSourceLabel;
	Surface.PreferredGuidanceLaneLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
			CachedCoachPanelState.PreferredGuidanceLane);
	Surface.PreferredGuidanceSourceLabel =
		CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachPanelState.PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.LaunchBiasLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
			CachedCoachPanelState.PreferredLaunchBudgetBias);
	Surface.LaunchBiasSourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel);
	Surface.MethodDrillRecoveryPostureLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
			EffectiveMethodDrillRecoveryMemoryHandoffBias);
	Surface.MethodDrillRecoveryPacketPreferredKindLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
			MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind);
	Surface.MethodDrillRecoveryPlanPreferenceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanComparisonPreference(
			MethodDrillRecoveryPlanComparisonSummary);
	Surface.StartActionSourceLabel =
		DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None
			? ResolveDashboardHandoffStartActionSourceLabel(
				DisplayedCoachHandoffRecommendationKind)
			: TEXT("n/a");
	Surface.AcceptedQueuedHandoffCount = HandoffHistoryBias.QueueAcceptedDeltaCount;
	Surface.AcceptedFollowUpHandoffCount = HandoffHistoryBias.FollowUpAcceptedDeltaCount;
	Surface.AcceptedRecommendedHandoffCount = HandoffHistoryBias.RecommendedAcceptedDeltaCount;
	Surface.QueueRecommendationCount = HandoffHistoryBias.QueueRecommendationCount;
	Surface.FollowUpRecommendationCount = HandoffHistoryBias.FollowUpRecommendationCount;
	Surface.RecommendedRecommendationCount = HandoffHistoryBias.RecommendedRecommendationCount;
	Surface.StrongMethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount;
	Surface.WeakMethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount;
	Surface.MethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.MethodDrillRecoveryHistoryCount;
	Surface.PacketQueueHistoryCount = MethodDrillRecoveryPacketHandoffBias.QueueEntryHistoryCount;
	Surface.PacketFollowUpHistoryCount =
		MethodDrillRecoveryPacketHandoffBias.FollowUpPacketHistoryCount;
	Surface.PacketRecommendedHistoryCount =
		MethodDrillRecoveryPacketHandoffBias.RecommendedBriefHistoryCount;
	Surface.bHasRecommendation =
		DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None;
	Surface.bUsedDeferredFirstSuppressionSignal =
		bDisplayedCoachHandoffRecommendationUsedDeferredFirstSuppressionSignal;
	Surface.bUsedMethodDrillWeighting =
		bDisplayedCoachHandoffRecommendationUsedMethodDrillWeighting;
	Surface.bUsedAlignedTightPacketAcceptedHistory =
		bDisplayedCoachHandoffRecommendationUsedAlignedTightPacketAcceptedHistory;
	Surface.bUsedAlignedBroadPacketAcceptedHistory =
		bDisplayedCoachHandoffRecommendationUsedAlignedBroadPacketAcceptedHistory;
	Surface.bUsedAcceptedAlignedTightPacketOutcomeTrust =
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust;
	Surface.bUsedAcceptedAlignedBroadPacketOutcomeTrust =
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust;
	Surface.bUsedReliableAcceptedAlignedTightPacketOutcomeTrust =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust;
	Surface.bUsedReliableAcceptedAlignedBroadPacketOutcomeTrust =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust;
	Surface.bUsedReliableAcceptedAlignedTightPacketOutcomeHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory;
	Surface.bUsedReliableAcceptedAlignedBroadPacketOutcomeHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory;
	Surface.bUsedReliableAcceptedAlignedTightPacketExactHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory;
	Surface.bUsedReliableAcceptedAlignedBroadPacketExactHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory;
	Surface.bUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory;
	Surface.bUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory;
	Surface.bUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory;
	Surface.bUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory;
	Surface.bUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory;
	Surface.bUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedCoachHandoffRecommendationStatusLine.IsEmpty()
		? DisplayedCoachHandoffRecommendationStatusLine
		: TEXT("Recommendation: no coach-directed handoff is currently ready.");
	Surface.DetailLine = !DisplayedCoachHandoffRecommendationDetailLine.IsEmpty()
		? DisplayedCoachHandoffRecommendationDetailLine
		: TEXT("Handoff recommendation detail: closure-history pressure is retained, but no displayed handoff recommendation is currently active.");
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.StatusLine = !DisplayedCoachHandoffRecommendationStatusLine.IsEmpty()
			? DisplayedCoachHandoffRecommendationStatusLine
			: TEXT("Handoff recommendation: none; the coach-to-review loop is idle.");
		Surface.DetailLine = !DisplayedCoachHandoffRecommendationDetailLine.IsEmpty()
			? DisplayedCoachHandoffRecommendationDetailLine
			: TEXT("Handoff detail: retained closure history remains inspectable, but no queued, follow-up, or recommended continuation is active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedCoachHandoffStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffStatusInspectSurface Surface;
	Surface.Headline = TEXT("Coach handoff status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bQueueReady = CachedCoachPanelState.bCanStartQueuedRun;
	Surface.bFollowUpReady =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachPanelState.bHasFollowUpGuidance;
	Surface.bRecommendedReady = CachedCoachPanelState.bCanStartCoachRecommendedRun;
	Surface.QueueSourceLabel =
		CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachPanelState.NextQueueSourceLabel;
	Surface.FollowUpBriefHeadline =
		CachedCoachFollowUpBrief.Headline.IsEmpty() ? TEXT("n/a") : CachedCoachFollowUpBrief.Headline;
	Surface.RecommendedBriefHeadline =
		CachedCoachBrief.Headline.IsEmpty() ? TEXT("n/a") : CachedCoachBrief.Headline;
	Surface.FollowUpFocusCaseCount = CachedCoachFollowUpBrief.FocusCaseIds.Num();
	Surface.RecommendedFocusCaseCount = CachedCoachBrief.FocusCaseIds.Num();
	Surface.QueueStatusLabel = Surface.bQueueReady
		? FString::Printf(TEXT("queue ready from %s"), *Surface.QueueSourceLabel)
		: TEXT("queue not ready");
	Surface.FollowUpStatusLabel = Surface.bFollowUpReady
		? FString::Printf(
			TEXT("follow-up %s (%d cases)"),
			CachedCoachFollowUpBrief.Headline.IsEmpty() ? TEXT("ready") : *CachedCoachFollowUpBrief.Headline,
			Surface.FollowUpFocusCaseCount)
		: TEXT("follow-up not ready");
	Surface.RecommendedStatusLabel = Surface.bRecommendedReady
		? FString::Printf(
			TEXT("recommended %s (%d cases)"),
			CachedCoachBrief.Headline.IsEmpty() ? TEXT("ready") : *CachedCoachBrief.Headline,
			Surface.RecommendedFocusCaseCount)
		: TEXT("recommended not ready");

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedCoachHandoffStatusLine.IsEmpty()
		? DisplayedCoachHandoffStatusLine
		: FString::Printf(
			TEXT("Coach handoff: %s | %s | %s"),
			*Surface.QueueStatusLabel,
			*Surface.FollowUpStatusLabel,
			*Surface.RecommendedStatusLabel);
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.DetailLine =
			TEXT("Coach handoff detail: retained readiness posture remains inspectable, but no queued, follow-up, or recommended continuation is active in the closed-loop idle state.");
	}
	else if (Surface.bHasLiveAttemptTimer)
	{
		Surface.DetailLine =
			TEXT("Coach handoff detail: live attempt or inspection is active, so coach-directed handoff launch surfaces are intentionally paused.");
	}
	else if (Surface.bHasActiveRun)
	{
		Surface.DetailLine =
			TEXT("Coach handoff detail: an active run is still owned by the dashboard; finish, clear, or complete it before launching another coach-directed run.");
	}
	else
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Coach handoff detail: %s | %s | %s"),
			*Surface.QueueStatusLabel,
			*Surface.FollowUpStatusLabel,
			*Surface.RecommendedStatusLabel);
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardTransitionStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTransitionStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTransitionStatusInspectSurface Surface;
	Surface.Headline = TEXT("Transition");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const FString ActiveCaseId = CachedRunState.CurrentSelection.TrainingCase.CaseId.IsEmpty()
		? TEXT("n/a")
		: CachedRunState.CurrentSelection.TrainingCase.CaseId;
	const FString ActivePromptLabel =
		CachedRunState.CurrentSelection.TrainingCase.PromptLabel.IsEmpty()
			? ActiveCaseId
			: CachedRunState.CurrentSelection.TrainingCase.PromptLabel;
	const bool bLiveInspectionPhase = IsLiveAttemptInspectionPhase();
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;
	const bool bHasSessionScopedLastStep = !LastStepResult.SessionSummary.TrainingSessionId.IsEmpty()
		&& LastStepResult.SessionSummary.TrainingSessionId == CachedRunState.Session.TrainingSessionId;
	const bool bLastStepCompletedRun = bHasSessionScopedLastStep
		&& (LastStepResult.AttemptResolution.UpdatedSession.SessionState
			== EHyperTwistTrainingSessionState::Completed
			|| LastStepResult.AttemptResolution.UpdatedSession.SessionState
				== EHyperTwistTrainingSessionState::Aborted);
	const bool bHasNextCaseFromLastStep = bHasSessionScopedLastStep
		&& LastStepResult.AttemptResolution.NextCaseSelection.IsStructurallyValid();
	const bool bGeneratedModeLaunchDeck =
		HyperTwistCoachDashboardWidgetInternal::IsGeneratedModeLaunchDeck(CachedRunState);
	const bool bCanExecuteGeneratedModeLaunch =
		bGeneratedModeLaunchDeck
		&& CachedCoachPanelState.bCanExecuteActiveGeneratedModeLaunchRequest;
	const bool bRecognitionAssistedCurrentRun =
		CachedRunState.Session.Mode == EHyperTwistTrainingDeliveryMode::RecognitionAssisted;
	const bool bRecognitionSessionOpenForCurrentRun =
		!bRecognitionAssistedCurrentRun || CachedRecognitionSessionState.bSessionOpen;
	const bool bRecognitionServiceReadyForCurrentRun =
		!bRecognitionAssistedCurrentRun || CachedRecognitionSessionState.ServiceHealth.bReady;
	const FString RecognitionRunBlockedReason =
		!CachedRecognitionSessionState.LastError.IsEmpty()
			? CachedRecognitionSessionState.LastError
			: (!CachedRecognitionSessionState.ServiceHealth.LastError.IsEmpty()
				? CachedRecognitionSessionState.ServiceHealth.LastError
				: TEXT("recognition-session-not-open"));
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	const bool bCanContinueCurrentRun = !bHasLiveAttemptTimer
		&& bHasRunnableCurrentCase
		&& !bLastStepCompletedRun
		&& (!bRecognitionAssistedCurrentRun
			|| bRecognitionSessionOpenForCurrentRun
			|| bRecognitionServiceReadyForCurrentRun)
		&& (!bGeneratedModeLaunchDeck || bCanExecuteGeneratedModeLaunch);
	const bool bCanLaunchCoachRun = !bHasLiveAttemptTimer
		&& (
			CachedCoachPanelState.bCanStartQueuedRun
			|| CachedCoachPanelState.bCanStartCoachFollowUpRun
			|| CachedCoachPanelState.bCanStartCoachRecommendedRun);
	FString TransitionLaunchLabel = CachedCoachPanelState.PrimaryActionLabel;
	if (TransitionLaunchLabel.IsEmpty())
	{
		TransitionLaunchLabel = TEXT("Launch Coach Run");
	}

	Surface.TransitionLaunchLabel = TransitionLaunchLabel;
	Surface.ActiveCaseId = ActiveCaseId;
	Surface.ActivePromptLabel = ActivePromptLabel;
	Surface.RecognitionBlockedReason = RecognitionRunBlockedReason;
	Surface.AttemptCount = CachedRunSummary.AttemptCount;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = bLiveInspectionPhase;
	Surface.bLiveSolvePhase = bLiveSolvePhase;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bLastStepCompletedRun = bLastStepCompletedRun;
	Surface.bHasNextCaseFromLastStep = bHasNextCaseFromLastStep;
	Surface.bGeneratedModeLaunchDeck = bGeneratedModeLaunchDeck;
	Surface.bCanExecuteGeneratedModeLaunch = bCanExecuteGeneratedModeLaunch;
	Surface.bRecognitionAssistedCurrentRun = bRecognitionAssistedCurrentRun;
	Surface.bRecognitionSessionOpenForCurrentRun = bRecognitionSessionOpenForCurrentRun;
	Surface.bRecognitionServiceReadyForCurrentRun = bRecognitionServiceReadyForCurrentRun;
	Surface.bCanContinueCurrentRun = bCanContinueCurrentRun;
	Surface.bCanLaunchCoachRun = bCanLaunchCoachRun;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedTransitionStatusLine.IsEmpty()
		? DisplayedTransitionStatusLine
		: FString::Printf(TEXT("Transition: no run is active. Use the next-step action to %s."), *TransitionLaunchLabel);
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.DetailLine =
			TEXT("Transition detail: the coach-to-review loop is closed and idle, so no runnable continuation or coach-directed launch remains active.");
	}
	else if (Surface.bLiveInspectionPhase)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: inspection is live on %s."),
			*Surface.ActivePromptLabel);
	}
	else if (Surface.bLiveSolvePhase)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: solve is live on %s."),
			*Surface.ActivePromptLabel);
	}
	else if (Surface.bLastStepCompletedRun)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: last step completed the run after case %s | coach launch available: %s"),
			LastStepResult.SessionSummary.LastCaseId.IsEmpty()
				? TEXT("n/a")
				: *LastStepResult.SessionSummary.LastCaseId,
			Surface.bCanLaunchCoachRun ? TEXT("yes") : TEXT("no"));
	}
	else if (Surface.bGeneratedModeLaunchDeck)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: generated-mode launch deck is active on %s | execute ready: %s"),
			*Surface.ActivePromptLabel,
			Surface.bCanExecuteGeneratedModeLaunch ? TEXT("yes") : TEXT("no"));
	}
	else if (Surface.bRecognitionAssistedCurrentRun)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: recognition-assisted run on %s | session open: %s | service ready: %s | blocked reason: %s"),
			*Surface.ActivePromptLabel,
			Surface.bRecognitionSessionOpenForCurrentRun ? TEXT("yes") : TEXT("no"),
			Surface.bRecognitionServiceReadyForCurrentRun ? TEXT("yes") : TEXT("no"),
			*Surface.RecognitionBlockedReason);
	}
	else if (Surface.bCanContinueCurrentRun)
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: runnable case %s | attempts %d | next-case-from-last-step: %s"),
			*Surface.ActivePromptLabel,
			Surface.AttemptCount,
			Surface.bHasNextCaseFromLastStep ? TEXT("yes") : TEXT("no"));
	}
	else if (Surface.bHasActiveRun)
	{
		Surface.DetailLine =
			TEXT("Transition detail: an active run exists but no runnable current case remains.");
	}
	else
	{
		Surface.DetailLine = FString::Printf(
			TEXT("Transition detail: no run is active | coach launch available: %s | launch label: %s"),
			Surface.bCanLaunchCoachRun ? TEXT("yes") : TEXT("no"),
			*Surface.TransitionLaunchLabel);
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunActionLabelsInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunActionLabelsInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunActionLabelsInspectSurface Surface;
	Surface.Headline = TEXT("Run action labels");

	const auto DescribeDisplayedHandoffKind = [](const EHyperTwistTrainingCoachHandoffKind Kind) -> FString
	{
		switch (Kind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("queue");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("recommended");
		default:
			return TEXT("none");
		}
	};

	FString TransitionLaunchLabel = CachedCoachPanelState.PrimaryActionLabel;
	if (TransitionLaunchLabel.IsEmpty())
	{
		TransitionLaunchLabel = TEXT("Launch Coach Run");
	}

	Surface.ContinueRunLabel =
		DisplayedContinueRunLabel.IsEmpty() ? TransitionLaunchLabel : DisplayedContinueRunLabel;
	Surface.QueuedRunLabel =
		DisplayedQueuedRunLabel.IsEmpty() ? TEXT("Start Queue") : DisplayedQueuedRunLabel;
	Surface.FollowUpRunLabel =
		DisplayedFollowUpRunLabel.IsEmpty() ? TEXT("Start Follow-Up") : DisplayedFollowUpRunLabel;
	Surface.RecommendedRunLabel =
		DisplayedRecommendedRunLabel.IsEmpty() ? TEXT("Start Recommended") : DisplayedRecommendedRunLabel;
	Surface.RecommendedHandoffKindLabel =
		DescribeDisplayedHandoffKind(DisplayedCoachHandoffRecommendationKind);
	Surface.TransitionLaunchLabel = TransitionLaunchLabel;
	Surface.bContinueUsesRecognitionPrimeLabel =
		Surface.ContinueRunLabel == TEXT("Prime Recognition")
		|| Surface.ContinueRunLabel == TEXT("Recognition Blocked");
	Surface.bContinueUsesGeneratedModeExecuteLabel =
		Surface.ContinueRunLabel == TEXT("Execute Generated Run");
	Surface.bContinueUsesGeneratedModeResolveLabel =
		Surface.ContinueRunLabel == TEXT("Resolve Selectors");
	Surface.bContinueUsesAttemptActiveLabel =
		Surface.ContinueRunLabel == TEXT("Start Solve")
		|| Surface.ContinueRunLabel == TEXT("Pause Timer")
		|| Surface.ContinueRunLabel == TEXT("Resume Solve")
		|| Surface.ContinueRunLabel == TEXT("Attempt Active");
	Surface.bQueueActionRecommended =
		Surface.QueuedRunLabel.StartsWith(TEXT("Recommended: "));
	Surface.bFollowUpActionRecommended =
		Surface.FollowUpRunLabel.StartsWith(TEXT("Recommended: "));
	Surface.bRecommendedActionRecommended =
		Surface.RecommendedRunLabel.StartsWith(TEXT("Recommended: "));

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = FString::Printf(
		TEXT("Continue: %s | Queue: %s | Follow-up: %s | Recommended: %s"),
		*Surface.ContinueRunLabel,
		*Surface.QueuedRunLabel,
		*Surface.FollowUpRunLabel,
		*Surface.RecommendedRunLabel);
	Surface.DetailLine = FString::Printf(
		TEXT("Action-label detail: recommended handoff branch %s | transition launch label %s"),
		*Surface.RecommendedHandoffKindLabel,
		*Surface.TransitionLaunchLabel);
	Surface.DetailLine += Surface.bContinueUsesGeneratedModeExecuteLabel
		? TEXT(" | continue is currently an execute-generated-run action")
		: TEXT("");
	Surface.DetailLine += Surface.bContinueUsesGeneratedModeResolveLabel
		? TEXT(" | continue is currently a selector-resolution action")
		: TEXT("");
	Surface.DetailLine += Surface.bContinueUsesRecognitionPrimeLabel
		? TEXT(" | continue is currently a recognition priming gate")
		: TEXT("");
	Surface.DetailLine += Surface.bContinueUsesAttemptActiveLabel
		? TEXT(" | continue is currently carrying the live-attempt control label")
		: TEXT("");
	if (Surface.bClosedLoopIdleDashboard)
	{
		Surface.DetailLine =
			TEXT("Action-label detail: closed-loop idle keeps the labels inspectable, but no runnable continuation or coach-directed launch remains active.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardHandoffTransitionBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedHandoffTransitionBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardHandoffTransitionBandInspectSurface Surface;
	Surface.Headline = TEXT("Handoff transition band");

	const FHyperTwistTrainingCoachDashboardHandoffRecommendationInspectSurface HandoffRecommendationSurface =
		GetDisplayedCoachHandoffRecommendationInspectSurface();
	const FHyperTwistTrainingCoachDashboardHandoffStatusInspectSurface HandoffStatusSurface =
		GetDisplayedCoachHandoffStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardTransitionStatusInspectSurface TransitionSurface =
		GetDisplayedTransitionStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunActionLabelsInspectSurface RunActionSurface =
		GetDisplayedRunActionLabelsInspectSurface();

	Surface.HandoffRecommendationStatusLine = HandoffRecommendationSurface.StatusLine.IsEmpty()
		? TEXT("Handoff recommendation: unavailable.")
		: HandoffRecommendationSurface.StatusLine;
	Surface.HandoffStatusLine = HandoffStatusSurface.StatusLine.IsEmpty()
		? TEXT("Handoff status: unavailable.")
		: HandoffStatusSurface.StatusLine;
	Surface.TransitionStatusLine = TransitionSurface.StatusLine.IsEmpty()
		? TEXT("Transition status: unavailable.")
		: TransitionSurface.StatusLine;
	Surface.RunActionLabelsStatusLine = RunActionSurface.StatusLine.IsEmpty()
		? TEXT("Run action labels: unavailable.")
		: RunActionSurface.StatusLine;
	Surface.RecommendationKindLabel = HandoffRecommendationSurface.RecommendationKindLabel.IsEmpty()
		? TEXT("none")
		: HandoffRecommendationSurface.RecommendationKindLabel;
	Surface.QueueStatusLabel = HandoffStatusSurface.QueueStatusLabel.IsEmpty()
		? TEXT("queue not ready")
		: HandoffStatusSurface.QueueStatusLabel;
	Surface.FollowUpStatusLabel = HandoffStatusSurface.FollowUpStatusLabel.IsEmpty()
		? TEXT("follow-up not ready")
		: HandoffStatusSurface.FollowUpStatusLabel;
	Surface.RecommendedStatusLabel = HandoffStatusSurface.RecommendedStatusLabel.IsEmpty()
		? TEXT("recommended not ready")
		: HandoffStatusSurface.RecommendedStatusLabel;
	Surface.TransitionLaunchLabel = !TransitionSurface.TransitionLaunchLabel.IsEmpty()
		? TransitionSurface.TransitionLaunchLabel
		: (RunActionSurface.TransitionLaunchLabel.IsEmpty() ? TEXT("Launch Coach Run") : RunActionSurface.TransitionLaunchLabel);
	Surface.ContinueRunLabel = RunActionSurface.ContinueRunLabel.IsEmpty() ? TEXT("Continue") : RunActionSurface.ContinueRunLabel;
	Surface.QueuedRunLabel = RunActionSurface.QueuedRunLabel.IsEmpty() ? TEXT("Start Queue") : RunActionSurface.QueuedRunLabel;
	Surface.FollowUpRunLabel = RunActionSurface.FollowUpRunLabel.IsEmpty() ? TEXT("Start Follow-Up") : RunActionSurface.FollowUpRunLabel;
	Surface.RecommendedRunLabel = RunActionSurface.RecommendedRunLabel.IsEmpty() ? TEXT("Start Recommended") : RunActionSurface.RecommendedRunLabel;
	Surface.ActiveCaseId = TransitionSurface.ActiveCaseId.IsEmpty() ? TEXT("n/a") : TransitionSurface.ActiveCaseId;
	Surface.AttemptCount = TransitionSurface.AttemptCount;
	Surface.bHasRecommendation = HandoffRecommendationSurface.bHasRecommendation;
	Surface.bHasActiveRun = HandoffStatusSurface.bHasActiveRun || TransitionSurface.bHasActiveRun;
	Surface.bHasLiveAttemptTimer = HandoffStatusSurface.bHasLiveAttemptTimer || TransitionSurface.bHasLiveAttemptTimer;
	Surface.bQueueReady = HandoffStatusSurface.bQueueReady || HandoffRecommendationSurface.bQueueReady;
	Surface.bFollowUpReady = HandoffStatusSurface.bFollowUpReady || HandoffRecommendationSurface.bFollowUpReady;
	Surface.bRecommendedReady = HandoffStatusSurface.bRecommendedReady || HandoffRecommendationSurface.bRecommendedReady;
	Surface.bCanContinueCurrentRun = TransitionSurface.bCanContinueCurrentRun;
	Surface.bCanLaunchCoachRun = TransitionSurface.bCanLaunchCoachRun;
	Surface.bClosedLoopIdleDashboard = HandoffRecommendationSurface.bClosedLoopIdleDashboard || HandoffStatusSurface.bClosedLoopIdleDashboard || TransitionSurface.bClosedLoopIdleDashboard || RunActionSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Handoff-transition band: recommendation %s | continue %s | launch %s | queue/follow-up/recommended %s/%s/%s"),
		*Surface.RecommendationKindLabel,
		Surface.bCanContinueCurrentRun ? TEXT("enabled") : TEXT("disabled"),
		Surface.bCanLaunchCoachRun ? TEXT("enabled") : TEXT("disabled"),
		Surface.bQueueReady ? TEXT("ready") : TEXT("not-ready"),
		Surface.bFollowUpReady ? TEXT("ready") : TEXT("not-ready"),
		Surface.bRecommendedReady ? TEXT("ready") : TEXT("not-ready"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | active case %s | attempts %d | live timer %s | active run %s | closed-loop idle %s"),
		*Surface.HandoffRecommendationStatusLine,
		*Surface.HandoffStatusLine,
		*Surface.TransitionStatusLine,
		*Surface.RunActionLabelsStatusLine,
		*Surface.ActiveCaseId,
		Surface.AttemptCount,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardActiveRunStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedActiveRunStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardActiveRunStatusInspectSurface Surface;
	Surface.Headline = TEXT("Active run status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const FString ActiveDeckLabel = CachedRunState.ActiveDeck.Title.IsEmpty()
		? (CachedRunState.ActiveDeck.DeckId.IsEmpty() ? TEXT("n/a") : CachedRunState.ActiveDeck.DeckId)
		: CachedRunState.ActiveDeck.Title;
	const FString ActiveCaseId = CachedRunState.CurrentSelection.TrainingCase.CaseId.IsEmpty()
		? TEXT("n/a")
		: CachedRunState.CurrentSelection.TrainingCase.CaseId;
	const FHyperTwistTrainingAnalyticsReportBundle AnalyticsReportBundle =
		UHyperTwistTrainingRuntimeLibrary::GetActiveTrainingAnalyticsReportBundle(
			const_cast<UHyperTwistCoachDashboardWidget*>(this)
		);
	const FHyperTwistTrainingSessionDomainBundle SessionDomainBundle =
		HyperTwistCoachDashboardWidgetInternal::BuildDisplayedSessionDomainBundle(
			CachedRunState,
			CachedRunSummary,
			CachedRunState.TemplateLaunchProvenance,
			CachedCoachPanelState,
			CachedMethodDrillRunState,
			AnalyticsReportBundle
		);
	const FHyperTwistTrainingAnalyticsPanelContractBundle AnalyticsPanelBundle =
		UHyperTwistTrainingAnalyticsLibrary::BuildAnalyticsPanelContractBundle(
			SessionDomainBundle,
			AnalyticsReportBundle
		);

	Surface.TrainingSessionId = CachedRunState.Session.TrainingSessionId.IsEmpty()
		? TEXT("n/a")
		: CachedRunState.Session.TrainingSessionId;
	Surface.SessionStateLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.SessionState);
	Surface.DeliveryModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.Mode);
	Surface.SessionKindLabel = SessionDomainBundle.GameSession.SessionKindLabel.IsEmpty()
		? TEXT("n/a")
		: SessionDomainBundle.GameSession.SessionKindLabel;
	Surface.GameSessionId = SessionDomainBundle.GameSession.GameSessionId.IsEmpty()
		? TEXT("n/a")
		: SessionDomainBundle.GameSession.GameSessionId;
	Surface.PrimaryAnalyticsPanelId = AnalyticsPanelBundle.PrimaryPanelId.IsEmpty()
		? TEXT("n/a")
		: AnalyticsPanelBundle.PrimaryPanelId;
	Surface.ActiveDeckLabel = ActiveDeckLabel;
	Surface.ActiveCaseId = ActiveCaseId;
	Surface.LastCaseId = CachedRunSummary.LastCaseId.IsEmpty()
		? TEXT("n/a")
		: CachedRunSummary.LastCaseId;
	Surface.RemainingCaseCount = CachedRunState.RemainingCaseIds.Num();
	Surface.AttemptCount = CachedRunSummary.AttemptCount;
	Surface.CompletedAttemptCount = CachedRunSummary.CompletedAttemptCount;
	Surface.SuccessCount = CachedRunSummary.SuccessCount;
	Surface.FailureCount = CachedRunSummary.FailureCount;
	Surface.TimeoutCount = CachedRunSummary.TimeoutCount;
	Surface.DNFCount = CachedRunSummary.DNFCount;
	Surface.BestTotalTimeMs = CachedRunSummary.BestTotalTimeMs;
	Surface.AverageTotalTimeMs = CachedRunSummary.AverageTotalTimeMs;
	Surface.VisibleAnalyticsPanelCount = AnalyticsPanelBundle.Panels.Num();
	Surface.bHasActiveRun = bHasActiveRun;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedActiveRunStatusLine.IsEmpty()
		? DisplayedActiveRunStatusLine
		: (bHasActiveRun
			? FString::Printf(
				TEXT("Session: %s | Kind: %s | Game: %s | Deck: %s | Mode: %s | Current case: %s | Remaining: %d | Panel: %s"),
				*Surface.TrainingSessionId,
				*Surface.SessionKindLabel,
				*Surface.GameSessionId,
				*Surface.ActiveDeckLabel,
				*Surface.DeliveryModeLabel,
				*Surface.ActiveCaseId,
				Surface.RemainingCaseCount,
				*Surface.PrimaryAnalyticsPanelId)
			: (Surface.bClosedLoopIdleDashboard
				? TEXT("No active run. The coach-to-review loop is closed and idle.")
				: TEXT("No active run. Queue and coach guidance are ready for launch from this screen.")));
	Surface.SummaryLine = !DisplayedActiveRunSummaryLine.IsEmpty()
		? DisplayedActiveRunSummaryLine
		: FString::Printf(
			TEXT("Attempts: %d total | %d completed | Success %d | Failure %d | Timeout %d | DNF %d | Best %d ms | Avg %d ms | Last case: %s | Panels: %d"),
			Surface.AttemptCount,
			Surface.CompletedAttemptCount,
			Surface.SuccessCount,
			Surface.FailureCount,
			Surface.TimeoutCount,
			Surface.DNFCount,
			Surface.BestTotalTimeMs,
			Surface.AverageTotalTimeMs,
			*Surface.LastCaseId,
			Surface.VisibleAnalyticsPanelCount);
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunRecapStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunRecapStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunRecapStatusInspectSurface Surface;
	Surface.Headline = TEXT("Run recap status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasCurrentRunRecap = bHasActiveRun
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	const FHyperTwistTrainingDeck* DisplayedRunRecapDeck = bHasCurrentRunRecap
		? &CachedRunState.ActiveDeck
		: (bHasRetainedRunRecap ? &RetainedRunRecapDeck : nullptr);
	const EHyperTwistTrainingDeliveryMode DisplayedRunRecapMode = bHasCurrentRunRecap
		? CachedRunState.Session.Mode
		: RetainedRunRecapMode;
	const bool bHasDisplayedRunRecap = DisplayedRunRecap != nullptr
		&& !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	const FString RunRecapSourceLabel = bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: (bHasActiveRun ? TEXT("active run") : TEXT("none yet"));
	const bool bHasActiveTemplateLaunchForDisplayedRun =
		bHasCurrentRunRecap
		&& DisplayedRunRecap != nullptr
		&& !ActiveTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == ActiveTemplateLaunchSessionId
		&& ActiveTemplateLaunchProvenance.IsStructurallyValid();
	const bool bHasDisplayedRetainedTemplateLaunch =
		!bHasCurrentRunRecap
		&& bHasRetainedTemplateLaunch
		&& DisplayedRunRecap != nullptr
		&& !RetainedTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == RetainedTemplateLaunchSessionId
		&& RetainedTemplateLaunchProvenance.IsStructurallyValid();
	const FHyperTwistTrainingTemplateLaunchProvenance* DisplayedTemplateLaunch =
		bHasActiveTemplateLaunchForDisplayedRun
			? &ActiveTemplateLaunchProvenance
			: (bHasDisplayedRetainedTemplateLaunch ? &RetainedTemplateLaunchProvenance : nullptr);
	const FString DisplayedDeckLabel =
		DisplayedRunRecapDeck != nullptr
			? (DisplayedRunRecapDeck->Title.IsEmpty()
				? (DisplayedRunRecapDeck->DeckId.IsEmpty()
					? TEXT("n/a")
					: DisplayedRunRecapDeck->DeckId)
				: DisplayedRunRecapDeck->Title)
			: (bHasDisplayedRunRecap && !DisplayedRunRecap->DeckId.IsEmpty()
				? DisplayedRunRecap->DeckId
				: TEXT("n/a"));
	const FHyperTwistTrainingAnalyticsReportBundle AnalyticsReportBundle =
		bHasCurrentRunRecap
			? UHyperTwistTrainingRuntimeLibrary::GetActiveTrainingAnalyticsReportBundle(
				const_cast<UHyperTwistCoachDashboardWidget*>(this))
			: FHyperTwistTrainingAnalyticsReportBundle();
	const FHyperTwistTrainingSessionDomainBundle SessionDomainBundle =
		bHasCurrentRunRecap
			? HyperTwistCoachDashboardWidgetInternal::BuildDisplayedSessionDomainBundle(
				CachedRunState,
				CachedRunSummary,
				CachedRunState.TemplateLaunchProvenance,
				CachedCoachPanelState,
				CachedMethodDrillRunState,
				AnalyticsReportBundle)
			: (bHasDisplayedRunRecap
				? HyperTwistCoachDashboardWidgetInternal::BuildDisplayedRecapSessionDomainBundle(
					*DisplayedRunRecap,
					bHasCurrentRunRecap ? CachedRunState.Session.UserId : RetainedRunRecapUserId,
					DisplayedRunRecapMode,
					DisplayedTemplateLaunch != nullptr
						? *DisplayedTemplateLaunch
						: FHyperTwistTrainingTemplateLaunchProvenance(),
					CachedCoachPanelState,
					CachedMethodDrillRunState)
				: FHyperTwistTrainingSessionDomainBundle());
	const FHyperTwistTrainingAnalyticsPanelContractBundle AnalyticsPanelBundle =
		UHyperTwistTrainingAnalyticsLibrary::BuildAnalyticsPanelContractBundle(
			SessionDomainBundle,
			AnalyticsReportBundle
		);

	Surface.SourceLabel = RunRecapSourceLabel;
	Surface.TrainingSessionId = bHasDisplayedRunRecap
		? DisplayedRunRecap->TrainingSessionId
		: TEXT("n/a");
	Surface.DeckId = bHasDisplayedRunRecap && !DisplayedRunRecap->DeckId.IsEmpty()
		? DisplayedRunRecap->DeckId
		: TEXT("n/a");
	Surface.DeckLabel = DisplayedDeckLabel;
	Surface.SessionStateLabel = bHasDisplayedRunRecap
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecap->SessionState)
		: TEXT("n/a");
	Surface.DeliveryModeLabel = bHasDisplayedRunRecap
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecapMode)
		: TEXT("n/a");
	Surface.SessionKindLabel = SessionDomainBundle.GameSession.SessionKindLabel.IsEmpty()
		? TEXT("n/a")
		: SessionDomainBundle.GameSession.SessionKindLabel;
	Surface.GameSessionId = SessionDomainBundle.GameSession.GameSessionId.IsEmpty()
		? TEXT("n/a")
		: SessionDomainBundle.GameSession.GameSessionId;
	Surface.PrimaryAnalyticsPanelId = AnalyticsPanelBundle.PrimaryPanelId.IsEmpty()
		? TEXT("n/a")
		: AnalyticsPanelBundle.PrimaryPanelId;
	Surface.CompletedAtUtc = bHasDisplayedRunRecap && !DisplayedRunRecap->LastCompletedAtUtc.IsEmpty()
		? DisplayedRunRecap->LastCompletedAtUtc
		: TEXT("n/a");
	Surface.TemplateId = DisplayedTemplateLaunch != nullptr && !DisplayedTemplateLaunch->TemplateId.IsEmpty()
		? DisplayedTemplateLaunch->TemplateId
		: TEXT("n/a");
	Surface.TemplateKindLabel = DisplayedTemplateLaunch != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedTemplateLaunch->TemplateKind)
		: TEXT("n/a");
	Surface.TemplateSourcePlanId =
		DisplayedTemplateLaunch != nullptr && !DisplayedTemplateLaunch->SourceReviewPlanId.IsEmpty()
			? DisplayedTemplateLaunch->SourceReviewPlanId
			: TEXT("none");
	Surface.bHasDisplayedRunRecap = bHasDisplayedRunRecap;
	Surface.bHasCurrentRunRecap = bHasCurrentRunRecap;
	Surface.bHasRetainedRunRecap = !bHasCurrentRunRecap && bHasRetainedRunRecap;
	Surface.bHasTemplateLaunch = DisplayedTemplateLaunch != nullptr;
	Surface.bTemplateUsesReviewLane =
		DisplayedTemplateLaunch != nullptr
		&& (DisplayedTemplateLaunch->bPreferReviewRun
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::ReviewPlan
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::Coach);
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.VisibleAnalyticsPanelCount = AnalyticsPanelBundle.Panels.Num();

	Surface.StatusLine = !DisplayedRunRecapStatusLine.IsEmpty()
		? DisplayedRunRecapStatusLine
		: (bHasDisplayedRunRecap
			? (DisplayedTemplateLaunch != nullptr
				? FString::Printf(
					TEXT("Source: %s | Session: %s | Kind: %s | Game: %s | Deck: %s | Completed at: %s | Template: %s (%s) | Source plan: %s | Panel: %s"),
					*Surface.SourceLabel,
					*Surface.TrainingSessionId,
					*Surface.SessionKindLabel,
					*Surface.GameSessionId,
					*Surface.DeckId,
					*Surface.CompletedAtUtc,
					*Surface.TemplateId,
					*Surface.TemplateKindLabel,
					*Surface.TemplateSourcePlanId,
					*Surface.PrimaryAnalyticsPanelId)
				: FString::Printf(
					TEXT("Source: %s | Session: %s | Kind: %s | Game: %s | Deck: %s | Completed at: %s | Panel: %s"),
					*Surface.SourceLabel,
					*Surface.TrainingSessionId,
					*Surface.SessionKindLabel,
					*Surface.GameSessionId,
					*Surface.DeckId,
					*Surface.CompletedAtUtc,
					*Surface.PrimaryAnalyticsPanelId))
			: (bHasActiveRun
				? TEXT("Source: active run | recap will stabilize here when the run completes or aborts.")
				: TEXT("Source: none yet | complete a run to retain a session recap on this dashboard.")));
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunRecapDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunRecapDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunRecapDetailInspectSurface Surface;
	Surface.Headline = TEXT("Run recap detail");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasCurrentRunRecap = bHasActiveRun
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	const bool bHasDisplayedRunRecap = DisplayedRunRecap != nullptr
		&& !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	const FString RunRecapSourceLabel = bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: (bHasActiveRun ? TEXT("active run") : TEXT("none yet"));
	const bool bHasActiveTemplateLaunchForDisplayedRun =
		bHasCurrentRunRecap
		&& DisplayedRunRecap != nullptr
		&& !ActiveTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == ActiveTemplateLaunchSessionId
		&& ActiveTemplateLaunchProvenance.IsStructurallyValid();
	const bool bHasDisplayedRetainedTemplateLaunch =
		!bHasCurrentRunRecap
		&& bHasRetainedTemplateLaunch
		&& DisplayedRunRecap != nullptr
		&& !RetainedTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == RetainedTemplateLaunchSessionId
		&& RetainedTemplateLaunchProvenance.IsStructurallyValid();
	const FHyperTwistTrainingTemplateLaunchProvenance* DisplayedTemplateLaunch =
		bHasActiveTemplateLaunchForDisplayedRun
			? &ActiveTemplateLaunchProvenance
			: (bHasDisplayedRetainedTemplateLaunch ? &RetainedTemplateLaunchProvenance : nullptr);
	const FString DisplayedTemplateLaunchUserId = DisplayedTemplateLaunch != nullptr
		? (DisplayedTemplateLaunch->UserId.IsEmpty()
			? (bHasCurrentRunRecap ? CachedRunState.Session.UserId : RetainedRunRecapUserId)
			: DisplayedTemplateLaunch->UserId)
		: FString();
	const FHyperTwistTrainingTemplateLaunchScopedStats* DisplayedTemplateLaunchStats =
		DisplayedTemplateLaunch != nullptr
			? FindCachedTemplateLaunchScopedStats(
				DisplayedTemplateLaunch->TemplateId,
				DisplayedTemplateLaunchUserId)
			: nullptr;
	const FString DisplayedTemplateLaunchSelectionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			DisplayedTemplateLaunch != nullptr
				&& DisplayedTemplateLaunch->SelectionProvenance.IsStructurallyValid()
					? &DisplayedTemplateLaunch->SelectionProvenance
					: nullptr
		);
	const bool bDisplayedTemplateLaunchUsesReviewLane =
		DisplayedTemplateLaunch != nullptr
		&& (DisplayedTemplateLaunch->bPreferReviewRun
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::ReviewPlan
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::Coach);
	const FString TemplateAggregateFragment = DisplayedTemplateLaunch != nullptr
		? HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
			DisplayedTemplateLaunchStats)
		: TEXT("n/a");
	const FString TemplateAnalyticsDetailFragment = DisplayedTemplateLaunch != nullptr
		? HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsDetailFragment(
			DisplayedTemplateLaunchStats)
		: TEXT("n/a");
	const FString TemplateTitle = DisplayedTemplateLaunch != nullptr
		? (DisplayedTemplateLaunch->Title.IsEmpty()
			? (DisplayedTemplateLaunch->TemplateId.IsEmpty()
				? TEXT("n/a")
				: DisplayedTemplateLaunch->TemplateId)
			: DisplayedTemplateLaunch->Title)
		: TEXT("n/a");

	Surface.SourceLabel = RunRecapSourceLabel;
	Surface.LastCaseId = bHasDisplayedRunRecap && !DisplayedRunRecap->LastCaseId.IsEmpty()
		? DisplayedRunRecap->LastCaseId
		: TEXT("n/a");
	Surface.TemplateTitle = TemplateTitle;
	Surface.TemplateModeLabel = DisplayedTemplateLaunch != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedTemplateLaunch->SuggestedMode)
		: TEXT("n/a");
	Surface.TemplateSelectionLabel = DisplayedTemplateLaunch != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			DisplayedTemplateLaunch->SuggestedSelectionPolicy)
		: TEXT("n/a");
	Surface.TemplateAggregateFragment = TemplateAggregateFragment;
	Surface.TemplateAnalyticsDetailFragment = TemplateAnalyticsDetailFragment;
	Surface.TemplateSelectionDetailFragment = DisplayedTemplateLaunchSelectionDetail;
	Surface.AttemptCount = bHasDisplayedRunRecap ? DisplayedRunRecap->AttemptCount : 0;
	Surface.CompletedAttemptCount = bHasDisplayedRunRecap ? DisplayedRunRecap->CompletedAttemptCount : 0;
	Surface.SuccessCount = bHasDisplayedRunRecap ? DisplayedRunRecap->SuccessCount : 0;
	Surface.FailureCount = bHasDisplayedRunRecap ? DisplayedRunRecap->FailureCount : 0;
	Surface.TimeoutCount = bHasDisplayedRunRecap ? DisplayedRunRecap->TimeoutCount : 0;
	Surface.DNFCount = bHasDisplayedRunRecap ? DisplayedRunRecap->DNFCount : 0;
	Surface.AbortedCount = bHasDisplayedRunRecap ? DisplayedRunRecap->AbortedCount : 0;
	Surface.BestTotalTimeMs = bHasDisplayedRunRecap ? DisplayedRunRecap->BestTotalTimeMs : 0;
	Surface.AverageTotalTimeMs = bHasDisplayedRunRecap ? DisplayedRunRecap->AverageTotalTimeMs : 0;
	Surface.AverageRawSolveTimeMs = bHasDisplayedRunRecap ? DisplayedRunRecap->AverageRawSolveTimeMs : 0;
	Surface.AverageInspectionTimeMs = bHasDisplayedRunRecap
		? DisplayedRunRecap->AverageInspectionTimeMs
		: 0;
	Surface.TotalMistakes = bHasDisplayedRunRecap ? DisplayedRunRecap->TotalMistakes : 0;
	Surface.RecommendedCaseCount = DisplayedTemplateLaunch != nullptr
		? DisplayedTemplateLaunch->RecommendedCaseCount
		: 0;
	Surface.FocusCaseCount = DisplayedTemplateLaunch != nullptr
		? DisplayedTemplateLaunch->FocusCaseIds.Num()
		: 0;
	Surface.SuccessRate = bHasDisplayedRunRecap ? DisplayedRunRecap->SuccessRate : 0.0f;
	Surface.bHasDisplayedRunRecap = bHasDisplayedRunRecap;
	Surface.bHasCurrentRunRecap = bHasCurrentRunRecap;
	Surface.bHasTemplateLaunch = DisplayedTemplateLaunch != nullptr;
	Surface.bTemplateUsesReviewLane = bDisplayedTemplateLaunchUsesReviewLane;
	Surface.bHasTemplateSelectionDetail = !DisplayedTemplateLaunchSelectionDetail.IsEmpty();
	Surface.bHasTemplateAnalytics = DisplayedTemplateLaunchStats != nullptr
		&& DisplayedTemplateLaunchStats->IsStructurallyValid();

	if (!DisplayedRunRecapDetailLine.IsEmpty())
	{
		Surface.DetailLine = DisplayedRunRecapDetailLine;
		return Surface;
	}

	if (bHasDisplayedRunRecap)
	{
		Surface.DetailLine =
			DisplayedTemplateLaunch != nullptr
				? FString::Printf(
					TEXT("Attempts %d/%d | Success %d | Failure %d | Timeout %d | DNF %d | Aborted %d | Success rate %.2f | Best %d ms | Avg %d ms | Avg raw %d ms | Avg inspection %d ms | Mistakes %d | Last case %s | Template title %s | Template mode %s | Template selection %s | Recommended %d | Focus %d | Review-backed %s | Template aggregate %s | Template detail %s"),
					Surface.CompletedAttemptCount,
					Surface.AttemptCount,
					Surface.SuccessCount,
					Surface.FailureCount,
					Surface.TimeoutCount,
					Surface.DNFCount,
					Surface.AbortedCount,
					Surface.SuccessRate,
					Surface.BestTotalTimeMs,
					Surface.AverageTotalTimeMs,
					Surface.AverageRawSolveTimeMs,
					Surface.AverageInspectionTimeMs,
					Surface.TotalMistakes,
					*Surface.LastCaseId,
					*Surface.TemplateTitle,
					*Surface.TemplateModeLabel,
					*Surface.TemplateSelectionLabel,
					Surface.RecommendedCaseCount,
					Surface.FocusCaseCount,
					Surface.bTemplateUsesReviewLane ? TEXT("yes") : TEXT("no"),
					*Surface.TemplateAggregateFragment,
					*Surface.TemplateAnalyticsDetailFragment)
				: FString::Printf(
					TEXT("Attempts %d/%d | Success %d | Failure %d | Timeout %d | DNF %d | Aborted %d | Success rate %.2f | Best %d ms | Avg %d ms | Avg raw %d ms | Avg inspection %d ms | Mistakes %d | Last case %s"),
					Surface.CompletedAttemptCount,
					Surface.AttemptCount,
					Surface.SuccessCount,
					Surface.FailureCount,
					Surface.TimeoutCount,
					Surface.DNFCount,
					Surface.AbortedCount,
					Surface.SuccessRate,
					Surface.BestTotalTimeMs,
					Surface.AverageTotalTimeMs,
					Surface.AverageRawSolveTimeMs,
					Surface.AverageInspectionTimeMs,
					Surface.TotalMistakes,
					*Surface.LastCaseId);
		if (Surface.bHasTemplateSelectionDetail)
		{
			Surface.DetailLine += TEXT(" | ");
			Surface.DetailLine += Surface.TemplateSelectionDetailFragment;
		}
	}
	else
	{
		Surface.DetailLine =
			TEXT("Recap detail: unavailable until a run has been completed or explicitly aborted.");
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunRecapActionControlInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunRecapActionControlInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunRecapActionControlInspectSurface Surface;
	Surface.Headline = TEXT("Run recap action control");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasCurrentRunRecap = bHasActiveRun
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const bool bHasDisplayedRunRecap = bHasCurrentRunRecap || bHasRetainedRunRecap;
	const bool bCanRepeatDisplayedRun = !bHasLiveAttemptTimer
		&& RetainedRunRecapDeck.IsStructurallyValid()
		&& (!bHasActiveRun
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const bool bCanDismissStoredRecap = !bHasCurrentRunRecap && bHasRetainedRunRecap;
	const FString DisplayedRecapSourceLabel = bHasDisplayedRunRecap
		? (bHasCurrentRunRecap ? TEXT("current run") : TEXT("last completed run"))
		: (bHasActiveRun ? TEXT("active run") : TEXT("none yet"));
	const FString RetainedDeckLabel = RetainedRunRecapDeck.IsStructurallyValid()
		? (RetainedRunRecapDeck.Title.IsEmpty()
			? (RetainedRunRecapDeck.DeckId.IsEmpty() ? TEXT("n/a") : RetainedRunRecapDeck.DeckId)
			: RetainedRunRecapDeck.Title)
		: TEXT("n/a");

	Surface.RepeatLabel = !DisplayedRepeatRunActionLabel.IsEmpty()
		? DisplayedRepeatRunActionLabel
		: TEXT("Repeat Run");
	Surface.DismissLabel = !DisplayedDismissRecapActionLabel.IsEmpty()
		? DisplayedDismissRecapActionLabel
		: TEXT("Dismiss Recap");
	Surface.DisplayedRecapSourceLabel = DisplayedRecapSourceLabel;
	Surface.RetainedDeckLabel = RetainedDeckLabel;
	Surface.RetainedSessionId = RetainedRunRecapSessionId.IsEmpty()
		? TEXT("none")
		: RetainedRunRecapSessionId;
	Surface.bHasDisplayedRunRecap = bHasDisplayedRunRecap;
	Surface.bHasCurrentRunRecap = bHasCurrentRunRecap;
	Surface.bHasRetainedRunRecap = bHasRetainedRunRecap;
	Surface.bHasRetainedDeck = RetainedRunRecapDeck.IsStructurallyValid();
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bRepeatEnabled = bCanRepeatDisplayedRun;
	Surface.bDismissEnabled = bCanDismissStoredRecap;
	Surface.StatusLine = FString::Printf(
		TEXT("%s: %s | %s: %s | displayed recap: %s"),
		*Surface.RepeatLabel,
		Surface.bRepeatEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.DismissLabel,
		Surface.bDismissEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.DisplayedRecapSourceLabel);
	Surface.DetailLine = FString::Printf(
		TEXT("Run-recap control detail: retained deck %s | retained session %s | active run %s | live timer %s | current recap %s | retained recap %s"),
		*Surface.RetainedDeckLabel,
		*Surface.RetainedSessionId,
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasCurrentRunRecap ? TEXT("yes") : TEXT("no"),
		Surface.bHasRetainedRunRecap ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunStateRecapBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunStateRecapBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunStateRecapBandInspectSurface Surface;
	Surface.Headline = TEXT("Run-state recap band");

	const FHyperTwistTrainingCoachDashboardActiveRunStatusInspectSurface ActiveRunSurface =
		GetDisplayedActiveRunStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunRecapStatusInspectSurface RunRecapStatusSurface =
		GetDisplayedRunRecapStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunRecapDetailInspectSurface RunRecapDetailSurface =
		GetDisplayedRunRecapDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunRecapActionControlInspectSurface RunRecapActionSurface =
		GetDisplayedRunRecapActionControlInspectSurface();

	Surface.ActiveRunStatusLine = ActiveRunSurface.StatusLine.IsEmpty()
		? TEXT("Active run status: unavailable.")
		: ActiveRunSurface.StatusLine;
	Surface.ActiveRunSummaryLine = ActiveRunSurface.SummaryLine.IsEmpty()
		? TEXT("Active run summary: unavailable.")
		: ActiveRunSurface.SummaryLine;
	Surface.RunRecapStatusLine = RunRecapStatusSurface.StatusLine.IsEmpty()
		? TEXT("Run recap status: unavailable.")
		: RunRecapStatusSurface.StatusLine;
	Surface.RunRecapDetailLine = RunRecapDetailSurface.DetailLine.IsEmpty()
		? TEXT("Run recap detail: unavailable.")
		: RunRecapDetailSurface.DetailLine;
	Surface.RunRecapActionStatusLine = RunRecapActionSurface.StatusLine.IsEmpty()
		? TEXT("Run recap action control: unavailable.")
		: RunRecapActionSurface.StatusLine;
	Surface.TrainingSessionId = !RunRecapStatusSurface.TrainingSessionId.IsEmpty()
		? RunRecapStatusSurface.TrainingSessionId
		: (ActiveRunSurface.TrainingSessionId.IsEmpty() ? TEXT("n/a") : ActiveRunSurface.TrainingSessionId);
	Surface.SessionStateLabel = !ActiveRunSurface.SessionStateLabel.IsEmpty()
		? ActiveRunSurface.SessionStateLabel
		: (RunRecapStatusSurface.SessionStateLabel.IsEmpty() ? TEXT("n/a") : RunRecapStatusSurface.SessionStateLabel);
	Surface.ActiveDeckLabel = !ActiveRunSurface.ActiveDeckLabel.IsEmpty()
		? ActiveRunSurface.ActiveDeckLabel
		: (RunRecapStatusSurface.DeckLabel.IsEmpty() ? TEXT("n/a") : RunRecapStatusSurface.DeckLabel);
	Surface.RecapSourceLabel = RunRecapStatusSurface.SourceLabel.IsEmpty()
		? TEXT("none")
		: RunRecapStatusSurface.SourceLabel;
	Surface.RepeatLabel = RunRecapActionSurface.RepeatLabel.IsEmpty()
		? TEXT("Repeat Run")
		: RunRecapActionSurface.RepeatLabel;
	Surface.DismissLabel = RunRecapActionSurface.DismissLabel.IsEmpty()
		? TEXT("Dismiss Recap")
		: RunRecapActionSurface.DismissLabel;
	Surface.AttemptCount = ActiveRunSurface.AttemptCount > 0
		? ActiveRunSurface.AttemptCount
		: RunRecapDetailSurface.AttemptCount;
	Surface.CompletedAttemptCount = ActiveRunSurface.CompletedAttemptCount > 0
		? ActiveRunSurface.CompletedAttemptCount
		: RunRecapDetailSurface.CompletedAttemptCount;
	Surface.SuccessRate = RunRecapDetailSurface.SuccessRate;
	Surface.bHasActiveRun = ActiveRunSurface.bHasActiveRun || RunRecapStatusSurface.bHasActiveRun || RunRecapActionSurface.bHasActiveRun;
	Surface.bHasDisplayedRunRecap = RunRecapStatusSurface.bHasDisplayedRunRecap || RunRecapDetailSurface.bHasDisplayedRunRecap || RunRecapActionSurface.bHasDisplayedRunRecap;
	Surface.bHasRetainedRunRecap = RunRecapStatusSurface.bHasRetainedRunRecap || RunRecapActionSurface.bHasRetainedRunRecap;
	Surface.bRepeatEnabled = RunRecapActionSurface.bRepeatEnabled;
	Surface.bDismissEnabled = RunRecapActionSurface.bDismissEnabled;
	Surface.bClosedLoopIdleDashboard = ActiveRunSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Run-state recap band: session %s | state %s | recap %s | repeat %s | dismiss %s"),
		*Surface.TrainingSessionId,
		*Surface.SessionStateLabel,
		*Surface.RecapSourceLabel,
		Surface.bRepeatEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bDismissEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | %s | deck %s | attempts %d | completed %d | success %.2f | active run %s | retained recap %s | closed-loop idle %s"),
		*Surface.ActiveRunStatusLine,
		*Surface.ActiveRunSummaryLine,
		*Surface.RunRecapStatusLine,
		*Surface.RunRecapDetailLine,
		*Surface.RunRecapActionStatusLine,
		*Surface.ActiveDeckLabel,
		Surface.AttemptCount,
		Surface.CompletedAttemptCount,
		Surface.SuccessRate,
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasRetainedRunRecap ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchStatusInspectSurface Surface;
	Surface.Headline = TEXT("Template launch status");

	const FHyperTwistTrainingCoachDashboardPreferredTemplateLaunchActionInspectSurface ActionSurface =
		GetDisplayedPreferredTemplateLaunchActionInspectSurface();

	Surface.StatusLine = !ActionSurface.DisplayedTemplateStatusLine.IsEmpty()
		? ActionSurface.DisplayedTemplateStatusLine
		: TEXT("Template launch status: not yet displayed.");
	Surface.TemplateTitle =
		ActionSurface.TemplateTitle.IsEmpty() ? TEXT("n/a") : ActionSurface.TemplateTitle;
	Surface.TemplateId = ActionSurface.TemplateId.IsEmpty() ? TEXT("n/a") : ActionSurface.TemplateId;
	Surface.TemplateKindLabel = ActionSurface.TemplateKindLabel.IsEmpty()
		? TEXT("n/a")
		: ActionSurface.TemplateKindLabel;
	Surface.FocusDeckId =
		ActionSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : ActionSurface.FocusDeckId;
	Surface.EligibleTemplateCount = ActionSurface.EligibleTemplateCount;
	Surface.ActiveTemplateCount = ActionSurface.ActiveTemplateCount;
	Surface.RecommendedCaseCount = ActionSurface.RecommendedCaseCount;
	Surface.FocusCaseCount = ActionSurface.FocusCaseCount;
	Surface.bHasPreferredTemplate = ActionSurface.bHasPreferredTemplate;
	Surface.bUsesReviewLane = ActionSurface.bUsesReviewLane;
	Surface.bHasLiveAttemptTimer = ActionSurface.bHasLiveAttemptTimer;
	Surface.bHasActiveRun = ActionSurface.bHasActiveRun;
	Surface.bLaunchEnabled = ActionSurface.bActionEnabled;
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchDetailInspectSurface Surface;
	Surface.Headline = TEXT("Template launch detail");

	const FHyperTwistTrainingCoachDashboardPreferredTemplateLaunchActionInspectSurface ActionSurface =
		GetDisplayedPreferredTemplateLaunchActionInspectSurface();

	Surface.DetailLine = !ActionSurface.DisplayedTemplateDetailLine.IsEmpty()
		? ActionSurface.DisplayedTemplateDetailLine
		: TEXT("Template launch detail: not yet displayed.");
	Surface.SelectionDetailLine = ActionSurface.SelectionDetailLine.IsEmpty()
		? TEXT("none")
		: ActionSurface.SelectionDetailLine;
	Surface.TemplateTitle =
		ActionSurface.TemplateTitle.IsEmpty() ? TEXT("n/a") : ActionSurface.TemplateTitle;
	Surface.TemplateId = ActionSurface.TemplateId.IsEmpty() ? TEXT("n/a") : ActionSurface.TemplateId;
	Surface.TemplateKindLabel = ActionSurface.TemplateKindLabel.IsEmpty()
		? TEXT("n/a")
		: ActionSurface.TemplateKindLabel;
	Surface.UserId = ActionSurface.UserId.IsEmpty() ? TEXT("n/a") : ActionSurface.UserId;
	Surface.FocusDeckId =
		ActionSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : ActionSurface.FocusDeckId;
	Surface.GuidanceLabel =
		ActionSurface.GuidanceLabel.IsEmpty() ? TEXT("n/a") : ActionSurface.GuidanceLabel;
	Surface.SuggestedModeLabel = ActionSurface.SuggestedModeLabel.IsEmpty()
		? TEXT("n/a")
		: ActionSurface.SuggestedModeLabel;
	Surface.SuggestedSelectionLabel = ActionSurface.SuggestedSelectionLabel.IsEmpty()
		? TEXT("n/a")
		: ActionSurface.SuggestedSelectionLabel;
	Surface.bHasPreferredTemplate = ActionSurface.bHasPreferredTemplate;
	Surface.bUsesReviewLane = ActionSurface.bUsesReviewLane;
	Surface.bHasScopedStats = ActionSurface.bHasScopedStats;
	Surface.bHasSelectionProvenance = ActionSurface.bHasSelectionProvenance;
	return Surface;
}

FHyperTwistTrainingCoachDashboardPreferredTemplateLaunchActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedPreferredTemplateLaunchActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardPreferredTemplateLaunchActionInspectSurface Surface;
	Surface.Headline = TEXT("Preferred template launch action");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	FHyperTwistTrainingTemplateLaunchSelectionProvenance SelectionProvenance;
	const FHyperTwistTrainingSessionTemplate* PreferredTemplateLaunch =
		FindPreferredDashboardTemplateLaunch(&SelectionProvenance);
	int32 EligibleTemplateCount = 0;
	for (const FHyperTwistTrainingSessionTemplate& SessionTemplate : CachedActiveTrainingSessionTemplates)
	{
		if (HyperTwistCoachDashboardWidgetInternal::ScoreTemplateForDashboardLaunch(SessionTemplate) > 0)
		{
			EligibleTemplateCount += 1;
		}
	}

	const bool bHasPreferredTemplate = PreferredTemplateLaunch != nullptr;
	const bool bUsesReviewLane =
		bHasPreferredTemplate
		&& (PreferredTemplateLaunch->bPreferReviewRun
			|| PreferredTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::ReviewPlan
			|| PreferredTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::Coach);
	const FString PreferredTemplateTitle = bHasPreferredTemplate
		? (PreferredTemplateLaunch->Title.IsEmpty()
			? PreferredTemplateLaunch->TemplateId
			: PreferredTemplateLaunch->Title)
		: TEXT("n/a");
	const FString PreferredTemplateUserId = bHasPreferredTemplate
		? (PreferredTemplateLaunch->UserId.IsEmpty() ? DefaultUserId : PreferredTemplateLaunch->UserId)
		: FString();
	const FHyperTwistTrainingTemplateLaunchScopedStats* PreferredTemplateStats =
		bHasPreferredTemplate
			? FindCachedTemplateLaunchScopedStats(
				PreferredTemplateLaunch->TemplateId,
				PreferredTemplateUserId)
			: nullptr;
	const FString TemplateSelectionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			SelectionProvenance.IsStructurallyValid() ? &SelectionProvenance : nullptr
		);
	const bool bCanLaunchPreferredTemplate =
		!bHasLiveAttemptTimer && !bHasActiveRun && bHasPreferredTemplate;

	FString TemplateActionLabel = TEXT("No Template");
	if (bHasPreferredTemplate)
	{
		TemplateActionLabel =
			PreferredTemplateTitle.Len() <= 28
				? PreferredTemplateTitle
				: (bUsesReviewLane ? TEXT("Launch Review Template") : TEXT("Launch Recovery Template"));
	}
	if (bHasLiveAttemptTimer && bHasPreferredTemplate)
	{
		TemplateActionLabel = TEXT("Template Busy");
	}
	else if (bHasActiveRun && bHasPreferredTemplate)
	{
		TemplateActionLabel = TEXT("Clear Run For Template");
	}

	Surface.ActionLabel = !DisplayedTemplateLaunchActionLabel.IsEmpty()
		? DisplayedTemplateLaunchActionLabel
		: TemplateActionLabel;
	Surface.DisplayedTemplateStatusLine = !DisplayedTemplateLaunchStatusLine.IsEmpty()
		? DisplayedTemplateLaunchStatusLine
		: TEXT("Template launch status: not yet displayed.");
	Surface.DisplayedTemplateDetailLine = !DisplayedTemplateLaunchDetailLine.IsEmpty()
		? DisplayedTemplateLaunchDetailLine
		: TEXT("Template launch detail: not yet displayed.");
	Surface.TemplateTitle = PreferredTemplateTitle;
	Surface.TemplateId = bHasPreferredTemplate && !PreferredTemplateLaunch->TemplateId.IsEmpty()
		? PreferredTemplateLaunch->TemplateId
		: TEXT("n/a");
	Surface.TemplateKindLabel = bHasPreferredTemplate
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(PreferredTemplateLaunch->TemplateKind)
		: TEXT("n/a");
	Surface.UserId = PreferredTemplateUserId.IsEmpty() ? TEXT("n/a") : PreferredTemplateUserId;
	Surface.FocusDeckId =
		bHasPreferredTemplate && !PreferredTemplateLaunch->FocusDeckId.IsEmpty()
			? PreferredTemplateLaunch->FocusDeckId
			: TEXT("n/a");
	Surface.GuidanceLabel =
		bHasPreferredTemplate && !PreferredTemplateLaunch->GuidanceLabel.IsEmpty()
			? PreferredTemplateLaunch->GuidanceLabel
			: TEXT("n/a");
	Surface.SuggestedModeLabel = bHasPreferredTemplate
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(PreferredTemplateLaunch->SuggestedMode)
		: TEXT("n/a");
	Surface.SuggestedSelectionLabel = bHasPreferredTemplate
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			PreferredTemplateLaunch->SuggestedSelectionPolicy)
		: TEXT("n/a");
	Surface.SelectionDetailLine =
		TemplateSelectionDetail.IsEmpty() ? TEXT("none") : TemplateSelectionDetail;
	Surface.EligibleTemplateCount = EligibleTemplateCount;
	Surface.ActiveTemplateCount = CachedActiveTrainingSessionTemplates.Num();
	Surface.RecommendedCaseCount =
		bHasPreferredTemplate ? PreferredTemplateLaunch->RecommendedCaseCount : 0;
	Surface.FocusCaseCount = bHasPreferredTemplate ? PreferredTemplateLaunch->FocusCaseIds.Num() : 0;
	Surface.bHasPreferredTemplate = bHasPreferredTemplate;
	Surface.bUsesReviewLane = bUsesReviewLane;
	Surface.bHasScopedStats =
		PreferredTemplateStats != nullptr && PreferredTemplateStats->IsStructurallyValid();
	Surface.bHasSelectionProvenance = SelectionProvenance.IsStructurallyValid();
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bActionEnabled = bCanLaunchPreferredTemplate;
	Surface.StatusLine = FString::Printf(
		TEXT("%s | Action: %s (%s)"),
		*Surface.DisplayedTemplateStatusLine,
		*Surface.ActionLabel,
		Surface.bActionEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | active run %s | live timer %s | review lane %s | selection provenance %s"),
		*Surface.DisplayedTemplateDetailLine,
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bUsesReviewLane ? TEXT("yes") : TEXT("no"),
		Surface.bHasSelectionProvenance ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRecommendedPreviewActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface Surface;
	Surface.Headline = TEXT("Recommended preview action");
	Surface.GuidanceLaneLabel = TEXT("recommended");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface PreviewSurface =
		GetDisplayedRecommendedGuidanceDeckPreviewInspectSurface();
	const bool bActionEnabled =
		!bHasLiveAttemptTimer && CachedCoachPanelState.bCanStartCoachRecommendedRun;

	Surface.ActionLabel = !DisplayedPreviewRecommendedActionLabel.IsEmpty()
		? DisplayedPreviewRecommendedActionLabel
		: TEXT("Preview Recommended");
	Surface.PreviewStatusLine = PreviewSurface.StatusLine.IsEmpty()
		? TEXT("Recommended guidance: no guidance available.")
		: PreviewSurface.StatusLine;
	Surface.DeckLabel = PreviewSurface.DeckLabel.IsEmpty() ? TEXT("n/a") : PreviewSurface.DeckLabel;
	Surface.BriefHeadline =
		PreviewSurface.BriefHeadline.IsEmpty() ? TEXT("n/a") : PreviewSurface.BriefHeadline;
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.FocusDeckId =
		PreviewSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : PreviewSurface.FocusDeckId;
	Surface.FocusMethodSegmentId = PreviewSurface.FocusMethodSegmentId.IsEmpty()
		? TEXT("n/a")
		: PreviewSurface.FocusMethodSegmentId;
	Surface.CaseCount = PreviewSurface.CaseCount;
	Surface.FocusCaseCount = PreviewSurface.FocusCaseCount;
	Surface.bGuidanceReadyToLaunch = PreviewSurface.bGuidanceReadyToLaunch;
	Surface.bHasGuidancePayload =
		PreviewSurface.bHasDeck || PreviewSurface.bHasBrief || PreviewSurface.bGuidanceReadyToLaunch;
	Surface.bHasDeck = PreviewSurface.bHasDeck;
	Surface.bHasBrief = PreviewSurface.bHasBrief;
	Surface.bUsesBriefFallback = PreviewSurface.bUsesBriefFallback;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bActionEnabled = bActionEnabled;
	Surface.bActivePreviewLane = PreviewSurface.bActivePreviewLane;
	Surface.bClosedLoopIdleDashboard = PreviewSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("%s | Action: %s (%s)"),
		*Surface.PreviewStatusLine,
		*Surface.ActionLabel,
		Surface.bActionEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | live timer %s | active preview lane %s"),
		*PreviewSurface.DetailLine,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		*Surface.ActivePreviewLaneLabel);
	return Surface;
}

FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedFollowUpPreviewActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface Surface;
	Surface.Headline = TEXT("Follow-up preview action");
	Surface.GuidanceLaneLabel = TEXT("follow-up");

	const auto BuildPreviewLaneLabel = [](const EHyperTwistCoachDashboardGuidancePreviewLane Lane) -> FString
	{
		return Lane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (Lane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none"));
	};

	const FHyperTwistTrainingCoachDashboardGuidanceDeckPreviewInspectSurface PreviewSurface =
		GetDisplayedFollowUpGuidanceDeckPreviewInspectSurface();
	const bool bActionEnabled =
		!bHasLiveAttemptTimer
		&& CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachPanelState.bHasFollowUpGuidance;

	Surface.ActionLabel = !DisplayedPreviewFollowUpActionLabel.IsEmpty()
		? DisplayedPreviewFollowUpActionLabel
		: TEXT("Preview Follow-Up");
	Surface.PreviewStatusLine = PreviewSurface.StatusLine.IsEmpty()
		? TEXT("Follow-up guidance: no guidance available.")
		: PreviewSurface.StatusLine;
	Surface.DeckLabel = PreviewSurface.DeckLabel.IsEmpty() ? TEXT("n/a") : PreviewSurface.DeckLabel;
	Surface.BriefHeadline =
		PreviewSurface.BriefHeadline.IsEmpty() ? TEXT("n/a") : PreviewSurface.BriefHeadline;
	Surface.ActivePreviewLaneLabel = BuildPreviewLaneLabel(ActiveGuidancePreviewLane);
	Surface.FocusDeckId =
		PreviewSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : PreviewSurface.FocusDeckId;
	Surface.FocusMethodSegmentId = PreviewSurface.FocusMethodSegmentId.IsEmpty()
		? TEXT("n/a")
		: PreviewSurface.FocusMethodSegmentId;
	Surface.CaseCount = PreviewSurface.CaseCount;
	Surface.FocusCaseCount = PreviewSurface.FocusCaseCount;
	Surface.bGuidanceReadyToLaunch = PreviewSurface.bGuidanceReadyToLaunch;
	Surface.bHasGuidancePayload =
		CachedCoachPanelState.bHasFollowUpGuidance
		|| PreviewSurface.bHasDeck
		|| PreviewSurface.bHasBrief
		|| PreviewSurface.bGuidanceReadyToLaunch;
	Surface.bHasDeck = PreviewSurface.bHasDeck;
	Surface.bHasBrief = PreviewSurface.bHasBrief;
	Surface.bUsesBriefFallback = PreviewSurface.bUsesBriefFallback;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bActionEnabled = bActionEnabled;
	Surface.bActivePreviewLane = PreviewSurface.bActivePreviewLane;
	Surface.bClosedLoopIdleDashboard = PreviewSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("%s | Action: %s (%s)"),
		*Surface.PreviewStatusLine,
		*Surface.ActionLabel,
		Surface.bActionEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | live timer %s | active preview lane %s"),
		*PreviewSurface.DetailLine,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		*Surface.ActivePreviewLaneLabel);
	return Surface;
}

FHyperTwistTrainingCoachDashboardTemplateLaunchPreviewActionControlBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedTemplateLaunchPreviewActionControlBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardTemplateLaunchPreviewActionControlBandInspectSurface Surface;
	Surface.Headline = TEXT("Template-launch / preview action control band");

	const FHyperTwistTrainingCoachDashboardPreferredTemplateLaunchActionInspectSurface TemplateSurface =
		GetDisplayedPreferredTemplateLaunchActionInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface RecommendedSurface =
		GetDisplayedRecommendedPreviewActionInspectSurface();
	const FHyperTwistTrainingCoachDashboardGuidancePreviewActionInspectSurface FollowUpSurface =
		GetDisplayedFollowUpPreviewActionInspectSurface();

	Surface.PreferredTemplateActionLabel = TemplateSurface.ActionLabel.IsEmpty()
		? TEXT("No Template")
		: TemplateSurface.ActionLabel;
	Surface.RecommendedPreviewActionLabel = RecommendedSurface.ActionLabel.IsEmpty()
		? TEXT("Preview Recommended")
		: RecommendedSurface.ActionLabel;
	Surface.FollowUpPreviewActionLabel = FollowUpSurface.ActionLabel.IsEmpty()
		? TEXT("Preview Follow-Up")
		: FollowUpSurface.ActionLabel;
	Surface.PreferredTemplateStatusLine = TemplateSurface.StatusLine.IsEmpty()
		? TEXT("Template launch action: unavailable.")
		: TemplateSurface.StatusLine;
	Surface.RecommendedPreviewStatusLine = RecommendedSurface.StatusLine.IsEmpty()
		? TEXT("Recommended preview action: unavailable.")
		: RecommendedSurface.StatusLine;
	Surface.FollowUpPreviewStatusLine = FollowUpSurface.StatusLine.IsEmpty()
		? TEXT("Follow-up preview action: unavailable.")
		: FollowUpSurface.StatusLine;
	Surface.PreferredTemplateTitle = TemplateSurface.TemplateTitle.IsEmpty()
		? TEXT("n/a")
		: TemplateSurface.TemplateTitle;
	Surface.RecommendedDeckLabel = RecommendedSurface.DeckLabel.IsEmpty()
		? TEXT("n/a")
		: RecommendedSurface.DeckLabel;
	Surface.FollowUpDeckLabel = FollowUpSurface.DeckLabel.IsEmpty()
		? TEXT("n/a")
		: FollowUpSurface.DeckLabel;
	Surface.ActivePreviewLaneLabel = !RecommendedSurface.ActivePreviewLaneLabel.IsEmpty()
		? RecommendedSurface.ActivePreviewLaneLabel
		: (FollowUpSurface.ActivePreviewLaneLabel.IsEmpty()
			? TEXT("none")
			: FollowUpSurface.ActivePreviewLaneLabel);
	Surface.bHasPreferredTemplate = TemplateSurface.bHasPreferredTemplate;
	Surface.bRecommendedGuidanceReady =
		RecommendedSurface.bHasGuidancePayload || RecommendedSurface.bGuidanceReadyToLaunch;
	Surface.bFollowUpGuidanceReady =
		FollowUpSurface.bHasGuidancePayload || FollowUpSurface.bGuidanceReadyToLaunch;
	Surface.bHasLiveAttemptTimer =
		TemplateSurface.bHasLiveAttemptTimer
		|| RecommendedSurface.bHasLiveAttemptTimer
		|| FollowUpSurface.bHasLiveAttemptTimer;
	Surface.bHasActiveRun = TemplateSurface.bHasActiveRun;
	Surface.bPreferredTemplateActionEnabled = TemplateSurface.bActionEnabled;
	Surface.bRecommendedPreviewActionEnabled = RecommendedSurface.bActionEnabled;
	Surface.bFollowUpPreviewActionEnabled = FollowUpSurface.bActionEnabled;
	Surface.bAnyActionEnabled =
		Surface.bPreferredTemplateActionEnabled
		|| Surface.bRecommendedPreviewActionEnabled
		|| Surface.bFollowUpPreviewActionEnabled;
	Surface.bClosedLoopIdleDashboard =
		RecommendedSurface.bClosedLoopIdleDashboard || FollowUpSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Action control band: template %s (%s) | recommended %s (%s) | follow-up %s (%s)"),
		*Surface.PreferredTemplateActionLabel,
		Surface.bPreferredTemplateActionEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.RecommendedPreviewActionLabel,
		Surface.bRecommendedPreviewActionEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.FollowUpPreviewActionLabel,
		Surface.bFollowUpPreviewActionEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("Template: %s | Recommended: %s | Follow-up: %s | preferred template %s | recommended deck %s | follow-up deck %s | active preview lane %s | live timer %s | active run %s | closed-loop idle %s"),
		*Surface.PreferredTemplateStatusLine,
		*Surface.RecommendedPreviewStatusLine,
		*Surface.FollowUpPreviewStatusLine,
		*Surface.PreferredTemplateTitle,
		*Surface.RecommendedDeckLabel,
		*Surface.FollowUpDeckLabel,
		*Surface.ActivePreviewLaneLabel,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardActiveAttemptTimerStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedActiveAttemptTimerStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardActiveAttemptTimerStatusInspectSurface Surface;
	Surface.Headline = TEXT("Active attempt / timer status");

	int32 ParsedAttemptOverrideMs = 0;
	const bool bHasParsedAttemptOverride = TryParseAttemptTimeOverride(ParsedAttemptOverrideMs);
	const int32 ResolvedSuccessTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Success);
	const int32 ResolvedFailureTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Failure);
	const int32 ResolvedTimeoutTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Timeout);
	const int32 ResolvedDnfTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::DNF);
	const FHyperTwistTrainingTimingPolicy* TimingPolicy = FindActiveTimingPolicy();
	const bool bHasInspectionWindow = TimingPolicy != nullptr
		&& TimingPolicy->bInspectionEnabled
		&& TimingPolicy->InspectionDurationMs > 0;
	const int32 InspectionLimitMs = bHasInspectionWindow ? FMath::Max(TimingPolicy->InspectionDurationMs, 0) : 0;
	const bool bLiveInspectionPhase = IsLiveAttemptInspectionPhase();
	const bool bLivePausedPhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Paused;
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;
	const bool bRunningSolveTimeHidden =
		TimingPolicy != nullptr && TimingPolicy->bHideRunningTime && bLiveSolvePhase;
	const FString RunningSolveLabel =
		bRunningSolveTimeHidden ? TEXT("hidden") : FString::FromInt(LiveAttemptSolveElapsedMs);
	const EHyperTwistTrainingPenalty LiveInspectionPenalty =
		(bHasInspectionWindow
			&& TimingPolicy->bInspectionPenaltiesEnabled
			&& LiveAttemptInspectionElapsedMs > InspectionLimitMs
			&& LiveAttemptInspectionElapsedMs <= InspectionLimitMs + 2000)
		? EHyperTwistTrainingPenalty::Plus2
		: ((bHasInspectionWindow
			&& TimingPolicy->bInspectionPenaltiesEnabled
			&& LiveAttemptInspectionElapsedMs > InspectionLimitMs + 2000)
			? EHyperTwistTrainingPenalty::DNF
			: EHyperTwistTrainingPenalty::None);
	const FString InspectionWindowLabel = bHasInspectionWindow
		? FString::Printf(TEXT("inspection target %d ms"), InspectionLimitMs)
		: TEXT("no inspection window");

	Surface.AttemptOverrideMs = ParsedAttemptOverrideMs;
	Surface.TargetTimeMs = CachedRunState.CurrentSelection.TrainingCase.TimeTargetMs;
	Surface.AverageTotalTimeMs = CachedRunSummary.AverageTotalTimeMs;
	Surface.ResolvedSuccessTimeMs = ResolvedSuccessTimeMs;
	Surface.ResolvedFailureTimeMs = ResolvedFailureTimeMs;
	Surface.ResolvedTimeoutTimeMs = ResolvedTimeoutTimeMs;
	Surface.ResolvedDnfTimeMs = ResolvedDnfTimeMs;
	Surface.InspectionLimitMs = InspectionLimitMs;
	Surface.InspectionElapsedMs = LiveAttemptInspectionElapsedMs;
	Surface.SolveElapsedMs = LiveAttemptSolveElapsedMs;
	Surface.DisplayedElapsedMs = LiveAttemptDisplayedMs;
	Surface.TimerPhaseLabel = bLiveInspectionPhase
		? TEXT("inspection")
		: (bLiveSolvePhase ? TEXT("solving") : (bLivePausedPhase ? TEXT("paused") : TEXT("idle")));
	Surface.RunningSolveLabel = RunningSolveLabel;
	Surface.InspectionWindowLabel = InspectionWindowLabel;
	Surface.PendingPenaltyLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(LiveInspectionPenalty);
	Surface.bHasParsedAttemptOverride = bHasParsedAttemptOverride;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = bLiveInspectionPhase;
	Surface.bLiveSolvePhase = bLiveSolvePhase;
	Surface.bHasInspectionWindow = bHasInspectionWindow;
	Surface.bRunningSolveTimeHidden = bRunningSolveTimeHidden;

	Surface.AttemptInputLine = !DisplayedAttemptInputStatusLine.IsEmpty()
		? DisplayedAttemptInputStatusLine
		: FString::Printf(
			TEXT("Attempt ms input: %s | Target %d | Avg %d | Success %d | Failure %d | Timeout %d | DNF %d"),
			bHasParsedAttemptOverride ? *FString::FromInt(ParsedAttemptOverrideMs) : TEXT("auto"),
			Surface.TargetTimeMs,
			Surface.AverageTotalTimeMs,
			Surface.ResolvedSuccessTimeMs,
			Surface.ResolvedFailureTimeMs,
			Surface.ResolvedTimeoutTimeMs,
			Surface.ResolvedDnfTimeMs);
	if (!DisplayedTimerStatusLine.IsEmpty())
	{
		Surface.TimerStatusLine = DisplayedTimerStatusLine;
	}
	else if (bLiveInspectionPhase)
	{
		Surface.TimerStatusLine = FString::Printf(
			TEXT("Phase: inspection | elapsed %d ms | remaining %d ms | pending penalty: %s | click Start Solve when ready"),
			Surface.InspectionElapsedMs,
			bHasInspectionWindow ? FMath::Max(InspectionLimitMs - LiveAttemptInspectionElapsedMs, 0) : 0,
			*Surface.PendingPenaltyLabel
		);
	}
	else if (bLiveSolvePhase)
	{
		Surface.TimerStatusLine = FString::Printf(
			TEXT("Phase: solving | inspection %d ms | solve %s ms | finish with Success / Failure / Timeout / DNF"),
			Surface.InspectionElapsedMs,
			*Surface.RunningSolveLabel
		);
	}
	else if (bLivePausedPhase)
	{
		Surface.TimerStatusLine = FString::Printf(
			TEXT("Phase: paused | inspection %d ms | solve %d ms | click Resume Solve or Cancel Timer"),
			Surface.InspectionElapsedMs,
			Surface.SolveElapsedMs
		);
	}
	else
	{
		Surface.TimerStatusLine = FString::Printf(
			TEXT("Timer idle | %s | start a live attempt for less-synthetic run entry"),
			*Surface.InspectionWindowLabel
		);
	}
	return Surface;
}

FHyperTwistTrainingCoachDashboardCurrentCaseDeckStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedCurrentCaseDeckStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardCurrentCaseDeckStatusInspectSurface Surface;
	Surface.Headline = TEXT("Current case / deck status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	const FHyperTwistTrainingCase& CurrentTrainingCase = CachedRunState.CurrentSelection.TrainingCase;
	const FString ActiveDeckLabel = CachedRunState.ActiveDeck.Title.IsEmpty()
		? (CachedRunState.ActiveDeck.DeckId.IsEmpty() ? TEXT("n/a") : CachedRunState.ActiveDeck.DeckId)
		: CachedRunState.ActiveDeck.Title;
	const FString ActiveCaseId = CurrentTrainingCase.CaseId.IsEmpty()
		? TEXT("n/a")
		: CurrentTrainingCase.CaseId;
	const FString TagLine = CurrentTrainingCase.Tags.Num() > 0
		? FString::Join(CurrentTrainingCase.Tags, TEXT(", "))
		: TEXT("n/a");

	Surface.ActiveDeckLabel = ActiveDeckLabel;
	Surface.ActiveDeckId = CachedRunState.ActiveDeck.DeckId.IsEmpty()
		? TEXT("n/a")
		: CachedRunState.ActiveDeck.DeckId;
	Surface.DeliveryModeLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.Mode);
	Surface.ActiveCaseId = ActiveCaseId;
	Surface.PromptLabel = CurrentTrainingCase.PromptLabel.IsEmpty()
		? TEXT("n/a")
		: CurrentTrainingCase.PromptLabel;
	Surface.PromptKindLabel =
		HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CurrentTrainingCase.PromptKind);
	Surface.SubsetId = CurrentTrainingCase.SubsetId.IsEmpty()
		? TEXT("n/a")
		: CurrentTrainingCase.SubsetId;
	Surface.ScrambleNotation = CurrentTrainingCase.ScrambleNotation.IsEmpty()
		? TEXT("n/a")
		: CurrentTrainingCase.ScrambleNotation;
	Surface.CanonicalNotation = CurrentTrainingCase.CanonicalNotation.IsEmpty()
		? TEXT("n/a")
		: CurrentTrainingCase.CanonicalNotation;
	Surface.TagLine = TagLine;
	Surface.TimeTargetMs = CurrentTrainingCase.TimeTargetMs;
	Surface.SelectionAttemptCount = CachedRunState.CurrentSelection.AttemptCount;
	Surface.SelectionSuccessCount = CachedRunState.CurrentSelection.SuccessCount;
	Surface.RemainingCaseCount = CachedRunState.RemainingCaseIds.Num();
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasRunnableCurrentCase = bHasRunnableCurrentCase;

	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);

	Surface.StatusLine = !DisplayedActiveRunStatusLine.IsEmpty()
		? DisplayedActiveRunStatusLine
		: (bHasActiveRun
			? FString::Printf(
				TEXT("Session: %s | State: %s | Deck: %s | Mode: %s | Current case: %s | Remaining: %d"),
				CachedRunState.Session.TrainingSessionId.IsEmpty()
					? TEXT("n/a")
					: *CachedRunState.Session.TrainingSessionId,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.SessionState),
				*Surface.ActiveDeckLabel,
				*Surface.DeliveryModeLabel,
				*Surface.ActiveCaseId,
				Surface.RemainingCaseCount)
			: (Surface.bClosedLoopIdleDashboard
				? TEXT("No active run. The coach-to-review loop is closed and idle.")
				: TEXT("No active run. Queue and coach guidance are ready for launch from this screen.")));
	Surface.PromptLine = !DisplayedCurrentCasePromptLine.IsEmpty()
		? DisplayedCurrentCasePromptLine
		: (bHasRunnableCurrentCase
			? FString::Printf(
				TEXT("Prompt: %s | Kind: %s | Subset: %s | Target: %d ms | Attempts on selection: %d | Successes on selection: %d"),
				*Surface.PromptLabel,
				*Surface.PromptKindLabel,
				*Surface.SubsetId,
				Surface.TimeTargetMs,
				Surface.SelectionAttemptCount,
				Surface.SelectionSuccessCount)
			: TEXT("Prompt: no active current case is loaded."));
	Surface.NotationLine = !DisplayedCurrentCaseNotationLine.IsEmpty()
		? DisplayedCurrentCaseNotationLine
		: (bHasRunnableCurrentCase
			? FString::Printf(
				TEXT("Scramble: %s\nCanonical: %s\nTags: %s"),
				*Surface.ScrambleNotation,
				*Surface.CanonicalNotation,
				*Surface.TagLine)
			: TEXT("Scramble / notation: unavailable until a run is active."));
	return Surface;
}

FHyperTwistTrainingCoachDashboardAttemptTimeInputHintInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedAttemptTimeInputHintInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardAttemptTimeInputHintInspectSurface Surface;
	Surface.Headline = TEXT("Attempt-time input hint");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	const FHyperTwistTrainingCase& CurrentTrainingCase = CachedRunState.CurrentSelection.TrainingCase;

	Surface.HintLabel = !DisplayedAttemptTimeHintLabel.IsEmpty()
		? DisplayedAttemptTimeHintLabel
		: (CurrentTrainingCase.TimeTargetMs > 0
			? FString::Printf(TEXT("Enter attempt ms (target %d)"), CurrentTrainingCase.TimeTargetMs)
			: TEXT("Enter attempt ms"));
	Surface.UseTargetLabel = !DisplayedUseTargetTimeLabel.IsEmpty()
		? DisplayedUseTargetTimeLabel
		: TEXT("Use Target");
	Surface.UseAverageLabel = !DisplayedUseAverageTimeLabel.IsEmpty()
		? DisplayedUseAverageTimeLabel
		: TEXT("Use Avg");
	Surface.TargetTimeMs = CurrentTrainingCase.TimeTargetMs;
	Surface.AverageTotalTimeMs = CachedRunSummary.AverageTotalTimeMs;
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasRunnableCurrentCase = bHasRunnableCurrentCase;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bAttemptInputEnabled = !bHasLiveAttemptTimer && bHasRunnableCurrentCase;
	Surface.bCanUseTargetTime =
		!bHasLiveAttemptTimer && bHasRunnableCurrentCase && CurrentTrainingCase.TimeTargetMs > 0;
	Surface.bCanUseAverageTime =
		!bHasLiveAttemptTimer && bHasActiveRun && CachedRunSummary.AverageTotalTimeMs > 0;
	Surface.StatusLine = FString::Printf(
		TEXT("Hint: %s | input enabled: %s | %s: %s | %s: %s"),
		*Surface.HintLabel,
		Surface.bAttemptInputEnabled ? TEXT("yes") : TEXT("no"),
		*Surface.UseTargetLabel,
		Surface.bCanUseTargetTime ? TEXT("yes") : TEXT("no"),
		*Surface.UseAverageLabel,
		Surface.bCanUseAverageTime ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardLiveTimerSplitControlLabelInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedLiveTimerSplitControlLabelInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardLiveTimerSplitControlLabelInspectSurface Surface;
	Surface.Headline = TEXT("Live timer / split control labels");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	const bool bLiveInspectionPhase = IsLiveAttemptInspectionPhase();
	const bool bLivePausedPhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Paused;
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;
	const FHyperTwistTrainingSplitPhaseDefinition* NextSplitPhaseDefinition = FindNextSplitPhaseToCapture();
	const FString NextSplitLabel = NextSplitPhaseDefinition == nullptr
		? TEXT("none")
		: (NextSplitPhaseDefinition->Label.IsEmpty()
			? NextSplitPhaseDefinition->PhaseId
			: NextSplitPhaseDefinition->Label);

	Surface.StartTimerLabel = !DisplayedStartTimerControlLabel.IsEmpty()
		? DisplayedStartTimerControlLabel
		: (bLiveInspectionPhase
			? TEXT("Start Solve")
			: (bLiveSolvePhase
				? TEXT("Pause Timer")
				: (bLivePausedPhase ? TEXT("Resume Solve") : TEXT("Start Attempt"))));
	Surface.CancelTimerLabel = !DisplayedCancelTimerControlLabel.IsEmpty()
		? DisplayedCancelTimerControlLabel
		: TEXT("Cancel Timer");
	Surface.CaptureSplitLabel = !DisplayedCaptureSplitControlLabel.IsEmpty()
		? DisplayedCaptureSplitControlLabel
		: (NextSplitPhaseDefinition == nullptr
			? TEXT("All Splits Captured")
			: FString::Printf(TEXT("Capture %s"), *NextSplitLabel));
	Surface.UndoSplitLabel = !DisplayedUndoSplitControlLabel.IsEmpty()
		? DisplayedUndoSplitControlLabel
		: TEXT("Undo Split");
	Surface.NextSplitLabel = NextSplitLabel;
	Surface.CapturedSplitCount = LiveAttemptSplitCaptures.Num();
	Surface.bHasRunnableCurrentCase = bHasRunnableCurrentCase;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = bLiveInspectionPhase;
	Surface.bLiveSolvePhase = bLiveSolvePhase;
	Surface.bCanStartOrAdvanceTimer =
		bHasRunnableCurrentCase && (!bHasLiveAttemptTimer || bLiveInspectionPhase || bLiveSolvePhase || bLivePausedPhase);
	Surface.bCanCancelTimer = bHasLiveAttemptTimer;
	Surface.bCanCaptureSplit = bLiveSolvePhase && NextSplitPhaseDefinition != nullptr;
	Surface.bCanUndoSplit = (bLiveSolvePhase || bLivePausedPhase) && LiveAttemptSplitCaptures.Num() > 0;
	Surface.TimerControlLine = FString::Printf(
		TEXT("%s: %s | %s: %s"),
		*Surface.StartTimerLabel,
		Surface.bCanStartOrAdvanceTimer ? TEXT("enabled") : TEXT("disabled"),
		*Surface.CancelTimerLabel,
		Surface.bCanCancelTimer ? TEXT("enabled") : TEXT("disabled"));
	Surface.SplitControlLine = FString::Printf(
		TEXT("%s: %s | %s: %s | next split: %s | captured: %d"),
		*Surface.CaptureSplitLabel,
		Surface.bCanCaptureSplit ? TEXT("enabled") : TEXT("disabled"),
		*Surface.UndoSplitLabel,
		Surface.bCanUndoSplit ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextSplitLabel,
		Surface.CapturedSplitCount);
	return Surface;
}

FHyperTwistTrainingCoachDashboardAttemptResultActionEnablementInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedAttemptResultActionEnablementInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardAttemptResultActionEnablementInspectSurface Surface;
	Surface.Headline = TEXT("Attempt result-action enablement");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	const bool bLivePausedPhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Paused;
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;

	Surface.SuccessLabel = !DisplayedRecordSuccessActionLabel.IsEmpty()
		? DisplayedRecordSuccessActionLabel
		: (bLiveSolvePhase ? TEXT("Stop Success") : TEXT("Record Success"));
	Surface.FailureLabel = !DisplayedRecordFailureActionLabel.IsEmpty()
		? DisplayedRecordFailureActionLabel
		: (bLiveSolvePhase ? TEXT("Stop Failure") : TEXT("Record Failure"));
	Surface.TimeoutLabel = !DisplayedRecordTimeoutActionLabel.IsEmpty()
		? DisplayedRecordTimeoutActionLabel
		: (bLiveSolvePhase ? TEXT("Stop Timeout") : TEXT("Record Timeout"));
	Surface.DnfLabel = !DisplayedRecordDnfActionLabel.IsEmpty()
		? DisplayedRecordDnfActionLabel
		: (bLiveSolvePhase ? TEXT("Stop DNF") : TEXT("Record DNF"));
	Surface.bHasRunnableCurrentCase = bHasRunnableCurrentCase;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bLiveSolvePhase = bLiveSolvePhase;
	Surface.bCanRecordSyntheticAttempt = !bHasLiveAttemptTimer && bHasRunnableCurrentCase;
	Surface.bCanStopLiveTimedAttempt = bLiveSolvePhase;
	Surface.bSuccessEnabled = bLiveSolvePhase || (!bHasLiveAttemptTimer && bHasRunnableCurrentCase);
	Surface.bFailureEnabled = Surface.bSuccessEnabled;
	Surface.bTimeoutEnabled = Surface.bSuccessEnabled;
	Surface.bDnfEnabled = Surface.bSuccessEnabled;
	Surface.StatusLine = FString::Printf(
		TEXT("%s | %s | %s | %s"),
		*Surface.SuccessLabel,
		*Surface.FailureLabel,
		*Surface.TimeoutLabel,
		*Surface.DnfLabel);
	Surface.DetailLine = FString::Printf(
		TEXT("Result-action detail: live solve %s | live paused %s | synthetic attempt entry %s | stop-live-attempt %s"),
		Surface.bLiveSolvePhase ? TEXT("yes") : TEXT("no"),
		bLivePausedPhase ? TEXT("yes") : TEXT("no"),
		Surface.bCanRecordSyntheticAttempt ? TEXT("enabled") : TEXT("disabled"),
		Surface.bCanStopLiveTimedAttempt ? TEXT("enabled") : TEXT("disabled"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardAttemptReviewNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedAttemptReviewNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardAttemptReviewNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Attempt-review navigation");

	const bool bHasReviewedAttempt =
		SelectedAttemptIndex >= 0 && SelectedAttemptIndex < CachedRunState.Attempts.Num();
	const int32 TotalAttemptCount = CachedRunState.Attempts.Num();
	const bool bNavigationEnabled = TotalAttemptCount > 1;

	Surface.PreviousLabel = !DisplayedPreviousAttemptNavigationLabel.IsEmpty()
		? DisplayedPreviousAttemptNavigationLabel
		: TEXT("Prev Attempt");
	Surface.NextLabel = !DisplayedNextAttemptNavigationLabel.IsEmpty()
		? DisplayedNextAttemptNavigationLabel
		: TEXT("Next Attempt");
	Surface.SelectedAttemptIndex = SelectedAttemptIndex;
	Surface.TotalAttemptCount = TotalAttemptCount;
	Surface.bHasReviewedAttempt = bHasReviewedAttempt;
	Surface.bCanSelectPreviousAttempt = bNavigationEnabled;
	Surface.bCanSelectNextAttempt = bNavigationEnabled;
	Surface.AttemptOrdinal = bHasReviewedAttempt
		? FString::Printf(TEXT("%d/%d"), SelectedAttemptIndex + 1, TotalAttemptCount)
		: TEXT("none");
	Surface.StatusLine = FString::Printf(
		TEXT("%s: %s | %s: %s | selected attempt: %s"),
		*Surface.PreviousLabel,
		Surface.bCanSelectPreviousAttempt ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bCanSelectNextAttempt ? TEXT("enabled") : TEXT("disabled"),
		*Surface.AttemptOrdinal);
	return Surface;
}

FHyperTwistTrainingCoachDashboardRunControlEnablementInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRunControlEnablementInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRunControlEnablementInspectSurface Surface;
	Surface.Headline = TEXT("Run-control enablement");

	const FHyperTwistTrainingCoachDashboardTransitionStatusInspectSurface TransitionSurface =
		GetDisplayedTransitionStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunActionLabelsInspectSurface RunActionSurface =
		GetDisplayedRunActionLabelsInspectSurface();

	FString PrimaryLabel = !DisplayedPrimaryActionLabel.IsEmpty()
		? DisplayedPrimaryActionLabel
		: CachedCoachPanelState.PrimaryActionLabel;
	if (PrimaryLabel.IsEmpty())
	{
		PrimaryLabel = TEXT("Refresh");
	}

	Surface.PrimaryLabel = PrimaryLabel;
	Surface.ContinueLabel = RunActionSurface.ContinueRunLabel;
	Surface.CompleteLabel = !DisplayedCompleteRunControlLabel.IsEmpty()
		? DisplayedCompleteRunControlLabel
		: TEXT("Complete Run");
	Surface.ClearLabel = !DisplayedClearRunControlLabel.IsEmpty()
		? DisplayedClearRunControlLabel
		: TEXT("Clear Run");
	Surface.bHasActiveRun = TransitionSurface.bHasActiveRun;
	Surface.bHasRunnableCurrentCase =
		TransitionSurface.bHasActiveRun
		&& CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	Surface.bHasLiveAttemptTimer = TransitionSurface.bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = TransitionSurface.bLiveInspectionPhase;
	Surface.bCanContinueCurrentRun = TransitionSurface.bCanContinueCurrentRun;
	Surface.bCanLaunchCoachRun = TransitionSurface.bCanLaunchCoachRun;
	Surface.bPrimaryEnabled = TransitionSurface.bCanLaunchCoachRun;
	Surface.bContinueEnabled =
		(!TransitionSurface.bHasLiveAttemptTimer && TransitionSurface.bCanContinueCurrentRun)
		|| (TransitionSurface.bLiveInspectionPhase && Surface.bHasRunnableCurrentCase)
		|| TransitionSurface.bCanLaunchCoachRun;
	Surface.bCompleteEnabled =
		TransitionSurface.bHasActiveRun && !TransitionSurface.bHasLiveAttemptTimer;
	Surface.bClearEnabled =
		TransitionSurface.bHasActiveRun && !TransitionSurface.bHasLiveAttemptTimer;
	Surface.StatusLine = FString::Printf(
		TEXT("%s: %s | %s: %s | %s: %s | %s: %s"),
		*Surface.PrimaryLabel,
		Surface.bPrimaryEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.ContinueLabel,
		Surface.bContinueEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.CompleteLabel,
		Surface.bCompleteEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.ClearLabel,
		Surface.bClearEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("Run-control detail: active run %s | runnable case %s | live timer %s | inspection %s | continue-current-run %s | coach-launch %s"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasRunnableCurrentCase ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bLiveInspectionPhase ? TEXT("yes") : TEXT("no"),
		Surface.bCanContinueCurrentRun ? TEXT("yes") : TEXT("no"),
		Surface.bCanLaunchCoachRun ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueActionEnablementInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueActionEnablementInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueActionEnablementInspectSurface Surface;
	Surface.Headline = TEXT("Queue-action enablement");

	const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedQueueEntry = FindSelectedQueueEntry();
	const FString DeferredQueueEntryId = FindFirstDeferredQueueEntryId();
	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bQueueRecoveryFollowUp =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp;
	const bool bQueueRecoveryRecommended =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended;
	const FHyperTwistCoachSignal* QueueDeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"));
	const bool bHasDeferredFirstQueueSuppressionSignal =
		QueueDeferredFirstSuppressionSignal != nullptr;
	const bool bCanLaunchQueueRecovery =
		CachedCoachPanelState.bCanStartQueuedRun
		|| (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const bool bUpstreamPrefersLaunchRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryAction
		== EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
	const FHyperTwistCoachDashboardQueueRecoveryWeighting QueueRecoveryWeighting =
		BuildQueueRecoveryWeighting();
	const bool bPreferLaunchRecoveryAction =
		!DeferredQueueEntryId.IsEmpty()
		&& bCanLaunchQueueRecovery
		&& !(bHasDeferredFirstQueueSuppressionSignal && bQueueRecoveryFollowUp)
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && bUpstreamPrefersLaunchRecovery));
	const bool bHasQueueRecoveryFriction =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals
		|| CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals
		|| CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview
		|| CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork
		|| CachedCoachQueueExecutionSummary.bHasCompletionGap;
	const bool bClosedLoopIdleDashboard =
		IsCoachLoopActionabilityClosed()
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| DisplayedCoachHandoffRecommendationKind != EHyperTwistTrainingCoachHandoffKind::None);
	const bool bCanApplyQueueRecovery =
		!bClosedLoopIdleDashboard
		&& !bHasLiveAttemptTimer
		&& (bQueueRecoveryMemorySource || bHasQueueRecoveryFriction)
		&& (!DeferredQueueEntryId.IsEmpty()
			|| CachedCoachPanelState.bCanStartQueuedRun
			|| (bQueueRecoveryFollowUp
				&& CachedCoachPanelState.bCanStartCoachFollowUpRun
				&& CachedCoachPanelState.bHasFollowUpGuidance)
			|| (bQueueRecoveryRecommended
				&& CachedCoachPanelState.bCanStartCoachRecommendedRun)
			|| (!bQueueRecoveryMemorySource
				&& (CachedCoachPanelState.bCanStartCoachFollowUpRun
					|| CachedCoachPanelState.bCanStartCoachRecommendedRun)));
	const FString RecoveryLabel = !DisplayedQueueRecoveryActionLabel.IsEmpty()
		? DisplayedQueueRecoveryActionLabel
		: (bClosedLoopIdleDashboard
			? TEXT("No Recovery Action")
			: (!DeferredQueueEntryId.IsEmpty() && !bPreferLaunchRecoveryAction
				? (bQueueRecoveryFollowUp
					? TEXT("Promote Follow-Up Recovery")
					: (bQueueRecoveryRecommended
						? TEXT("Promote Recommended Recovery")
						: TEXT("Promote Recovery")))
				: (bQueueRecoveryFollowUp
					? TEXT("Start Follow-Up Recovery")
					: (bQueueRecoveryRecommended
						? TEXT("Start Recommended Recovery")
						: (CachedCoachPanelState.bCanStartQueuedRun
							? TEXT("Launch Queue Recovery")
							: TEXT("Apply Recovery"))))));

	Surface.DeferLabel = !DisplayedDeferQueueActionLabel.IsEmpty()
		? DisplayedDeferQueueActionLabel
		: TEXT("Defer 24h");
	Surface.PromoteLabel = !DisplayedPromoteQueueActionLabel.IsEmpty()
		? DisplayedPromoteQueueActionLabel
		: TEXT("Promote Deferred");
	Surface.RecoveryLabel = RecoveryLabel;
	Surface.SelectedQueueEntryId =
		SelectedQueueEntry != nullptr && !SelectedQueueEntry->EntryId.IsEmpty()
			? SelectedQueueEntry->EntryId
			: TEXT("none");
	Surface.DeferredQueueEntryId = DeferredQueueEntryId.IsEmpty()
		? TEXT("none")
		: DeferredQueueEntryId;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasSelectedQueueEntry = SelectedQueueEntry != nullptr;
	Surface.bHasDeferredQueueEntry = !DeferredQueueEntryId.IsEmpty();
	Surface.bQueueRecoveryMemorySource = bQueueRecoveryMemorySource;
	Surface.bHasQueueRecoveryFriction = bHasQueueRecoveryFriction;
	Surface.bClosedLoopIdleDashboard = bClosedLoopIdleDashboard;
	Surface.bDeferEnabled = !bHasLiveAttemptTimer && SelectedQueueEntry != nullptr;
	Surface.bPromoteEnabled = !bHasLiveAttemptTimer && !DeferredQueueEntryId.IsEmpty();
	Surface.bRecoveryEnabled = bCanApplyQueueRecovery;
	Surface.StatusLine = FString::Printf(
		TEXT("%s: %s | %s: %s | %s: %s"),
		*Surface.DeferLabel,
		Surface.bDeferEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.PromoteLabel,
		Surface.bPromoteEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.RecoveryLabel,
		Surface.bRecoveryEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("Queue-action detail: selected entry %s | deferred entry %s | live timer %s | recovery-memory-source %s | recovery-friction %s | closed-loop idle %s"),
		*Surface.SelectedQueueEntryId,
		*Surface.DeferredQueueEntryId,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bQueueRecoveryMemorySource ? TEXT("yes") : TEXT("no"),
		Surface.bHasQueueRecoveryFriction ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardExecutionActionControlBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedExecutionActionControlBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardExecutionActionControlBandInspectSurface Surface;
	Surface.Headline = TEXT("Execution action control band");

	const FHyperTwistTrainingCoachDashboardAttemptResultActionEnablementInspectSurface AttemptSurface =
		GetDisplayedAttemptResultActionEnablementInspectSurface();
	const FHyperTwistTrainingCoachDashboardRunControlEnablementInspectSurface RunSurface =
		GetDisplayedRunControlEnablementInspectSurface();
	const FHyperTwistTrainingCoachDashboardQueueActionEnablementInspectSurface QueueSurface =
		GetDisplayedQueueActionEnablementInspectSurface();

	Surface.AttemptResultStatusLine = AttemptSurface.StatusLine.IsEmpty()
		? TEXT("Attempt-result action: unavailable.")
		: AttemptSurface.StatusLine;
	Surface.RunControlStatusLine = RunSurface.StatusLine.IsEmpty()
		? TEXT("Run control: unavailable.")
		: RunSurface.StatusLine;
	Surface.QueueActionStatusLine = QueueSurface.StatusLine.IsEmpty()
		? TEXT("Queue action: unavailable.")
		: QueueSurface.StatusLine;
	Surface.SuccessLabel = AttemptSurface.SuccessLabel.IsEmpty() ? TEXT("Record Success") : AttemptSurface.SuccessLabel;
	Surface.FailureLabel = AttemptSurface.FailureLabel.IsEmpty() ? TEXT("Record Failure") : AttemptSurface.FailureLabel;
	Surface.TimeoutLabel = AttemptSurface.TimeoutLabel.IsEmpty() ? TEXT("Record Timeout") : AttemptSurface.TimeoutLabel;
	Surface.DnfLabel = AttemptSurface.DnfLabel.IsEmpty() ? TEXT("Record DNF") : AttemptSurface.DnfLabel;
	Surface.PrimaryLabel = RunSurface.PrimaryLabel.IsEmpty() ? TEXT("Start Run") : RunSurface.PrimaryLabel;
	Surface.ContinueLabel = RunSurface.ContinueLabel.IsEmpty() ? TEXT("Continue Run") : RunSurface.ContinueLabel;
	Surface.CompleteLabel = RunSurface.CompleteLabel.IsEmpty() ? TEXT("Complete Run") : RunSurface.CompleteLabel;
	Surface.ClearLabel = RunSurface.ClearLabel.IsEmpty() ? TEXT("Clear Run") : RunSurface.ClearLabel;
	Surface.DeferLabel = QueueSurface.DeferLabel.IsEmpty() ? TEXT("Defer 24h") : QueueSurface.DeferLabel;
	Surface.PromoteLabel = QueueSurface.PromoteLabel.IsEmpty() ? TEXT("Promote Deferred") : QueueSurface.PromoteLabel;
	Surface.RecoveryLabel = QueueSurface.RecoveryLabel.IsEmpty() ? TEXT("Apply Recovery") : QueueSurface.RecoveryLabel;
	Surface.SelectedQueueEntryId = QueueSurface.SelectedQueueEntryId.IsEmpty()
		? TEXT("none")
		: QueueSurface.SelectedQueueEntryId;
	Surface.DeferredQueueEntryId = QueueSurface.DeferredQueueEntryId.IsEmpty()
		? TEXT("none")
		: QueueSurface.DeferredQueueEntryId;
	Surface.bHasRunnableCurrentCase = AttemptSurface.bHasRunnableCurrentCase || RunSurface.bHasRunnableCurrentCase;
	Surface.bHasActiveRun = RunSurface.bHasActiveRun;
	Surface.bHasLiveAttemptTimer =
		AttemptSurface.bHasLiveAttemptTimer || RunSurface.bHasLiveAttemptTimer || QueueSurface.bHasLiveAttemptTimer;
	Surface.bLiveSolvePhase = AttemptSurface.bLiveSolvePhase;
	Surface.bLiveInspectionPhase = RunSurface.bLiveInspectionPhase;
	Surface.bHasSelectedQueueEntry = QueueSurface.bHasSelectedQueueEntry;
	Surface.bHasDeferredQueueEntry = QueueSurface.bHasDeferredQueueEntry;
	Surface.bClosedLoopIdleDashboard = QueueSurface.bClosedLoopIdleDashboard;
	Surface.bAnyActionEnabled =
		AttemptSurface.bSuccessEnabled
		|| AttemptSurface.bFailureEnabled
		|| AttemptSurface.bTimeoutEnabled
		|| AttemptSurface.bDnfEnabled
		|| RunSurface.bPrimaryEnabled
		|| RunSurface.bContinueEnabled
		|| RunSurface.bCompleteEnabled
		|| RunSurface.bClearEnabled
		|| QueueSurface.bDeferEnabled
		|| QueueSurface.bPromoteEnabled
		|| QueueSurface.bRecoveryEnabled;
	Surface.StatusLine = FString::Printf(
		TEXT("Execution controls: attempts %s | run %s | queue %s"),
		(AttemptSurface.bSuccessEnabled || AttemptSurface.bFailureEnabled
			|| AttemptSurface.bTimeoutEnabled || AttemptSurface.bDnfEnabled)
			? TEXT("available")
			: TEXT("idle"),
		(RunSurface.bPrimaryEnabled || RunSurface.bContinueEnabled
			|| RunSurface.bCompleteEnabled || RunSurface.bClearEnabled)
			? TEXT("available")
			: TEXT("idle"),
		(QueueSurface.bDeferEnabled || QueueSurface.bPromoteEnabled || QueueSurface.bRecoveryEnabled)
			? TEXT("available")
			: TEXT("idle"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | runnable case %s | active run %s | selected queue %s | deferred queue %s | live timer %s | solve %s | inspection %s | closed-loop idle %s"),
		*Surface.AttemptResultStatusLine,
		*Surface.RunControlStatusLine,
		*Surface.QueueActionStatusLine,
		Surface.bHasRunnableCurrentCase ? TEXT("yes") : TEXT("no"),
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasSelectedQueueEntry ? TEXT("yes") : TEXT("no"),
		Surface.bHasDeferredQueueEntry ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bLiveSolvePhase ? TEXT("yes") : TEXT("no"),
		Surface.bLiveInspectionPhase ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardCurrentCaseTimerBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedCurrentCaseTimerBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardCurrentCaseTimerBandInspectSurface Surface;
	Surface.Headline = TEXT("Current-case timer band");

	const FHyperTwistTrainingCoachDashboardActiveAttemptTimerStatusInspectSurface TimerSurface =
		GetDisplayedActiveAttemptTimerStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardCurrentCaseDeckStatusInspectSurface CaseSurface =
		GetDisplayedCurrentCaseDeckStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardAttemptTimeInputHintInspectSurface InputHintSurface =
		GetDisplayedAttemptTimeInputHintInspectSurface();
	const FHyperTwistTrainingCoachDashboardLiveTimerSplitControlLabelInspectSurface SplitSurface =
		GetDisplayedLiveTimerSplitControlLabelInspectSurface();
	const FHyperTwistTrainingCoachDashboardAttemptReviewNavigationInspectSurface ReviewSurface =
		GetDisplayedAttemptReviewNavigationInspectSurface();

	Surface.AttemptInputLine = TimerSurface.AttemptInputLine.IsEmpty()
		? TEXT("Attempt input: unavailable.")
		: TimerSurface.AttemptInputLine;
	Surface.TimerStatusLine = TimerSurface.TimerStatusLine.IsEmpty()
		? TEXT("Timer status: unavailable.")
		: TimerSurface.TimerStatusLine;
	Surface.CurrentCaseStatusLine = CaseSurface.StatusLine.IsEmpty()
		? TEXT("Current case status: unavailable.")
		: CaseSurface.StatusLine;
	Surface.CurrentCasePromptLine = CaseSurface.PromptLine.IsEmpty()
		? TEXT("Current case prompt: unavailable.")
		: CaseSurface.PromptLine;
	Surface.TimerControlLine = SplitSurface.TimerControlLine.IsEmpty()
		? TEXT("Timer control: unavailable.")
		: SplitSurface.TimerControlLine;
	Surface.SplitControlLine = SplitSurface.SplitControlLine.IsEmpty()
		? TEXT("Split control: unavailable.")
		: SplitSurface.SplitControlLine;
	Surface.AttemptReviewStatusLine = ReviewSurface.StatusLine.IsEmpty()
		? TEXT("Attempt review navigation: unavailable.")
		: ReviewSurface.StatusLine;
	Surface.ActiveDeckLabel = CaseSurface.ActiveDeckLabel.IsEmpty() ? TEXT("n/a") : CaseSurface.ActiveDeckLabel;
	Surface.ActiveCaseId = CaseSurface.ActiveCaseId.IsEmpty() ? TEXT("n/a") : CaseSurface.ActiveCaseId;
	Surface.TimerPhaseLabel = TimerSurface.TimerPhaseLabel.IsEmpty() ? TEXT("idle") : TimerSurface.TimerPhaseLabel;
	Surface.HintLabel = InputHintSurface.HintLabel.IsEmpty() ? TEXT("n/a") : InputHintSurface.HintLabel;
	Surface.AttemptOrdinal = ReviewSurface.AttemptOrdinal.IsEmpty() ? TEXT("none") : ReviewSurface.AttemptOrdinal;
	Surface.TimeTargetMs = CaseSurface.TimeTargetMs > 0 ? CaseSurface.TimeTargetMs : TimerSurface.TargetTimeMs;
	Surface.DisplayedElapsedMs = TimerSurface.DisplayedElapsedMs;
	Surface.TotalAttemptCount = ReviewSurface.TotalAttemptCount;
	Surface.bHasActiveRun = CaseSurface.bHasActiveRun || InputHintSurface.bHasActiveRun;
	Surface.bHasRunnableCurrentCase = CaseSurface.bHasRunnableCurrentCase || InputHintSurface.bHasRunnableCurrentCase || SplitSurface.bHasRunnableCurrentCase;
	Surface.bHasLiveAttemptTimer = TimerSurface.bHasLiveAttemptTimer || InputHintSurface.bHasLiveAttemptTimer || SplitSurface.bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = TimerSurface.bLiveInspectionPhase || SplitSurface.bLiveInspectionPhase;
	Surface.bLiveSolvePhase = TimerSurface.bLiveSolvePhase || SplitSurface.bLiveSolvePhase;
	Surface.bAttemptInputEnabled = InputHintSurface.bAttemptInputEnabled;
	Surface.bCanStartOrAdvanceTimer = SplitSurface.bCanStartOrAdvanceTimer;
	Surface.bCanCaptureSplit = SplitSurface.bCanCaptureSplit;
	Surface.bCanSelectPreviousAttempt = ReviewSurface.bCanSelectPreviousAttempt;
	Surface.bCanSelectNextAttempt = ReviewSurface.bCanSelectNextAttempt;
	Surface.bClosedLoopIdleDashboard = CaseSurface.bClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Current-case timer band: deck %s | case %s | phase %s | input %s | timer %s | split %s"),
		*Surface.ActiveDeckLabel,
		*Surface.ActiveCaseId,
		*Surface.TimerPhaseLabel,
		Surface.bAttemptInputEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bCanStartOrAdvanceTimer ? TEXT("enabled") : TEXT("disabled"),
		Surface.bCanCaptureSplit ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | %s | %s | target %d | elapsed %d | attempts %s | live timer %s | closed-loop idle %s"),
		*Surface.AttemptInputLine,
		*Surface.TimerStatusLine,
		*Surface.CurrentCaseStatusLine,
		*Surface.CurrentCasePromptLine,
		*Surface.TimerControlLine,
		*Surface.AttemptReviewStatusLine,
		Surface.TimeTargetMs,
		Surface.DisplayedElapsedMs,
		*Surface.AttemptOrdinal,
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardVerificationActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedVerificationActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardVerificationActionInspectSurface Surface;
	Surface.Headline = TEXT("Verification action");

	Surface.VerifyLabel = !DisplayedVerificationActionLabel.IsEmpty()
		? DisplayedVerificationActionLabel
		: TEXT("Verify");
	Surface.RepositoryPath = CachedRepositoryRoundTripVerification.ResolvedPath.IsEmpty()
		? TEXT("not yet verified")
		: CachedRepositoryRoundTripVerification.ResolvedPath;
	Surface.LatestNote = CachedRepositoryRoundTripVerification.VerificationNotes.Num() > 0
		? CachedRepositoryRoundTripVerification.VerificationNotes[0]
		: TEXT("none");
	Surface.bVerifyEnabled = true;
	Surface.bHasResolvedPath = !CachedRepositoryRoundTripVerification.ResolvedPath.IsEmpty();
	Surface.bDidRoundTripPass = CachedRepositoryRoundTripVerification.bDidRoundTripPass;
	Surface.bSaveSucceeded = CachedRepositoryRoundTripVerification.bSaveSucceeded;
	Surface.bLoadSucceeded = CachedRepositoryRoundTripVerification.bLoadSucceeded;
	Surface.bCountsMatched = CachedRepositoryRoundTripVerification.bRepositoryCountsMatch;
	Surface.bStateMatched = CachedRepositoryRoundTripVerification.bSerializedStateMatch;
	Surface.bIntegrityMatched = CachedRepositoryRoundTripVerification.bIntegrityReportMatch;
	Surface.bDerivedMatched = CachedRepositoryRoundTripVerification.bDerivedStateMatch;
	Surface.StatusLine = CachedCoachPanelState.VerificationStatusLine.IsEmpty()
		? FString::Printf(
			TEXT("%s: %s"),
			*Surface.VerifyLabel,
			Surface.bDidRoundTripPass ? TEXT("last round-trip passed") : TEXT("ready to run repository round-trip verification"))
		: CachedCoachPanelState.VerificationStatusLine;
	Surface.DetailLine = FString::Printf(
		TEXT("Verification detail: label %s | enabled %s | path %s | save %s | load %s | counts %s | state %s | integrity %s | derived %s | note %s"),
		*Surface.VerifyLabel,
		Surface.bVerifyEnabled ? TEXT("yes") : TEXT("no"),
		*Surface.RepositoryPath,
		Surface.bSaveSucceeded ? TEXT("yes") : TEXT("no"),
		Surface.bLoadSucceeded ? TEXT("yes") : TEXT("no"),
		Surface.bCountsMatched ? TEXT("yes") : TEXT("no"),
		Surface.bStateMatched ? TEXT("yes") : TEXT("no"),
		Surface.bIntegrityMatched ? TEXT("yes") : TEXT("no"),
		Surface.bDerivedMatched ? TEXT("yes") : TEXT("no"),
		*Surface.LatestNote);
	return Surface;
}

FHyperTwistTrainingCoachDashboardRepositoryVerificationStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRepositoryVerificationStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRepositoryVerificationStatusInspectSurface Surface;
	Surface.Headline = TEXT("Repository verification status");

	const FString VerificationNotePreview = CachedRepositoryRoundTripVerification.VerificationNotes.Num() > 0
		? CachedRepositoryRoundTripVerification.VerificationNotes[0]
		: TEXT("none");
	Surface.RepositoryPath = CachedRepositoryRoundTripVerification.ResolvedPath.IsEmpty()
		? TEXT("not yet verified")
		: CachedRepositoryRoundTripVerification.ResolvedPath;
	Surface.LatestNote = VerificationNotePreview;
	Surface.GeneratedLaunchRequestDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildDisplayedGeneratedLaunchRequestDetail(
			CachedCoachPanelState);
	Surface.GeneratedExecutionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildDisplayedGeneratedExecutionDetail(
			CachedCoachPanelState);
	Surface.StatusLine = !DisplayedVerificationStatusLine.IsEmpty()
		? DisplayedVerificationStatusLine
		: (CachedCoachPanelState.VerificationStatusLine.IsEmpty()
			? TEXT("Repository verification status: not yet populated.")
			: CachedCoachPanelState.VerificationStatusLine);
	Surface.DetailLine = !DisplayedVerificationDetailLine.IsEmpty()
		? DisplayedVerificationDetailLine
		: HyperTwistCoachDashboardWidgetInternal::BuildDisplayedRepositoryVerificationDetailLine(
			CachedRepositoryRoundTripVerification,
			VerificationNotePreview,
			CachedCoachPanelState);
	Surface.bHasResolvedPath = !CachedRepositoryRoundTripVerification.ResolvedPath.IsEmpty();
	Surface.bDidRoundTripPass = CachedRepositoryRoundTripVerification.bDidRoundTripPass;
	Surface.bSaveSucceeded = CachedRepositoryRoundTripVerification.bSaveSucceeded;
	Surface.bLoadSucceeded = CachedRepositoryRoundTripVerification.bLoadSucceeded;
	Surface.bCountsMatched = CachedRepositoryRoundTripVerification.bRepositoryCountsMatch;
	Surface.bStateMatched = CachedRepositoryRoundTripVerification.bSerializedStateMatch;
	Surface.bIntegrityMatched = CachedRepositoryRoundTripVerification.bIntegrityReportMatch;
	Surface.bDerivedMatched = CachedRepositoryRoundTripVerification.bDerivedStateMatch;
	Surface.bHasGeneratedLaunchRequest = CachedCoachPanelState.bHasLatestGeneratedModeLaunchRequest;
	Surface.bHasGeneratedExecutionTarget = CachedCoachPanelState.bHasActiveGeneratedModeExecutionTarget;
	Surface.bCanExecuteGeneratedLaunchRequest =
		CachedCoachPanelState.bCanExecuteActiveGeneratedModeLaunchRequest;
	Surface.bGeneratedExecutionWillRefreshRequest =
		CachedCoachPanelState.bActiveGeneratedModeExecutionWillRefreshLaunchRequest;
	return Surface;
}

FHyperTwistTrainingCoachDashboardRecognitionStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedRecognitionStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardRecognitionStatusInspectSurface Surface;
	Surface.Headline = TEXT("Recognition status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	Surface.StatusLine = !DisplayedRecognitionStatusLine.IsEmpty()
		? DisplayedRecognitionStatusLine
		: (CachedCoachPanelState.RecognitionStatusLine.IsEmpty()
			? TEXT("Recognition status: not yet populated.")
			: CachedCoachPanelState.RecognitionStatusLine);
	Surface.DetailLine = !DisplayedRecognitionDetailLine.IsEmpty()
		? DisplayedRecognitionDetailLine
		: CachedCoachPanelState.RecognitionDetailLine;
	Surface.RunModeLabel = bHasActiveRun
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.Mode)
		: TEXT("n/a");
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasRecognitionStatus = !CachedCoachPanelState.RecognitionStatusLine.IsEmpty();
	Surface.bHasRecognitionDetail = !CachedCoachPanelState.RecognitionDetailLine.IsEmpty();
	return Surface;
}

FHyperTwistTrainingCoachDashboardReviewPolicyStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedReviewPolicyStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardReviewPolicyStatusInspectSurface Surface;
	Surface.Headline = TEXT("Review-policy status");

	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasRunnableCurrentCase =
		bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	Surface.StatusLine = !DisplayedReviewPolicyStatusLine.IsEmpty()
		? DisplayedReviewPolicyStatusLine
		: (CachedCoachPanelState.ReviewPolicyStatusLine.IsEmpty()
			? TEXT("Review-policy status: not yet populated.")
			: CachedCoachPanelState.ReviewPolicyStatusLine);
	Surface.DetailLine = !DisplayedReviewPolicyDetailLine.IsEmpty()
		? DisplayedReviewPolicyDetailLine
		: CachedCoachPanelState.ReviewPolicyDetailLine;
	Surface.RunModeLabel = bHasActiveRun
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.Mode)
		: TEXT("n/a");
	Surface.bHasActiveRun = bHasActiveRun;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bHasRunnableCurrentCase = bHasRunnableCurrentCase;
	Surface.bHasReviewPolicyStatus = !CachedCoachPanelState.ReviewPolicyStatusLine.IsEmpty();
	Surface.bHasReviewPolicyDetail = !CachedCoachPanelState.ReviewPolicyDetailLine.IsEmpty();
	return Surface;
}

FHyperTwistTrainingCoachDashboardVerificationRecognitionPolicyBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedVerificationRecognitionPolicyBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardVerificationRecognitionPolicyBandInspectSurface Surface;
	Surface.Headline = TEXT("Verification / recognition / review-policy band");

	const FHyperTwistTrainingCoachDashboardVerificationActionInspectSurface VerificationActionSurface =
		GetDisplayedVerificationActionInspectSurface();
	const FHyperTwistTrainingCoachDashboardRepositoryVerificationStatusInspectSurface RepositorySurface =
		GetDisplayedRepositoryVerificationStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardRecognitionStatusInspectSurface RecognitionSurface =
		GetDisplayedRecognitionStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardReviewPolicyStatusInspectSurface ReviewPolicySurface =
		GetDisplayedReviewPolicyStatusInspectSurface();

	Surface.VerificationActionStatusLine = VerificationActionSurface.StatusLine.IsEmpty()
		? TEXT("Verification action: unavailable.")
		: VerificationActionSurface.StatusLine;
	Surface.RepositoryVerificationStatusLine = RepositorySurface.StatusLine.IsEmpty()
		? TEXT("Repository verification status: unavailable.")
		: RepositorySurface.StatusLine;
	Surface.RecognitionStatusLine = RecognitionSurface.StatusLine.IsEmpty()
		? TEXT("Recognition status: unavailable.")
		: RecognitionSurface.StatusLine;
	Surface.ReviewPolicyStatusLine = ReviewPolicySurface.StatusLine.IsEmpty()
		? TEXT("Review-policy status: unavailable.")
		: ReviewPolicySurface.StatusLine;
	Surface.VerifyLabel = VerificationActionSurface.VerifyLabel.IsEmpty()
		? TEXT("Verify")
		: VerificationActionSurface.VerifyLabel;
	Surface.RepositoryPath = !RepositorySurface.RepositoryPath.IsEmpty()
		? RepositorySurface.RepositoryPath
		: (VerificationActionSurface.RepositoryPath.IsEmpty()
			? TEXT("not yet verified")
			: VerificationActionSurface.RepositoryPath);
	Surface.LatestVerificationNote = !RepositorySurface.LatestNote.IsEmpty()
		? RepositorySurface.LatestNote
		: (VerificationActionSurface.LatestNote.IsEmpty()
			? TEXT("none")
			: VerificationActionSurface.LatestNote);
	Surface.GeneratedLaunchRequestDetail = RepositorySurface.GeneratedLaunchRequestDetail.IsEmpty()
		? TEXT("n/a")
		: RepositorySurface.GeneratedLaunchRequestDetail;
	Surface.GeneratedExecutionDetail = RepositorySurface.GeneratedExecutionDetail.IsEmpty()
		? TEXT("n/a")
		: RepositorySurface.GeneratedExecutionDetail;
	Surface.RecognitionRunModeLabel = RecognitionSurface.RunModeLabel.IsEmpty()
		? TEXT("n/a")
		: RecognitionSurface.RunModeLabel;
	Surface.ReviewPolicyRunModeLabel = ReviewPolicySurface.RunModeLabel.IsEmpty()
		? TEXT("n/a")
		: ReviewPolicySurface.RunModeLabel;
	Surface.bVerifyEnabled = VerificationActionSurface.bVerifyEnabled;
	Surface.bHasResolvedPath = RepositorySurface.bHasResolvedPath || VerificationActionSurface.bHasResolvedPath;
	Surface.bDidRoundTripPass = RepositorySurface.bDidRoundTripPass || VerificationActionSurface.bDidRoundTripPass;
	Surface.bSaveSucceeded = RepositorySurface.bSaveSucceeded || VerificationActionSurface.bSaveSucceeded;
	Surface.bLoadSucceeded = RepositorySurface.bLoadSucceeded || VerificationActionSurface.bLoadSucceeded;
	Surface.bCountsMatched = RepositorySurface.bCountsMatched || VerificationActionSurface.bCountsMatched;
	Surface.bStateMatched = RepositorySurface.bStateMatched || VerificationActionSurface.bStateMatched;
	Surface.bIntegrityMatched = RepositorySurface.bIntegrityMatched || VerificationActionSurface.bIntegrityMatched;
	Surface.bDerivedMatched = RepositorySurface.bDerivedMatched || VerificationActionSurface.bDerivedMatched;
	Surface.bHasGeneratedLaunchRequest = RepositorySurface.bHasGeneratedLaunchRequest;
	Surface.bHasGeneratedExecutionTarget = RepositorySurface.bHasGeneratedExecutionTarget;
	Surface.bCanExecuteGeneratedLaunchRequest = RepositorySurface.bCanExecuteGeneratedLaunchRequest;
	Surface.bGeneratedExecutionWillRefreshRequest = RepositorySurface.bGeneratedExecutionWillRefreshRequest;
	Surface.bHasActiveRun = RecognitionSurface.bHasActiveRun || ReviewPolicySurface.bHasActiveRun;
	Surface.bHasLiveAttemptTimer =
		RecognitionSurface.bHasLiveAttemptTimer || ReviewPolicySurface.bHasLiveAttemptTimer;
	Surface.bHasRunnableCurrentCase = ReviewPolicySurface.bHasRunnableCurrentCase;
	Surface.bHasRecognitionStatus = RecognitionSurface.bHasRecognitionStatus;
	Surface.bHasRecognitionDetail = RecognitionSurface.bHasRecognitionDetail;
	Surface.bHasReviewPolicyStatus = ReviewPolicySurface.bHasReviewPolicyStatus;
	Surface.bHasReviewPolicyDetail = ReviewPolicySurface.bHasReviewPolicyDetail;
	Surface.StatusLine = FString::Printf(
		TEXT("Status band: verify %s | repository %s | recognition %s | review policy %s"),
		Surface.bVerifyEnabled ? TEXT("ready") : TEXT("idle"),
		Surface.bDidRoundTripPass ? TEXT("passed") : TEXT("pending"),
		Surface.bHasRecognitionStatus ? TEXT("ready") : TEXT("pending"),
		Surface.bHasReviewPolicyStatus ? TEXT("ready") : TEXT("pending"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | path %s | note %s | recognition mode %s | review mode %s | active run %s | live timer %s | runnable case %s"),
		*Surface.VerificationActionStatusLine,
		*Surface.RepositoryVerificationStatusLine,
		*Surface.RecognitionStatusLine,
		*Surface.ReviewPolicyStatusLine,
		*Surface.RepositoryPath,
		*Surface.LatestVerificationNote,
		*Surface.RecognitionRunModeLabel,
		*Surface.ReviewPolicyRunModeLabel,
		Surface.bHasActiveRun ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"),
		Surface.bHasRunnableCurrentCase ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardSelectedQueueNavigationInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedSelectedQueueNavigationInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardSelectedQueueNavigationInspectSurface Surface;
	Surface.Headline = TEXT("Selected-queue navigation");

	const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
	const bool bNavigationEnabled =
		!bHasLiveAttemptTimer && CachedCoachSessionQueueState.Entries.Num() > 1;

	Surface.PreviousLabel = !DisplayedPreviousQueueNavigationLabel.IsEmpty()
		? DisplayedPreviousQueueNavigationLabel
		: TEXT("Prev Queue");
	Surface.NextLabel = !DisplayedNextQueueNavigationLabel.IsEmpty()
		? DisplayedNextQueueNavigationLabel
		: TEXT("Next Queue");
	Surface.SelectedQueueEntryId =
		SelectedEntry != nullptr && !SelectedEntry->EntryId.IsEmpty()
			? SelectedEntry->EntryId
			: TEXT("none");
	Surface.SelectedQueueSourceLabel =
		SelectedEntry != nullptr && !SelectedEntry->SourceLabel.IsEmpty()
			? SelectedEntry->SourceLabel
			: TEXT("n/a");
	Surface.SelectedQueueStateLabel =
		SelectedEntry != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->EntryState)
			: TEXT("n/a");
	Surface.SelectedQueueOrdinal =
		SelectedEntry != nullptr
			? FString::Printf(
				TEXT("%d/%d"),
				SelectedQueueEntryIndex + 1,
				CachedCoachSessionQueueState.Entries.Num())
			: TEXT("none");
	Surface.SelectedQueueEntryIndex = SelectedQueueEntryIndex;
	Surface.TotalQueueEntries = CachedCoachSessionQueueState.Entries.Num();
	Surface.bHasSelectedQueueEntry = SelectedEntry != nullptr;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bSelectedEntryMatchesActiveQueue =
		SelectedEntry != nullptr
		&& SelectedEntry->EntryId == CachedCoachPanelState.ActiveQueueEntryId;
	Surface.bPreviousEnabled = bNavigationEnabled;
	Surface.bNextEnabled = bNavigationEnabled;
	Surface.StatusLine =
		SelectedEntry != nullptr
			? FString::Printf(
				TEXT("Selected queue item %d/%d | Source: %s | State: %s | Priority: %s (%.1f)"),
				SelectedQueueEntryIndex + 1,
				CachedCoachSessionQueueState.Entries.Num(),
				*Surface.SelectedQueueSourceLabel,
				*Surface.SelectedQueueStateLabel,
				SelectedEntry->PriorityLabel.IsEmpty() ? TEXT("n/a") : *SelectedEntry->PriorityLabel,
				SelectedEntry->PriorityScore)
			: TEXT("Selected queue item: none");
	Surface.DetailLine = FString::Printf(
		TEXT("%s: %s | %s: %s | active selection: %s | live timer: %s"),
		*Surface.PreviousLabel,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		*Surface.NextLabel,
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bSelectedEntryMatchesActiveQueue ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardStartSelectedQueueActionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedStartSelectedQueueActionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardStartSelectedQueueActionInspectSurface Surface;
	Surface.Headline = TEXT("Start-selected queue action");

	const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
	const bool bSelectedEntryReady =
		SelectedEntry != nullptr
		&& SelectedEntry->EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Ready;
	const bool bSelectedEntryPendingImmediate =
		SelectedEntry != nullptr
		&& SelectedEntry->EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Pending
		&& SelectedEntry->bCanStartImmediately;

	Surface.StartSelectedLabel = !DisplayedStartSelectedQueueActionLabel.IsEmpty()
		? DisplayedStartSelectedQueueActionLabel
		: TEXT("Start Selected");
	Surface.SelectedQueueEntryId =
		SelectedEntry != nullptr && !SelectedEntry->EntryId.IsEmpty()
			? SelectedEntry->EntryId
			: TEXT("none");
	Surface.SelectedQueueStateLabel =
		SelectedEntry != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->EntryState)
			: TEXT("n/a");
	Surface.SelectedQueueSourceLabel =
		SelectedEntry != nullptr && !SelectedEntry->SourceLabel.IsEmpty()
			? SelectedEntry->SourceLabel
			: TEXT("n/a");
	Surface.SelectedQueuePrimaryActionLabel =
		SelectedEntry != nullptr && !SelectedEntry->PrimaryActionLabel.IsEmpty()
			? SelectedEntry->PrimaryActionLabel
			: TEXT("n/a");
	Surface.bHasSelectedQueueEntry = SelectedEntry != nullptr;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bSelectedEntryReady = bSelectedEntryReady;
	Surface.bSelectedEntryPendingStartImmediate = bSelectedEntryPendingImmediate;
	Surface.bStartSelectedEnabled =
		!bHasLiveAttemptTimer && (bSelectedEntryReady || bSelectedEntryPendingImmediate);
	Surface.StatusLine =
		SelectedEntry != nullptr
			? FString::Printf(
				TEXT("%s: %s | entry %s | state %s"),
				*Surface.StartSelectedLabel,
				Surface.bStartSelectedEnabled ? TEXT("enabled") : TEXT("disabled"),
				*Surface.SelectedQueueEntryId,
				*Surface.SelectedQueueStateLabel)
			: FString::Printf(
				TEXT("%s: disabled | no queue entry selected"),
				*Surface.StartSelectedLabel);
	Surface.DetailLine = FString::Printf(
		TEXT("Start-selected detail: source %s | action %s | ready %s | pending-immediate %s | live timer %s"),
		*Surface.SelectedQueueSourceLabel,
		*Surface.SelectedQueuePrimaryActionLabel,
		Surface.bSelectedEntryReady ? TEXT("yes") : TEXT("no"),
		Surface.bSelectedEntryPendingStartImmediate ? TEXT("yes") : TEXT("no"),
		Surface.bHasLiveAttemptTimer ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueCountsStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueCountsStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueCountsStatusInspectSurface Surface;
	Surface.Headline = TEXT("Queue counts / status");

	Surface.QueueId = CachedCoachSessionQueueState.QueueId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSessionQueueState.QueueId;
	Surface.ActiveQueueEntryId = CachedCoachPanelState.ActiveQueueEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachPanelState.ActiveQueueEntryId;
	Surface.NextQueueSourceLabel = CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
		? TEXT("n/a")
		: CachedCoachPanelState.NextQueueSourceLabel;
	Surface.SignalCount = CachedCoachPanelState.SignalCount;
	Surface.TotalEntryCount = CachedCoachSessionQueueState.TotalEntryCount;
	Surface.PendingEntryCount = CachedCoachSessionQueueState.PendingEntryCount;
	Surface.ReadyEntryCount = CachedCoachSessionQueueState.ReadyEntryCount;
	Surface.DeferredEntryCount = CachedCoachSessionQueueState.DeferredEntryCount;
	Surface.InProgressEntryCount = CachedCoachSessionQueueState.InProgressEntryCount;
	Surface.CompletedEntryCount = CachedCoachSessionQueueState.CompletedEntryCount;
	Surface.QueuedEventCount = CachedCoachQueueExecutionSummary.QueuedEventCount;
	Surface.StartedEventCount = CachedCoachQueueExecutionSummary.StartedEventCount;
	Surface.CompletedEventCount = CachedCoachQueueExecutionSummary.CompletedEventCount;
	Surface.DeferredEventCount = CachedCoachQueueExecutionSummary.DeferredEventCount;
	Surface.PromotedEventCount = CachedCoachQueueExecutionSummary.PromotedEventCount;
	Surface.ManualRescheduleEventCount = CachedCoachQueueExecutionSummary.ManualRescheduleEventCount;
	Surface.bHasOutstandingDeferredWork = CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork;
	Surface.bHasCompletionGap = CachedCoachQueueExecutionSummary.bHasCompletionGap;
	Surface.bHasArchiveAwareFriction = CachedCoachQueueExecutionSummary.bHasArchiveAwareFriction;
	Surface.bHasBlockedFollowUpFriction = CachedCoachQueueExecutionSummary.bHasBlockedFollowUpFriction;
	Surface.StatusLine = !DisplayedQueueStatusLine.IsEmpty()
		? DisplayedQueueStatusLine
		: CachedCoachPanelState.QueueStatusLine;
	Surface.CountsLine = !DisplayedQueueCountsLine.IsEmpty()
		? DisplayedQueueCountsLine
		: FString::Printf(
			TEXT("Signals: %d | Ready: %d | Deferred: %d | In-progress: %d | Completed: %d"),
			Surface.SignalCount,
			Surface.ReadyEntryCount,
			Surface.DeferredEntryCount,
			Surface.InProgressEntryCount,
			Surface.CompletedEntryCount);
	Surface.ExecutionLine = !DisplayedQueueExecutionLine.IsEmpty()
		? DisplayedQueueExecutionLine
		: FString::Printf(
			TEXT("Execution: queued %d | started %d | completed %d | deferred %d | promoted %d | manual reschedules %d | outstanding deferred: %s | completion gap: %s | archive-aware friction: %s | blocked follow-up friction: %s"),
			Surface.QueuedEventCount,
			Surface.StartedEventCount,
			Surface.CompletedEventCount,
			Surface.DeferredEventCount,
			Surface.PromotedEventCount,
			Surface.ManualRescheduleEventCount,
			Surface.bHasOutstandingDeferredWork ? TEXT("yes") : TEXT("no"),
			Surface.bHasCompletionGap ? TEXT("yes") : TEXT("no"),
			Surface.bHasArchiveAwareFriction ? TEXT("yes") : TEXT("no"),
			Surface.bHasBlockedFollowUpFriction ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardSelectedQueueSummaryInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedSelectedQueueSummaryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardSelectedQueueSummaryInspectSurface Surface;
	Surface.Headline = TEXT("Selected queue summary");

	const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
	Surface.SelectedQueueEntryId =
		SelectedEntry != nullptr && !SelectedEntry->EntryId.IsEmpty()
			? SelectedEntry->EntryId
			: TEXT("none");
	Surface.SelectedQueueSourceLabel =
		SelectedEntry != nullptr && !SelectedEntry->SourceLabel.IsEmpty()
			? SelectedEntry->SourceLabel
			: TEXT("n/a");
	Surface.SelectedQueueStateLabel =
		SelectedEntry != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->EntryState)
			: TEXT("n/a");
	Surface.SelectedQueuePriorityLabel =
		SelectedEntry != nullptr && !SelectedEntry->PriorityLabel.IsEmpty()
			? SelectedEntry->PriorityLabel
			: TEXT("n/a");
	Surface.SelectedQueueOrdinal =
		SelectedEntry != nullptr
			? FString::Printf(
				TEXT("%d/%d"),
				SelectedQueueEntryIndex + 1,
				CachedCoachSessionQueueState.Entries.Num())
			: TEXT("none");
	Surface.SelectedQueuePriorityScore =
		SelectedEntry != nullptr ? SelectedEntry->PriorityScore : 0.0f;
	Surface.SelectedQueueEntryIndex = SelectedQueueEntryIndex;
	Surface.TotalQueueEntries = CachedCoachSessionQueueState.Entries.Num();
	Surface.bHasSelectedQueueEntry = SelectedEntry != nullptr;
	Surface.bSelectedEntryMatchesActiveQueue =
		SelectedEntry != nullptr
		&& SelectedEntry->EntryId == CachedCoachPanelState.ActiveQueueEntryId;
	Surface.StatusLine = !DisplayedSelectedQueueSummaryLine.IsEmpty()
		? DisplayedSelectedQueueSummaryLine
		: (SelectedEntry != nullptr
			? FString::Printf(
				TEXT("Selected queue item %d/%d | Source: %s | State: %s | Priority: %s (%.1f)"),
				SelectedQueueEntryIndex + 1,
				CachedCoachSessionQueueState.Entries.Num(),
				*Surface.SelectedQueueSourceLabel,
				*Surface.SelectedQueueStateLabel,
				*Surface.SelectedQueuePriorityLabel,
				Surface.SelectedQueuePriorityScore)
			: TEXT("Selected queue item: none"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardSelectedQueueEntryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedSelectedQueueEntryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardSelectedQueueEntryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Selected queue-entry detail");

	const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
	Surface.SelectedQueueEntryId =
		SelectedEntry != nullptr && !SelectedEntry->EntryId.IsEmpty()
			? SelectedEntry->EntryId
			: TEXT("none");
	Surface.EntryHeadline =
		SelectedEntry != nullptr && !SelectedEntry->Headline.IsEmpty()
			? SelectedEntry->Headline
			: TEXT("n/a");
	Surface.FocusDeckId =
		SelectedEntry != nullptr && !SelectedEntry->FocusDeckId.IsEmpty()
			? SelectedEntry->FocusDeckId
			: TEXT("n/a");
	Surface.FocusMethodSegmentId =
		SelectedEntry != nullptr && !SelectedEntry->FocusMethodSegmentId.IsEmpty()
			? SelectedEntry->FocusMethodSegmentId
			: TEXT("n/a");
	Surface.SuggestedModeLabel =
		SelectedEntry != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->SuggestedMode)
			: TEXT("n/a");
	Surface.SuggestedSelectionPolicyLabel =
		SelectedEntry != nullptr
			? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedEntry->SuggestedSelectionPolicy)
			: TEXT("n/a");
	Surface.DeferredUntilUtc =
		SelectedEntry != nullptr && !SelectedEntry->DeferredUntilUtc.IsEmpty()
			? SelectedEntry->DeferredUntilUtc
			: TEXT("n/a");
	Surface.DeferralReasonLabel =
		SelectedEntry != nullptr && !SelectedEntry->DeferralReasonLabel.IsEmpty()
			? SelectedEntry->DeferralReasonLabel
			: TEXT("n/a");
	Surface.FocusCaseCount = SelectedEntry != nullptr ? SelectedEntry->FocusCaseIds.Num() : 0;
	Surface.bHasSelectedQueueEntry = SelectedEntry != nullptr;
	Surface.bRequiresFollowUp = SelectedEntry != nullptr && SelectedEntry->bRequiresFollowUp;
	Surface.bRequiresArchiveRetentionTuning =
		SelectedEntry != nullptr && SelectedEntry->bRequiresArchiveRetentionTuning;
	Surface.bPinned = SelectedEntry != nullptr && SelectedEntry->bPinned;
	Surface.bCanStartImmediately = SelectedEntry != nullptr && SelectedEntry->bCanStartImmediately;
	Surface.DetailLine = !DisplayedSelectedQueueEntryDetailLine.IsEmpty()
		? DisplayedSelectedQueueEntryDetailLine
		: (SelectedEntry != nullptr
			? FString::Printf(
				TEXT("Headline: %s | Deck: %s | Method: %s | Cases: %d | Mode: %s | Policy: %s | Deferred until: %s | Reason: %s | Follow-up: %s | Archive tune: %s | Pinned: %s"),
				*Surface.EntryHeadline,
				*Surface.FocusDeckId,
				*Surface.FocusMethodSegmentId,
				Surface.FocusCaseCount,
				*Surface.SuggestedModeLabel,
				*Surface.SuggestedSelectionPolicyLabel,
				*Surface.DeferredUntilUtc,
				*Surface.DeferralReasonLabel,
				Surface.bRequiresFollowUp ? TEXT("yes") : TEXT("no"),
				Surface.bRequiresArchiveRetentionTuning ? TEXT("yes") : TEXT("no"),
				Surface.bPinned ? TEXT("yes") : TEXT("no"))
			: TEXT("Queue entry detail: no queue entry selected"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardSelectedQueueBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedSelectedQueueBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardSelectedQueueBandInspectSurface Surface;
	Surface.Headline = TEXT("Selected-queue band");

	const FHyperTwistTrainingCoachDashboardSelectedQueueNavigationInspectSurface NavigationSurface =
		GetDisplayedSelectedQueueNavigationInspectSurface();
	const FHyperTwistTrainingCoachDashboardStartSelectedQueueActionInspectSurface StartSurface =
		GetDisplayedStartSelectedQueueActionInspectSurface();
	const FHyperTwistTrainingCoachDashboardSelectedQueueSummaryInspectSurface SummarySurface =
		GetDisplayedSelectedQueueSummaryInspectSurface();
	const FHyperTwistTrainingCoachDashboardSelectedQueueEntryDetailInspectSurface DetailSurface =
		GetDisplayedSelectedQueueEntryDetailInspectSurface();

	Surface.NavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Selected-queue navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.SummaryStatusLine = SummarySurface.StatusLine.IsEmpty()
		? TEXT("Selected queue summary: unavailable.")
		: SummarySurface.StatusLine;
	Surface.EntryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Selected queue detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.StartSelectedStatusLine = StartSurface.StatusLine.IsEmpty()
		? TEXT("Start selected action: unavailable.")
		: StartSurface.StatusLine;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Queue") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Queue") : NavigationSurface.NextLabel;
	Surface.StartSelectedLabel = StartSurface.StartSelectedLabel.IsEmpty()
		? TEXT("Start Selected")
		: StartSurface.StartSelectedLabel;
	Surface.SelectedQueueEntryId = !SummarySurface.SelectedQueueEntryId.IsEmpty()
		? SummarySurface.SelectedQueueEntryId
		: (DetailSurface.SelectedQueueEntryId.IsEmpty() ? TEXT("none") : DetailSurface.SelectedQueueEntryId);
	Surface.SelectedQueueSourceLabel = !SummarySurface.SelectedQueueSourceLabel.IsEmpty()
		? SummarySurface.SelectedQueueSourceLabel
		: (NavigationSurface.SelectedQueueSourceLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.SelectedQueueSourceLabel);
	Surface.SelectedQueueStateLabel = !SummarySurface.SelectedQueueStateLabel.IsEmpty()
		? SummarySurface.SelectedQueueStateLabel
		: (NavigationSurface.SelectedQueueStateLabel.IsEmpty()
			? TEXT("n/a")
			: NavigationSurface.SelectedQueueStateLabel);
	Surface.SelectedQueuePriorityLabel = SummarySurface.SelectedQueuePriorityLabel.IsEmpty()
		? TEXT("n/a")
		: SummarySurface.SelectedQueuePriorityLabel;
	Surface.SelectedQueueOrdinal = !SummarySurface.SelectedQueueOrdinal.IsEmpty()
		? SummarySurface.SelectedQueueOrdinal
		: (NavigationSurface.SelectedQueueOrdinal.IsEmpty()
			? TEXT("none")
			: NavigationSurface.SelectedQueueOrdinal);
	Surface.EntryHeadline = DetailSurface.EntryHeadline.IsEmpty() ? TEXT("n/a") : DetailSurface.EntryHeadline;
	Surface.FocusDeckId = DetailSurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : DetailSurface.FocusDeckId;
	Surface.FocusMethodSegmentId = DetailSurface.FocusMethodSegmentId.IsEmpty()
		? TEXT("n/a")
		: DetailSurface.FocusMethodSegmentId;
	Surface.SelectedQueuePriorityScore = SummarySurface.SelectedQueuePriorityScore;
	Surface.SelectedQueueEntryIndex = SummarySurface.SelectedQueueEntryIndex;
	Surface.TotalQueueEntries = SummarySurface.TotalQueueEntries;
	Surface.FocusCaseCount = DetailSurface.FocusCaseCount;
	Surface.bHasSelectedQueueEntry =
		NavigationSurface.bHasSelectedQueueEntry
		|| SummarySurface.bHasSelectedQueueEntry
		|| DetailSurface.bHasSelectedQueueEntry
		|| StartSurface.bHasSelectedQueueEntry;
	Surface.bHasLiveAttemptTimer = NavigationSurface.bHasLiveAttemptTimer || StartSurface.bHasLiveAttemptTimer;
	Surface.bSelectedEntryMatchesActiveQueue = SummarySurface.bSelectedEntryMatchesActiveQueue;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.bSelectedEntryReady = StartSurface.bSelectedEntryReady;
	Surface.bSelectedEntryPendingStartImmediate = StartSurface.bSelectedEntryPendingStartImmediate;
	Surface.bStartSelectedEnabled = StartSurface.bStartSelectedEnabled;
	Surface.bRequiresFollowUp = DetailSurface.bRequiresFollowUp;
	Surface.bRequiresArchiveRetentionTuning = DetailSurface.bRequiresArchiveRetentionTuning;
	Surface.bPinned = DetailSurface.bPinned;
	Surface.bCanStartImmediately = DetailSurface.bCanStartImmediately;
	Surface.StatusLine = FString::Printf(
		TEXT("Selected queue band: %s | %s | Start: %s (%s)"),
		*Surface.SelectedQueueOrdinal,
		*Surface.SelectedQueueStateLabel,
		*Surface.StartSelectedLabel,
		Surface.bStartSelectedEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | entry %s | source %s | priority %s (%.1f) | focus deck %s | method %s | cases %d | active queue match %s | prev %s | next %s | pinned %s | immediate %s"),
		*Surface.NavigationStatusLine,
		*Surface.SummaryStatusLine,
		*Surface.StartSelectedStatusLine,
		*Surface.SelectedQueueEntryId,
		*Surface.SelectedQueueSourceLabel,
		*Surface.SelectedQueuePriorityLabel,
		Surface.SelectedQueuePriorityScore,
		*Surface.FocusDeckId,
		*Surface.FocusMethodSegmentId,
		Surface.FocusCaseCount,
		Surface.bSelectedEntryMatchesActiveQueue ? TEXT("yes") : TEXT("no"),
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bPinned ? TEXT("yes") : TEXT("no"),
		Surface.bCanStartImmediately ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardScheduleHorizonStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedScheduleHorizonStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardScheduleHorizonStatusInspectSurface Surface;
	Surface.Headline = TEXT("Schedule horizon status");

	Surface.QueueId = CachedCoachScheduleHorizonSummary.QueueId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachScheduleHorizonSummary.QueueId;
	Surface.FocusDeckId = CachedCoachScheduleHorizonSummary.FocusDeckId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachScheduleHorizonSummary.FocusDeckId;
	Surface.FocusMethodSegmentId =
		CachedCoachScheduleHorizonSummary.FocusMethodSegmentId.IsEmpty()
			? TEXT("n/a")
			: CachedCoachScheduleHorizonSummary.FocusMethodSegmentId;
	Surface.ActiveEntryId = CachedCoachScheduleHorizonSummary.ActiveEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachScheduleHorizonSummary.ActiveEntryId;
	Surface.NextReadyEntryId = CachedCoachScheduleHorizonSummary.NextReadyEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachScheduleHorizonSummary.NextReadyEntryId;
	Surface.NextDeferredEntryId =
		CachedCoachScheduleHorizonSummary.NextDeferredEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachScheduleHorizonSummary.NextDeferredEntryId;
	Surface.NextArchiveEntryId = CachedCoachScheduleHorizonSummary.NextArchiveEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachScheduleHorizonSummary.NextArchiveEntryId;
	Surface.NextFollowUpEntryId =
		CachedCoachScheduleHorizonSummary.NextFollowUpEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachScheduleHorizonSummary.NextFollowUpEntryId;
	Surface.CurrentHorizonLabel =
		CachedCoachScheduleHorizonSummary.CurrentHorizonLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachScheduleHorizonSummary.CurrentHorizonLabel;
	Surface.ImmediateEntryCount = CachedCoachScheduleHorizonSummary.ImmediateEntryCount;
	Surface.DeferredEntryCount = CachedCoachScheduleHorizonSummary.DeferredEntryCount;
	Surface.ArchiveAwareEntryCount = CachedCoachScheduleHorizonSummary.ArchiveAwareEntryCount;
	Surface.FollowUpEntryCount = CachedCoachScheduleHorizonSummary.FollowUpEntryCount;
	Surface.PinnedEntryCount = CachedCoachScheduleHorizonSummary.PinnedEntryCount;
	Surface.bHasImmediateWindow = CachedCoachScheduleHorizonSummary.bHasImmediateWindow;
	Surface.bHasDeferredWindow = CachedCoachScheduleHorizonSummary.bHasDeferredWindow;
	Surface.bNeedsArchiveWindow = CachedCoachScheduleHorizonSummary.bNeedsArchiveWindow;
	Surface.bHasBlockedFollowUp = CachedCoachScheduleHorizonSummary.bHasBlockedFollowUp;
	Surface.bHasInProgressEntry = CachedCoachScheduleHorizonSummary.bHasInProgressEntry;
	Surface.StatusLine = !DisplayedScheduleStatusLine.IsEmpty()
		? DisplayedScheduleStatusLine
		: FString::Printf(
			TEXT("Horizon: %s | Immediate %d | Deferred %d | Archive-aware %d | Follow-up %d | Pinned %d | Immediate window: %s | Deferred window: %s | Blocked follow-up: %s"),
			*Surface.CurrentHorizonLabel,
			Surface.ImmediateEntryCount,
			Surface.DeferredEntryCount,
			Surface.ArchiveAwareEntryCount,
			Surface.FollowUpEntryCount,
			Surface.PinnedEntryCount,
			Surface.bHasImmediateWindow ? TEXT("yes") : TEXT("no"),
			Surface.bHasDeferredWindow ? TEXT("yes") : TEXT("no"),
			Surface.bHasBlockedFollowUp ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardSchedulePolicyFrictionInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedSchedulePolicyFrictionInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardSchedulePolicyFrictionInspectSurface Surface;
	Surface.Headline = TEXT("Schedule policy / friction");

	Surface.QueueId = CachedCoachSchedulePolicySummary.QueueId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.QueueId;
	Surface.FocusDeckId = CachedCoachSchedulePolicySummary.FocusDeckId.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.FocusDeckId;
	Surface.FocusMethodSegmentId =
		CachedCoachSchedulePolicySummary.FocusMethodSegmentId.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.FocusMethodSegmentId;
	Surface.NextImmediateEntryId =
		CachedCoachSchedulePolicySummary.NextImmediateEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachSchedulePolicySummary.NextImmediateEntryId;
	Surface.NextPendingEntryId = CachedCoachSchedulePolicySummary.NextPendingEntryId.IsEmpty()
		? TEXT("none")
		: CachedCoachSchedulePolicySummary.NextPendingEntryId;
	Surface.NextDeferredEntryId =
		CachedCoachSchedulePolicySummary.NextDeferredEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachSchedulePolicySummary.NextDeferredEntryId;
	Surface.NextManualRescheduleEntryId =
		CachedCoachSchedulePolicySummary.NextManualRescheduleEntryId.IsEmpty()
			? TEXT("none")
			: CachedCoachSchedulePolicySummary.NextManualRescheduleEntryId;
	Surface.EarliestDeferredUntilUtc =
		CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc;
	Surface.DominantDeferralReasonLabel =
		CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel;
	Surface.ClosurePolicyLine = CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.ClosurePolicyLine;
	Surface.HistoricalFollowUpContinuationCount =
		CachedCoachSchedulePolicySummary.HistoricalFollowUpContinuationCount;
	Surface.HistoricalBorderlineFollowUpSuppressionCount =
		CachedCoachSchedulePolicySummary.HistoricalBorderlineFollowUpSuppressionCount;
	Surface.ImmediateEntryCount = CachedCoachSchedulePolicySummary.ImmediateEntryCount;
	Surface.PendingEntryCount = CachedCoachSchedulePolicySummary.PendingEntryCount;
	Surface.DeferredEntryCount = CachedCoachSchedulePolicySummary.DeferredEntryCount;
	Surface.ManualRescheduleEntryCount =
		CachedCoachSchedulePolicySummary.ManualRescheduleEntryCount;
	Surface.ArchiveAwareDeferredEntryCount =
		CachedCoachSchedulePolicySummary.ArchiveAwareDeferredEntryCount;
	Surface.BlockedFollowUpDeferredEntryCount =
		CachedCoachSchedulePolicySummary.BlockedFollowUpDeferredEntryCount;
	Surface.ReschedulePressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	Surface.bAllowsManualReschedule = CachedCoachSchedulePolicySummary.bAllowsManualReschedule;
	Surface.bHasExpiredDeferrals = CachedCoachSchedulePolicySummary.bHasExpiredDeferrals;
	Surface.bNeedsManualRescheduleReview =
		CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview;
	Surface.bHasArchiveAwareDeferrals =
		CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals;
	Surface.bHasBlockedFollowUpDeferrals =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	Surface.bFollowUpContinuationFromRecoveryHistory =
		CachedCoachSchedulePolicySummary.bFollowUpContinuationFromRecoveryHistory;
	Surface.bBorderlineFollowUpSuppressedByRecoveryHistory =
		CachedCoachSchedulePolicySummary.bBorderlineFollowUpSuppressedByRecoveryHistory;
	Surface.PolicyLine = !DisplayedSchedulePolicyLine.IsEmpty()
		? DisplayedSchedulePolicyLine
		: FString::Printf(
			TEXT("Policy: immediate %d | pending %d | deferred %d | manual %d | earliest deferred: %s | dominant reason: %s | pressure %.2f | manual allowed: %s | expired deferrals: %s | review needed: %s | archive-aware: %s | blocked follow-up: %s | closure: %s"),
			Surface.ImmediateEntryCount,
			Surface.PendingEntryCount,
			Surface.DeferredEntryCount,
			Surface.ManualRescheduleEntryCount,
			*Surface.EarliestDeferredUntilUtc,
			*Surface.DominantDeferralReasonLabel,
			Surface.ReschedulePressureScore,
			Surface.bAllowsManualReschedule ? TEXT("yes") : TEXT("no"),
			Surface.bHasExpiredDeferrals ? TEXT("yes") : TEXT("no"),
			Surface.bNeedsManualRescheduleReview ? TEXT("yes") : TEXT("no"),
			Surface.bHasArchiveAwareDeferrals ? TEXT("yes") : TEXT("no"),
			Surface.bHasBlockedFollowUpDeferrals ? TEXT("yes") : TEXT("no"),
			*Surface.ClosurePolicyLine);
	return Surface;
}

FHyperTwistTrainingCoachDashboardQueueSchedulingRecoveryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedQueueSchedulingRecoveryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardQueueSchedulingRecoveryBandInspectSurface Surface;
	Surface.Headline = TEXT("Queue scheduling / recovery band");

	const FHyperTwistTrainingCoachDashboardQueueCountsStatusInspectSurface QueueCountsSurface =
		GetDisplayedQueueCountsStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardScheduleHorizonStatusInspectSurface HorizonSurface =
		GetDisplayedScheduleHorizonStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardSchedulePolicyFrictionInspectSurface PolicySurface =
		GetDisplayedSchedulePolicyFrictionInspectSurface();
	const FHyperTwistTrainingCoachDashboardQueueRecoveryStatusInspectSurface RecoveryStatusSurface =
		GetDisplayedQueueRecoveryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardQueueRecoveryDetailInspectSurface RecoveryDetailSurface =
		GetDisplayedQueueRecoveryDetailInspectSurface();

	Surface.QueueCountsStatusLine = QueueCountsSurface.StatusLine.IsEmpty()
		? TEXT("Queue counts / status: unavailable.")
		: QueueCountsSurface.StatusLine;
	Surface.QueueCountsLine = QueueCountsSurface.CountsLine.IsEmpty()
		? TEXT("Queue counts: unavailable.")
		: QueueCountsSurface.CountsLine;
	Surface.QueueExecutionLine = QueueCountsSurface.ExecutionLine.IsEmpty()
		? TEXT("Queue execution: unavailable.")
		: QueueCountsSurface.ExecutionLine;
	Surface.ScheduleHorizonStatusLine = HorizonSurface.StatusLine.IsEmpty()
		? TEXT("Schedule horizon: unavailable.")
		: HorizonSurface.StatusLine;
	Surface.SchedulePolicyLine = PolicySurface.PolicyLine.IsEmpty()
		? TEXT("Schedule policy: unavailable.")
		: PolicySurface.PolicyLine;
	Surface.QueueRecoveryStatusLine = RecoveryStatusSurface.StatusLine.IsEmpty()
		? TEXT("Queue recovery: unavailable.")
		: RecoveryStatusSurface.StatusLine;
	Surface.QueueRecoveryDetailLine = RecoveryDetailSurface.CombinedLine.IsEmpty()
		? (RecoveryDetailSurface.DetailLine.IsEmpty()
			? TEXT("Queue recovery detail: unavailable.")
			: RecoveryDetailSurface.DetailLine)
		: RecoveryDetailSurface.CombinedLine;
	Surface.QueueId = !QueueCountsSurface.QueueId.IsEmpty()
		? QueueCountsSurface.QueueId
		: (HorizonSurface.QueueId.IsEmpty() ? PolicySurface.QueueId : HorizonSurface.QueueId);
	Surface.ActiveQueueEntryId = QueueCountsSurface.ActiveQueueEntryId.IsEmpty()
		? TEXT("none")
		: QueueCountsSurface.ActiveQueueEntryId;
	Surface.FocusDeckId = !HorizonSurface.FocusDeckId.IsEmpty()
		? HorizonSurface.FocusDeckId
		: (PolicySurface.FocusDeckId.IsEmpty() ? TEXT("n/a") : PolicySurface.FocusDeckId);
	Surface.FocusMethodSegmentId = !HorizonSurface.FocusMethodSegmentId.IsEmpty()
		? HorizonSurface.FocusMethodSegmentId
		: (PolicySurface.FocusMethodSegmentId.IsEmpty()
			? TEXT("n/a")
			: PolicySurface.FocusMethodSegmentId);
	Surface.CurrentHorizonLabel = HorizonSurface.CurrentHorizonLabel.IsEmpty()
		? TEXT("n/a")
		: HorizonSurface.CurrentHorizonLabel;
	Surface.DominantDeferralReasonLabel = !PolicySurface.DominantDeferralReasonLabel.IsEmpty()
		? PolicySurface.DominantDeferralReasonLabel
		: (RecoveryDetailSurface.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: RecoveryDetailSurface.DominantDeferralReasonLabel);
	Surface.RecoveryLaneLabel = RecoveryStatusSurface.RecoveryLaneLabel.IsEmpty()
		? TEXT("none")
		: RecoveryStatusSurface.RecoveryLaneLabel;
	Surface.RecoverySourceDescription = RecoveryStatusSurface.RecoverySourceDescription.IsEmpty()
		? TEXT("n/a")
		: RecoveryStatusSurface.RecoverySourceDescription;
	Surface.TotalEntryCount = QueueCountsSurface.TotalEntryCount;
	Surface.ReadyEntryCount = QueueCountsSurface.ReadyEntryCount;
	Surface.DeferredEntryCount = QueueCountsSurface.DeferredEntryCount;
	Surface.ManualRescheduleEntryCount = PolicySurface.ManualRescheduleEntryCount;
	Surface.FollowUpEntryCount = HorizonSurface.FollowUpEntryCount;
	Surface.ReschedulePressureScore = PolicySurface.ReschedulePressureScore;
	Surface.bHasOutstandingDeferredWork = QueueCountsSurface.bHasOutstandingDeferredWork;
	Surface.bHasCompletionGap = QueueCountsSurface.bHasCompletionGap;
	Surface.bHasArchiveAwareFriction = QueueCountsSurface.bHasArchiveAwareFriction;
	Surface.bHasBlockedFollowUpFriction = QueueCountsSurface.bHasBlockedFollowUpFriction;
	Surface.bHasImmediateWindow = HorizonSurface.bHasImmediateWindow;
	Surface.bHasDeferredWindow = HorizonSurface.bHasDeferredWindow;
	Surface.bNeedsArchiveWindow = HorizonSurface.bNeedsArchiveWindow;
	Surface.bHasQueueRecoveryFriction = RecoveryStatusSurface.bHasQueueRecoveryFriction;
	Surface.bCanLaunchQueueRecovery = RecoveryStatusSurface.bCanLaunchQueueRecovery;
	Surface.bShouldPresentClosedLoopIdleDashboard =
		RecoveryStatusSurface.bShouldPresentClosedLoopIdleDashboard
		|| RecoveryDetailSurface.bShouldPresentClosedLoopIdleDashboard;
	Surface.StatusLine = FString::Printf(
		TEXT("Queue scheduling / recovery band: horizon %s | entries %d | deferred %d | pressure %.2f | recovery lane %s | recovery launch %s"),
		*Surface.CurrentHorizonLabel,
		Surface.TotalEntryCount,
		Surface.DeferredEntryCount,
		Surface.ReschedulePressureScore,
		*Surface.RecoveryLaneLabel,
		Surface.bCanLaunchQueueRecovery ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | %s | queue %s | active entry %s | focus deck %s | method %s | dominant reason %s | ready %d | follow-up %d | manual %d | outstanding deferred %s | completion gap %s | archive window %s | closed-loop idle %s"),
		*Surface.QueueCountsStatusLine,
		*Surface.QueueCountsLine,
		*Surface.ScheduleHorizonStatusLine,
		*Surface.SchedulePolicyLine,
		*Surface.QueueRecoveryStatusLine,
		*Surface.QueueId,
		*Surface.ActiveQueueEntryId,
		*Surface.FocusDeckId,
		*Surface.FocusMethodSegmentId,
		*Surface.DominantDeferralReasonLabel,
		Surface.ReadyEntryCount,
		Surface.FollowUpEntryCount,
		Surface.ManualRescheduleEntryCount,
		Surface.bHasOutstandingDeferredWork ? TEXT("yes") : TEXT("no"),
		Surface.bHasCompletionGap ? TEXT("yes") : TEXT("no"),
		Surface.bNeedsArchiveWindow ? TEXT("yes") : TEXT("no"),
		Surface.bShouldPresentClosedLoopIdleDashboard ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardClosureRecoveryStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedClosureRecoveryStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardClosureRecoveryStatusInspectSurface Surface;
	Surface.Headline = TEXT("Closure recovery status");

	Surface.HistoricalFollowUpContinuationCount =
		CachedCoachSchedulePolicySummary.HistoricalFollowUpContinuationCount;
	Surface.HistoricalBorderlineFollowUpSuppressionCount =
		CachedCoachSchedulePolicySummary.HistoricalBorderlineFollowUpSuppressionCount;
	Surface.bHasClosureRecoveryHistory =
		Surface.HistoricalFollowUpContinuationCount > 0
		|| Surface.HistoricalBorderlineFollowUpSuppressionCount > 0;
	Surface.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Surface.GuidanceLaneLabel = HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
		Surface.PreferredGuidanceLane);
	Surface.ClosurePolicyLine = CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.ClosurePolicyLine;
	Surface.ClosureRecoveryHistoryLabel =
		Surface.HistoricalFollowUpContinuationCount
			> Surface.HistoricalBorderlineFollowUpSuppressionCount
			? TEXT("follow-up continuity history is dominant")
			: (Surface.HistoricalBorderlineFollowUpSuppressionCount
					> Surface.HistoricalFollowUpContinuationCount
				? TEXT("recommended-side suppression history is dominant")
				: (Surface.bHasClosureRecoveryHistory
					? TEXT("retained closure history is balanced")
					: TEXT("no retained closure history")));

	const FHyperTwistCoachSignal* ClosureRecoverySignal = CachedCoachSignals.FindByPredicate(
		[](const FHyperTwistCoachSignal& Signal)
		{
			return Signal.SignalId == TEXT("closure_history_follow_up_continuation")
				|| Signal.SignalId == TEXT("closure_history_recommended_suppression");
		});
	Surface.bHasActiveSignal = ClosureRecoverySignal != nullptr;
	Surface.bActiveSignalPromoted =
		ClosureRecoverySignal != nullptr
		&& CachedCoachBrief.Signals.Num() > 0
		&& CachedCoachBrief.Signals[0].SignalId == ClosureRecoverySignal->SignalId;
	Surface.ActiveSignalId =
		ClosureRecoverySignal != nullptr && !ClosureRecoverySignal->SignalId.IsEmpty()
			? ClosureRecoverySignal->SignalId
			: TEXT("none");
	Surface.ActiveSignalHeadline =
		ClosureRecoverySignal != nullptr && !ClosureRecoverySignal->Headline.IsEmpty()
			? ClosureRecoverySignal->Headline
			: TEXT("n/a");
	Surface.ActiveSignalPriorityLabel = ClosureRecoverySignal != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			ClosureRecoverySignal->Priority)
		: TEXT("n/a");
	Surface.ActiveSignalScore = ClosureRecoverySignal != nullptr
		? ClosureRecoverySignal->Score
		: 0.0f;
	Surface.StatusLine = !DisplayedClosureRecoveryStatusLine.IsEmpty()
		? DisplayedClosureRecoveryStatusLine
		: (ClosureRecoverySignal != nullptr
			? FString::Printf(
				TEXT("Closure recovery: %s | promoted: %s | headline: %s | priority: %s | score %.1f"),
				*Surface.ClosureRecoveryHistoryLabel,
				Surface.bActiveSignalPromoted ? TEXT("yes") : TEXT("no"),
				*Surface.ActiveSignalHeadline,
				*Surface.ActiveSignalPriorityLabel,
				Surface.ActiveSignalScore)
			: (Surface.bHasClosureRecoveryHistory
				? FString::Printf(
					TEXT("Closure recovery: retained history is present without an active closure-history signal | policy: %s"),
					*Surface.ClosurePolicyLine)
				: TEXT("Closure recovery: no retained closure-recovery history is recorded yet.")));
	return Surface;
}

FHyperTwistTrainingCoachDashboardClosureRecoveryDetailInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedClosureRecoveryDetailInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardClosureRecoveryDetailInspectSurface Surface;
	Surface.Headline = TEXT("Closure recovery detail");

	Surface.HistoricalFollowUpContinuationCount =
		CachedCoachSchedulePolicySummary.HistoricalFollowUpContinuationCount;
	Surface.HistoricalBorderlineFollowUpSuppressionCount =
		CachedCoachSchedulePolicySummary.HistoricalBorderlineFollowUpSuppressionCount;
	Surface.bHasClosureRecoveryHistory =
		Surface.HistoricalFollowUpContinuationCount > 0
		|| Surface.HistoricalBorderlineFollowUpSuppressionCount > 0;
	Surface.bFollowUpContinuationFromRecoveryHistory =
		CachedCoachSchedulePolicySummary.bFollowUpContinuationFromRecoveryHistory;
	Surface.bBorderlineFollowUpSuppressedByRecoveryHistory =
		CachedCoachSchedulePolicySummary.bBorderlineFollowUpSuppressedByRecoveryHistory;
	Surface.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Surface.GuidanceLaneLabel = HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
		Surface.PreferredGuidanceLane);
	Surface.PreferredGuidanceSourceLabel =
		CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("none")
			: CachedCoachPanelState.PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Surface.ClosurePolicyLine = CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
		? TEXT("n/a")
		: CachedCoachSchedulePolicySummary.ClosurePolicyLine;

	const FHyperTwistCoachSignal* ClosureRecoverySignal = CachedCoachSignals.FindByPredicate(
		[](const FHyperTwistCoachSignal& Signal)
		{
			return Signal.SignalId == TEXT("closure_history_follow_up_continuation")
				|| Signal.SignalId == TEXT("closure_history_recommended_suppression");
		});
	Surface.bHasActiveSignal = ClosureRecoverySignal != nullptr;
	Surface.ActiveSignalId =
		ClosureRecoverySignal != nullptr && !ClosureRecoverySignal->SignalId.IsEmpty()
			? ClosureRecoverySignal->SignalId
			: TEXT("none");
	Surface.ActiveSignalDetail =
		ClosureRecoverySignal != nullptr && !ClosureRecoverySignal->Detail.IsEmpty()
			? ClosureRecoverySignal->Detail
			: TEXT("");
	Surface.DetailLine = !DisplayedClosureRecoveryDetailLine.IsEmpty()
		? DisplayedClosureRecoveryDetailLine
		: FString::Printf(
			TEXT("Policy: %s | keep %d | suppress %d | continuation active: %s | borderline suppression active: %s | guidance lane: %s | source: %s%s%s"),
			*Surface.ClosurePolicyLine,
			Surface.HistoricalFollowUpContinuationCount,
			Surface.HistoricalBorderlineFollowUpSuppressionCount,
			Surface.bFollowUpContinuationFromRecoveryHistory ? TEXT("yes") : TEXT("no"),
			Surface.bBorderlineFollowUpSuppressedByRecoveryHistory ? TEXT("yes") : TEXT("no"),
			*Surface.GuidanceLaneLabel,
			*Surface.PreferredGuidanceSourceDescription,
			ClosureRecoverySignal != nullptr ? TEXT(" || Signal detail: ") : TEXT(""),
			ClosureRecoverySignal != nullptr ? *Surface.ActiveSignalDetail : TEXT(""));
	return Surface;
}

FHyperTwistTrainingCoachDashboardClosureRecoveryBandInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedClosureRecoveryBandInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardClosureRecoveryBandInspectSurface Surface;
	Surface.Headline = TEXT("Closure-recovery band");

	const FHyperTwistTrainingCoachDashboardClosureRecoveryStatusInspectSurface StatusSurface =
		GetDisplayedClosureRecoveryStatusInspectSurface();
	const FHyperTwistTrainingCoachDashboardClosureRecoveryDetailInspectSurface DetailSurface =
		GetDisplayedClosureRecoveryDetailInspectSurface();
	const FHyperTwistTrainingCoachDashboardClosureRecoveryHistoryNavigationInspectSurface NavigationSurface =
		GetDisplayedClosureRecoveryHistoryNavigationInspectSurface();

	Surface.ClosureRecoveryStatusLine = StatusSurface.StatusLine.IsEmpty()
		? TEXT("Closure recovery status: unavailable.")
		: StatusSurface.StatusLine;
	Surface.ClosureRecoveryDetailLine = DetailSurface.DetailLine.IsEmpty()
		? TEXT("Closure recovery detail: unavailable.")
		: DetailSurface.DetailLine;
	Surface.ClosureRecoveryNavigationStatusLine = NavigationSurface.StatusLine.IsEmpty()
		? TEXT("Closure recovery navigation: unavailable.")
		: NavigationSurface.StatusLine;
	Surface.ClosureRecoveryNavigationDetailLine = NavigationSurface.DetailLine.IsEmpty()
		? TEXT("Closure recovery navigation detail: unavailable.")
		: NavigationSurface.DetailLine;
	Surface.ClosureRecoveryHistoryLabel = StatusSurface.ClosureRecoveryHistoryLabel.IsEmpty()
		? TEXT("n/a")
		: StatusSurface.ClosureRecoveryHistoryLabel;
	Surface.ClosurePolicyLine = !DetailSurface.ClosurePolicyLine.IsEmpty()
		? DetailSurface.ClosurePolicyLine
		: (StatusSurface.ClosurePolicyLine.IsEmpty() ? TEXT("n/a") : StatusSurface.ClosurePolicyLine);
	Surface.GuidanceLaneLabel = !DetailSurface.GuidanceLaneLabel.IsEmpty()
		? DetailSurface.GuidanceLaneLabel
		: (StatusSurface.GuidanceLaneLabel.IsEmpty() ? TEXT("none") : StatusSurface.GuidanceLaneLabel);
	Surface.PreferredGuidanceSourceLabel = DetailSurface.PreferredGuidanceSourceLabel.IsEmpty()
		? TEXT("none")
		: DetailSurface.PreferredGuidanceSourceLabel;
	Surface.PreferredGuidanceSourceDescription = !DetailSurface.PreferredGuidanceSourceDescription.IsEmpty()
		? DetailSurface.PreferredGuidanceSourceDescription
		: NavigationSurface.PreferredGuidanceSourceDescription;
	Surface.ActiveSignalId = !DetailSurface.ActiveSignalId.IsEmpty()
		? DetailSurface.ActiveSignalId
		: (StatusSurface.ActiveSignalId.IsEmpty() ? TEXT("none") : StatusSurface.ActiveSignalId);
	Surface.ActiveSignalHeadline = StatusSurface.ActiveSignalHeadline.IsEmpty()
		? TEXT("n/a")
		: StatusSurface.ActiveSignalHeadline;
	Surface.ActiveSignalPriorityLabel = StatusSurface.ActiveSignalPriorityLabel.IsEmpty()
		? TEXT("n/a")
		: StatusSurface.ActiveSignalPriorityLabel;
	Surface.ActiveSignalDetail = DetailSurface.ActiveSignalDetail.IsEmpty()
		? TEXT("")
		: DetailSurface.ActiveSignalDetail;
	Surface.PreviousLabel = NavigationSurface.PreviousLabel.IsEmpty() ? TEXT("Prev Closure Recovery") : NavigationSurface.PreviousLabel;
	Surface.NextLabel = NavigationSurface.NextLabel.IsEmpty() ? TEXT("Next Closure Recovery") : NavigationSurface.NextLabel;
	Surface.SelectedEntryOrdinal = NavigationSurface.SelectedEntryOrdinal.IsEmpty()
		? TEXT("none")
		: NavigationSurface.SelectedEntryOrdinal;
	Surface.RecordedAtUtc = NavigationSurface.RecordedAtUtc.IsEmpty() ? TEXT("n/a") : NavigationSurface.RecordedAtUtc;
	Surface.SelectedLaneLabel = NavigationSurface.SelectedLaneLabel.IsEmpty() ? TEXT("none") : NavigationSurface.SelectedLaneLabel;
	Surface.SelectedEntryIndex = NavigationSurface.SelectedEntryIndex;
	Surface.HistoryEntryCount = NavigationSurface.HistoryEntryCount;
	Surface.HistoricalFollowUpContinuationCount = StatusSurface.HistoricalFollowUpContinuationCount;
	Surface.HistoricalBorderlineFollowUpSuppressionCount =
		StatusSurface.HistoricalBorderlineFollowUpSuppressionCount;
	Surface.ActiveSignalScore = StatusSurface.ActiveSignalScore;
	Surface.PreferredGuidanceLane = StatusSurface.PreferredGuidanceLane;
	Surface.bHasClosureRecoveryHistory =
		StatusSurface.bHasClosureRecoveryHistory || DetailSurface.bHasClosureRecoveryHistory;
	Surface.bHasActiveSignal = StatusSurface.bHasActiveSignal || DetailSurface.bHasActiveSignal;
	Surface.bActiveSignalPromoted = StatusSurface.bActiveSignalPromoted;
	Surface.bFollowUpContinuationFromRecoveryHistory =
		DetailSurface.bFollowUpContinuationFromRecoveryHistory;
	Surface.bBorderlineFollowUpSuppressedByRecoveryHistory =
		DetailSurface.bBorderlineFollowUpSuppressedByRecoveryHistory;
	Surface.bHasSelectedEntry = NavigationSurface.bHasSelectedEntry;
	Surface.bSelectedEntryIsLatest = NavigationSurface.bSelectedEntryIsLatest;
	Surface.bPreviousEnabled = NavigationSurface.bPreviousEnabled;
	Surface.bNextEnabled = NavigationSurface.bNextEnabled;
	Surface.StatusLine = FString::Printf(
		TEXT("Closure-recovery band: %s | lane %s | selected %s | signal %s | navigation %s/%s"),
		*Surface.ClosureRecoveryHistoryLabel,
		*Surface.GuidanceLaneLabel,
		*Surface.SelectedEntryOrdinal,
		*Surface.ActiveSignalId,
		Surface.bPreviousEnabled ? TEXT("enabled") : TEXT("disabled"),
		Surface.bNextEnabled ? TEXT("enabled") : TEXT("disabled"));
	Surface.DetailLine = FString::Printf(
		TEXT("%s | %s | %s | %s | policy %s | source %s | signal headline %s | signal priority %s | recorded %s | latest %s"),
		*Surface.ClosureRecoveryStatusLine,
		*Surface.ClosureRecoveryDetailLine,
		*Surface.ClosureRecoveryNavigationStatusLine,
		*Surface.ClosureRecoveryNavigationDetailLine,
		*Surface.ClosurePolicyLine,
		*Surface.PreferredGuidanceSourceDescription,
		*Surface.ActiveSignalHeadline,
		*Surface.ActiveSignalPriorityLabel,
		*Surface.RecordedAtUtc,
		Surface.bSelectedEntryIsLatest ? TEXT("yes") : TEXT("no"));
	return Surface;
}

FHyperTwistTrainingCoachDashboardLastAttemptReviewSummaryInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedLastAttemptReviewSummaryInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardLastAttemptReviewSummaryInspectSurface Surface;
	Surface.Headline = TEXT("Last attempt review summary");

	const FHyperTwistTrainingAttempt* ReviewedAttempt =
		SelectedAttemptIndex >= 0 && SelectedAttemptIndex < CachedRunState.Attempts.Num()
		? &CachedRunState.Attempts[SelectedAttemptIndex]
		: nullptr;
	const bool bHasSessionScopedLastStep = !LastStepResult.SessionSummary.TrainingSessionId.IsEmpty()
		&& LastStepResult.SessionSummary.TrainingSessionId == CachedRunState.Session.TrainingSessionId;
	const FString ReviewedAttemptOrdinal = ReviewedAttempt != nullptr
		? FString::Printf(TEXT("%d/%d"), SelectedAttemptIndex + 1, CachedRunState.Attempts.Num())
		: TEXT("none");

	Surface.AttemptOrdinal = ReviewedAttemptOrdinal;
	Surface.AttemptId = ReviewedAttempt != nullptr && !ReviewedAttempt->AttemptId.IsEmpty()
		? ReviewedAttempt->AttemptId
		: TEXT("n/a");
	Surface.CaseId = ReviewedAttempt != nullptr && !ReviewedAttempt->CaseId.IsEmpty()
		? ReviewedAttempt->CaseId
		: TEXT("n/a");
	Surface.ResultLabel = ReviewedAttempt != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ReviewedAttempt->Result)
		: TEXT("n/a");
	Surface.CompletedAtUtc = ReviewedAttempt != nullptr && !ReviewedAttempt->CompletedAtUtc.IsEmpty()
		? ReviewedAttempt->CompletedAtUtc
		: TEXT("n/a");
	Surface.LatestSubmissionLabel = bHasSessionScopedLastStep ? TEXT("yes") : TEXT("no");
	Surface.SelectedAttemptIndex = SelectedAttemptIndex;
	Surface.TotalAttemptCount = CachedRunState.Attempts.Num();
	Surface.bHasReviewedAttempt = ReviewedAttempt != nullptr;
	Surface.bLatestSubmissionMatchesActiveSession = bHasSessionScopedLastStep;

	Surface.StatusLine = !DisplayedLastAttemptReviewSummaryLine.IsEmpty()
		? DisplayedLastAttemptReviewSummaryLine
		: (ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Attempt review: %s | case %s | result %s | completed at %s | latest submission: %s"),
				*Surface.AttemptOrdinal,
				*Surface.CaseId,
				*Surface.ResultLabel,
				*Surface.CompletedAtUtc,
				*Surface.LatestSubmissionLabel)
			: TEXT("Attempt review: no attempts recorded in the active run yet."));
	return Surface;
}

FHyperTwistTrainingCoachDashboardLastAttemptTimingDerivedPhaseReviewInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedLastAttemptTimingDerivedPhaseReviewInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardLastAttemptTimingDerivedPhaseReviewInspectSurface Surface;
	Surface.Headline = TEXT("Last attempt timing / derived-phase review");

	const FHyperTwistTrainingAttempt* ReviewedAttempt =
		SelectedAttemptIndex >= 0 && SelectedAttemptIndex < CachedRunState.Attempts.Num()
		? &CachedRunState.Attempts[SelectedAttemptIndex]
		: nullptr;
	FString ReviewedAttemptPhaseSummary = TEXT("none");
	if (ReviewedAttempt != nullptr && ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings.Num() > 0)
	{
		TArray<FString> PhaseParts;
		PhaseParts.Reserve(ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings.Num());
		for (const FHyperTwistPhaseTiming& PhaseTiming : ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings)
		{
			PhaseParts.Add(FString::Printf(
				TEXT("%s %d-%d (%d ms)"),
				PhaseTiming.PhaseKind.IsEmpty() ? TEXT("phase") : *PhaseTiming.PhaseKind,
				PhaseTiming.StartedAtMs,
				PhaseTiming.EndedAtMs,
				PhaseTiming.DurationMs
			));
		}
		ReviewedAttemptPhaseSummary = FString::Join(PhaseParts, TEXT(" | "));
	}

	Surface.AttemptId = ReviewedAttempt != nullptr && !ReviewedAttempt->AttemptId.IsEmpty()
		? ReviewedAttempt->AttemptId
		: TEXT("n/a");
	Surface.AppliedPenaltyLabel = ReviewedAttempt != nullptr
		? HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
			ReviewedAttempt->TimingBreakdown.AppliedPenalty)
		: TEXT("n/a");
	Surface.DerivedPhaseSummary = ReviewedAttemptPhaseSummary;
	Surface.InspectionElapsedMs =
		ReviewedAttempt != nullptr ? ReviewedAttempt->TimingBreakdown.InspectionElapsedMs : 0;
	Surface.RawSolveTimeMs =
		ReviewedAttempt != nullptr ? ReviewedAttempt->TimingBreakdown.RawSolveTimeMs : 0;
	Surface.FinalTimeMs =
		ReviewedAttempt != nullptr ? ReviewedAttempt->TimingBreakdown.FinalTimeMs : 0;
	Surface.SplitCaptureCount =
		ReviewedAttempt != nullptr ? ReviewedAttempt->TimingBreakdown.SplitCaptures.Num() : 0;
	Surface.DerivedPhaseCount =
		ReviewedAttempt != nullptr ? ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings.Num() : 0;
	Surface.bHasReviewedAttempt = ReviewedAttempt != nullptr;
	Surface.bDidNotFinish =
		ReviewedAttempt != nullptr && ReviewedAttempt->TimingBreakdown.bDidNotFinish;

	Surface.TimingLine = !DisplayedLastAttemptTimingLine.IsEmpty()
		? DisplayedLastAttemptTimingLine
		: (ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Reviewed timing: inspection %d ms | raw solve %d ms | final %d ms | penalty %s | split captures %d | did-not-finish: %s"),
				Surface.InspectionElapsedMs,
				Surface.RawSolveTimeMs,
				Surface.FinalTimeMs,
				*Surface.AppliedPenaltyLabel,
				Surface.SplitCaptureCount,
				Surface.bDidNotFinish ? TEXT("yes") : TEXT("no"))
			: TEXT("Reviewed timing: unavailable until the active run records an attempt."));
	Surface.DerivedPhaseLine = !DisplayedLastAttemptDerivedPhaseLine.IsEmpty()
		? DisplayedLastAttemptDerivedPhaseLine
		: (ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Reviewed derived phases: %s"),
				*Surface.DerivedPhaseSummary)
			: TEXT("Reviewed derived phases: none yet."));
	return Surface;
}

FHyperTwistTrainingCoachDashboardLiveSplitCaptureStatusInspectSurface
UHyperTwistCoachDashboardWidget::GetDisplayedLiveSplitCaptureStatusInspectSurface() const
{
	FHyperTwistTrainingCoachDashboardLiveSplitCaptureStatusInspectSurface Surface;
	Surface.Headline = TEXT("Live split capture status");

	const FHyperTwistTrainingTimingPolicy* TimingPolicy = FindActiveTimingPolicy();
	const int32 MaxManualSplitCaptureCount = GetMaxManualSplitCaptureCount();
	const FHyperTwistTrainingSplitPhaseDefinition* NextSplitPhaseDefinition = FindNextSplitPhaseToCapture();
	const FString NextSplitLabel = NextSplitPhaseDefinition == nullptr
		? TEXT("none")
		: (NextSplitPhaseDefinition->Label.IsEmpty()
			? NextSplitPhaseDefinition->PhaseId
			: NextSplitPhaseDefinition->Label);
	FString CapturedSplitSummary = TEXT("none");
	if (LiveAttemptSplitCaptures.Num() > 0)
	{
		TArray<FString> CapturedSplitParts;
		CapturedSplitParts.Reserve(LiveAttemptSplitCaptures.Num());
		for (const FHyperTwistTrainingSplitCapture& SplitCapture : LiveAttemptSplitCaptures)
		{
			const FString Label = SplitCapture.Label.IsEmpty() ? SplitCapture.PhaseId : SplitCapture.Label;
			CapturedSplitParts.Add(FString::Printf(TEXT("%s@%d"), *Label, SplitCapture.TimestampMs));
		}
		CapturedSplitSummary = FString::Join(CapturedSplitParts, TEXT(" | "));
	}
	const FString FinalSplitLabel =
		TimingPolicy != nullptr
		&& TimingPolicy->SplitPhases.IsValidIndex(MaxManualSplitCaptureCount)
		? (TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].Label.IsEmpty()
			? TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].PhaseId
			: TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].Label)
		: TEXT("solve end");
	const bool bLiveInspectionPhase = IsLiveAttemptInspectionPhase();
	const bool bLivePausedPhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Paused;
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;

	Surface.NextSplitLabel = NextSplitLabel;
	Surface.FinalAutoCloseLabel = FinalSplitLabel;
	Surface.CapturedSummary = CapturedSplitSummary;
	Surface.CapturedSplitCount = LiveAttemptSplitCaptures.Num();
	Surface.MaxManualSplitCaptureCount = MaxManualSplitCaptureCount;
	Surface.bHasConfiguredManualSplitPhases = MaxManualSplitCaptureCount > 0;
	Surface.bHasLiveAttemptTimer = bHasLiveAttemptTimer;
	Surface.bLiveInspectionPhase = bLiveInspectionPhase;
	Surface.bLiveSolvePhase = bLiveSolvePhase;

	if (!DisplayedSplitCaptureStatusLine.IsEmpty())
	{
		Surface.StatusLine = DisplayedSplitCaptureStatusLine;
	}
	else if (MaxManualSplitCaptureCount <= 0)
	{
		Surface.StatusLine =
			TEXT("Split capture: no manual split phases are configured for this timing policy.");
	}
	else
	{
		const FString SplitStateLine = FString::Printf(
			TEXT("Manual splits %d/%d | Next: %s | Final auto-close: %s | Captured: %s"),
			Surface.CapturedSplitCount,
			Surface.MaxManualSplitCaptureCount,
			*Surface.NextSplitLabel,
			*Surface.FinalAutoCloseLabel,
			*Surface.CapturedSummary);
		if (bLiveSolvePhase)
		{
			Surface.StatusLine =
				SplitStateLine + TEXT(" | capture phase ends during solve; final phase closes on attempt stop");
		}
		else if (bLivePausedPhase)
		{
			Surface.StatusLine =
				SplitStateLine + TEXT(" | split capture is paused; resume solve to capture the next phase");
		}
		else if (bLiveInspectionPhase)
		{
			Surface.StatusLine = SplitStateLine + TEXT(" | split capture unlocks after solve start");
		}
		else
		{
			Surface.StatusLine =
				SplitStateLine + TEXT(" | start a live attempt to record manual split boundaries");
		}
	}
	return Surface;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousMethodDrillFollowUpHistoryEntry()
{
	if (MethodDrillFollowUpHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillFollowUpHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillFollowUpHistoryIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillFollowUpHistoryEntry();
		return SelectedMethodDrillFollowUpHistoryIndex != INDEX_NONE;
	}

	SelectedMethodDrillFollowUpHistoryIndex =
		(SelectedMethodDrillFollowUpHistoryIndex - 1 + MethodDrillFollowUpHistoryEntries.Num())
		% MethodDrillFollowUpHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextMethodDrillFollowUpHistoryEntry()
{
	if (MethodDrillFollowUpHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillFollowUpHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillFollowUpHistoryIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillFollowUpHistoryEntry();
		return SelectedMethodDrillFollowUpHistoryIndex != INDEX_NONE;
	}

	SelectedMethodDrillFollowUpHistoryIndex =
		(SelectedMethodDrillFollowUpHistoryIndex + 1) % MethodDrillFollowUpHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousMethodDrillRecoveryOutcomeEntry()
{
	TArray<int32> MethodDrillRecoveryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryIndices
	);
	if (MethodDrillRecoveryIndices.Num() <= 0)
	{
		SelectedMethodDrillRecoveryOutcomeIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillRecoveryOutcomeIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryOutcomeEntry();
		return SelectedMethodDrillRecoveryOutcomeIndex != INDEX_NONE;
	}

	const int32 CurrentFilteredIndex =
		MethodDrillRecoveryIndices.IndexOfByKey(SelectedMethodDrillRecoveryOutcomeIndex);
	if (CurrentFilteredIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryOutcomeEntry();
		return SelectedMethodDrillRecoveryOutcomeIndex != INDEX_NONE;
	}

	SelectedMethodDrillRecoveryOutcomeIndex =
		MethodDrillRecoveryIndices[
			(CurrentFilteredIndex - 1 + MethodDrillRecoveryIndices.Num())
				% MethodDrillRecoveryIndices.Num()];
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextMethodDrillRecoveryOutcomeEntry()
{
	TArray<int32> MethodDrillRecoveryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryIndices
	);
	if (MethodDrillRecoveryIndices.Num() <= 0)
	{
		SelectedMethodDrillRecoveryOutcomeIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillRecoveryOutcomeIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryOutcomeEntry();
		return SelectedMethodDrillRecoveryOutcomeIndex != INDEX_NONE;
	}

	const int32 CurrentFilteredIndex =
		MethodDrillRecoveryIndices.IndexOfByKey(SelectedMethodDrillRecoveryOutcomeIndex);
	if (CurrentFilteredIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryOutcomeEntry();
		return SelectedMethodDrillRecoveryOutcomeIndex != INDEX_NONE;
	}

	SelectedMethodDrillRecoveryOutcomeIndex =
		MethodDrillRecoveryIndices[
			(CurrentFilteredIndex + 1) % MethodDrillRecoveryIndices.Num()];
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectPreviousMethodDrillRecoveryMemoryHistoryEntry()
{
	if (MethodDrillRecoveryMemoryHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillRecoveryMemoryHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillRecoveryMemoryHistoryIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryMemoryHistoryEntry();
		return SelectedMethodDrillRecoveryMemoryHistoryIndex != INDEX_NONE;
	}

	SelectedMethodDrillRecoveryMemoryHistoryIndex =
		(SelectedMethodDrillRecoveryMemoryHistoryIndex - 1
			+ MethodDrillRecoveryMemoryHistoryEntries.Num())
		% MethodDrillRecoveryMemoryHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::SelectNextMethodDrillRecoveryMemoryHistoryEntry()
{
	if (MethodDrillRecoveryMemoryHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillRecoveryMemoryHistoryIndex = INDEX_NONE;
		return false;
	}

	if (SelectedMethodDrillRecoveryMemoryHistoryIndex == INDEX_NONE)
	{
		SyncSelectedMethodDrillRecoveryMemoryHistoryEntry();
		return SelectedMethodDrillRecoveryMemoryHistoryIndex != INDEX_NONE;
	}

	SelectedMethodDrillRecoveryMemoryHistoryIndex =
		(SelectedMethodDrillRecoveryMemoryHistoryIndex + 1)
		% MethodDrillRecoveryMemoryHistoryEntries.Num();
	UpdateDashboardPresentation();
	return true;
}

bool UHyperTwistCoachDashboardWidget::StartLiveAttemptTimer()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		bool bStarted = TrainingSubsystem->StartActiveLiveTimerForCurrentDrillCase();
		if (!bStarted)
		{
			bStarted = TrainingSubsystem->StartActiveLiveTimer();
		}
		RefreshLiveAttemptClock();
		UpdateDashboardPresentation();
		return bStarted;
	}

	return false;
}

bool UHyperTwistCoachDashboardWidget::AdvanceLiveAttemptToSolvePhase()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		const bool bAdvanced = TrainingSubsystem->AdvanceActiveLiveTimerToSolvePhase();
		RefreshLiveAttemptClock();
		UpdateDashboardPresentation();
		return bAdvanced;
	}

	return false;
}

void UHyperTwistCoachDashboardWidget::CancelLiveAttemptTimer()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		TrainingSubsystem->CancelActiveLiveTimer();
	}
	RefreshLiveAttemptClock();
	UpdateDashboardPresentation();
}

FHyperTwistTrainingRunStepResult UHyperTwistCoachDashboardWidget::SubmitLiveTimedAttempt(
	const EHyperTwistTrainingAttemptResult Result
)
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		FHyperTwistTrainingRunStepResult StepResult;
		const FHyperTwistTrainingDrillTimerCompletionResult CompletionResult =
			TrainingSubsystem->SubmitAndAdvanceActiveDrillTimerAttempt(Result);
		if (CompletionResult.bSubmitSucceeded)
		{
			StepResult = CompletionResult.SubmitStepResult;
		}
		else
		{
			StepResult = TrainingSubsystem->SubmitActiveLiveTimedAttempt(Result);
		}
		LastStepResult = StepResult;
		RefreshTrainingState();
		RefreshLiveAttemptClock();
		SyncRetainedRunRecap();
		SyncSelectedAttempt();
		UpdateDashboardPresentation();
		return StepResult;
	}

	return FHyperTwistTrainingRunStepResult();
}

bool UHyperTwistCoachDashboardWidget::CaptureNextLiveAttemptSplit()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		const bool bCaptured = TrainingSubsystem->CaptureActiveLiveTimerSplit();
		RefreshLiveAttemptClock();
		UpdateDashboardPresentation();
		return bCaptured;
	}

	return false;
}

bool UHyperTwistCoachDashboardWidget::UndoLastLiveAttemptSplit()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		const bool bUndid = TrainingSubsystem->UndoActiveLiveTimerSplit();
		RefreshLiveAttemptClock();
		UpdateDashboardPresentation();
		return bUndid;
	}

	return false;
}

void UHyperTwistCoachDashboardWidget::HandlePrimaryActionClicked()
{
	ExecutePrimaryCoachAction();
}

void UHyperTwistCoachDashboardWidget::HandleVerifyClicked()
{
	VerifyTrainingRepositoryRoundTrip();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleDeferClicked()
{
	if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry())
	{
		DeferCoachQueueEntry(
			SelectedEntry->EntryId,
			BuildDefaultDeferredUntilUtc(),
			TEXT("dashboard-defer"),
			true
		);
		SyncSelectedQueueEntry();
		UpdateDashboardPresentation();
	}
	else
	{
		DeferDisplayedQueueEntryByDefaultWindow();
	}
}

void UHyperTwistCoachDashboardWidget::HandlePromoteClicked()
{
	PromoteFirstDeferredQueueEntry(FString());
}

void UHyperTwistCoachDashboardWidget::HandleApplyQueueRecoveryClicked()
{
	ApplyQueueRecoveryPosture();
}

void UHyperTwistCoachDashboardWidget::HandleRepeatRunClicked()
{
	RestartRetainedRunRecapDeck();
}

void UHyperTwistCoachDashboardWidget::HandleDismissRecapClicked()
{
	ClearRetainedRunRecap();
}

void UHyperTwistCoachDashboardWidget::HandleStartQueuedRunClicked()
{
	StartNextQueuedCoachRun(
		DefaultCoachMaxCases,
		ResolveDashboardHandoffStartActionSourceLabel(EHyperTwistTrainingCoachHandoffKind::Queue));
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleStartFollowUpRunClicked()
{
	StartCoachFollowUpRun(
		DefaultCoachMaxCases,
		ResolveDashboardHandoffStartActionSourceLabel(EHyperTwistTrainingCoachHandoffKind::FollowUp));
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleStartRecommendedRunClicked()
{
	StartCoachRecommendedRun(
		DefaultCoachMaxCases,
		ResolveDashboardHandoffStartActionSourceLabel(
			EHyperTwistTrainingCoachHandoffKind::Recommended));
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleStartTemplateLaunchClicked()
{
	StartPreferredActiveSessionTemplateRun();
}

void UHyperTwistCoachDashboardWidget::HandlePreviewRecommendedClicked()
{
	PreviewRecommendedCoachDeck();
}

void UHyperTwistCoachDashboardWidget::HandlePreviewFollowUpClicked()
{
	PreviewFollowUpCoachDeck();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousGuidanceCaseClicked()
{
	SelectPreviousGuidancePreviewCase();
}

void UHyperTwistCoachDashboardWidget::HandleNextGuidanceCaseClicked()
{
	SelectNextGuidancePreviewCase();
}

void UHyperTwistCoachDashboardWidget::HandleStartPreviewDeckClicked()
{
	StartActiveGuidancePreviewDeckRun();
}

void UHyperTwistCoachDashboardWidget::HandleStartPreviewCaseClicked()
{
	StartSelectedGuidancePreviewCaseRun();
}

void UHyperTwistCoachDashboardWidget::HandleStartMethodDrillFollowUpClicked()
{
	const FHyperTwistTrainingRunState RunState =
		StartActiveMethodDrillFollowUpRun(DefaultSessionId + TEXT("_method_drill_follow_up"));
	if (RunState.Session.IsStructurallyValid())
	{
		CaptureActiveMethodDrillFollowUpLaunchContext(RunState.Session.TrainingSessionId);
	}
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleCompleteRunClicked()
{
	CompleteActiveTrainingRun(false);
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleContinueRunClicked()
{
	ContinueCurrentRunFlow();
}

void UHyperTwistCoachDashboardWidget::HandleGuidanceOutcomeActionClicked()
{
	ApplyGuidanceOutcomeAction();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousGuidanceDecisionClicked()
{
	SelectPreviousGuidanceDecisionHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextGuidanceDecisionClicked()
{
	SelectNextGuidanceDecisionHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousHandoffHistoryClicked()
{
	SelectPreviousHandoffHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextHandoffHistoryClicked()
{
	SelectNextHandoffHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousTemplateLaunchHistoryClicked()
{
	SelectPreviousTemplateLaunchHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextTemplateLaunchHistoryClicked()
{
	SelectNextTemplateLaunchHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousQueueSuppressionClicked()
{
	SelectPreviousQueueSuppressionHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextQueueSuppressionClicked()
{
	SelectNextQueueSuppressionHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousClosureRecoveryClicked()
{
	SelectPreviousClosureRecoveryHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextClosureRecoveryClicked()
{
	SelectNextClosureRecoveryHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillFollowUpHistoryClicked()
{
	SelectPreviousMethodDrillFollowUpHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextMethodDrillFollowUpHistoryClicked()
{
	SelectNextMethodDrillFollowUpHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillRecoveryHistoryClicked()
{
	SelectPreviousMethodDrillRecoveryOutcomeEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextMethodDrillRecoveryHistoryClicked()
{
	SelectNextMethodDrillRecoveryOutcomeEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillRecoveryMemoryHistoryClicked()
{
	SelectPreviousMethodDrillRecoveryMemoryHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextMethodDrillRecoveryMemoryHistoryClicked()
{
	SelectNextMethodDrillRecoveryMemoryHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::HandleClearRunClicked()
{
	ClearActiveTrainingRun();
	SyncRetainedRunRecap();
	SyncSelectedQueueEntry();
	SyncSelectedAttempt();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleRecordSuccessClicked()
{
	if (bHasLiveAttemptTimer)
	{
		SubmitLiveTimedAttempt(EHyperTwistTrainingAttemptResult::Success);
	}
	else
	{
		SubmitSyntheticCurrentAttempt(
			EHyperTwistTrainingAttemptResult::Success,
			ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Success)
		);
	}
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleRecordFailureClicked()
{
	if (bHasLiveAttemptTimer)
	{
		SubmitLiveTimedAttempt(EHyperTwistTrainingAttemptResult::Failure);
	}
	else
	{
		SubmitSyntheticCurrentAttempt(
			EHyperTwistTrainingAttemptResult::Failure,
			ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Failure)
		);
	}
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleRecordTimeoutClicked()
{
	if (bHasLiveAttemptTimer)
	{
		SubmitLiveTimedAttempt(EHyperTwistTrainingAttemptResult::Timeout);
	}
	else
	{
		SubmitSyntheticCurrentAttempt(
			EHyperTwistTrainingAttemptResult::Timeout,
			ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Timeout)
		);
	}
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleRecordDnfClicked()
{
	if (bHasLiveAttemptTimer)
	{
		SubmitLiveTimedAttempt(EHyperTwistTrainingAttemptResult::DNF);
	}
	else
	{
		SubmitSyntheticCurrentAttempt(
			EHyperTwistTrainingAttemptResult::DNF,
			ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::DNF)
		);
	}
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleUseTargetTimeClicked()
{
	if (CachedRunState.CurrentSelection.TrainingCase.TimeTargetMs > 0)
	{
		SetAttemptTimeText(CachedRunState.CurrentSelection.TrainingCase.TimeTargetMs);
	}
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleUseAverageTimeClicked()
{
	if (CachedRunSummary.AverageTotalTimeMs > 0)
	{
		SetAttemptTimeText(CachedRunSummary.AverageTotalTimeMs);
	}
	SyncSelectedQueueEntry();
	UpdateDashboardPresentation();
}

void UHyperTwistCoachDashboardWidget::HandleStartTimerClicked()
{
	StartLiveAttemptTimer();
}

void UHyperTwistCoachDashboardWidget::HandleCancelTimerClicked()
{
	CancelLiveAttemptTimer();
}

void UHyperTwistCoachDashboardWidget::HandleCaptureSplitClicked()
{
	CaptureNextLiveAttemptSplit();
}

void UHyperTwistCoachDashboardWidget::HandleUndoSplitClicked()
{
	UndoLastLiveAttemptSplit();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousQueueClicked()
{
	SelectPreviousQueueEntry();
}

void UHyperTwistCoachDashboardWidget::HandlePreviousAttemptClicked()
{
	SelectPreviousAttemptReview();
}

void UHyperTwistCoachDashboardWidget::HandleStartSelectedClicked()
{
	StartSelectedQueueEntry();
}

void UHyperTwistCoachDashboardWidget::HandleNextAttemptClicked()
{
	SelectNextAttemptReview();
}

void UHyperTwistCoachDashboardWidget::HandleNextQueueClicked()
{
	SelectNextQueueEntry();
}

void UHyperTwistCoachDashboardWidget::EnsureDefaultDashboardBuilt()
{
	if (WidgetTree == nullptr || WidgetTree->RootWidget != nullptr)
	{
		return;
	}

	RootLayout = WidgetTree->ConstructWidget<UVerticalBox>(UVerticalBox::StaticClass(), TEXT("CoachDashboardRoot"));
	if (RootLayout == nullptr)
	{
		return;
	}

	WidgetTree->RootWidget = RootLayout;

	HeadlineTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHeadline"),
		6
	);
	SecondaryTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachSecondary"),
		4
	);
	FocusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachFocus"),
		8
	);
	ActiveRunHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachActiveRunHeader"),
		2
	);
	ActiveRunStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachActiveRunStatus"),
		2
	);
	ActiveRunSummaryTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachActiveRunSummary"),
		2
	);
	RunRecapHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRunRecapHeader"),
		2
	);
	RunRecapStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRunRecapStatus"),
		2
	);
	RunRecapDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRunRecapDetail"),
		2
	);
	GuidanceComparisonHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceComparisonHeader"),
		2
	);
	GuidanceComparisonStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceComparisonStatus"),
		2
	);
	GuidanceComparisonDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceComparisonDetail"),
		8
	);
	GuidanceOutcomeHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceOutcomeHeader"),
		2
	);
	GuidanceOutcomeStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceOutcomeStatus"),
		2
	);
	GuidanceOutcomeDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceOutcomeDetail"),
		8
	);
	GuidanceDecisionWeightingHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionWeightingHeader"),
		2
	);
	GuidanceDecisionWeightingStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionWeightingStatus"),
		2
	);
	GuidanceDecisionWeightingDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionWeightingDetail"),
		8
	);
	GuidancePreferenceHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidancePreferenceHeader"),
		2
	);
	GuidancePreferenceStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidancePreferenceStatus"),
		2
	);
	GuidancePreferenceDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidancePreferenceDetail"),
		8
	);
	GuidanceDecisionHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionHistoryHeader"),
		2
	);
	GuidanceDecisionHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionHistoryStatus"),
		2
	);
	GuidanceDecisionHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceDecisionHistoryDetail"),
		8
	);
	CoachHandoffHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffHeader"),
		2
	);
	CoachHandoffStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffStatus"),
		2
	);
	CoachHandoffRecommendationHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffRecommendationHeader"),
		2
	);
	CoachHandoffRecommendationStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffRecommendationStatus"),
		2
	);
	CoachHandoffRecommendationDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffRecommendationDetail"),
		8
	);
	TemplateLaunchHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchHeader"),
		2
	);
	TemplateLaunchStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchStatus"),
		2
	);
	TemplateLaunchDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchDetail"),
		8
	);
	TemplateLaunchHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchHistoryHeader"),
		2
	);
	TemplateLaunchHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchHistoryStatus"),
		2
	);
	TemplateLaunchHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTemplateLaunchHistoryDetail"),
		8
	);
	UHorizontalBox* TemplateLaunchHistoryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardTemplateLaunchHistoryNavRow")
	);
	if (TemplateLaunchHistoryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* TemplateLaunchHistoryNavRowSlot =
				RootLayout->AddChildToVerticalBox(TemplateLaunchHistoryNavRow))
		{
			TemplateLaunchHistoryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousTemplateLaunchHistoryLabelRaw = nullptr;
		PreviousTemplateLaunchHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			TemplateLaunchHistoryNavRow,
			TEXT("PreviousTemplateLaunchHistoryButton"),
			TEXT("PreviousTemplateLaunchHistoryButtonLabel"),
			TEXT("Prev Template Launch"),
			PreviousTemplateLaunchHistoryLabelRaw
		);
		PreviousTemplateLaunchHistoryButtonLabel = PreviousTemplateLaunchHistoryLabelRaw;

		UTextBlock* NextTemplateLaunchHistoryLabelRaw = nullptr;
		NextTemplateLaunchHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			TemplateLaunchHistoryNavRow,
			TEXT("NextTemplateLaunchHistoryButton"),
			TEXT("NextTemplateLaunchHistoryButtonLabel"),
			TEXT("Next Template Launch"),
			NextTemplateLaunchHistoryLabelRaw
		);
		NextTemplateLaunchHistoryButtonLabel = NextTemplateLaunchHistoryLabelRaw;
	}
	HandoffHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffHistoryHeader"),
		2
	);
	HandoffHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffHistoryStatus"),
		2
	);
	HandoffHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachHandoffHistoryDetail"),
		8
	);
	GuidanceReviewHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceReviewHeader"),
		2
	);
	GuidanceRationaleHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceRationaleHeader"),
		2
	);
	GuidanceRationaleStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceRationaleStatus"),
		2
	);
	GuidanceRationaleDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidanceRationaleDetail"),
		8
	);
	GuidancePreviewSelectionTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidancePreviewSelection"),
		2
	);
	RecommendedDeckPreviewTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRecommendedDeckPreview"),
		2
	);
	FollowUpDeckPreviewTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachFollowUpDeckPreview"),
		2
	);
	GuidancePreviewCaseDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachGuidancePreviewCaseDetail"),
		2
	);
	MethodDrillDiagnosticsHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillDiagnosticsHeader"),
		2
	);
	MethodDrillDiagnosticsStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillDiagnosticsStatus"),
		2
	);
	MethodDrillDiagnosticsDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillDiagnosticsDetail"),
		8
	);
	UHorizontalBox* MethodDrillActionRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardMethodDrillActions")
	);
	if (MethodDrillActionRow != nullptr)
	{
		if (UVerticalBoxSlot* MethodDrillActionRowSlot = RootLayout->AddChildToVerticalBox(MethodDrillActionRow))
		{
			MethodDrillActionRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* StartMethodDrillFollowUpLabelRaw = nullptr;
		StartMethodDrillFollowUpButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			MethodDrillActionRow,
			TEXT("StartMethodDrillFollowUpButton"),
			TEXT("StartMethodDrillFollowUpButtonLabel"),
			TEXT("Launch Drill Follow-Up"),
			StartMethodDrillFollowUpLabelRaw
		);
		StartMethodDrillFollowUpButtonLabel = StartMethodDrillFollowUpLabelRaw;
	}
	MethodDrillFollowUpHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillFollowUpHistoryHeader"),
		2
	);
	MethodDrillFollowUpHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillFollowUpHistoryStatus"),
		2
	);
	MethodDrillFollowUpHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillFollowUpHistoryDetail"),
		8
	);
	UHorizontalBox* MethodDrillHistoryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardMethodDrillHistoryNavRow")
	);
	if (MethodDrillHistoryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* MethodDrillHistoryNavRowSlot = RootLayout->AddChildToVerticalBox(MethodDrillHistoryNavRow))
		{
			MethodDrillHistoryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousMethodDrillHistoryLabelRaw = nullptr;
		PreviousMethodDrillFollowUpHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			MethodDrillHistoryNavRow,
			TEXT("PreviousMethodDrillFollowUpHistoryButton"),
			TEXT("PreviousMethodDrillFollowUpHistoryButtonLabel"),
			TEXT("Prev Drill Follow-Up"),
			PreviousMethodDrillHistoryLabelRaw
		);
		PreviousMethodDrillFollowUpHistoryButtonLabel = PreviousMethodDrillHistoryLabelRaw;

		UTextBlock* NextMethodDrillHistoryLabelRaw = nullptr;
		NextMethodDrillFollowUpHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			MethodDrillHistoryNavRow,
			TEXT("NextMethodDrillFollowUpHistoryButton"),
			TEXT("NextMethodDrillFollowUpHistoryButtonLabel"),
			TEXT("Next Drill Follow-Up"),
			NextMethodDrillHistoryLabelRaw
		);
		NextMethodDrillFollowUpHistoryButtonLabel = NextMethodDrillHistoryLabelRaw;
	}
	UHorizontalBox* RunRecapActionRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardRunRecapActions")
	);
	if (RunRecapActionRow != nullptr)
	{
		if (UVerticalBoxSlot* RunRecapActionRowSlot = RootLayout->AddChildToVerticalBox(RunRecapActionRow))
		{
			RunRecapActionRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* RepeatRunLabelRaw = nullptr;
		RepeatRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunRecapActionRow,
			TEXT("RepeatRunButton"),
			TEXT("RepeatRunButtonLabel"),
			TEXT("Repeat Run"),
			RepeatRunLabelRaw
		);
		RepeatRunButtonLabel = RepeatRunLabelRaw;

		UTextBlock* GuidanceOutcomeActionLabelRaw = nullptr;
		GuidanceOutcomeActionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunRecapActionRow,
			TEXT("GuidanceOutcomeActionButton"),
			TEXT("GuidanceOutcomeActionButtonLabel"),
			TEXT("Apply Outcome"),
			GuidanceOutcomeActionLabelRaw
		);
		GuidanceOutcomeActionButtonLabel = GuidanceOutcomeActionLabelRaw;

		UTextBlock* PreviousGuidanceDecisionLabelRaw = nullptr;
		PreviousGuidanceDecisionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunRecapActionRow,
			TEXT("PreviousGuidanceDecisionButton"),
			TEXT("PreviousGuidanceDecisionButtonLabel"),
			TEXT("Prev Decision"),
			PreviousGuidanceDecisionLabelRaw
		);
		PreviousGuidanceDecisionButtonLabel = PreviousGuidanceDecisionLabelRaw;

		UTextBlock* NextGuidanceDecisionLabelRaw = nullptr;
		NextGuidanceDecisionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunRecapActionRow,
			TEXT("NextGuidanceDecisionButton"),
			TEXT("NextGuidanceDecisionButtonLabel"),
			TEXT("Next Decision"),
			NextGuidanceDecisionLabelRaw
		);
		NextGuidanceDecisionButtonLabel = NextGuidanceDecisionLabelRaw;

		UTextBlock* DismissRecapLabelRaw = nullptr;
		DismissRecapButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunRecapActionRow,
			TEXT("DismissRecapButton"),
			TEXT("DismissRecapButtonLabel"),
			TEXT("Dismiss Recap"),
			DismissRecapLabelRaw
		);
		DismissRecapButtonLabel = DismissRecapLabelRaw;
	}
	UHorizontalBox* CoachHandoffActionRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardHandoffActions")
	);
	if (CoachHandoffActionRow != nullptr)
	{
		if (UVerticalBoxSlot* CoachHandoffActionRowSlot = RootLayout->AddChildToVerticalBox(CoachHandoffActionRow))
		{
			CoachHandoffActionRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* StartQueuedRunLabelRaw = nullptr;
		StartQueuedRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			CoachHandoffActionRow,
			TEXT("StartQueuedRunButton"),
			TEXT("StartQueuedRunButtonLabel"),
			TEXT("Start Queue"),
			StartQueuedRunLabelRaw
		);
		StartQueuedRunButtonLabel = StartQueuedRunLabelRaw;

		UTextBlock* StartFollowUpRunLabelRaw = nullptr;
		StartFollowUpRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			CoachHandoffActionRow,
			TEXT("StartFollowUpRunButton"),
			TEXT("StartFollowUpRunButtonLabel"),
			TEXT("Start Follow-Up"),
			StartFollowUpRunLabelRaw
		);
		StartFollowUpRunButtonLabel = StartFollowUpRunLabelRaw;

		UTextBlock* StartRecommendedRunLabelRaw = nullptr;
		StartRecommendedRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			CoachHandoffActionRow,
			TEXT("StartRecommendedRunButton"),
			TEXT("StartRecommendedRunButtonLabel"),
			TEXT("Start Recommended"),
			StartRecommendedRunLabelRaw
		);
		StartRecommendedRunButtonLabel = StartRecommendedRunLabelRaw;

		UTextBlock* StartTemplateLaunchLabelRaw = nullptr;
		StartTemplateLaunchButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			CoachHandoffActionRow,
			TEXT("StartTemplateLaunchButton"),
			TEXT("StartTemplateLaunchButtonLabel"),
			TEXT("Launch Template"),
			StartTemplateLaunchLabelRaw
		);
		StartTemplateLaunchButtonLabel = StartTemplateLaunchLabelRaw;
	}
	UHorizontalBox* HandoffHistoryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardHandoffHistoryNavRow")
	);
	if (HandoffHistoryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* HandoffHistoryNavRowSlot = RootLayout->AddChildToVerticalBox(HandoffHistoryNavRow))
		{
			HandoffHistoryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousHandoffHistoryLabelRaw = nullptr;
		PreviousHandoffHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			HandoffHistoryNavRow,
			TEXT("PreviousHandoffHistoryButton"),
			TEXT("PreviousHandoffHistoryButtonLabel"),
			TEXT("Prev Handoff"),
			PreviousHandoffHistoryLabelRaw
		);
		PreviousHandoffHistoryButtonLabel = PreviousHandoffHistoryLabelRaw;

		UTextBlock* NextHandoffHistoryLabelRaw = nullptr;
		NextHandoffHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			HandoffHistoryNavRow,
			TEXT("NextHandoffHistoryButton"),
			TEXT("NextHandoffHistoryButtonLabel"),
			TEXT("Next Handoff"),
			NextHandoffHistoryLabelRaw
		);
		NextHandoffHistoryButtonLabel = NextHandoffHistoryLabelRaw;
	}
	UHorizontalBox* GuidancePreviewActionRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardGuidancePreviewActions")
	);
	if (GuidancePreviewActionRow != nullptr)
	{
		if (UVerticalBoxSlot* GuidancePreviewActionRowSlot = RootLayout->AddChildToVerticalBox(GuidancePreviewActionRow))
		{
			GuidancePreviewActionRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviewRecommendedLabelRaw = nullptr;
		PreviewRecommendedButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("PreviewRecommendedButton"),
			TEXT("PreviewRecommendedButtonLabel"),
			TEXT("Preview Recommended"),
			PreviewRecommendedLabelRaw
		);
		PreviewRecommendedButtonLabel = PreviewRecommendedLabelRaw;

		UTextBlock* PreviewFollowUpLabelRaw = nullptr;
		PreviewFollowUpButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("PreviewFollowUpButton"),
			TEXT("PreviewFollowUpButtonLabel"),
			TEXT("Preview Follow-Up"),
			PreviewFollowUpLabelRaw
		);
		PreviewFollowUpButtonLabel = PreviewFollowUpLabelRaw;

		UTextBlock* PreviousGuidanceCaseLabelRaw = nullptr;
		PreviousGuidanceCaseButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("PreviousGuidanceCaseButton"),
			TEXT("PreviousGuidanceCaseButtonLabel"),
			TEXT("Prev Guidance Case"),
			PreviousGuidanceCaseLabelRaw
		);
		PreviousGuidanceCaseButtonLabel = PreviousGuidanceCaseLabelRaw;

		UTextBlock* NextGuidanceCaseLabelRaw = nullptr;
		NextGuidanceCaseButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("NextGuidanceCaseButton"),
			TEXT("NextGuidanceCaseButtonLabel"),
			TEXT("Next Guidance Case"),
			NextGuidanceCaseLabelRaw
		);
		NextGuidanceCaseButtonLabel = NextGuidanceCaseLabelRaw;

		UTextBlock* StartPreviewDeckLabelRaw = nullptr;
		StartPreviewDeckButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("StartPreviewDeckButton"),
			TEXT("StartPreviewDeckButtonLabel"),
			TEXT("Start Preview Deck"),
			StartPreviewDeckLabelRaw
		);
		StartPreviewDeckButtonLabel = StartPreviewDeckLabelRaw;

		UTextBlock* StartPreviewCaseLabelRaw = nullptr;
		StartPreviewCaseButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			GuidancePreviewActionRow,
			TEXT("StartPreviewCaseButton"),
			TEXT("StartPreviewCaseButtonLabel"),
			TEXT("Start Selected Preview Case"),
			StartPreviewCaseLabelRaw
		);
		StartPreviewCaseButtonLabel = StartPreviewCaseLabelRaw;
	}
	LastAttemptTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachLastAttempt"),
		2
	);
	LastAttemptTimingTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachLastAttemptTiming"),
		2
	);
	LastAttemptPhaseTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachLastAttemptPhase"),
		2
	);
	CurrentCaseHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachCurrentCaseHeader"),
		2
	);
	CurrentCasePromptTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachCurrentCasePrompt"),
		2
	);
	CurrentCaseNotationTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachCurrentCaseNotation"),
		2
	);
	TransitionHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTransitionHeader"),
		2
	);
	TransitionStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTransitionStatus"),
		2
	);
	AttemptControlHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachAttemptControlHeader"),
		2
	);
	AttemptInputStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachAttemptInputStatus"),
		2
	);
	TimerHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTimerHeader"),
		2
	);
	TimerStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachTimerStatus"),
		2
	);
	SplitHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachSplitHeader"),
		2
	);
	SplitStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachSplitStatus"),
		8
	);
	FollowUpTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachFollowUp"),
		4
	);
	QueueStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueStatus"),
		2
	);
	QueueSelectionTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueSelection"),
		2
	);
	QueueEntryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueEntryDetail"),
		2
	);
	QueueCountsTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueCounts"),
		2
	);
	QueueExecutionTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueExecution"),
		8
	);
	ScheduleHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachScheduleHeader"),
		2
	);
	ScheduleStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachScheduleStatus"),
		2
	);
	SchedulePolicyTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachSchedulePolicy"),
		2
	);
	ClosureRecoveryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryHeader"),
		2
	);
	ClosureRecoveryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryStatus"),
		2
	);
	ClosureRecoveryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryDetail"),
		8
	);
	ClosureRecoveryHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryHistoryHeader"),
		2
	);
	ClosureRecoveryHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryHistoryStatus"),
		2
	);
	ClosureRecoveryHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachClosureRecoveryHistoryDetail"),
		8
	);
	QueueRecoveryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryHeader"),
		2
	);
	QueueRecoveryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryStatus"),
		2
	);
	QueueRecoveryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryDetail"),
		2
	);
	QueueRecoveryOutcomeHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryOutcomeHeader"),
		2
	);
	QueueRecoveryOutcomeStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryOutcomeStatus"),
		2
	);
	QueueRecoveryOutcomeDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueRecoveryOutcomeDetail"),
		8
	);
	MethodDrillRecoveryHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillRecoveryHistoryHeader"),
		2
	);
	MethodDrillRecoveryHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillRecoveryHistoryStatus"),
		2
	);
	MethodDrillRecoveryHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachMethodDrillRecoveryHistoryDetail"),
		8
	);
	MethodDrillRecoveryMemoryHistoryHeaderTextBlock =
		HyperTwistCoachDashboardWidgetInternal::AddTextRow(
			WidgetTree,
			RootLayout,
			TEXT("CoachMethodDrillRecoveryMemoryHistoryHeader"),
			2
		);
	MethodDrillRecoveryMemoryHistoryStatusTextBlock =
		HyperTwistCoachDashboardWidgetInternal::AddTextRow(
			WidgetTree,
			RootLayout,
			TEXT("CoachMethodDrillRecoveryMemoryHistoryStatus"),
			2
		);
	MethodDrillRecoveryMemoryHistoryDetailTextBlock =
		HyperTwistCoachDashboardWidgetInternal::AddTextRow(
			WidgetTree,
			RootLayout,
			TEXT("CoachMethodDrillRecoveryMemoryHistoryDetail"),
			8
		);
	QueueSuppressionHistoryHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueSuppressionHistoryHeader"),
		2
	);
	QueueSuppressionHistoryStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueSuppressionHistoryStatus"),
		2
	);
	QueueSuppressionHistoryDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachQueueSuppressionHistoryDetail"),
		8
	);
	RecognitionStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRecognitionStatus"),
		2
	);
	RecognitionDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachRecognitionDetail"),
		8
	);
	ReviewPolicyStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachReviewPolicyStatus"),
		2
	);
	ReviewPolicyDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachReviewPolicyDetail"),
		8
	);
	VerificationStatusTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachVerificationStatus"),
		2
	);
	VerificationHeaderTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachVerificationHeader"),
		2
	);
	VerificationDetailTextBlock = HyperTwistCoachDashboardWidgetInternal::AddTextRow(
		WidgetTree,
		RootLayout,
		TEXT("CoachVerificationDetail"),
		10
	);

	UHorizontalBox* ButtonRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardButtons")
	);
	if (ButtonRow != nullptr)
	{
		if (UVerticalBoxSlot* ButtonRowSlot = RootLayout->AddChildToVerticalBox(ButtonRow))
		{
			ButtonRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PrimaryActionLabelRaw = nullptr;
		PrimaryActionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ButtonRow,
			TEXT("PrimaryActionButton"),
			TEXT("PrimaryActionButtonLabel"),
			TEXT("Start"),
			PrimaryActionLabelRaw
		);
		PrimaryActionButtonLabel = PrimaryActionLabelRaw;

		UTextBlock* VerifyLabelRaw = nullptr;
		VerifyButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ButtonRow,
			TEXT("VerifyButton"),
			TEXT("VerifyButtonLabel"),
			TEXT("Verify"),
			VerifyLabelRaw
		);
		VerifyButtonLabel = VerifyLabelRaw;

		UTextBlock* DeferLabelRaw = nullptr;
		DeferButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ButtonRow,
			TEXT("DeferButton"),
			TEXT("DeferButtonLabel"),
			TEXT("Defer"),
			DeferLabelRaw
		);
		DeferButtonLabel = DeferLabelRaw;

		UTextBlock* PromoteLabelRaw = nullptr;
		PromoteButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ButtonRow,
			TEXT("PromoteButton"),
			TEXT("PromoteButtonLabel"),
			TEXT("Promote"),
			PromoteLabelRaw
		);
		PromoteButtonLabel = PromoteLabelRaw;

		UTextBlock* QueueRecoveryActionLabelRaw = nullptr;
		QueueRecoveryActionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ButtonRow,
			TEXT("QueueRecoveryActionButton"),
			TEXT("QueueRecoveryActionButtonLabel"),
			TEXT("Apply Recovery"),
			QueueRecoveryActionLabelRaw
		);
		QueueRecoveryActionButtonLabel = QueueRecoveryActionLabelRaw;
	}

	UHorizontalBox* QueueSuppressionNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardQueueSuppressionNavRow")
	);
	if (QueueSuppressionNavRow != nullptr)
	{
		if (UVerticalBoxSlot* QueueSuppressionNavRowSlot = RootLayout->AddChildToVerticalBox(QueueSuppressionNavRow))
		{
			QueueSuppressionNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousQueueSuppressionLabelRaw = nullptr;
		PreviousQueueSuppressionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			QueueSuppressionNavRow,
			TEXT("PreviousQueueSuppressionButton"),
			TEXT("PreviousQueueSuppressionButtonLabel"),
			TEXT("Prev Suppression"),
			PreviousQueueSuppressionLabelRaw
		);
		PreviousQueueSuppressionButtonLabel = PreviousQueueSuppressionLabelRaw;

		UTextBlock* NextQueueSuppressionLabelRaw = nullptr;
		NextQueueSuppressionButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			QueueSuppressionNavRow,
			TEXT("NextQueueSuppressionButton"),
			TEXT("NextQueueSuppressionButtonLabel"),
			TEXT("Next Suppression"),
			NextQueueSuppressionLabelRaw
		);
		NextQueueSuppressionButtonLabel = NextQueueSuppressionLabelRaw;
	}

	UHorizontalBox* ClosureRecoveryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardClosureRecoveryNavRow")
	);
	if (ClosureRecoveryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* ClosureRecoveryNavRowSlot = RootLayout->AddChildToVerticalBox(ClosureRecoveryNavRow))
		{
			ClosureRecoveryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousClosureRecoveryLabelRaw = nullptr;
		PreviousClosureRecoveryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ClosureRecoveryNavRow,
			TEXT("PreviousClosureRecoveryButton"),
			TEXT("PreviousClosureRecoveryButtonLabel"),
			TEXT("Prev Closure"),
			PreviousClosureRecoveryLabelRaw
		);
		PreviousClosureRecoveryButtonLabel = PreviousClosureRecoveryLabelRaw;

		UTextBlock* NextClosureRecoveryLabelRaw = nullptr;
		NextClosureRecoveryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			ClosureRecoveryNavRow,
			TEXT("NextClosureRecoveryButton"),
			TEXT("NextClosureRecoveryButtonLabel"),
			TEXT("Next Closure"),
			NextClosureRecoveryLabelRaw
		);
		NextClosureRecoveryButtonLabel = NextClosureRecoveryLabelRaw;
	}

	UHorizontalBox* MethodDrillRecoveryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardMethodDrillRecoveryNavRow")
	);
	if (MethodDrillRecoveryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* MethodDrillRecoveryNavRowSlot =
				RootLayout->AddChildToVerticalBox(MethodDrillRecoveryNavRow))
		{
			MethodDrillRecoveryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousMethodDrillRecoveryLabelRaw = nullptr;
		PreviousMethodDrillRecoveryHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			MethodDrillRecoveryNavRow,
			TEXT("PreviousMethodDrillRecoveryHistoryButton"),
			TEXT("PreviousMethodDrillRecoveryHistoryButtonLabel"),
			TEXT("Prev Drill Recovery"),
			PreviousMethodDrillRecoveryLabelRaw
		);
		PreviousMethodDrillRecoveryHistoryButtonLabel = PreviousMethodDrillRecoveryLabelRaw;

		UTextBlock* NextMethodDrillRecoveryLabelRaw = nullptr;
		NextMethodDrillRecoveryHistoryButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			MethodDrillRecoveryNavRow,
			TEXT("NextMethodDrillRecoveryHistoryButton"),
			TEXT("NextMethodDrillRecoveryHistoryButtonLabel"),
			TEXT("Next Drill Recovery"),
			NextMethodDrillRecoveryLabelRaw
		);
		NextMethodDrillRecoveryHistoryButtonLabel = NextMethodDrillRecoveryLabelRaw;
	}

	UHorizontalBox* MethodDrillRecoveryMemoryNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardMethodDrillRecoveryMemoryNavRow")
	);
	if (MethodDrillRecoveryMemoryNavRow != nullptr)
	{
		if (UVerticalBoxSlot* MethodDrillRecoveryMemoryNavRowSlot =
				RootLayout->AddChildToVerticalBox(MethodDrillRecoveryMemoryNavRow))
		{
			MethodDrillRecoveryMemoryNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousMethodDrillRecoveryMemoryLabelRaw = nullptr;
		PreviousMethodDrillRecoveryMemoryHistoryButton =
			HyperTwistCoachDashboardWidgetInternal::AddButton(
				WidgetTree,
				MethodDrillRecoveryMemoryNavRow,
				TEXT("PreviousMethodDrillRecoveryMemoryHistoryButton"),
				TEXT("PreviousMethodDrillRecoveryMemoryHistoryButtonLabel"),
				TEXT("Prev Drill Memory"),
				PreviousMethodDrillRecoveryMemoryLabelRaw
			);
		PreviousMethodDrillRecoveryMemoryHistoryButtonLabel =
			PreviousMethodDrillRecoveryMemoryLabelRaw;

		UTextBlock* NextMethodDrillRecoveryMemoryLabelRaw = nullptr;
		NextMethodDrillRecoveryMemoryHistoryButton =
			HyperTwistCoachDashboardWidgetInternal::AddButton(
				WidgetTree,
				MethodDrillRecoveryMemoryNavRow,
				TEXT("NextMethodDrillRecoveryMemoryHistoryButton"),
				TEXT("NextMethodDrillRecoveryMemoryHistoryButtonLabel"),
				TEXT("Next Drill Memory"),
				NextMethodDrillRecoveryMemoryLabelRaw
			);
		NextMethodDrillRecoveryMemoryHistoryButtonLabel =
			NextMethodDrillRecoveryMemoryLabelRaw;
	}

	UHorizontalBox* AttemptInputRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardAttemptInputRow")
	);
	if (AttemptInputRow != nullptr)
	{
		if (UVerticalBoxSlot* AttemptInputRowSlot = RootLayout->AddChildToVerticalBox(AttemptInputRow))
		{
			AttemptInputRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		AttemptTimeTextBox = HyperTwistCoachDashboardWidgetInternal::AddEditableTextBox(
			WidgetTree,
			AttemptInputRow,
			TEXT("AttemptTimeTextBox")
		);
		if (AttemptTimeTextBox != nullptr)
		{
			AttemptTimeTextBox->SetHintText(FText::FromString(TEXT("Enter attempt ms")));
		}

		UTextBlock* UseTargetTimeLabelRaw = nullptr;
		UseTargetTimeButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			AttemptInputRow,
			TEXT("UseTargetTimeButton"),
			TEXT("UseTargetTimeButtonLabel"),
			TEXT("Use Target"),
			UseTargetTimeLabelRaw
		);
		UseTargetTimeButtonLabel = UseTargetTimeLabelRaw;

		UTextBlock* UseAverageTimeLabelRaw = nullptr;
		UseAverageTimeButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			AttemptInputRow,
			TEXT("UseAverageTimeButton"),
			TEXT("UseAverageTimeButtonLabel"),
			TEXT("Use Avg"),
			UseAverageTimeLabelRaw
		);
		UseAverageTimeButtonLabel = UseAverageTimeLabelRaw;
	}

	UHorizontalBox* LiveTimerRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardLiveTimerRow")
	);
	if (LiveTimerRow != nullptr)
	{
		if (UVerticalBoxSlot* LiveTimerRowSlot = RootLayout->AddChildToVerticalBox(LiveTimerRow))
		{
			LiveTimerRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* StartTimerLabelRaw = nullptr;
		StartTimerButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			LiveTimerRow,
			TEXT("StartTimerButton"),
			TEXT("StartTimerButtonLabel"),
			TEXT("Start Attempt"),
			StartTimerLabelRaw
		);
		StartTimerButtonLabel = StartTimerLabelRaw;

		UTextBlock* CancelTimerLabelRaw = nullptr;
		CancelTimerButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			LiveTimerRow,
			TEXT("CancelTimerButton"),
			TEXT("CancelTimerButtonLabel"),
			TEXT("Cancel Timer"),
			CancelTimerLabelRaw
		);
		CancelTimerButtonLabel = CancelTimerLabelRaw;
	}

	UHorizontalBox* SplitCaptureRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardSplitCaptureRow")
	);
	if (SplitCaptureRow != nullptr)
	{
		if (UVerticalBoxSlot* SplitCaptureRowSlot = RootLayout->AddChildToVerticalBox(SplitCaptureRow))
		{
			SplitCaptureRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* CaptureSplitLabelRaw = nullptr;
		CaptureSplitButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			SplitCaptureRow,
			TEXT("CaptureSplitButton"),
			TEXT("CaptureSplitButtonLabel"),
			TEXT("Capture Split"),
			CaptureSplitLabelRaw
		);
		CaptureSplitButtonLabel = CaptureSplitLabelRaw;

		UTextBlock* UndoSplitLabelRaw = nullptr;
		UndoSplitButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			SplitCaptureRow,
			TEXT("UndoSplitButton"),
			TEXT("UndoSplitButtonLabel"),
			TEXT("Undo Split"),
			UndoSplitLabelRaw
		);
		UndoSplitButtonLabel = UndoSplitLabelRaw;
	}

	UHorizontalBox* RunControlRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardRunControlButtons")
	);
	if (RunControlRow != nullptr)
	{
		if (UVerticalBoxSlot* RunControlRowSlot = RootLayout->AddChildToVerticalBox(RunControlRow))
		{
			RunControlRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* CompleteRunLabelRaw = nullptr;
		CompleteRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("CompleteRunButton"),
			TEXT("CompleteRunButtonLabel"),
			TEXT("Complete Run"),
			CompleteRunLabelRaw
		);
		CompleteRunButtonLabel = CompleteRunLabelRaw;

		UTextBlock* ContinueRunLabelRaw = nullptr;
		ContinueRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("ContinueRunButton"),
			TEXT("ContinueRunButtonLabel"),
			TEXT("Continue Run"),
			ContinueRunLabelRaw
		);
		ContinueRunButtonLabel = ContinueRunLabelRaw;

		UTextBlock* ClearRunLabelRaw = nullptr;
		ClearRunButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("ClearRunButton"),
			TEXT("ClearRunButtonLabel"),
			TEXT("Clear Run"),
			ClearRunLabelRaw
		);
		ClearRunButtonLabel = ClearRunLabelRaw;

		UTextBlock* RecordSuccessLabelRaw = nullptr;
		RecordSuccessButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("RecordSuccessButton"),
			TEXT("RecordSuccessButtonLabel"),
			TEXT("Record Success"),
			RecordSuccessLabelRaw
		);
		RecordSuccessButtonLabel = RecordSuccessLabelRaw;

		UTextBlock* RecordFailureLabelRaw = nullptr;
		RecordFailureButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("RecordFailureButton"),
			TEXT("RecordFailureButtonLabel"),
			TEXT("Record Failure"),
			RecordFailureLabelRaw
		);
		RecordFailureButtonLabel = RecordFailureLabelRaw;

		UTextBlock* RecordTimeoutLabelRaw = nullptr;
		RecordTimeoutButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("RecordTimeoutButton"),
			TEXT("RecordTimeoutButtonLabel"),
			TEXT("Record Timeout"),
			RecordTimeoutLabelRaw
		);
		RecordTimeoutButtonLabel = RecordTimeoutLabelRaw;

		UTextBlock* RecordDnfLabelRaw = nullptr;
		RecordDnfButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			RunControlRow,
			TEXT("RecordDnfButton"),
			TEXT("RecordDnfButtonLabel"),
			TEXT("Record DNF"),
			RecordDnfLabelRaw
		);
		RecordDnfButtonLabel = RecordDnfLabelRaw;
	}

	UHorizontalBox* AttemptReviewRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardAttemptReviewButtons")
	);
	if (AttemptReviewRow != nullptr)
	{
		if (UVerticalBoxSlot* AttemptReviewRowSlot = RootLayout->AddChildToVerticalBox(AttemptReviewRow))
		{
			AttemptReviewRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousAttemptLabelRaw = nullptr;
		PreviousAttemptButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			AttemptReviewRow,
			TEXT("PreviousAttemptButton"),
			TEXT("PreviousAttemptButtonLabel"),
			TEXT("Prev Attempt"),
			PreviousAttemptLabelRaw
		);
		PreviousAttemptButtonLabel = PreviousAttemptLabelRaw;

		UTextBlock* NextAttemptLabelRaw = nullptr;
		NextAttemptButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			AttemptReviewRow,
			TEXT("NextAttemptButton"),
			TEXT("NextAttemptButtonLabel"),
			TEXT("Next Attempt"),
			NextAttemptLabelRaw
		);
		NextAttemptButtonLabel = NextAttemptLabelRaw;
	}

	UHorizontalBox* QueueNavRow = WidgetTree->ConstructWidget<UHorizontalBox>(
		UHorizontalBox::StaticClass(),
		TEXT("CoachDashboardQueueNavButtons")
	);
	if (QueueNavRow != nullptr)
	{
		if (UVerticalBoxSlot* QueueNavRowSlot = RootLayout->AddChildToVerticalBox(QueueNavRow))
		{
			QueueNavRowSlot->SetPadding(FMargin(0.0f, 4.0f, 0.0f, 0.0f));
		}

		UTextBlock* PreviousQueueLabelRaw = nullptr;
		PreviousQueueButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			QueueNavRow,
			TEXT("PreviousQueueButton"),
			TEXT("PreviousQueueButtonLabel"),
			TEXT("Prev Queue"),
			PreviousQueueLabelRaw
		);
		PreviousQueueButtonLabel = PreviousQueueLabelRaw;

		UTextBlock* StartSelectedLabelRaw = nullptr;
		StartSelectedButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			QueueNavRow,
			TEXT("StartSelectedQueueButton"),
			TEXT("StartSelectedQueueButtonLabel"),
			TEXT("Start Selected"),
			StartSelectedLabelRaw
		);
		StartSelectedButtonLabel = StartSelectedLabelRaw;

		UTextBlock* NextQueueLabelRaw = nullptr;
		NextQueueButton = HyperTwistCoachDashboardWidgetInternal::AddButton(
			WidgetTree,
			QueueNavRow,
			TEXT("NextQueueButton"),
			TEXT("NextQueueButtonLabel"),
			TEXT("Next Queue"),
			NextQueueLabelRaw
		);
		NextQueueButtonLabel = NextQueueLabelRaw;
	}

	if (PrimaryActionButton != nullptr)
	{
		PrimaryActionButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePrimaryActionClicked);
	}
	if (VerifyButton != nullptr)
	{
		VerifyButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleVerifyClicked);
	}
	if (DeferButton != nullptr)
	{
		DeferButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleDeferClicked);
	}
	if (PromoteButton != nullptr)
	{
		PromoteButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePromoteClicked);
	}
	if (QueueRecoveryActionButton != nullptr)
	{
		QueueRecoveryActionButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleApplyQueueRecoveryClicked);
	}
	if (PreviousQueueSuppressionButton != nullptr)
	{
		PreviousQueueSuppressionButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousQueueSuppressionClicked
		);
	}
	if (NextQueueSuppressionButton != nullptr)
	{
		NextQueueSuppressionButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextQueueSuppressionClicked
		);
	}
	if (PreviousClosureRecoveryButton != nullptr)
	{
		PreviousClosureRecoveryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousClosureRecoveryClicked
		);
	}
	if (NextClosureRecoveryButton != nullptr)
	{
		NextClosureRecoveryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextClosureRecoveryClicked
		);
	}
	if (RepeatRunButton != nullptr)
	{
		RepeatRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleRepeatRunClicked);
	}
	if (GuidanceOutcomeActionButton != nullptr)
	{
		GuidanceOutcomeActionButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleGuidanceOutcomeActionClicked);
	}
	if (PreviousGuidanceDecisionButton != nullptr)
	{
		PreviousGuidanceDecisionButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviousGuidanceDecisionClicked);
	}
	if (NextGuidanceDecisionButton != nullptr)
	{
		NextGuidanceDecisionButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleNextGuidanceDecisionClicked);
	}
	if (PreviousHandoffHistoryButton != nullptr)
	{
		PreviousHandoffHistoryButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviousHandoffHistoryClicked);
	}
	if (NextHandoffHistoryButton != nullptr)
	{
		NextHandoffHistoryButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleNextHandoffHistoryClicked);
	}
	if (PreviousTemplateLaunchHistoryButton != nullptr)
	{
		PreviousTemplateLaunchHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousTemplateLaunchHistoryClicked
		);
	}
	if (NextTemplateLaunchHistoryButton != nullptr)
	{
		NextTemplateLaunchHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextTemplateLaunchHistoryClicked
		);
	}
	if (DismissRecapButton != nullptr)
	{
		DismissRecapButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleDismissRecapClicked);
	}
	if (StartQueuedRunButton != nullptr)
	{
		StartQueuedRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartQueuedRunClicked);
	}
	if (StartFollowUpRunButton != nullptr)
	{
		StartFollowUpRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartFollowUpRunClicked);
	}
	if (StartRecommendedRunButton != nullptr)
	{
		StartRecommendedRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartRecommendedRunClicked);
	}
	if (StartTemplateLaunchButton != nullptr)
	{
		StartTemplateLaunchButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleStartTemplateLaunchClicked);
	}
	if (PreviewRecommendedButton != nullptr)
	{
		PreviewRecommendedButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviewRecommendedClicked);
	}
	if (PreviewFollowUpButton != nullptr)
	{
		PreviewFollowUpButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviewFollowUpClicked);
	}
	if (PreviousGuidanceCaseButton != nullptr)
	{
		PreviousGuidanceCaseButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviousGuidanceCaseClicked);
	}
	if (NextGuidanceCaseButton != nullptr)
	{
		NextGuidanceCaseButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleNextGuidanceCaseClicked);
	}
	if (StartPreviewDeckButton != nullptr)
	{
		StartPreviewDeckButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartPreviewDeckClicked);
	}
	if (StartPreviewCaseButton != nullptr)
	{
		StartPreviewCaseButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartPreviewCaseClicked);
	}
	if (StartMethodDrillFollowUpButton != nullptr)
	{
		StartMethodDrillFollowUpButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleStartMethodDrillFollowUpClicked
		);
	}
	if (PreviousMethodDrillFollowUpHistoryButton != nullptr)
	{
		PreviousMethodDrillFollowUpHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillFollowUpHistoryClicked
		);
	}
	if (NextMethodDrillFollowUpHistoryButton != nullptr)
	{
		NextMethodDrillFollowUpHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextMethodDrillFollowUpHistoryClicked
		);
	}
	if (PreviousMethodDrillRecoveryHistoryButton != nullptr)
	{
		PreviousMethodDrillRecoveryHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillRecoveryHistoryClicked
		);
	}
	if (NextMethodDrillRecoveryHistoryButton != nullptr)
	{
		NextMethodDrillRecoveryHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextMethodDrillRecoveryHistoryClicked
		);
	}
	if (PreviousMethodDrillRecoveryMemoryHistoryButton != nullptr)
	{
		PreviousMethodDrillRecoveryMemoryHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandlePreviousMethodDrillRecoveryMemoryHistoryClicked
		);
	}
	if (NextMethodDrillRecoveryMemoryHistoryButton != nullptr)
	{
		NextMethodDrillRecoveryMemoryHistoryButton->OnClicked.AddDynamic(
			this,
			&UHyperTwistCoachDashboardWidget::HandleNextMethodDrillRecoveryMemoryHistoryClicked
		);
	}
	if (CompleteRunButton != nullptr)
	{
		CompleteRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleCompleteRunClicked);
	}
	if (ContinueRunButton != nullptr)
	{
		ContinueRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleContinueRunClicked);
	}
	if (ClearRunButton != nullptr)
	{
		ClearRunButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleClearRunClicked);
	}
	if (RecordSuccessButton != nullptr)
	{
		RecordSuccessButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleRecordSuccessClicked);
	}
	if (RecordFailureButton != nullptr)
	{
		RecordFailureButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleRecordFailureClicked);
	}
	if (RecordTimeoutButton != nullptr)
	{
		RecordTimeoutButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleRecordTimeoutClicked);
	}
	if (RecordDnfButton != nullptr)
	{
		RecordDnfButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleRecordDnfClicked);
	}
	if (UseTargetTimeButton != nullptr)
	{
		UseTargetTimeButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleUseTargetTimeClicked);
	}
	if (UseAverageTimeButton != nullptr)
	{
		UseAverageTimeButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleUseAverageTimeClicked);
	}
	if (StartTimerButton != nullptr)
	{
		StartTimerButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartTimerClicked);
	}
	if (CancelTimerButton != nullptr)
	{
		CancelTimerButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleCancelTimerClicked);
	}
	if (CaptureSplitButton != nullptr)
	{
		CaptureSplitButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleCaptureSplitClicked);
	}
	if (UndoSplitButton != nullptr)
	{
		UndoSplitButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleUndoSplitClicked);
	}
	if (PreviousQueueButton != nullptr)
	{
		PreviousQueueButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviousQueueClicked);
	}
	if (PreviousAttemptButton != nullptr)
	{
		PreviousAttemptButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandlePreviousAttemptClicked);
	}
	if (StartSelectedButton != nullptr)
	{
		StartSelectedButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleStartSelectedClicked);
	}
	if (NextAttemptButton != nullptr)
	{
		NextAttemptButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleNextAttemptClicked);
	}
	if (NextQueueButton != nullptr)
	{
		NextQueueButton->OnClicked.AddDynamic(this, &UHyperTwistCoachDashboardWidget::HandleNextQueueClicked);
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedQueueEntry()
{
	if (CachedCoachSessionQueueState.Entries.Num() <= 0)
	{
		SelectedQueueEntryIndex = INDEX_NONE;
		return;
	}

	if (SelectedQueueEntryIndex >= 0
		&& SelectedQueueEntryIndex < CachedCoachSessionQueueState.Entries.Num())
	{
		return;
	}

	SelectedQueueEntryIndex = INDEX_NONE;

	if (bPreferActiveQueueSelectionOnRefresh && !CachedCoachPanelState.ActiveQueueEntryId.IsEmpty())
	{
		SelectedQueueEntryIndex = CachedCoachSessionQueueState.Entries.IndexOfByPredicate(
			[this](const FHyperTwistTrainingCoachSessionQueueStateEntry& Candidate)
			{
				return Candidate.EntryId == CachedCoachPanelState.ActiveQueueEntryId;
			}
		);
	}

	if (SelectedQueueEntryIndex == INDEX_NONE)
	{
		SelectedQueueEntryIndex = CachedCoachSessionQueueState.Entries.IndexOfByPredicate(
			[](const FHyperTwistTrainingCoachSessionQueueStateEntry& Candidate)
			{
				return Candidate.EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Ready
					|| (Candidate.EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Pending
						&& Candidate.bCanStartImmediately);
			}
		);
	}

	if (SelectedQueueEntryIndex == INDEX_NONE)
	{
		SelectedQueueEntryIndex = CachedCoachSessionQueueState.Entries.IndexOfByPredicate(
			[](const FHyperTwistTrainingCoachSessionQueueStateEntry& Candidate)
			{
				return Candidate.EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Deferred;
			}
		);
	}

	if (SelectedQueueEntryIndex == INDEX_NONE)
	{
		SelectedQueueEntryIndex = 0;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedAttempt()
{
	if (CachedRunState.Attempts.Num() <= 0)
	{
		SelectedAttemptIndex = INDEX_NONE;
		LastObservedAttemptCount = 0;
		return;
	}

	const bool bAttemptCountChanged = LastObservedAttemptCount != CachedRunState.Attempts.Num();
	const bool bSelectionStillValid =
		SelectedAttemptIndex >= 0 && SelectedAttemptIndex < CachedRunState.Attempts.Num();

	if (bPreferLatestAttemptSelectionOnRefresh && bAttemptCountChanged)
	{
		SelectedAttemptIndex = CachedRunState.Attempts.Num() - 1;
	}
	else if (!bSelectionStillValid)
	{
		SelectedAttemptIndex = CachedRunState.Attempts.Num() - 1;
	}

	LastObservedAttemptCount = CachedRunState.Attempts.Num();
}

void UHyperTwistCoachDashboardWidget::SyncRetainedRunRecap()
{
	if (CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.TemplateLaunchProvenance.IsStructurallyValid())
	{
		ActiveTemplateLaunchSessionId = CachedRunState.Session.TrainingSessionId;
		ActiveTemplateLaunchProvenance = CachedRunState.TemplateLaunchProvenance;
	}

	if (CachedRunState.Session.IsStructurallyValid()
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted))
	{
		RetainedRunRecapSummary = CachedRunSummary;
		bHasRetainedRunRecap = !RetainedRunRecapSummary.TrainingSessionId.IsEmpty();
		RetainedRunRecapDeck = CachedRunState.ActiveDeck;
		RetainedRunRecapUserId = CachedRunState.Session.UserId;
		RetainedRunRecapSessionId = CachedRunState.Session.TrainingSessionId;
		RetainedRunRecapMode = CachedRunState.Session.Mode;
		if (!ActiveTemplateLaunchSessionId.IsEmpty()
			&& ActiveTemplateLaunchSessionId == RetainedRunRecapSessionId
			&& ActiveTemplateLaunchProvenance.IsStructurallyValid())
		{
			bHasRetainedTemplateLaunch = true;
			RetainedTemplateLaunchSessionId = ActiveTemplateLaunchSessionId;
			RetainedTemplateLaunchProvenance = ActiveTemplateLaunchProvenance;
		}
		if (!ActiveGuidanceLaunchSessionId.IsEmpty()
			&& ActiveGuidanceLaunchSessionId == RetainedRunRecapSessionId
			&& ActiveGuidanceLaunchLane != EHyperTwistCoachDashboardGuidancePreviewLane::None)
		{
			bHasRetainedGuidanceComparison = true;
			RetainedGuidanceComparisonSessionId = ActiveGuidanceLaunchSessionId;
			RetainedGuidanceComparisonLane = ActiveGuidanceLaunchLane;
			bRetainedGuidanceComparisonSingleCase = bActiveGuidanceLaunchSingleCase;
			RetainedGuidanceComparisonBrief = ActiveGuidanceLaunchBrief;
			RetainedGuidanceComparisonDeck = ActiveGuidanceLaunchDeck;
			RetainedGuidanceComparisonSelectedCaseId = ActiveGuidanceLaunchSelectedCaseId;
		}
		if (!ActiveMethodDrillFollowUpLaunchSessionId.IsEmpty()
			&& ActiveMethodDrillFollowUpLaunchSessionId == RetainedRunRecapSessionId
			&& ActiveMethodDrillFollowUpLaunchDiagnosticPacket.IsStructurallyValid())
		{
			RecordMethodDrillFollowUpHistoryEntry(RetainedRunRecapSummary);
			ActiveMethodDrillFollowUpLaunchSessionId.Reset();
			ActiveMethodDrillFollowUpLaunchDiagnosticPacket =
				FHyperTwistTrainingMethodDrillDiagnosticPacket();
			ActiveMethodDrillFollowUpLaunchTemplate = FHyperTwistTrainingSessionTemplate();
			ActiveMethodDrillFollowUpLaunchPacketStructureLabel.Reset();
			ActiveMethodDrillFollowUpLaunchPacketLaneLabel.Reset();
			ActiveMethodDrillFollowUpLaunchPacketStanceLabel.Reset();
		}
	}

	SyncTemplateLaunchHistoryFromRepository();
}

void UHyperTwistCoachDashboardWidget::SyncSelectedGuidancePreviewCase()
{
	const FHyperTwistTrainingDeck* Deck = GetActiveGuidancePreviewDeck();
	if (Deck == nullptr || Deck->Cases.Num() <= 0)
	{
		SelectedGuidancePreviewCaseIndex = INDEX_NONE;
		return;
	}

	if (SelectedGuidancePreviewCaseIndex < 0
		|| SelectedGuidancePreviewCaseIndex >= Deck->Cases.Num())
	{
		SelectedGuidancePreviewCaseIndex = 0;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedGuidanceDecisionHistoryEntry()
{
	if (GuidanceDecisionHistoryEntries.Num() <= 0)
	{
		SelectedGuidanceDecisionIndex = INDEX_NONE;
		return;
	}

	if (SelectedGuidanceDecisionIndex < 0
		|| SelectedGuidanceDecisionIndex >= GuidanceDecisionHistoryEntries.Num())
	{
		SelectedGuidanceDecisionIndex = GuidanceDecisionHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedHandoffHistoryEntry()
{
	if (HandoffHistoryEntries.Num() <= 0)
	{
		SelectedHandoffHistoryIndex = INDEX_NONE;
		return;
	}

	if (SelectedHandoffHistoryIndex < 0
		|| SelectedHandoffHistoryIndex >= HandoffHistoryEntries.Num())
	{
		SelectedHandoffHistoryIndex = HandoffHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedTemplateLaunchHistoryEntry()
{
	if (TemplateLaunchHistoryEntries.Num() <= 0)
	{
		SelectedTemplateLaunchHistoryIndex = INDEX_NONE;
		return;
	}

	if (SelectedTemplateLaunchHistoryIndex < 0
		|| SelectedTemplateLaunchHistoryIndex >= TemplateLaunchHistoryEntries.Num())
	{
		SelectedTemplateLaunchHistoryIndex = TemplateLaunchHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedQueueSuppressionHistoryEntry()
{
	if (QueueSuppressionHistoryEntries.Num() <= 0)
	{
		SelectedQueueSuppressionIndex = INDEX_NONE;
		return;
	}

	if (SelectedQueueSuppressionIndex < 0
		|| SelectedQueueSuppressionIndex >= QueueSuppressionHistoryEntries.Num())
	{
		SelectedQueueSuppressionIndex = QueueSuppressionHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedClosureRecoveryHistoryEntry()
{
	if (ClosureRecoveryHistoryEntries.Num() <= 0)
	{
		SelectedClosureRecoveryIndex = INDEX_NONE;
		return;
	}

	if (SelectedClosureRecoveryIndex < 0
		|| SelectedClosureRecoveryIndex >= ClosureRecoveryHistoryEntries.Num())
	{
		SelectedClosureRecoveryIndex = ClosureRecoveryHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedMethodDrillFollowUpHistoryEntry()
{
	if (MethodDrillFollowUpHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillFollowUpHistoryIndex = INDEX_NONE;
		return;
	}

	if (SelectedMethodDrillFollowUpHistoryIndex < 0
		|| SelectedMethodDrillFollowUpHistoryIndex >= MethodDrillFollowUpHistoryEntries.Num())
	{
		SelectedMethodDrillFollowUpHistoryIndex = MethodDrillFollowUpHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedMethodDrillRecoveryOutcomeEntry()
{
	TArray<int32> MethodDrillRecoveryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryIndices
	);
	if (MethodDrillRecoveryIndices.Num() <= 0)
	{
		SelectedMethodDrillRecoveryOutcomeIndex = INDEX_NONE;
		return;
	}

	if (!MethodDrillRecoveryIndices.Contains(SelectedMethodDrillRecoveryOutcomeIndex))
	{
		SelectedMethodDrillRecoveryOutcomeIndex = MethodDrillRecoveryIndices.Last();
	}
}

void UHyperTwistCoachDashboardWidget::SyncSelectedMethodDrillRecoveryMemoryHistoryEntry()
{
	if (MethodDrillRecoveryMemoryHistoryEntries.Num() <= 0)
	{
		SelectedMethodDrillRecoveryMemoryHistoryIndex = INDEX_NONE;
		return;
	}

	if (SelectedMethodDrillRecoveryMemoryHistoryIndex < 0
		|| SelectedMethodDrillRecoveryMemoryHistoryIndex
			>= MethodDrillRecoveryMemoryHistoryEntries.Num())
	{
		SelectedMethodDrillRecoveryMemoryHistoryIndex =
			MethodDrillRecoveryMemoryHistoryEntries.Num() - 1;
	}
}

void UHyperTwistCoachDashboardWidget::SyncPreferredGuidancePreviewLane(const bool bForceAdoptPreferredLane)
{
	const FHyperTwistCoachDashboardGuidanceLanePreference Preference = BuildGuidanceLanePreference();
	if (!Preference.IsStructurallyValid())
	{
		if (ActiveGuidancePreviewLane != EHyperTwistCoachDashboardGuidancePreviewLane::None
			&& GetActiveGuidancePreviewDeck() == nullptr)
		{
			ActiveGuidancePreviewLane = EHyperTwistCoachDashboardGuidancePreviewLane::None;
			SelectedGuidancePreviewCaseIndex = INDEX_NONE;
		}
		return;
	}

	const bool bHasActivePreviewDeck = GetActiveGuidancePreviewDeck() != nullptr;
	if (bForceAdoptPreferredLane
		|| ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::None
		|| !bHasActivePreviewDeck)
	{
		ActiveGuidancePreviewLane = Preference.PreferredLane;
		SyncSelectedGuidancePreviewCase();
	}
}

const FHyperTwistTrainingDeck* UHyperTwistCoachDashboardWidget::GetActiveGuidancePreviewDeck() const
{
	switch (ActiveGuidancePreviewLane)
	{
	case EHyperTwistCoachDashboardGuidancePreviewLane::Recommended:
		return CachedCoachPanelState.bCanStartCoachRecommendedRun
				&& CachedCoachRecommendedDeck.IsStructurallyValid()
			? &CachedCoachRecommendedDeck
			: nullptr;
	case EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp:
		return CachedCoachPanelState.bCanStartCoachFollowUpRun
				&& CachedCoachFollowUpDeck.IsStructurallyValid()
			? &CachedCoachFollowUpDeck
			: nullptr;
	default:
		return nullptr;
	}
}

const FHyperTwistCoachBrief* UHyperTwistCoachDashboardWidget::GetActiveGuidancePreviewBrief() const
{
	switch (ActiveGuidancePreviewLane)
	{
	case EHyperTwistCoachDashboardGuidancePreviewLane::Recommended:
		return !CachedCoachPanelState.bCanStartCoachRecommendedRun
				|| (CachedCoachBrief.Headline.IsEmpty()
					&& CachedCoachBrief.PrimaryActionLabel.IsEmpty())
			? nullptr
			: &CachedCoachBrief;
	case EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp:
		return !CachedCoachPanelState.bCanStartCoachFollowUpRun
				|| !CachedCoachPanelState.bHasFollowUpGuidance
				|| (CachedCoachFollowUpBrief.Headline.IsEmpty()
					&& CachedCoachFollowUpBrief.PrimaryActionLabel.IsEmpty())
			? nullptr
			: &CachedCoachFollowUpBrief;
	default:
		return nullptr;
	}
}

const FHyperTwistTrainingSessionTemplate* UHyperTwistCoachDashboardWidget::FindPreferredDashboardTemplateLaunch(
	FHyperTwistTrainingTemplateLaunchSelectionProvenance* OutSelectionProvenance
) const
{
	if (OutSelectionProvenance != nullptr)
	{
		*OutSelectionProvenance = FHyperTwistTrainingTemplateLaunchSelectionProvenance();
	}

	const FString EffectiveDefaultUserId = DefaultUserId;
	const FHyperTwistTrainingSessionTemplate* PreferredTemplate = nullptr;
	int32 PreferredScore = TNumericLimits<int32>::Lowest();
	for (const FHyperTwistTrainingSessionTemplate& SessionTemplate : CachedActiveTrainingSessionTemplates)
	{
		const int32 TemplateScore =
			HyperTwistCoachDashboardWidgetInternal::ScoreTemplateForDashboardLaunch(SessionTemplate);
		if (TemplateScore > PreferredScore)
		{
			PreferredTemplate = &SessionTemplate;
			PreferredScore = TemplateScore;
			if (OutSelectionProvenance != nullptr)
			{
				*OutSelectionProvenance = FHyperTwistTrainingTemplateLaunchSelectionProvenance();
			}
			continue;
		}

		if (TemplateScore == PreferredScore
			&& TemplateScore > 0
			&& PreferredTemplate != nullptr)
		{
			const FString CandidateUserId =
				HyperTwistCoachDashboardWidgetInternal::ResolveDashboardTemplateAnalyticsUserId(
					SessionTemplate,
					EffectiveDefaultUserId
				);
			const FString PreferredUserId =
				HyperTwistCoachDashboardWidgetInternal::ResolveDashboardTemplateAnalyticsUserId(
					*PreferredTemplate,
					EffectiveDefaultUserId
				);
			const FHyperTwistTrainingTemplateLaunchScopedStats* CandidateStats =
				FindCachedTemplateLaunchScopedStats(SessionTemplate.TemplateId, CandidateUserId);
			const FHyperTwistTrainingTemplateLaunchScopedStats* PreferredStats =
				FindCachedTemplateLaunchScopedStats(PreferredTemplate->TemplateId, PreferredUserId);
			const HyperTwistCoachDashboardWidgetInternal::FTemplateLaunchAnalyticsPreferenceDecision
				AnalyticsDecision =
					HyperTwistCoachDashboardWidgetInternal::ResolveTemplateAnalyticsPreferenceDecision(
						CandidateStats,
						PreferredStats
					);
			if (AnalyticsDecision.bPreferCandidate)
			{
				const FHyperTwistTrainingSessionTemplate& PreviousPreferredTemplate = *PreferredTemplate;
				PreferredTemplate = &SessionTemplate;
				if (OutSelectionProvenance != nullptr)
				{
					*OutSelectionProvenance =
						HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsTieBreakSelectionProvenance(
							SessionTemplate,
							CandidateStats,
							PreviousPreferredTemplate,
							PreferredStats,
							AnalyticsDecision.CandidateAnalyticsSupportKind,
							AnalyticsDecision
								.bCandidateUsedTemplateSignalSupportBiasSnapshotGuard,
							AnalyticsDecision
								.bCandidateUsedTemplateSignalSupportDecisionBiasGuard,
							AnalyticsDecision
								.bCandidateUsedTemplateSignalSupportDecisionBiasSnapshotGuard
						);
				}
			}
		}
	}

	return PreferredScore > 0 ? PreferredTemplate : nullptr;
}

const FHyperTwistTrainingTemplateLaunchScopedStats*
UHyperTwistCoachDashboardWidget::FindCachedTemplateLaunchScopedStats(
	const FString& TemplateId,
	const FString& UserId
) const
{
	if (TemplateId.IsEmpty()
		|| CachedTemplateLaunchScopedStats.Num() <= 0)
	{
		return nullptr;
	}

	if (!UserId.IsEmpty()
		&& !CachedTemplateLaunchAnalyticsUserId.IsEmpty()
		&& UserId != CachedTemplateLaunchAnalyticsUserId)
	{
		return nullptr;
	}

	return CachedTemplateLaunchScopedStats.FindByPredicate(
		[&TemplateId, &UserId](const FHyperTwistTrainingTemplateLaunchScopedStats& Candidate)
		{
			return Candidate.TemplateId == TemplateId
				&& (UserId.IsEmpty() || Candidate.UserId.IsEmpty() || Candidate.UserId == UserId);
		}
	);
}

void UHyperTwistCoachDashboardWidget::CaptureActiveGuidanceLaunchContext(
	const FString& SessionId,
	const FHyperTwistTrainingDeck& Deck,
	const bool bSingleCaseLaunch,
	const FString& SelectedCaseId
)
{
	ActiveGuidanceLaunchSessionId = SessionId;
	ActiveGuidanceLaunchLane = ActiveGuidancePreviewLane;
	bActiveGuidanceLaunchSingleCase = bSingleCaseLaunch;
	ActiveGuidanceLaunchDeck = Deck;
	ActiveGuidanceLaunchSelectedCaseId = SelectedCaseId;
	ActiveGuidanceLaunchBrief = FHyperTwistCoachBrief();
	if (const FHyperTwistCoachBrief* ActiveBrief = GetActiveGuidancePreviewBrief())
	{
		ActiveGuidanceLaunchBrief = *ActiveBrief;
	}
}

void UHyperTwistCoachDashboardWidget::CaptureActiveTemplateLaunchContext(
	const FString& SessionId,
	const FHyperTwistTrainingTemplateLaunchProvenance& TemplateLaunchProvenance
)
{
	ActiveTemplateLaunchSessionId = SessionId;
	ActiveTemplateLaunchProvenance = TemplateLaunchProvenance;
}

void UHyperTwistCoachDashboardWidget::CaptureActiveMethodDrillFollowUpLaunchContext(
	const FString& SessionId
)
{
	ActiveMethodDrillFollowUpLaunchSessionId = SessionId;
	ActiveMethodDrillFollowUpLaunchDiagnosticPacket = CachedMethodDrillDiagnosticPacket;
	ActiveMethodDrillFollowUpLaunchTemplate = CachedMethodDrillFollowUpTemplate;
	ActiveMethodDrillFollowUpLaunchPacketStructureLabel.Reset();
	ActiveMethodDrillFollowUpLaunchPacketLaneLabel.Reset();
	ActiveMethodDrillFollowUpLaunchPacketStanceLabel.Reset();
	if (CachedCoachFollowUpBrief.Signals.Num() > 0)
	{
		const FHyperTwistCoachSignal& Signal = CachedCoachFollowUpBrief.Signals[0];
		ActiveMethodDrillFollowUpLaunchPacketStructureLabel =
			HyperTwistCoachDashboardWidgetInternal::ExtractDetailFieldValue(
				Signal.Detail,
				TEXT("deferredPacketOrdering"));
		ActiveMethodDrillFollowUpLaunchPacketLaneLabel =
			HyperTwistCoachDashboardWidgetInternal::ExtractDetailFieldValue(
				Signal.Detail,
				TEXT("drillRecoveryPacketLane"));
		ActiveMethodDrillFollowUpLaunchPacketStanceLabel =
			HyperTwistCoachDashboardWidgetInternal::ExtractDetailFieldValue(
				Signal.Detail,
				TEXT("drillRecoveryPacketStance"));
	}
}

FHyperTwistTrainingDeck UHyperTwistCoachDashboardWidget::BuildSelectedGuidancePreviewCaseDeck() const
{
	const FHyperTwistTrainingDeck* Deck = GetActiveGuidancePreviewDeck();
	if (Deck == nullptr
		|| !Deck->IsStructurallyValid()
		|| SelectedGuidancePreviewCaseIndex < 0
		|| SelectedGuidancePreviewCaseIndex >= Deck->Cases.Num())
	{
		return FHyperTwistTrainingDeck();
	}

	FHyperTwistTrainingDeck SingleCaseDeck = *Deck;
	const FHyperTwistTrainingCase SelectedCase = Deck->Cases[SelectedGuidancePreviewCaseIndex];
	SingleCaseDeck.Cases = { SelectedCase };
	SingleCaseDeck.DeckId = FString::Printf(
		TEXT("%s_case_%s"),
		Deck->DeckId.IsEmpty() ? TEXT("preview") : *Deck->DeckId,
		SelectedCase.CaseId.IsEmpty() ? TEXT("selected") : *SelectedCase.CaseId
	);
	SingleCaseDeck.Title = FString::Printf(
		TEXT("%s (Selected Case)"),
		Deck->Title.IsEmpty() ? TEXT("Preview Guidance") : *Deck->Title
	);
	return SingleCaseDeck;
}

FString UHyperTwistCoachDashboardWidget::ResolveDashboardHandoffStartActionSourceLabel(
	const EHyperTwistTrainingCoachHandoffKind HandoffKind) const
{
	if (!DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel.IsEmpty()
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind)
	{
		return DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel;
	}

	const bool bUseDeferredFirstSuppressionLabel =
		bDisplayedCoachHandoffRecommendationUsedDeferredFirstSuppressionSignal
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseMethodDrillLabel =
		bDisplayedCoachHandoffRecommendationUsedMethodDrillWeighting
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseAlignedTightPacketAcceptedLabel =
		bDisplayedCoachHandoffRecommendationUsedAlignedTightPacketAcceptedHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseAlignedBroadPacketAcceptedLabel =
		bDisplayedCoachHandoffRecommendationUsedAlignedBroadPacketAcceptedHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseAcceptedAlignedTightPacketOutcomeLabel =
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseAcceptedAlignedBroadPacketOutcomeLabel =
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketOutcomeLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketOutcomeLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketOutcomeHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketOutcomeHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketExactHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketExactHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketExactOutcomeHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketExactOutcomeHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	const bool bUseReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryLabel =
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory
		&& DisplayedCoachHandoffRecommendationKind == HandoffKind;
	if (bUseReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-reliable-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-reliable-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-reliable-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-reliable-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedTightPacketExactOutcomeHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-outcome-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedBroadPacketExactOutcomeHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-outcome-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedTightPacketExactHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-reliable-outcome-reliable-recommended");
		default:
			return FString();
		}
	}
	if (bUseReliableAcceptedAlignedBroadPacketExactHistoryLabel)
	{
		switch (HandoffKind)
		{
		case EHyperTwistTrainingCoachHandoffKind::Queue:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-queued");
		case EHyperTwistTrainingCoachHandoffKind::FollowUp:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-follow-up");
		case EHyperTwistTrainingCoachHandoffKind::Recommended:
			return TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-reliable-outcome-reliable-recommended");
		default:
			return FString();
		}
	}
	return HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
		HandoffKind,
		bUseDeferredFirstSuppressionLabel,
		bUseMethodDrillLabel,
		HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None,
		false,
		false,
		false,
		false,
		false,
		false,
		false,
		false,
		bUseAlignedTightPacketAcceptedLabel,
		bUseAlignedBroadPacketAcceptedLabel,
		bUseAcceptedAlignedTightPacketOutcomeLabel,
		bUseAcceptedAlignedBroadPacketOutcomeLabel,
		bUseReliableAcceptedAlignedTightPacketOutcomeLabel,
		bUseReliableAcceptedAlignedBroadPacketOutcomeLabel,
		bUseReliableAcceptedAlignedTightPacketOutcomeHistoryLabel,
		bUseReliableAcceptedAlignedBroadPacketOutcomeHistoryLabel
	);
}

bool UHyperTwistCoachDashboardWidget::ResolveDisplayedGuidanceComparisonContext(
	const FHyperTwistTrainingSessionSummary*& OutDisplayedRunRecap,
	const FHyperTwistCoachBrief*& OutDisplayedGuidanceComparisonBrief,
	const FHyperTwistTrainingDeck*& OutDisplayedGuidanceComparisonDeck,
	FString& OutDisplayedGuidanceComparisonSelectedCaseId,
	bool& bOutDisplayedGuidanceComparisonSingleCase
) const
{
	OutDisplayedRunRecap = nullptr;
	OutDisplayedGuidanceComparisonBrief = nullptr;
	OutDisplayedGuidanceComparisonDeck = nullptr;
	OutDisplayedGuidanceComparisonSelectedCaseId.Reset();
	bOutDisplayedGuidanceComparisonSingleCase = false;

	const bool bHasCurrentRunRecap = CachedRunState.Session.IsStructurallyValid()
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	OutDisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	if (OutDisplayedRunRecap == nullptr || OutDisplayedRunRecap->TrainingSessionId.IsEmpty())
	{
		return false;
	}

	const bool bHasActiveGuidanceComparison =
		bHasCurrentRunRecap
		&& !ActiveGuidanceLaunchSessionId.IsEmpty()
		&& OutDisplayedRunRecap->TrainingSessionId == ActiveGuidanceLaunchSessionId
		&& ActiveGuidanceLaunchLane != EHyperTwistCoachDashboardGuidancePreviewLane::None;
	const bool bHasDisplayedRetainedGuidanceComparison =
		!bHasCurrentRunRecap
		&& bHasRetainedGuidanceComparison
		&& !RetainedGuidanceComparisonSessionId.IsEmpty()
		&& OutDisplayedRunRecap->TrainingSessionId == RetainedGuidanceComparisonSessionId
		&& RetainedGuidanceComparisonLane != EHyperTwistCoachDashboardGuidancePreviewLane::None;

	if (bHasActiveGuidanceComparison)
	{
		OutDisplayedGuidanceComparisonBrief = &ActiveGuidanceLaunchBrief;
		OutDisplayedGuidanceComparisonDeck = &ActiveGuidanceLaunchDeck;
		OutDisplayedGuidanceComparisonSelectedCaseId = ActiveGuidanceLaunchSelectedCaseId;
		bOutDisplayedGuidanceComparisonSingleCase = bActiveGuidanceLaunchSingleCase;
	}
	else if (bHasDisplayedRetainedGuidanceComparison)
	{
		OutDisplayedGuidanceComparisonBrief = &RetainedGuidanceComparisonBrief;
		OutDisplayedGuidanceComparisonDeck = &RetainedGuidanceComparisonDeck;
		OutDisplayedGuidanceComparisonSelectedCaseId = RetainedGuidanceComparisonSelectedCaseId;
		bOutDisplayedGuidanceComparisonSingleCase = bRetainedGuidanceComparisonSingleCase;
	}

	return OutDisplayedGuidanceComparisonBrief != nullptr
		&& OutDisplayedGuidanceComparisonDeck != nullptr
		&& OutDisplayedGuidanceComparisonDeck->IsStructurallyValid();
}

bool UHyperTwistCoachDashboardWidget::IsCoachLoopActionabilityClosed() const
{
	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const bool bHasQueueRecoveryFriction =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals
		|| CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals
		|| CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview
		|| CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork
		|| CachedCoachQueueExecutionSummary.bHasCompletionGap;
	return !bHasLiveAttemptTimer
		&& !bHasActiveRun
		&& !CachedCoachPanelState.bCanStartQueuedRun
		&& !CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& !CachedCoachPanelState.bCanStartCoachRecommendedRun
		&& !CachedCoachPanelState.bHasCoachGuidance
		&& !CachedCoachPanelState.bHasFollowUpGuidance
		&& CachedCoachPanelState.TotalQueueEntryCount == 0
		&& CachedCoachPanelState.ReadyQueueEntryCount == 0
		&& CachedCoachPanelState.DeferredQueueEntryCount == 0
		&& !bHasQueueRecoveryFriction;
}

EHyperTwistCoachDashboardOutcomeAction UHyperTwistCoachDashboardWidget::DeriveGuidanceOutcomeAction() const
{
	if (IsCoachLoopActionabilityClosed())
	{
		return EHyperTwistCoachDashboardOutcomeAction::None;
	}

	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	if (!ResolveDisplayedGuidanceComparisonContext(
		DisplayedRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase)
		|| DisplayedRunRecap == nullptr
		|| DisplayedRunRecap->CompletedAttemptCount <= 0)
	{
		return EHyperTwistCoachDashboardOutcomeAction::None;
	}

	const int32 NonSuccessCount =
		DisplayedRunRecap->FailureCount + DisplayedRunRecap->TimeoutCount + DisplayedRunRecap->DNFCount;
	if (bDisplayedGuidanceComparisonSingleCase)
	{
		if (DisplayedRunRecap->SuccessRate >= 0.85f
			&& DisplayedRunRecap->TimeoutCount == 0
			&& DisplayedRunRecap->DNFCount == 0
			&& DisplayedRunRecap->TotalMistakes <= 1)
		{
			return EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck;
		}

		return DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
			? EHyperTwistCoachDashboardOutcomeAction::None
			: EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
	}

	if (DisplayedRunRecap->SuccessRate >= 0.8f
		&& NonSuccessCount <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 4)
		&& DisplayedRunRecap->TotalMistakes <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 2))
	{
		return EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance;
	}

	if (DisplayedRunRecap->SuccessRate >= 0.55f)
	{
		return EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck;
	}

	return !DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
		? EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
		: EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance;
}

FHyperTwistCoachDashboardDecisionWeighting UHyperTwistCoachDashboardWidget::BuildGuidanceDecisionWeighting(
	const EHyperTwistCoachDashboardOutcomeAction BaseAction
) const
{
	FHyperTwistCoachDashboardDecisionWeighting Weighting;
	Weighting.BaseAction = BaseAction;
	Weighting.WeightedAction = BaseAction;
	if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::None)
	{
		return Weighting;
	}

	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	if (!ResolveDisplayedGuidanceComparisonContext(
		DisplayedRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase)
		|| DisplayedRunRecap == nullptr
		|| DisplayedGuidanceComparisonDeck == nullptr)
	{
		return Weighting;
	}

	EHyperTwistCoachDashboardGuidancePreviewLane DisplayedGuidanceComparisonLane =
		EHyperTwistCoachDashboardGuidancePreviewLane::None;
	if (!ActiveGuidanceLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == ActiveGuidanceLaunchSessionId)
	{
		DisplayedGuidanceComparisonLane = ActiveGuidanceLaunchLane;
	}
	else if (!RetainedGuidanceComparisonSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == RetainedGuidanceComparisonSessionId)
	{
		DisplayedGuidanceComparisonLane = RetainedGuidanceComparisonLane;
	}

	if (DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::None)
	{
		return Weighting;
	}

	constexpr int32 MaxMatchedDecisionEntries = 6;
	Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	for (int32 Index = GuidanceDecisionHistoryEntries.Num() - 1;
		Index >= 0 && Weighting.MatchingDecisionCount < MaxMatchedDecisionEntries;
		--Index)
	{
		const FHyperTwistCoachDashboardDecisionHistoryEntry& Entry = GuidanceDecisionHistoryEntries[Index];
		if (Entry.GuidanceLane != DisplayedGuidanceComparisonLane
			|| Entry.bSingleCaseScope != bDisplayedGuidanceComparisonSingleCase)
		{
			continue;
		}

		if (bDisplayedGuidanceComparisonSingleCase
			&& !DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
			&& Entry.SelectedCaseId != DisplayedGuidanceComparisonSelectedCaseId)
		{
			continue;
		}

		++Weighting.MatchingDecisionCount;
		Weighting.AverageSuccessRate += Entry.SuccessRate;
		Weighting.AverageLaunchCaseCount += static_cast<float>(Entry.LaunchedCaseCount);
		if (Weighting.LastAppliedAction == EHyperTwistCoachDashboardOutcomeAction::None)
		{
			Weighting.LastAppliedAction = Entry.AppliedAction;
		}
		if (Entry.bBroadenedLaunchScope)
		{
			++Weighting.BroadenedLaunchCount;
			Weighting.BroadenedLaunchAverageSuccessRate += Entry.SuccessRate;
		}
		if (Entry.bTightenedLaunchScope)
		{
			++Weighting.TightenedLaunchCount;
			Weighting.TightenedLaunchAverageSuccessRate += Entry.SuccessRate;
		}
		const bool bEntryUsesReliableAlignedTrustedTightPlanOutcomeHistory =
			Entry.bUsedReliableAlignedTrustedTightPlanOutcomeHistory;
		const bool bEntryUsesReliableAlignedTrustedBroadPlanOutcomeHistory =
			Entry.bUsedReliableAlignedTrustedBroadPlanOutcomeHistory;

		switch (Entry.AppliedAction)
		{
		case EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase:
			if (bEntryUsesReliableAlignedTrustedTightPlanOutcomeHistory)
			{
				++Weighting.ReliableAlignedTrustedTightContinuationDecisionCount;
			}
			++Weighting.RepeatSelectedCaseCount;
			break;
		case EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck:
			if (bEntryUsesReliableAlignedTrustedTightPlanOutcomeHistory)
			{
				++Weighting.ReliableAlignedTrustedTightContinuationDecisionCount;
			}
			++Weighting.RepeatPreviewDeckCount;
			break;
		case EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck:
			if (bEntryUsesReliableAlignedTrustedBroadPlanOutcomeHistory)
			{
				++Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount;
			}
			++Weighting.BroadenPreviewDeckCount;
			break;
		case EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance:
			if (bEntryUsesReliableAlignedTrustedBroadPlanOutcomeHistory)
			{
				++Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount;
			}
			++Weighting.RedirectCoachGuidanceCount;
			break;
		default:
			break;
		}
	}

	if (Weighting.MatchingDecisionCount <= 0)
	{
		return Weighting;
	}

	Weighting.AverageSuccessRate /= static_cast<float>(Weighting.MatchingDecisionCount);
	Weighting.AverageLaunchCaseCount /= static_cast<float>(Weighting.MatchingDecisionCount);
	if (Weighting.BroadenedLaunchCount > 0)
	{
		Weighting.BroadenedLaunchAverageSuccessRate /=
			static_cast<float>(Weighting.BroadenedLaunchCount);
	}
	if (Weighting.TightenedLaunchCount > 0)
	{
		Weighting.TightenedLaunchAverageSuccessRate /=
			static_cast<float>(Weighting.TightenedLaunchCount);
	}
	const HyperTwistCoachDashboardWidgetInternal::FClosureRecoveryDashboardBias ClosureBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveClosureRecoveryDashboardBias(
			ClosureRecoveryHistoryEntries
		);
	Weighting.ClosureContinuationBias = ClosureBias.ContinuationBias;
	Weighting.ClosureSuppressionBias = ClosureBias.SuppressionBias;
	const bool bDeferredOverflowMemoryActive =
		CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
			== TEXT("recommendation-history-deferred-tightened-launch");
	if (bDeferredOverflowMemoryActive
		&& DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp)
	{
		Weighting.DeferredOverflowContinuationBias =
			CachedCoachPanelState.DeferredTightenedLaunchHistoryCount;
		Weighting.DeferredOverflowCaseCount =
			CachedCoachPanelState.DeferredLaunchHistoryCaseCount;
	}
	const int32 ReliableAlignedTrustedTightPlanOutcomeSignalScore =
		(Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount >= 2
			&& Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 60.0f)
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					- Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					+ Weighting.ReliableAlignedTrustedTightContinuationDecisionCount
					- Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount
					+ (Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 80.0f ? 1 : 0),
				1,
				5)
			: 0;
	const int32 ReliableAlignedTrustedBroadPlanOutcomeSignalScore =
		(Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount >= 2
			&& Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 58.0f)
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					- Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					+ Weighting.ReliableAlignedTrustedBroadRedirectDecisionCount
					- Weighting.ReliableAlignedTrustedTightContinuationDecisionCount
					+ (Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 78.0f ? 1 : 0),
				1,
				5)
			: 0;

	if (bDisplayedGuidanceComparisonSingleCase)
	{
		if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
			&& ReliableAlignedTrustedTightPlanOutcomeSignalScore
				> ReliableAlignedTrustedBroadPlanOutcomeSignalScore
			&& Weighting.AverageSuccessRate < 0.95f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
			Weighting.bHasOverride = true;
			Weighting.bUsedReliableAlignedPlanOutcomeSignal = true;
		}
		else if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
			&& ReliableAlignedTrustedBroadPlanOutcomeSignalScore
				> ReliableAlignedTrustedTightPlanOutcomeSignalScore
			&& Weighting.AverageSuccessRate >= 0.70f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck;
			Weighting.bHasOverride = true;
			Weighting.bUsedReliableAlignedPlanOutcomeSignal = true;
		}
		if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
			&& Weighting.RepeatSelectedCaseCount >= 2
			&& Weighting.AverageSuccessRate < 0.90f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
			Weighting.bHasOverride = true;
		}
		else if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
			&& Weighting.BroadenPreviewDeckCount >= 2
			&& Weighting.AverageSuccessRate >= 0.78f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck;
			Weighting.bHasOverride = true;
		}
		if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
			&& Weighting.BroadenedLaunchCount >= 2
			&& Weighting.BroadenedLaunchAverageSuccessRate
				>= Weighting.TightenedLaunchAverageSuccessRate + 0.05f
			&& Weighting.BroadenedLaunchAverageSuccessRate >= 0.78f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck;
			Weighting.bHasOverride = true;
		}
		else if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
			&& Weighting.TightenedLaunchCount >= 2
			&& Weighting.TightenedLaunchAverageSuccessRate
				>= Weighting.BroadenedLaunchAverageSuccessRate + 0.10f
			&& Weighting.TightenedLaunchAverageSuccessRate >= 0.78f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
			Weighting.bHasOverride = true;
		}
	}
	else
	{
		if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			&& ReliableAlignedTrustedTightPlanOutcomeSignalScore
				> ReliableAlignedTrustedBroadPlanOutcomeSignalScore
			&& Weighting.AverageSuccessRate < 0.92f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck;
			Weighting.bHasOverride = true;
			Weighting.bUsedReliableAlignedPlanOutcomeSignal = true;
		}
		else if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck
			&& ReliableAlignedTrustedBroadPlanOutcomeSignalScore
				> ReliableAlignedTrustedTightPlanOutcomeSignalScore
			&& Weighting.AverageSuccessRate >= 0.68f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance;
			Weighting.bHasOverride = true;
			Weighting.bUsedReliableAlignedPlanOutcomeSignal = true;
		}
		if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			&& Weighting.RepeatPreviewDeckCount >= 2
			&& Weighting.AverageSuccessRate < 0.80f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck;
			Weighting.bHasOverride = true;
		}
		else if (BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck
			&& Weighting.RedirectCoachGuidanceCount >= 2
			&& Weighting.AverageSuccessRate >= 0.72f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance;
			Weighting.bHasOverride = true;
		}
	}

	if (DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
		&& ClosureBias.bHasSignal)
	{
		if (!bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			&& ClosureBias.ContinuationBias >= ClosureBias.SuppressionBias + 2
			&& Weighting.AverageSuccessRate < 0.90f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck;
			Weighting.bHasOverride = true;
			Weighting.bUsedClosureHistorySignal = true;
		}
		else if (!bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck
			&& ClosureBias.SuppressionBias >= ClosureBias.ContinuationBias + 2
			&& Weighting.AverageSuccessRate >= 0.60f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance;
			Weighting.bHasOverride = true;
			Weighting.bUsedClosureHistorySignal = true;
		}
		else if (bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
			&& ClosureBias.ContinuationBias >= ClosureBias.SuppressionBias + 2
			&& Weighting.AverageSuccessRate < 0.92f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
			Weighting.bHasOverride = true;
			Weighting.bUsedClosureHistorySignal = true;
		}
		else if (bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
			&& ClosureBias.SuppressionBias >= ClosureBias.ContinuationBias + 3
			&& Weighting.AverageSuccessRate >= 0.70f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck;
			Weighting.bHasOverride = true;
			Weighting.bUsedClosureHistorySignal = true;
		}
	}

	if (DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
		&& Weighting.DeferredOverflowContinuationBias >= 2)
	{
		if (!bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			&& Weighting.AverageSuccessRate < 0.92f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck;
			Weighting.bHasOverride = true;
			Weighting.bUsedDeferredOverflowSignal = true;
		}
		else if (bDisplayedGuidanceComparisonSingleCase
			&& BaseAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
			&& Weighting.AverageSuccessRate < 0.94f)
		{
			Weighting.WeightedAction = EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase;
			Weighting.bHasOverride = true;
			Weighting.bUsedDeferredOverflowSignal = true;
		}
	}

	return Weighting;
}

FHyperTwistCoachDashboardGuidanceLanePreference UHyperTwistCoachDashboardWidget::BuildGuidanceLanePreference() const
{
	FHyperTwistCoachDashboardGuidanceLanePreference Preference;
	const bool bHasRecommendedDeck = CachedCoachPanelState.bCanStartCoachRecommendedRun
		&& CachedCoachRecommendedDeck.IsStructurallyValid();
	const bool bHasFollowUpDeck = CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachFollowUpDeck.IsStructurallyValid();
	if (!bHasRecommendedDeck && !bHasFollowUpDeck)
	{
		return Preference;
	}

	if (bHasRecommendedDeck && !bHasFollowUpDeck)
	{
		Preference.PreferredLane = EHyperTwistCoachDashboardGuidancePreviewLane::Recommended;
		return Preference;
	}

	if (!bHasRecommendedDeck && bHasFollowUpDeck)
	{
		Preference.PreferredLane = EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp;
		return Preference;
	}

	float RecommendedSuccessRateSum = 0.0f;
	float FollowUpSuccessRateSum = 0.0f;
	Preference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Preference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Preference.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Preference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	constexpr int32 MaxDecisionEntriesToInspect = 8;
	int32 InspectedDecisionEntries = 0;
	for (int32 Index = GuidanceDecisionHistoryEntries.Num() - 1;
		Index >= 0 && InspectedDecisionEntries < MaxDecisionEntriesToInspect;
		--Index)
	{
		const FHyperTwistCoachDashboardDecisionHistoryEntry& Entry = GuidanceDecisionHistoryEntries[Index];
		if (Entry.GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended)
		{
			++Preference.RecommendedDecisionCount;
			RecommendedSuccessRateSum += Entry.SuccessRate;
			switch (Entry.AppliedAction)
			{
			case EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase:
			case EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck:
			case EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck:
				++Preference.RecommendedContinueBias;
				break;
			case EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance:
				Preference.RecommendedContinueBias -= 2;
				break;
			default:
				break;
			}
			if (Entry.bUsedReliableAlignedTrustedBroadPlanOutcomeHistory)
			{
				++Preference.ReliableAlignedTrustedBroadRedirectBias;
				++Preference.RecommendedContinueBias;
			}
			++InspectedDecisionEntries;
		}
		else if (Entry.GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp)
		{
			++Preference.FollowUpDecisionCount;
			FollowUpSuccessRateSum += Entry.SuccessRate;
			switch (Entry.AppliedAction)
			{
			case EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase:
			case EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck:
			case EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck:
				++Preference.FollowUpContinueBias;
				break;
			case EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance:
				Preference.FollowUpContinueBias -= 2;
				break;
			default:
				break;
			}
			if (Entry.bUsedReliableAlignedTrustedTightPlanOutcomeHistory)
			{
				++Preference.ReliableAlignedTrustedTightContinuationBias;
				++Preference.FollowUpContinueBias;
			}
			++InspectedDecisionEntries;
		}
	}

	if (Preference.RecommendedDecisionCount > 0)
	{
		Preference.RecommendedAverageSuccessRate =
			RecommendedSuccessRateSum / static_cast<float>(Preference.RecommendedDecisionCount);
	}
	if (Preference.FollowUpDecisionCount > 0)
	{
		Preference.FollowUpAverageSuccessRate =
			FollowUpSuccessRateSum / static_cast<float>(Preference.FollowUpDecisionCount);
	}
	const int32 ReliableAlignedTrustedTightPlanOutcomeSignalScore =
		(Preference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount >= 2
			&& Preference.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 60.0f)
			? FMath::Clamp(
				Preference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					- Preference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					+ (Preference.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 80.0f ? 1 : 0),
				1,
				4)
			: 0;
	const int32 ReliableAlignedTrustedBroadPlanOutcomeSignalScore =
		(Preference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount >= 2
			&& Preference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 58.0f)
			? FMath::Clamp(
				Preference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					- Preference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					+ (Preference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 78.0f ? 1 : 0),
				1,
				4)
			: 0;
	if (ReliableAlignedTrustedTightPlanOutcomeSignalScore
		> ReliableAlignedTrustedBroadPlanOutcomeSignalScore)
	{
		Preference.ReliableAlignedTrustedTightContinuationBias =
			Preference.ReliableAlignedTrustedTightContinuationBias
			+ ReliableAlignedTrustedTightPlanOutcomeSignalScore;
		Preference.FollowUpContinueBias += ReliableAlignedTrustedTightPlanOutcomeSignalScore;
		Preference.bHasReliableAlignedPlanOutcomeSignal = true;
	}
	else if (ReliableAlignedTrustedBroadPlanOutcomeSignalScore
		> ReliableAlignedTrustedTightPlanOutcomeSignalScore)
	{
		Preference.ReliableAlignedTrustedBroadRedirectBias =
			Preference.ReliableAlignedTrustedBroadRedirectBias
			+ ReliableAlignedTrustedBroadPlanOutcomeSignalScore;
		Preference.RecommendedContinueBias += ReliableAlignedTrustedBroadPlanOutcomeSignalScore;
		Preference.bHasReliableAlignedPlanOutcomeSignal = true;
	}
	if (!Preference.bHasReliableAlignedPlanOutcomeSignal)
	{
		Preference.bHasReliableAlignedPlanOutcomeSignal =
			Preference.ReliableAlignedTrustedTightContinuationBias > 0
			|| Preference.ReliableAlignedTrustedBroadRedirectBias > 0;
	}

	const HyperTwistCoachDashboardWidgetInternal::FClosureRecoveryDashboardBias ClosureBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveClosureRecoveryDashboardBias(
			ClosureRecoveryHistoryEntries
		);
	Preference.ClosureContinuationBias = ClosureBias.ContinuationBias;
	Preference.ClosureSuppressionBias = ClosureBias.SuppressionBias;
	Preference.bHasClosureHistorySignal = ClosureBias.bHasSignal;

	Preference.bHasDecisionSignal =
		Preference.RecommendedDecisionCount > 0 || Preference.FollowUpDecisionCount > 0;

	const EHyperTwistCoachDashboardGuidancePreviewLane MemoryPreferredLane =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp
			? EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			: (CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended
				? EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
				: EHyperTwistCoachDashboardGuidancePreviewLane::None);
	float RecommendedLaneScore =
		MemoryPreferredLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended ? 1.5f : 1.0f;
	float FollowUpLaneScore =
		MemoryPreferredLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? 1.75f
			: (CachedCoachPanelState.bHasFollowUpGuidance ? 1.25f : 1.0f);
	if (Preference.RecommendedDecisionCount > 0)
	{
		RecommendedLaneScore += static_cast<float>(Preference.RecommendedContinueBias);
		RecommendedLaneScore += Preference.RecommendedAverageSuccessRate;
	}
	if (Preference.FollowUpDecisionCount > 0)
	{
		FollowUpLaneScore += static_cast<float>(Preference.FollowUpContinueBias);
		FollowUpLaneScore += Preference.FollowUpAverageSuccessRate;
	}
	if (Preference.bHasClosureHistorySignal)
	{
		RecommendedLaneScore += static_cast<float>(Preference.ClosureSuppressionBias) * 0.75f;
		FollowUpLaneScore += static_cast<float>(Preference.ClosureContinuationBias) * 0.75f;
	}

	if (FollowUpLaneScore > RecommendedLaneScore)
	{
		Preference.PreferredLane = EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp;
	}
	else if (RecommendedLaneScore > FollowUpLaneScore)
	{
		Preference.PreferredLane = EHyperTwistCoachDashboardGuidancePreviewLane::Recommended;
	}
	else
	{
		Preference.PreferredLane =
			MemoryPreferredLane != EHyperTwistCoachDashboardGuidancePreviewLane::None
				? MemoryPreferredLane
				: (ActiveGuidancePreviewLane != EHyperTwistCoachDashboardGuidancePreviewLane::None
				? ActiveGuidancePreviewLane
				: (CachedCoachPanelState.bHasFollowUpGuidance
					? EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
					: EHyperTwistCoachDashboardGuidancePreviewLane::Recommended));
	}

	return Preference;
}

FHyperTwistCoachDashboardQueueRecoveryWeighting UHyperTwistCoachDashboardWidget::BuildQueueRecoveryWeighting() const
{
	FHyperTwistCoachDashboardQueueRecoveryWeighting Weighting;
	float PromoteDeltaAccumulator = 0.0f;
	float LaunchDeltaAccumulator = 0.0f;
	const bool bQueueLooksFollowUpOrRecovery =
		CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("follow-up"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("queue-recovery"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("closure_history_follow_up"));
	const bool bQueueLooksRecommendedOrPrimary =
		CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("primary"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("recommended"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("closure_history_recommended"));
	HyperTwistCoachDashboardWidgetInternal::FHandoffHistoryDashboardBias HandoffHistoryBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveHandoffHistoryDashboardBias(
			HandoffHistoryEntries
		);
	const int32 AcceptedAlignedTightPacketOutcomeTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore >= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore >= 80.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedBroadPacketOutcomeTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore >= 58.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore >= 78.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedTightPacketRetainedTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore
				>= 65.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore
							>= 82.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedBroadPacketRetainedTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore
				>= 63.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore
							>= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore
							>= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedBroadPacketReliableTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore
				>= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore
							>= 78.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedBroadPacketReliableOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
				>= 66.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableCompositeBias =
		FMath::Max(
			AcceptedAlignedTightPacketReliableTrustBias,
			AcceptedAlignedTightPacketReliableOutcomeBias);
	const int32 AcceptedAlignedBroadPacketReliableCompositeBias =
		FMath::Max(
			AcceptedAlignedBroadPacketReliableTrustBias,
			AcceptedAlignedBroadPacketReliableOutcomeBias);
	const int32 ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore
						   >= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
				>= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
						   >= 78.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore
				>= 70.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactAcceptedBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedAverageScore
				>= 64.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactAcceptedBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedAverageScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedAverageScore
						   >= 80.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactCompositeBias = FMath::Max(
		ReliableAcceptedAlignedTightPacketExactAcceptedBias,
		(ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias > 0
			&& ReliableAcceptedAlignedTightPacketExactOutcomeBias > 0)
			? FMath::Clamp(
				FMath::Min(
					ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias,
					ReliableAcceptedAlignedTightPacketExactOutcomeBias) + 1,
				1,
				4)
			: 0);
	const int32 ReliableAcceptedAlignedBroadPacketExactCompositeBias = FMath::Max(
		ReliableAcceptedAlignedBroadPacketExactAcceptedBias,
		(ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias > 0
			&& ReliableAcceptedAlignedBroadPacketExactOutcomeBias > 0)
			? FMath::Clamp(
				FMath::Min(
					ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias,
					ReliableAcceptedAlignedBroadPacketExactOutcomeBias) + 1,
				1,
				4)
			: 0);
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAverageScore
				>= 74.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAverageScore
						   >= 88.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAverageScore
				>= 72.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedAverageScore
				>= 66.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedAverageScore
				>= 64.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableAverageScore
				>= 70.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				6)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				6)
			: 0;
	if (AcceptedAlignedTightPacketOutcomeTrustBias > AcceptedAlignedBroadPacketOutcomeTrustBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketOutcomeTrustBias * 4;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketOutcomeTrustBias * 2;
		}
	}
	else if (AcceptedAlignedBroadPacketOutcomeTrustBias > AcceptedAlignedTightPacketOutcomeTrustBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketOutcomeTrustBias * 4;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketOutcomeTrustBias * 2;
		}
	}
	if (AcceptedAlignedTightPacketRetainedTrustBias > AcceptedAlignedBroadPacketRetainedTrustBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketRetainedTrustBias * 3;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketRetainedTrustBias;
		}
	}
	else if (AcceptedAlignedBroadPacketRetainedTrustBias
		> AcceptedAlignedTightPacketRetainedTrustBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketRetainedTrustBias * 3;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketRetainedTrustBias;
		}
	}
	if (AcceptedAlignedTightPacketReliableCompositeBias
		> AcceptedAlignedBroadPacketReliableCompositeBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketReliableCompositeBias * 4;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketReliableCompositeBias * 2;
		}
	}
	else if (AcceptedAlignedBroadPacketReliableCompositeBias
		> AcceptedAlignedTightPacketReliableCompositeBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketReliableCompositeBias * 4;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketReliableCompositeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias
		> ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias * 4;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias
		> ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias * 4;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeBias)
	{
		HandoffHistoryBias.FollowUpScore += ReliableAcceptedAlignedTightPacketExactOutcomeBias * 4;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedTightPacketExactOutcomeBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeBias)
	{
		HandoffHistoryBias.RecommendedScore += ReliableAcceptedAlignedBroadPacketExactOutcomeBias * 4;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedBroadPacketExactOutcomeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactCompositeBias
		> ReliableAcceptedAlignedBroadPacketExactCompositeBias)
	{
		HandoffHistoryBias.FollowUpScore += ReliableAcceptedAlignedTightPacketExactCompositeBias * 5;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedTightPacketExactCompositeBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactCompositeBias
		> ReliableAcceptedAlignedTightPacketExactCompositeBias)
	{
		HandoffHistoryBias.RecommendedScore += ReliableAcceptedAlignedBroadPacketExactCompositeBias * 5;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedBroadPacketExactCompositeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias * 6;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias * 6;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias * 7;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias * 7;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias * 8;
		if (bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias * 8;
		if (bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias * 2;
		}
	}
	{
		HandoffHistoryBias.PreferredKind =
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None;
		int32 BestScore = 0;
		int32 BestAcceptedDeltaCount = 0;
		auto ConsiderKind = [&BestScore, &BestAcceptedDeltaCount, &HandoffHistoryBias](
			const HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind Kind,
			const int32 Score,
			const int32 AcceptedDeltaCount)
		{
			if (Score <= 0)
			{
				return;
			}

			if (Score > BestScore
				|| (Score == BestScore && AcceptedDeltaCount > BestAcceptedDeltaCount))
			{
				BestScore = Score;
				BestAcceptedDeltaCount = AcceptedDeltaCount;
				HandoffHistoryBias.PreferredKind = Kind;
			}
		};

		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue,
			HandoffHistoryBias.QueueScore,
			HandoffHistoryBias.QueueAcceptedDeltaCount);
		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp,
			HandoffHistoryBias.FollowUpScore,
			HandoffHistoryBias.FollowUpAcceptedDeltaCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount);
		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended,
			HandoffHistoryBias.RecommendedScore,
			HandoffHistoryBias.RecommendedAcceptedDeltaCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount);
	}
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPacketDashboardBias
		MethodDrillRecoveryPacketBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPacketDashboardBias(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPlanComparisonSummary
		MethodDrillRecoveryPlanComparisonSummary =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanComparisonSummary(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const int32 TightPlanTrust =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanTightTrust(
			MethodDrillRecoveryPlanComparisonSummary);
	const int32 BroadPlanTrust =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanBroadTrust(
			MethodDrillRecoveryPlanComparisonSummary);

	auto ConsumeOutcome = [
		&Weighting,
		&PromoteDeltaAccumulator,
		&LaunchDeltaAccumulator
	](const FHyperTwistCoachDashboardQueueRecoveryOutcome& Outcome)
	{
		if (!Outcome.IsStructurallyValid())
		{
			return;
		}

		const float PressureDelta = Outcome.BeforePressureScore - Outcome.AfterPressureScore;
		switch (Outcome.ActionKind)
		{
		case FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred:
			++Weighting.PromoteCount;
			PromoteDeltaAccumulator += PressureDelta;
			if (Outcome.bUsedDeferredFirstSuppressionSignal)
			{
				++Weighting.DeferredFirstPromoteCount;
				Weighting.bHasDeferredFirstSignal = true;
			}
			if (Outcome.bReducedFriction)
			{
				++Weighting.PromoteReducedCount;
				if (Outcome.bUsedDeferredFirstSuppressionSignal)
				{
					++Weighting.DeferredFirstPromoteReducedCount;
				}
			}
			if (!Outcome.bSucceeded)
			{
				++Weighting.PromoteFailureCount;
			}
			if (Outcome.bUsedMethodDrillHandoffSignal)
			{
				++Weighting.MethodDrillPromoteCount;
				Weighting.bHasMethodDrillOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.MethodDrillPromoteReducedCount;
				}
				if (!Outcome.bSucceeded)
				{
					++Weighting.MethodDrillPromoteFailureCount;
				}
			}
			if (Outcome.bUsedBroadMethodDrillPacketStructureRecovery)
			{
				++Weighting.BroadMethodDrillPacketStructurePromoteCount;
				Weighting.bHasMethodDrillOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.BroadMethodDrillPacketStructurePromoteReducedCount;
				}
			}
			if (Outcome.bUsedWeakRetainedMethodDrillRecoveryPosture)
			{
				++Weighting.WeakRetainedMethodDrillPromoteCount;
				if (Outcome.bReducedFriction)
				{
					++Weighting.WeakRetainedMethodDrillPromoteReducedCount;
				}
			}
			if (Outcome.bUsedReliableTrustedBroadStructurePlanRecovery)
			{
				++Weighting.ReliableTrustedBroadPlanPromoteCount;
				Weighting.bHasReliableTrustedPlanOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.ReliableTrustedBroadPlanPromoteReducedCount;
				}
			}
			if (Outcome.bUsedReliableAlignedTrustedBroadStructurePlanRecovery)
			{
				++Weighting.ReliableAlignedTrustedBroadPlanPromoteCount;
				Weighting.bHasReliableAlignedTrustedPlanOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.ReliableAlignedTrustedBroadPlanPromoteReducedCount;
				}
			}
			break;
		case FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery:
			++Weighting.LaunchCount;
			LaunchDeltaAccumulator += PressureDelta;
			if (Outcome.bUsedDeferredFirstSuppressionSignal)
			{
				++Weighting.DeferredFirstLaunchCount;
				Weighting.bHasDeferredFirstSignal = true;
			}
			if (Outcome.bReducedFriction)
			{
				++Weighting.LaunchReducedCount;
				if (Outcome.bUsedDeferredFirstSuppressionSignal)
				{
					++Weighting.DeferredFirstLaunchReducedCount;
				}
			}
			if (!Outcome.bSucceeded)
			{
				++Weighting.LaunchFailureCount;
			}
			if (Outcome.bUsedMethodDrillHandoffSignal)
			{
				++Weighting.MethodDrillLaunchCount;
				Weighting.bHasMethodDrillOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.MethodDrillLaunchReducedCount;
				}
				if (!Outcome.bSucceeded)
				{
					++Weighting.MethodDrillLaunchFailureCount;
				}
			}
			if (Outcome.bUsedNarrowMethodDrillPacketStructureRecovery)
			{
				++Weighting.NarrowMethodDrillPacketStructureLaunchCount;
				Weighting.bHasMethodDrillOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.NarrowMethodDrillPacketStructureLaunchReducedCount;
				}
			}
			if (Outcome.bUsedStrongRetainedMethodDrillRecoveryPosture)
			{
				++Weighting.StrongRetainedMethodDrillLaunchCount;
				if (Outcome.bReducedFriction)
				{
					++Weighting.StrongRetainedMethodDrillLaunchReducedCount;
				}
			}
			if (Outcome.bUsedReliableTrustedTightStructurePlanRecovery)
			{
				++Weighting.ReliableTrustedTightPlanLaunchCount;
				Weighting.bHasReliableTrustedPlanOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.ReliableTrustedTightPlanLaunchReducedCount;
				}
			}
			if (Outcome.bUsedReliableAlignedTrustedTightStructurePlanRecovery)
			{
				++Weighting.ReliableAlignedTrustedTightPlanLaunchCount;
				Weighting.bHasReliableAlignedTrustedPlanOutcomeSignal = true;
				if (Outcome.bReducedFriction)
				{
					++Weighting.ReliableAlignedTrustedTightPlanLaunchReducedCount;
				}
			}
			break;
		default:
			break;
		}
	};

	for (const FHyperTwistCoachDashboardQueueRecoveryOutcome& Outcome : QueueRecoveryOutcomeHistory)
	{
		ConsumeOutcome(Outcome);
	}

	if (QueueRecoveryOutcome.IsStructurallyValid()
		&& !QueueRecoveryOutcomeHistory.ContainsByPredicate(
			[this](const FHyperTwistCoachDashboardQueueRecoveryOutcome& Candidate)
			{
				return Candidate.RecordedAtUtc == QueueRecoveryOutcome.RecordedAtUtc
					&& Candidate.AppliedActionLabel == QueueRecoveryOutcome.AppliedActionLabel
					&& Candidate.ActionKind == QueueRecoveryOutcome.ActionKind;
			}))
	{
		ConsumeOutcome(QueueRecoveryOutcome);
	}

	if (Weighting.PromoteCount > 0)
	{
		Weighting.PromoteAveragePressureDelta =
			PromoteDeltaAccumulator / static_cast<float>(Weighting.PromoteCount);
	}
	if (Weighting.LaunchCount > 0)
	{
		Weighting.LaunchAveragePressureDelta =
			LaunchDeltaAccumulator / static_cast<float>(Weighting.LaunchCount);
	}

	Weighting.MethodDrillLaunchBiasCount =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillLaunchRecoveryBias(
			HandoffHistoryBias
		);
	Weighting.MethodDrillPromoteBiasCount =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillPromoteRecoveryBias(
			HandoffHistoryBias
		);
	Weighting.MethodDrillUpstreamHistoryCount =
		CachedCoachPanelState.MethodDrillRecoveryHistoryCount;
	Weighting.MethodDrillUpstreamStrongCount =
		CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount;
	Weighting.MethodDrillUpstreamWeakCount =
		CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount;
	Weighting.MethodDrillUpstreamAverageOutcomeScore =
		CachedCoachPanelState.MethodDrillRecoveryAverageOutcomeScore;
	Weighting.ReliableTrustedTightPlanHistoryCount =
		CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Weighting.ReliableTrustedBroadPlanHistoryCount =
		CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Weighting.ReliableTrustedTightPlanAverageOutcomeScore =
		CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Weighting.ReliableTrustedBroadPlanAverageOutcomeScore =
		CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Weighting.ReliableAlignedTrustedTightPlanHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Weighting.ReliableAlignedTrustedBroadPlanHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Weighting.ReliableAlignedTrustedTightPlanAverageOutcomeScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Weighting.ReliableAlignedTrustedBroadPlanAverageOutcomeScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	const bool bStrongMethodDrillRecoveryMemory =
		Weighting.MethodDrillUpstreamHistoryCount >= 2
		&& Weighting.MethodDrillUpstreamStrongCount >= Weighting.MethodDrillUpstreamWeakCount
		&& Weighting.MethodDrillUpstreamAverageOutcomeScore >= 55.0f;
	const bool bWeakMethodDrillRecoveryMemory =
		Weighting.MethodDrillUpstreamHistoryCount >= 2
		&& Weighting.MethodDrillUpstreamWeakCount > Weighting.MethodDrillUpstreamStrongCount
		&& Weighting.MethodDrillUpstreamAverageOutcomeScore <= 45.0f;
	if (bStrongMethodDrillRecoveryMemory)
	{
		Weighting.MethodDrillLaunchBiasCount += FMath::Clamp(
			Weighting.MethodDrillUpstreamStrongCount - Weighting.MethodDrillUpstreamWeakCount
				+ (Weighting.MethodDrillUpstreamAverageOutcomeScore >= 75.0f ? 1 : 0),
			1,
			3
		);
		Weighting.bHasMethodDrillMemorySignal = true;
	}
	else if (bWeakMethodDrillRecoveryMemory)
	{
		Weighting.MethodDrillPromoteBiasCount += FMath::Clamp(
			Weighting.MethodDrillUpstreamWeakCount - Weighting.MethodDrillUpstreamStrongCount,
			1,
			3
		);
		Weighting.bHasMethodDrillMemorySignal = true;
	}
	const bool bReliableAlignedTrustedTightPlanOutcomeSourceActive =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
		== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome");
	const bool bReliableAlignedTrustedBroadPlanOutcomeSourceActive =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
		== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome");
	const int32 ReliableAlignedTrustedTightPlanOutcomeSignalScore =
		(bReliableAlignedTrustedTightPlanOutcomeSourceActive
			|| (Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount >= 2
				&& Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 60.0f))
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					- Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					+ (Weighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore >= 80.0f ? 1 : 0),
				1,
				5)
			: 0;
	const int32 ReliableAlignedTrustedBroadPlanOutcomeSignalScore =
		(bReliableAlignedTrustedBroadPlanOutcomeSourceActive
			|| (Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount >= 2
				&& Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 58.0f))
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
					- Weighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
					+ (Weighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore >= 78.0f ? 1 : 0),
				1,
				5)
			: 0;
	const int32 ReliableAlignedTrustedTightPlanSignalScore =
		(HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (Weighting.ReliableAlignedTrustedTightPlanHistoryCount >= 2
				&& Weighting.ReliableAlignedTrustedTightPlanAverageOutcomeScore >= 60.0f))
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedTightPlanHistoryCount
					- Weighting.ReliableAlignedTrustedBroadPlanHistoryCount
					+ (Weighting.ReliableAlignedTrustedTightPlanAverageOutcomeScore >= 80.0f ? 1 : 0),
				1,
				4)
			: 0;
	const int32 ReliableAlignedTrustedBroadPlanSignalScore =
		(HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (Weighting.ReliableAlignedTrustedBroadPlanHistoryCount >= 2
				&& Weighting.ReliableAlignedTrustedBroadPlanAverageOutcomeScore >= 60.0f))
			? FMath::Clamp(
				Weighting.ReliableAlignedTrustedBroadPlanHistoryCount
					- Weighting.ReliableAlignedTrustedTightPlanHistoryCount
					+ (Weighting.ReliableAlignedTrustedBroadPlanAverageOutcomeScore >= 80.0f ? 1 : 0),
				1,
				4)
			: 0;
	const int32 ReliableTrustedTightPlanSignalScore =
		(HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (Weighting.ReliableTrustedTightPlanHistoryCount >= 2
				&& Weighting.ReliableTrustedTightPlanAverageOutcomeScore >= 60.0f))
			? FMath::Clamp(
				Weighting.ReliableTrustedTightPlanHistoryCount
					- Weighting.ReliableTrustedBroadPlanHistoryCount
					+ (Weighting.ReliableTrustedTightPlanAverageOutcomeScore >= 80.0f ? 1 : 0),
				1,
				3)
			: 0;
	const int32 ReliableTrustedBroadPlanSignalScore =
		(HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
			|| (Weighting.ReliableTrustedBroadPlanHistoryCount >= 2
				&& Weighting.ReliableTrustedBroadPlanAverageOutcomeScore >= 60.0f))
			? FMath::Clamp(
				Weighting.ReliableTrustedBroadPlanHistoryCount
					- Weighting.ReliableTrustedTightPlanHistoryCount
					+ (Weighting.ReliableTrustedBroadPlanAverageOutcomeScore >= 80.0f ? 1 : 0),
				1,
				3)
			: 0;
	if (ReliableAlignedTrustedTightPlanOutcomeSignalScore
		> ReliableAlignedTrustedBroadPlanOutcomeSignalScore)
	{
		Weighting.ReliableAlignedTrustedTightPlanOutcomeBiasCount =
			ReliableAlignedTrustedTightPlanOutcomeSignalScore;
		Weighting.MethodDrillLaunchBiasCount += ReliableAlignedTrustedTightPlanOutcomeSignalScore;
		Weighting.bHasReliableAlignedTrustedPlanHandoffOutcomeSignal = true;
	}
	else if (ReliableAlignedTrustedBroadPlanOutcomeSignalScore
		> ReliableAlignedTrustedTightPlanOutcomeSignalScore)
	{
		Weighting.ReliableAlignedTrustedBroadPlanOutcomeBiasCount =
			ReliableAlignedTrustedBroadPlanOutcomeSignalScore;
		Weighting.MethodDrillPromoteBiasCount += ReliableAlignedTrustedBroadPlanOutcomeSignalScore;
		Weighting.bHasReliableAlignedTrustedPlanHandoffOutcomeSignal = true;
	}
	else if (ReliableAlignedTrustedTightPlanSignalScore > ReliableAlignedTrustedBroadPlanSignalScore)
	{
		Weighting.ReliableAlignedTrustedTightPlanBiasCount =
			ReliableAlignedTrustedTightPlanSignalScore;
		Weighting.MethodDrillLaunchBiasCount += ReliableAlignedTrustedTightPlanSignalScore;
		Weighting.bHasReliableAlignedTrustedPlanSignal = true;
	}
	else if (ReliableAlignedTrustedBroadPlanSignalScore
		> ReliableAlignedTrustedTightPlanSignalScore)
	{
		Weighting.ReliableAlignedTrustedBroadPlanBiasCount =
			ReliableAlignedTrustedBroadPlanSignalScore;
		Weighting.MethodDrillPromoteBiasCount += ReliableAlignedTrustedBroadPlanSignalScore;
		Weighting.bHasReliableAlignedTrustedPlanSignal = true;
	}
	else if (ReliableTrustedTightPlanSignalScore > ReliableTrustedBroadPlanSignalScore)
	{
		Weighting.ReliableTrustedTightPlanBiasCount = ReliableTrustedTightPlanSignalScore;
		Weighting.MethodDrillLaunchBiasCount += ReliableTrustedTightPlanSignalScore;
		Weighting.bHasReliableTrustedPlanSignal = true;
	}
	else if (ReliableTrustedBroadPlanSignalScore > ReliableTrustedTightPlanSignalScore)
	{
		Weighting.ReliableTrustedBroadPlanBiasCount = ReliableTrustedBroadPlanSignalScore;
		Weighting.MethodDrillPromoteBiasCount += ReliableTrustedBroadPlanSignalScore;
		Weighting.bHasReliableTrustedPlanSignal = true;
	}
	if (MethodDrillRecoveryPacketBias.bHasSignal)
	{
		Weighting.MethodDrillLaunchBiasCount += MethodDrillRecoveryPacketBias.LaunchRecoveryBias;
		Weighting.MethodDrillPromoteBiasCount += MethodDrillRecoveryPacketBias.PromoteRecoveryBias;
	}
	if (HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanTightContinuation(
			MethodDrillRecoveryPlanComparisonSummary))
	{
		Weighting.MethodDrillLaunchBiasCount += FMath::Clamp(TightPlanTrust, 1, 3);
	}
	else if (HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanBroadRedirect(
		MethodDrillRecoveryPlanComparisonSummary))
	{
		Weighting.MethodDrillPromoteBiasCount += FMath::Clamp(BroadPlanTrust, 1, 3);
	}
	if (CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-strong"))
	{
		Weighting.MethodDrillLaunchBiasCount += 2;
	}
	else if (
		CachedCoachPanelState.PreferredGuidanceSourceLabel
		== TEXT("coach-memory-method-drill-follow-up-weak"))
	{
		Weighting.MethodDrillPromoteBiasCount += 2;
	}
	Weighting.bHasMethodDrillSignal =
		Weighting.MethodDrillLaunchBiasCount > 0
		|| Weighting.MethodDrillPromoteBiasCount > 0
		|| Weighting.bHasMethodDrillOutcomeSignal
		|| Weighting.bHasMethodDrillMemorySignal
		|| Weighting.bHasReliableTrustedPlanSignal
		|| MethodDrillRecoveryPacketBias.bHasSignal;

	const bool bHasDirectOutcomeSignal = Weighting.PromoteCount > 0 || Weighting.LaunchCount > 0;
	Weighting.bHasSignal = bHasDirectOutcomeSignal || Weighting.bHasMethodDrillSignal;
	if (!Weighting.bHasSignal)
	{
		return Weighting;
	}

	auto ScoreAction = [bHasDirectOutcomeSignal](
		const int32 Count,
		const int32 ReducedCount,
		const int32 FailureCount,
		const float AverageDelta)
	{
		if (Count <= 0)
		{
			return bHasDirectOutcomeSignal ? -1000000.0f : 0.0f;
		}

		const int32 NeutralCount = FMath::Max(Count - ReducedCount - FailureCount, 0);
		return static_cast<float>(ReducedCount) * 3.0f
			+ static_cast<float>(NeutralCount) * 0.5f
			+ AverageDelta
			- static_cast<float>(FailureCount) * 2.0f;
	};

	const float PromoteScore = ScoreAction(
		Weighting.PromoteCount,
		Weighting.PromoteReducedCount,
		Weighting.PromoteFailureCount,
		Weighting.PromoteAveragePressureDelta
	);
	const float LaunchScore = ScoreAction(
		Weighting.LaunchCount,
		Weighting.LaunchReducedCount,
		Weighting.LaunchFailureCount,
		Weighting.LaunchAveragePressureDelta
	);
	const float DeferredFirstPromoteScore =
		static_cast<float>(Weighting.DeferredFirstPromoteReducedCount) * 3.0f
		+ static_cast<float>(
			FMath::Max(
				Weighting.DeferredFirstPromoteCount - Weighting.DeferredFirstPromoteReducedCount,
				0))
			* 0.5f;
	const float DeferredFirstLaunchScore =
		static_cast<float>(Weighting.DeferredFirstLaunchReducedCount) * 3.0f
		+ static_cast<float>(
			FMath::Max(
				Weighting.DeferredFirstLaunchCount - Weighting.DeferredFirstLaunchReducedCount,
				0))
			* 0.5f;
	const float MethodDrillPromoteOutcomeScore =
		static_cast<float>(Weighting.MethodDrillPromoteReducedCount) * 3.0f
		+ static_cast<float>(
			FMath::Max(
				Weighting.MethodDrillPromoteCount
					- Weighting.MethodDrillPromoteReducedCount
					- Weighting.MethodDrillPromoteFailureCount,
				0))
			* 0.5f
		- static_cast<float>(Weighting.MethodDrillPromoteFailureCount) * 2.0f;
	const float MethodDrillLaunchOutcomeScore =
		static_cast<float>(Weighting.MethodDrillLaunchReducedCount) * 3.0f
		+ static_cast<float>(
			FMath::Max(
				Weighting.MethodDrillLaunchCount
					- Weighting.MethodDrillLaunchReducedCount
					- Weighting.MethodDrillLaunchFailureCount,
				0))
			* 0.5f
		- static_cast<float>(Weighting.MethodDrillLaunchFailureCount) * 2.0f;
	const float StrongRetainedMethodDrillLaunchScore =
		static_cast<float>(Weighting.StrongRetainedMethodDrillLaunchReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.StrongRetainedMethodDrillLaunchCount
				- Weighting.StrongRetainedMethodDrillLaunchReducedCount,
			0)) * 0.5f;
	const float WeakRetainedMethodDrillPromoteScore =
		static_cast<float>(Weighting.WeakRetainedMethodDrillPromoteReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.WeakRetainedMethodDrillPromoteCount
				- Weighting.WeakRetainedMethodDrillPromoteReducedCount,
			0)) * 0.5f;
	const float NarrowMethodDrillPacketStructureLaunchScore =
		static_cast<float>(Weighting.NarrowMethodDrillPacketStructureLaunchReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.NarrowMethodDrillPacketStructureLaunchCount
				- Weighting.NarrowMethodDrillPacketStructureLaunchReducedCount,
			0)) * 0.5f;
	const float BroadMethodDrillPacketStructurePromoteScore =
		static_cast<float>(Weighting.BroadMethodDrillPacketStructurePromoteReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.BroadMethodDrillPacketStructurePromoteCount
				- Weighting.BroadMethodDrillPacketStructurePromoteReducedCount,
			0)) * 0.5f;
	const float ReliableTrustedTightPlanLaunchScore =
		static_cast<float>(Weighting.ReliableTrustedTightPlanLaunchReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.ReliableTrustedTightPlanLaunchCount
				- Weighting.ReliableTrustedTightPlanLaunchReducedCount,
			0)) * 0.5f;
	const float ReliableTrustedBroadPlanPromoteScore =
		static_cast<float>(Weighting.ReliableTrustedBroadPlanPromoteReducedCount) * 3.0f
		+ static_cast<float>(FMath::Max(
			Weighting.ReliableTrustedBroadPlanPromoteCount
				- Weighting.ReliableTrustedBroadPlanPromoteReducedCount,
			0)) * 0.5f;
	const float AdjustedPromoteScore =
		PromoteScore
		+ (Weighting.bHasDeferredFirstSignal ? DeferredFirstPromoteScore * 1.5f : 0.0f)
		+ (Weighting.bHasMethodDrillOutcomeSignal ? MethodDrillPromoteOutcomeScore * 1.1f : 0.0f)
		+ (Weighting.BroadMethodDrillPacketStructurePromoteCount > 0
			? BroadMethodDrillPacketStructurePromoteScore * 1.2f
			: 0.0f)
		+ (Weighting.ReliableTrustedBroadPlanPromoteCount > 0
			? ReliableTrustedBroadPlanPromoteScore * 1.25f
			: 0.0f)
		+ (Weighting.WeakRetainedMethodDrillPromoteCount > 0
			? WeakRetainedMethodDrillPromoteScore * 1.1f
			: 0.0f)
		+ static_cast<float>(Weighting.MethodDrillPromoteBiasCount) * 1.5f;
	const float AdjustedLaunchScore =
		LaunchScore
		+ (Weighting.bHasDeferredFirstSignal ? DeferredFirstLaunchScore * 0.75f : 0.0f)
		+ (Weighting.bHasMethodDrillOutcomeSignal ? MethodDrillLaunchOutcomeScore * 1.1f : 0.0f)
		+ (Weighting.NarrowMethodDrillPacketStructureLaunchCount > 0
			? NarrowMethodDrillPacketStructureLaunchScore * 1.2f
			: 0.0f)
		+ (Weighting.ReliableTrustedTightPlanLaunchCount > 0
			? ReliableTrustedTightPlanLaunchScore * 1.25f
			: 0.0f)
		+ (Weighting.StrongRetainedMethodDrillLaunchCount > 0
			? StrongRetainedMethodDrillLaunchScore * 1.1f
			: 0.0f)
		+ static_cast<float>(Weighting.MethodDrillLaunchBiasCount) * 0.85f;

	if (AdjustedPromoteScore > AdjustedLaunchScore)
	{
		Weighting.PreferredActionKind =
			FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred;
	}
	else if (AdjustedLaunchScore > AdjustedPromoteScore)
	{
		Weighting.PreferredActionKind =
			FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery;
	}
	else
	{
		for (int32 Index = QueueRecoveryOutcomeHistory.Num() - 1; Index >= 0; --Index)
		{
			const FHyperTwistCoachDashboardQueueRecoveryOutcome& Outcome = QueueRecoveryOutcomeHistory[Index];
			if (Outcome.IsStructurallyValid()
				&& Outcome.ActionKind != FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::None)
			{
				Weighting.PreferredActionKind = Outcome.ActionKind;
				break;
			}
		}
		if (Weighting.PreferredActionKind
			== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::None)
		{
			Weighting.PreferredActionKind =
				Weighting.PromoteCount >= Weighting.LaunchCount
					? FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred
					: FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery;
		}
	}

	return Weighting;
}

FHyperTwistCoachDashboardMethodDrillFollowUpWeighting
UHyperTwistCoachDashboardWidget::BuildMethodDrillFollowUpWeighting() const
{
	FHyperTwistCoachDashboardMethodDrillFollowUpWeighting Weighting;
	if (!CachedMethodDrillDiagnosticPacket.IsStructurallyValid())
	{
		return Weighting;
	}

	constexpr int32 MaxMatchedHistoryEntries = 6;
	for (int32 Index = MethodDrillFollowUpHistoryEntries.Num() - 1;
		Index >= 0 && Weighting.MatchingHistoryCount < MaxMatchedHistoryEntries;
		--Index)
	{
		const FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry& Entry =
			MethodDrillFollowUpHistoryEntries[Index];
		if (Entry.DiagnosticState != CachedMethodDrillDiagnosticPacket.DiagnosticState
			|| Entry.RecommendedReviewGrade
				!= CachedMethodDrillDiagnosticPacket.RecommendedReviewGrade)
		{
			continue;
		}

		++Weighting.MatchingHistoryCount;
		Weighting.AverageSuccessRate += Entry.SuccessRate;
		Weighting.AverageMistakes += static_cast<float>(Entry.TotalMistakes);

		const bool bStrongOutcome =
			Entry.SuccessRate >= 0.72f
			&& Entry.TotalMistakes <= FMath::Max(1, Entry.CompletedAttemptCount);
		const bool bWeakOutcome =
			Entry.SuccessRate < 0.50f
			|| Entry.TotalMistakes > FMath::Max(2, Entry.CompletedAttemptCount * 2);

		if (bStrongOutcome)
		{
			++Weighting.StrongOutcomeCount;
			Weighting.ContinueNarrowBias += 2;
		}
		if (Entry.bBoundaryPending || Entry.bBoundaryRepeatBurden)
		{
			++Weighting.ContinueNarrowBias;
		}
		if (bWeakOutcome)
		{
			++Weighting.WeakOutcomeCount;
			Weighting.RedirectCoachBias += 2;
		}
		if (!Entry.bBoundaryPending && Entry.SuccessRate < 0.65f)
		{
			++Weighting.RedirectCoachBias;
		}
		if (Entry.PacketStructureLabel.Equals(TEXT("queue-entry-first"), ESearchCase::IgnoreCase))
		{
			++Weighting.QueueEntryFirstStructureCount;
		}
		else if (Entry.PacketStructureLabel.Equals(TEXT("follow-up-packet-first"), ESearchCase::IgnoreCase))
		{
			++Weighting.FollowUpPacketFirstStructureCount;
		}
		else if (Entry.PacketStructureLabel.Equals(TEXT("recommended-brief-first"), ESearchCase::IgnoreCase))
		{
			++Weighting.RecommendedBriefFirstStructureCount;
		}
		else if (Entry.PacketStructureLabel.Equals(TEXT("recommended-brief-redirect"), ESearchCase::IgnoreCase)
			|| Entry.PacketStructureLabel.Equals(TEXT("broadened-redirect-first"), ESearchCase::IgnoreCase))
		{
			++Weighting.RecommendedRedirectStructureCount;
		}
		if (Entry.bPacketProvenStrongContinuation)
		{
			++Weighting.StrongPacketContinuationCount;
			if (bStrongOutcome)
			{
				Weighting.ContinueNarrowBias += 2;
			}
			else if (bWeakOutcome)
			{
				++Weighting.RedirectCoachBias;
			}
		}
		if (Entry.bPacketProvenWeakRedirect)
		{
			++Weighting.WeakPacketRedirectCount;
			if (bStrongOutcome)
			{
				Weighting.RedirectCoachBias += 2;
			}
			else if (bWeakOutcome)
			{
				++Weighting.ContinueNarrowBias;
			}
		}
	}

	Weighting.UpstreamNarrowPacketStructureHistoryCount =
		CachedCoachPanelState.NarrowMethodDrillFollowUpPacketStructureHistoryCount;
	Weighting.UpstreamBroadPacketStructureHistoryCount =
		CachedCoachPanelState.BroadMethodDrillFollowUpPacketStructureHistoryCount;
	Weighting.UpstreamPacketStructureHistoryCount =
		Weighting.UpstreamNarrowPacketStructureHistoryCount
		+ Weighting.UpstreamBroadPacketStructureHistoryCount;
	Weighting.UpstreamNarrowPacketStructureAverageOutcomeScore =
		CachedCoachPanelState.NarrowMethodDrillFollowUpPacketStructureAverageOutcomeScore;
	Weighting.UpstreamBroadPacketStructureAverageOutcomeScore =
		CachedCoachPanelState.BroadMethodDrillFollowUpPacketStructureAverageOutcomeScore;
	Weighting.bHasUpstreamStructureSignal = Weighting.UpstreamPacketStructureHistoryCount > 0;
	if (Weighting.bHasUpstreamStructureSignal)
	{
		const bool bPreferNarrowStructure =
			Weighting.UpstreamNarrowPacketStructureHistoryCount > 0
			&& (Weighting.UpstreamBroadPacketStructureHistoryCount <= 0
				|| Weighting.UpstreamNarrowPacketStructureAverageOutcomeScore
					>= Weighting.UpstreamBroadPacketStructureAverageOutcomeScore);
		const bool bPreferBroadStructure =
			Weighting.UpstreamBroadPacketStructureHistoryCount > 0
			&& (Weighting.UpstreamNarrowPacketStructureHistoryCount <= 0
				|| Weighting.UpstreamBroadPacketStructureAverageOutcomeScore
					> Weighting.UpstreamNarrowPacketStructureAverageOutcomeScore);
		if (bPreferNarrowStructure)
		{
			Weighting.bUsedUpstreamNarrowStructureSignal = true;
			Weighting.ContinueNarrowBias += FMath::Clamp(
				Weighting.UpstreamNarrowPacketStructureHistoryCount
					- Weighting.UpstreamBroadPacketStructureHistoryCount
					+ (Weighting.UpstreamNarrowPacketStructureAverageOutcomeScore >= 72.0f ? 1 : 0),
				1,
				3
			);
		}
		else if (bPreferBroadStructure)
		{
			Weighting.bUsedUpstreamBroadStructureSignal = true;
			Weighting.RedirectCoachBias += FMath::Clamp(
				Weighting.UpstreamBroadPacketStructureHistoryCount
					- Weighting.UpstreamNarrowPacketStructureHistoryCount
					+ (Weighting.UpstreamBroadPacketStructureAverageOutcomeScore >= 70.0f ? 1 : 0),
				1,
				3
			);
		}
	}

	if (Weighting.MatchingHistoryCount <= 0 && Weighting.UpstreamPacketStructureHistoryCount <= 0)
	{
		return Weighting;
	}

	if (Weighting.MatchingHistoryCount > 0)
	{
		Weighting.AverageSuccessRate /= static_cast<float>(Weighting.MatchingHistoryCount);
		Weighting.AverageMistakes /= static_cast<float>(Weighting.MatchingHistoryCount);
	}
	Weighting.bPreferDrillFollowUp =
		Weighting.ContinueNarrowBias >= Weighting.RedirectCoachBias + 2;
	Weighting.bPreferCoachHandoff =
		Weighting.RedirectCoachBias >= Weighting.ContinueNarrowBias + 2;
	return Weighting;
}

FString UHyperTwistCoachDashboardWidget::BuildGuidanceOutcomeActionLabel(
	const EHyperTwistCoachDashboardOutcomeAction Action) const
{
	switch (Action)
	{
	case EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase:
		return TEXT("Apply: Repeat Selected Case");
	case EHyperTwistCoachDashboardOutcomeAction::RepeatPreviewDeck:
		return TEXT("Apply: Repeat Preview Deck");
	case EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck:
		return TEXT("Apply: Broaden to Preview Deck");
	case EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance:
		return TEXT("Apply: Next Coach Guidance");
	default:
		return TEXT("Apply Outcome");
	}
}

FHyperTwistTrainingDeck UHyperTwistCoachDashboardWidget::BuildGuidanceOutcomeSelectedCaseDeck() const
{
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = nullptr;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = nullptr;
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = nullptr;
	FString DisplayedGuidanceComparisonSelectedCaseId;
	bool bDisplayedGuidanceComparisonSingleCase = false;
	if (!ResolveDisplayedGuidanceComparisonContext(
		DisplayedRunRecap,
		DisplayedGuidanceComparisonBrief,
		DisplayedGuidanceComparisonDeck,
		DisplayedGuidanceComparisonSelectedCaseId,
		bDisplayedGuidanceComparisonSingleCase)
		|| DisplayedGuidanceComparisonDeck == nullptr
		|| DisplayedGuidanceComparisonSelectedCaseId.IsEmpty())
	{
		return FHyperTwistTrainingDeck();
	}

	const FHyperTwistTrainingCase* SelectedCase = DisplayedGuidanceComparisonDeck->Cases.FindByPredicate(
		[&DisplayedGuidanceComparisonSelectedCaseId](const FHyperTwistTrainingCase& Candidate)
		{
			return Candidate.CaseId == DisplayedGuidanceComparisonSelectedCaseId;
		});
	if (SelectedCase == nullptr)
	{
		return FHyperTwistTrainingDeck();
	}

	FHyperTwistTrainingDeck SingleCaseDeck = *DisplayedGuidanceComparisonDeck;
	SingleCaseDeck.Cases = { *SelectedCase };
	SingleCaseDeck.DeckId = FString::Printf(
		TEXT("%s_case_%s"),
		DisplayedGuidanceComparisonDeck->DeckId.IsEmpty() ? TEXT("guidance") : *DisplayedGuidanceComparisonDeck->DeckId,
		SelectedCase->CaseId.IsEmpty() ? TEXT("selected") : *SelectedCase->CaseId
	);
	SingleCaseDeck.Title = FString::Printf(
		TEXT("%s (Selected Case)"),
		DisplayedGuidanceComparisonDeck->Title.IsEmpty() ? TEXT("Guidance Comparison") : *DisplayedGuidanceComparisonDeck->Title
	);
	return SingleCaseDeck;
}

void UHyperTwistCoachDashboardWidget::RecordGuidanceOutcomeDecision(
	const EHyperTwistCoachDashboardOutcomeAction RecommendedAction,
	const EHyperTwistCoachDashboardOutcomeAction AppliedAction,
	const FHyperTwistTrainingSessionSummary& DisplayedRunRecap,
	const FHyperTwistCoachBrief& DisplayedGuidanceComparisonBrief,
	const FHyperTwistTrainingDeck& DisplayedGuidanceComparisonDeck,
	const FString& DisplayedGuidanceComparisonSelectedCaseId,
	const bool bDisplayedGuidanceComparisonSingleCase,
	const int32 LaunchedCaseCount,
	const FString& LaunchBudgetReasonLine
)
{
	FHyperTwistCoachDashboardDecisionHistoryEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.SourceSessionId = DisplayedRunRecap.TrainingSessionId;
	Entry.GuidanceLane = !ActiveGuidanceLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap.TrainingSessionId == ActiveGuidanceLaunchSessionId
		? ActiveGuidanceLaunchLane
		: (!RetainedGuidanceComparisonSessionId.IsEmpty()
			&& DisplayedRunRecap.TrainingSessionId == RetainedGuidanceComparisonSessionId
			? RetainedGuidanceComparisonLane
			: EHyperTwistCoachDashboardGuidancePreviewLane::None);
	Entry.bSingleCaseScope = bDisplayedGuidanceComparisonSingleCase;
	Entry.SelectedCaseId = DisplayedGuidanceComparisonSelectedCaseId;
	Entry.BriefHeadline = DisplayedGuidanceComparisonBrief.Headline.IsEmpty()
		? (DisplayedGuidanceComparisonDeck.Title.IsEmpty()
			? DisplayedGuidanceComparisonDeck.DeckId
			: DisplayedGuidanceComparisonDeck.Title)
		: DisplayedGuidanceComparisonBrief.Headline;
	Entry.RecommendedAction = RecommendedAction;
	Entry.RecommendedActionLabel = BuildGuidanceOutcomeActionLabel(RecommendedAction);
	Entry.AppliedAction = AppliedAction;
	Entry.AppliedActionLabel = BuildGuidanceOutcomeActionLabel(AppliedAction);
	Entry.SuccessRate = DisplayedRunRecap.SuccessRate;
	Entry.CompletedAttemptCount = DisplayedRunRecap.CompletedAttemptCount;
	Entry.TotalMistakes = DisplayedRunRecap.TotalMistakes;
	Entry.LaunchedCaseCount = LaunchedCaseCount;
	Entry.ReferenceCaseCount = DisplayedGuidanceComparisonDeck.Cases.Num();
	Entry.bBroadenedLaunchScope =
		AppliedAction == EHyperTwistCoachDashboardOutcomeAction::BroadenPreviewDeck
		|| (Entry.ReferenceCaseCount > 0 && Entry.LaunchedCaseCount > Entry.ReferenceCaseCount);
	Entry.bTightenedLaunchScope =
		AppliedAction == EHyperTwistCoachDashboardOutcomeAction::RepeatSelectedCase
		|| (Entry.ReferenceCaseCount > 0 && Entry.LaunchedCaseCount > 0
			&& Entry.LaunchedCaseCount < Entry.ReferenceCaseCount);
	Entry.LaunchBudgetReasonLine = !LaunchBudgetReasonLine.IsEmpty()
		? LaunchBudgetReasonLine
		: (Entry.bBroadenedLaunchScope
			? TEXT("launch scope broadened against the comparison context")
			: (Entry.bTightenedLaunchScope
				? TEXT("launch scope stayed tighter than the comparison context")
				: TEXT("launch scope stayed aligned with the comparison context")));
	Entry.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.bUsedReliableAlignedTrustedTightPlanOutcomeHistory =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome");
	Entry.bUsedReliableAlignedTrustedBroadPlanOutcomeHistory =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome");

	if (Entry.IsStructurallyValid())
	{
		GuidanceDecisionHistoryEntries.Add(Entry);
		constexpr int32 MaxRetainedDecisionHistoryEntries = 16;
		if (GuidanceDecisionHistoryEntries.Num() > MaxRetainedDecisionHistoryEntries)
		{
			const int32 ExcessCount = GuidanceDecisionHistoryEntries.Num() - MaxRetainedDecisionHistoryEntries;
			GuidanceDecisionHistoryEntries.RemoveAt(0, ExcessCount, EAllowShrinking::No);
		}
		SelectedGuidanceDecisionIndex = GuidanceDecisionHistoryEntries.Num() - 1;
		SyncPreferredGuidancePreviewLane(true);
	}
}

void UHyperTwistCoachDashboardWidget::RecordQueueRecoveryOutcome(
	const FString& SourceLabel,
	const FString& AppliedActionLabel,
	const FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind ActionKind,
	const float BeforePressureScore,
	const int32 BeforeDeferredEventCount,
	const bool bBeforeBlockedFollowUp,
	const bool bBeforeOutstandingDeferred,
	const bool bBeforeCompletionGap,
	const bool bUsedDeferredFirstSuppressionSignal,
	const bool bUsedMethodDrillHandoffSignal,
	const bool bUsedNarrowMethodDrillPacketStructureRecovery,
	const bool bUsedBroadMethodDrillPacketStructureRecovery,
	const bool bUsedStrongRetainedMethodDrillRecoveryPosture,
	const bool bUsedWeakRetainedMethodDrillRecoveryPosture,
	const bool bUsedReliableTrustedTightStructurePlanRecovery,
	const bool bUsedReliableTrustedBroadStructurePlanRecovery,
	const bool bUsedReliableAlignedTrustedTightStructurePlanRecovery,
	const bool bUsedReliableAlignedTrustedBroadStructurePlanRecovery,
	const bool bSucceeded)
{
	QueueRecoveryOutcome.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	QueueRecoveryOutcome.SourceLabel = SourceLabel;
	QueueRecoveryOutcome.AppliedActionLabel = AppliedActionLabel;
	QueueRecoveryOutcome.ActionKind = ActionKind;
	QueueRecoveryOutcome.BeforePressureScore = BeforePressureScore;
	QueueRecoveryOutcome.AfterPressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	QueueRecoveryOutcome.BeforeDeferredEventCount = BeforeDeferredEventCount;
	QueueRecoveryOutcome.AfterDeferredEventCount = CachedCoachQueueExecutionSummary.DeferredEventCount;
	QueueRecoveryOutcome.bBeforeBlockedFollowUp = bBeforeBlockedFollowUp;
	QueueRecoveryOutcome.bAfterBlockedFollowUp = CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals;
	QueueRecoveryOutcome.bBeforeOutstandingDeferred = bBeforeOutstandingDeferred;
	QueueRecoveryOutcome.bAfterOutstandingDeferred = CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork;
	QueueRecoveryOutcome.bBeforeCompletionGap = bBeforeCompletionGap;
	QueueRecoveryOutcome.bAfterCompletionGap = CachedCoachQueueExecutionSummary.bHasCompletionGap;
	QueueRecoveryOutcome.bSucceeded = bSucceeded;
	QueueRecoveryOutcome.bReducedFriction = bSucceeded
		&& (QueueRecoveryOutcome.AfterPressureScore < QueueRecoveryOutcome.BeforePressureScore
			|| QueueRecoveryOutcome.AfterDeferredEventCount < QueueRecoveryOutcome.BeforeDeferredEventCount
			|| (!QueueRecoveryOutcome.bAfterBlockedFollowUp && QueueRecoveryOutcome.bBeforeBlockedFollowUp)
			|| (!QueueRecoveryOutcome.bAfterOutstandingDeferred && QueueRecoveryOutcome.bBeforeOutstandingDeferred)
			|| (!QueueRecoveryOutcome.bAfterCompletionGap && QueueRecoveryOutcome.bBeforeCompletionGap));
	QueueRecoveryOutcome.bShiftedFriction = bSucceeded
		&& !QueueRecoveryOutcome.bReducedFriction
		&& (
			!FMath::IsNearlyEqual(QueueRecoveryOutcome.AfterPressureScore, QueueRecoveryOutcome.BeforePressureScore)
			|| QueueRecoveryOutcome.AfterDeferredEventCount != QueueRecoveryOutcome.BeforeDeferredEventCount
			|| QueueRecoveryOutcome.bAfterBlockedFollowUp != QueueRecoveryOutcome.bBeforeBlockedFollowUp
			|| QueueRecoveryOutcome.bAfterOutstandingDeferred != QueueRecoveryOutcome.bBeforeOutstandingDeferred
			|| QueueRecoveryOutcome.bAfterCompletionGap != QueueRecoveryOutcome.bBeforeCompletionGap
		);
	QueueRecoveryOutcome.bUsedDeferredFirstSuppressionSignal =
		bUsedDeferredFirstSuppressionSignal;
	QueueRecoveryOutcome.bUsedMethodDrillHandoffSignal =
		bUsedMethodDrillHandoffSignal;
	QueueRecoveryOutcome.bUsedNarrowMethodDrillPacketStructureRecovery =
		bUsedNarrowMethodDrillPacketStructureRecovery;
	QueueRecoveryOutcome.bUsedBroadMethodDrillPacketStructureRecovery =
		bUsedBroadMethodDrillPacketStructureRecovery;
	QueueRecoveryOutcome.bUsedStrongRetainedMethodDrillRecoveryPosture =
		bUsedStrongRetainedMethodDrillRecoveryPosture;
	QueueRecoveryOutcome.bUsedWeakRetainedMethodDrillRecoveryPosture =
		bUsedWeakRetainedMethodDrillRecoveryPosture;
	QueueRecoveryOutcome.bUsedReliableTrustedTightStructurePlanRecovery =
		bUsedReliableTrustedTightStructurePlanRecovery;
	QueueRecoveryOutcome.bUsedReliableTrustedBroadStructurePlanRecovery =
		bUsedReliableTrustedBroadStructurePlanRecovery;
	QueueRecoveryOutcome.bUsedReliableAlignedTrustedTightStructurePlanRecovery =
		bUsedReliableAlignedTrustedTightStructurePlanRecovery;
	QueueRecoveryOutcome.bUsedReliableAlignedTrustedBroadStructurePlanRecovery =
		bUsedReliableAlignedTrustedBroadStructurePlanRecovery;
	bHasQueueRecoveryOutcome = QueueRecoveryOutcome.IsStructurallyValid();
	if (bHasQueueRecoveryOutcome)
	{
		QueueRecoveryOutcomeHistory.Add(QueueRecoveryOutcome);
		constexpr int32 MaxRetainedQueueRecoveryOutcomes = 16;
		if (QueueRecoveryOutcomeHistory.Num() > MaxRetainedQueueRecoveryOutcomes)
		{
			const int32 ExcessCount = QueueRecoveryOutcomeHistory.Num() - MaxRetainedQueueRecoveryOutcomes;
			QueueRecoveryOutcomeHistory.RemoveAt(0, ExcessCount, EAllowShrinking::No);
		}
		SyncSelectedMethodDrillRecoveryOutcomeEntry();
	}
}

void UHyperTwistCoachDashboardWidget::RecordCoachHandoffHistorySnapshot(
	const FString& RecommendedHandoffKindLabel,
	const FString& RecommendationStatusLine,
	const FString& RecommendationDetailLine,
	const FString& QueueSourceLabel,
	const int32 ClosureContinuationBias,
	const int32 ClosureSuppressionBias,
	const bool bQueueReady,
	const bool bFollowUpReady,
	const bool bRecommendedReady,
	const bool bUsedDeferredFirstSuppressionSignal,
	const bool bUsedMethodDrillWeighting,
	const bool bUsedStrongRetainedMethodDrillRecoveryPosture,
	const bool bUsedWeakRetainedMethodDrillRecoveryPosture,
	const bool bUsedReliableTrustedTightStructurePlanHistory,
	const bool bUsedReliableTrustedBroadStructurePlanHistory,
	const bool bUsedReliableAlignedTrustedTightStructurePlanHistory,
	const bool bUsedReliableAlignedTrustedBroadStructurePlanHistory,
	const bool bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory,
	const bool bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory,
	const bool bUsedReliableAcceptedAlignedTightPacketOutcomeHistory,
	const bool bUsedReliableAcceptedAlignedBroadPacketOutcomeHistory)
{
	FHyperTwistCoachDashboardHandoffHistoryEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.RecommendedHandoffKindLabel =
		RecommendedHandoffKindLabel.IsEmpty() ? TEXT("none") : RecommendedHandoffKindLabel;
	Entry.RecommendationStatusLine = RecommendationStatusLine;
	Entry.RecommendationDetailLine = RecommendationDetailLine;
	Entry.QueueSourceLabel = QueueSourceLabel;
	Entry.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Entry.PreferredGuidanceSourceLabel = CachedCoachPanelState.PreferredGuidanceSourceLabel;
	Entry.PreferredRecoveryAction = CachedCoachPanelState.PreferredQueueRecoveryAction;
	Entry.PreferredRecoveryActionSourceLabel =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel;
	Entry.AcceptedQueuedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedQueuedHandoffEventCount;
	Entry.AcceptedFollowUpHandoffCount =
		CachedCoachQueueExecutionSummary.StartedFollowUpHandoffEventCount;
	Entry.AcceptedRecommendedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedRecommendedHandoffEventCount;
	Entry.AcceptedDeferredOverflowQueuedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedDeferredOverflowQueuedHandoffEventCount;
	Entry.AcceptedDeferredOverflowFollowUpHandoffCount =
		CachedCoachQueueExecutionSummary.StartedDeferredOverflowFollowUpHandoffEventCount;
	Entry.AcceptedDeferredOverflowRecommendedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedDeferredOverflowRecommendedHandoffEventCount;
	Entry.AcceptedMethodDrillQueuedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedMethodDrillQueuedHandoffEventCount;
	Entry.AcceptedMethodDrillFollowUpHandoffCount =
		CachedCoachQueueExecutionSummary.StartedMethodDrillFollowUpHandoffEventCount;
	Entry.AcceptedMethodDrillRecommendedHandoffCount =
		CachedCoachQueueExecutionSummary.StartedMethodDrillRecommendedHandoffEventCount;
	const int32 PreviousAcceptedFollowUpHandoffCount = HandoffHistoryEntries.Num() > 0
		? HandoffHistoryEntries.Last().AcceptedFollowUpHandoffCount
		: 0;
	const int32 PreviousAcceptedRecommendedHandoffCount = HandoffHistoryEntries.Num() > 0
		? HandoffHistoryEntries.Last().AcceptedRecommendedHandoffCount
		: 0;
	const int32 PreviousAcceptedAlignedTightFollowUpOutcomeHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().AcceptedAlignedTightFollowUpOutcomeHandoffCount
			: 0;
	const int32 PreviousAcceptedAlignedBroadRecommendedOutcomeHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedOutcomeHandoffCount
			: 0;
	const int32 PreviousAcceptedAlignedTightFollowUpPacketHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().AcceptedAlignedTightFollowUpPacketHandoffCount
			: 0;
	const int32 PreviousAcceptedAlignedBroadRecommendedPacketHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedPacketHandoffCount
			: 0;
	const int32 PreviousReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
			: 0;
	const int32 PreviousReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount =
		HandoffHistoryEntries.Num() > 0
			? HandoffHistoryEntries.Last().ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
			: 0;
	const int32 AcceptedFollowUpHandoffDelta = FMath::Max(
		0,
		Entry.AcceptedFollowUpHandoffCount - PreviousAcceptedFollowUpHandoffCount
	);
	const int32 AcceptedRecommendedHandoffDelta = FMath::Max(
		0,
		Entry.AcceptedRecommendedHandoffCount - PreviousAcceptedRecommendedHandoffCount
	);
	const bool bAlignedTightFollowUpGuidanceOutcomeSource =
		HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpOutcomeSourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bAlignedBroadRecommendedGuidanceOutcomeSource =
		HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedOutcomeSourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bAlignedTightFollowUpPacketSource =
		HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpPacketSourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bAlignedBroadRecommendedPacketSource =
		HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedPacketSourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	Entry.AcceptedAlignedTightFollowUpOutcomeHandoffCount =
		PreviousAcceptedAlignedTightFollowUpOutcomeHandoffCount
		+ (bAlignedTightFollowUpGuidanceOutcomeSource ? AcceptedFollowUpHandoffDelta : 0);
	Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount =
		PreviousAcceptedAlignedBroadRecommendedOutcomeHandoffCount
		+ (bAlignedBroadRecommendedGuidanceOutcomeSource ? AcceptedRecommendedHandoffDelta : 0);
	Entry.AcceptedAlignedTightFollowUpPacketHandoffCount =
		PreviousAcceptedAlignedTightFollowUpPacketHandoffCount
		+ (bAlignedTightFollowUpPacketSource ? AcceptedFollowUpHandoffDelta : 0);
	Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount =
		PreviousAcceptedAlignedBroadRecommendedPacketHandoffCount
		+ (bAlignedBroadRecommendedPacketSource ? AcceptedRecommendedHandoffDelta : 0);
	Entry.ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount =
		PreviousReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
		+ (bUsedReliableAcceptedAlignedTightPacketOutcomeHistory ? AcceptedFollowUpHandoffDelta : 0);
	Entry.ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount =
		PreviousReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
		+ (bUsedReliableAcceptedAlignedBroadPacketOutcomeHistory ? AcceptedRecommendedHandoffDelta : 0);
	Entry.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedTightPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.ReliableAlignedTrustedBroadPlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.ClosureContinuationBias = ClosureContinuationBias;
	Entry.ClosureSuppressionBias = ClosureSuppressionBias;
	Entry.bQueueReady = bQueueReady;
	Entry.bFollowUpReady = bFollowUpReady;
	Entry.bRecommendedReady = bRecommendedReady;
	Entry.bUsedDeferredFirstSuppressionSignal = bUsedDeferredFirstSuppressionSignal;
	Entry.bUsedMethodDrillWeighting = bUsedMethodDrillWeighting;
	Entry.bUsedStrongRetainedMethodDrillRecoveryPosture =
		bUsedStrongRetainedMethodDrillRecoveryPosture;
	Entry.bUsedWeakRetainedMethodDrillRecoveryPosture =
		bUsedWeakRetainedMethodDrillRecoveryPosture;
	Entry.bUsedReliableTrustedTightStructurePlanHistory =
		bUsedReliableTrustedTightStructurePlanHistory;
	Entry.bUsedReliableTrustedBroadStructurePlanHistory =
		bUsedReliableTrustedBroadStructurePlanHistory;
	Entry.bUsedReliableAlignedTrustedTightStructurePlanHistory =
		bUsedReliableAlignedTrustedTightStructurePlanHistory;
	Entry.bUsedReliableAlignedTrustedBroadStructurePlanHistory =
		bUsedReliableAlignedTrustedBroadStructurePlanHistory;
	Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory =
		bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory;
	Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory =
		bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory;
	if (!Entry.IsStructurallyValid())
	{
		return;
	}

	const bool bMatchesLastEntry = HandoffHistoryEntries.Num() > 0
		&& HandoffHistoryEntries.Last().RecommendedHandoffKindLabel
			== Entry.RecommendedHandoffKindLabel
		&& HandoffHistoryEntries.Last().RecommendationStatusLine
			== Entry.RecommendationStatusLine
		&& HandoffHistoryEntries.Last().RecommendationDetailLine
			== Entry.RecommendationDetailLine
		&& HandoffHistoryEntries.Last().QueueSourceLabel == Entry.QueueSourceLabel
		&& HandoffHistoryEntries.Last().PreferredGuidanceLane == Entry.PreferredGuidanceLane
		&& HandoffHistoryEntries.Last().PreferredGuidanceSourceLabel
			== Entry.PreferredGuidanceSourceLabel
		&& HandoffHistoryEntries.Last().PreferredRecoveryAction
			== Entry.PreferredRecoveryAction
		&& HandoffHistoryEntries.Last().PreferredRecoveryActionSourceLabel
			== Entry.PreferredRecoveryActionSourceLabel
		&& HandoffHistoryEntries.Last().AcceptedQueuedHandoffCount
			== Entry.AcceptedQueuedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedFollowUpHandoffCount
			== Entry.AcceptedFollowUpHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedRecommendedHandoffCount
			== Entry.AcceptedRecommendedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedDeferredOverflowQueuedHandoffCount
			== Entry.AcceptedDeferredOverflowQueuedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedDeferredOverflowFollowUpHandoffCount
			== Entry.AcceptedDeferredOverflowFollowUpHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedDeferredOverflowRecommendedHandoffCount
			== Entry.AcceptedDeferredOverflowRecommendedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedMethodDrillQueuedHandoffCount
			== Entry.AcceptedMethodDrillQueuedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedMethodDrillFollowUpHandoffCount
			== Entry.AcceptedMethodDrillFollowUpHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedMethodDrillRecommendedHandoffCount
			== Entry.AcceptedMethodDrillRecommendedHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedAlignedTightFollowUpOutcomeHandoffCount
			== Entry.AcceptedAlignedTightFollowUpOutcomeHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedOutcomeHandoffCount
			== Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedAlignedTightFollowUpPacketHandoffCount
			== Entry.AcceptedAlignedTightFollowUpPacketHandoffCount
		&& HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedPacketHandoffCount
			== Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount
		&& HandoffHistoryEntries.Last().ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
			== Entry.ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount
		&& HandoffHistoryEntries.Last().ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
			== Entry.ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount
		&& HandoffHistoryEntries.Last().ReliableAlignedTrustedTightPlanOutcomeHistoryCount
			== Entry.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
		&& HandoffHistoryEntries.Last().ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
			== Entry.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
		&& FMath::IsNearlyEqual(
			HandoffHistoryEntries.Last().ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			Entry.ReliableAlignedTrustedTightPlanOutcomeAverageScore)
		&& FMath::IsNearlyEqual(
			HandoffHistoryEntries.Last().ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			Entry.ReliableAlignedTrustedBroadPlanOutcomeAverageScore)
		&& HandoffHistoryEntries.Last().ClosureContinuationBias
			== Entry.ClosureContinuationBias
		&& HandoffHistoryEntries.Last().ClosureSuppressionBias
			== Entry.ClosureSuppressionBias
		&& HandoffHistoryEntries.Last().bQueueReady == Entry.bQueueReady
		&& HandoffHistoryEntries.Last().bFollowUpReady == Entry.bFollowUpReady
		&& HandoffHistoryEntries.Last().bRecommendedReady == Entry.bRecommendedReady
		&& HandoffHistoryEntries.Last().bUsedDeferredFirstSuppressionSignal
			== Entry.bUsedDeferredFirstSuppressionSignal
		&& HandoffHistoryEntries.Last().bUsedMethodDrillWeighting
			== Entry.bUsedMethodDrillWeighting
		&& HandoffHistoryEntries.Last().bUsedStrongRetainedMethodDrillRecoveryPosture
			== Entry.bUsedStrongRetainedMethodDrillRecoveryPosture
		&& HandoffHistoryEntries.Last().bUsedWeakRetainedMethodDrillRecoveryPosture
			== Entry.bUsedWeakRetainedMethodDrillRecoveryPosture
		&& HandoffHistoryEntries.Last().bUsedReliableTrustedTightStructurePlanHistory
			== Entry.bUsedReliableTrustedTightStructurePlanHistory
		&& HandoffHistoryEntries.Last().bUsedReliableTrustedBroadStructurePlanHistory
			== Entry.bUsedReliableTrustedBroadStructurePlanHistory
		&& HandoffHistoryEntries.Last().bUsedReliableAlignedTrustedTightStructurePlanHistory
			== Entry.bUsedReliableAlignedTrustedTightStructurePlanHistory
		&& HandoffHistoryEntries.Last().bUsedReliableAlignedTrustedBroadStructurePlanHistory
			== Entry.bUsedReliableAlignedTrustedBroadStructurePlanHistory
		&& HandoffHistoryEntries.Last().bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory
			== Entry.bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory
		&& HandoffHistoryEntries.Last().bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory
			== Entry.bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory;
	if (bMatchesLastEntry)
	{
		return;
	}

	HandoffHistoryEntries.Add(Entry);
	constexpr int32 MaxRetainedHandoffHistoryEntries = 16;
	if (HandoffHistoryEntries.Num() > MaxRetainedHandoffHistoryEntries)
	{
		const int32 ExcessCount = HandoffHistoryEntries.Num() - MaxRetainedHandoffHistoryEntries;
		HandoffHistoryEntries.RemoveAt(0, ExcessCount, EAllowShrinking::No);
	}
	SelectedHandoffHistoryIndex = HandoffHistoryEntries.Num() - 1;
}

void UHyperTwistCoachDashboardWidget::RecordQueueSuppressionSnapshot()
{
	const bool bHasPrimarySuppression =
		CachedCoachSessionQueueSummary.bSuppressedPrimaryQueueCreation
		&& !CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason.IsEmpty();
	const bool bHasFollowUpSuppression =
		CachedCoachSessionQueueSummary.bSuppressedFollowUpQueueCreation
		&& !CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason.IsEmpty();
	if (!bHasPrimarySuppression && !bHasFollowUpSuppression)
	{
		return;
	}

	FHyperTwistCoachDashboardQueueSuppressionEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.TotalQueueEntryCount = CachedCoachPanelState.TotalQueueEntryCount;
	Entry.ReadyQueueEntryCount = CachedCoachPanelState.ReadyQueueEntryCount;
	Entry.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Entry.PreferredRecoveryAction = CachedCoachPanelState.PreferredQueueRecoveryAction;
	Entry.PressureScore = CachedCoachSchedulePolicySummary.ReschedulePressureScore;
	Entry.DominantDeferralReasonLabel = CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel;
	Entry.bSuppressedPrimaryQueueCreation = bHasPrimarySuppression;
	Entry.bSuppressedFollowUpQueueCreation = bHasFollowUpSuppression;
	Entry.PrimaryQueueSuppressionReason = CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason;
	Entry.FollowUpQueueSuppressionReason = CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason;
	if (!Entry.IsStructurallyValid())
	{
		return;
	}

	const bool bMatchesLastEntry = QueueSuppressionHistoryEntries.Num() > 0
		&& QueueSuppressionHistoryEntries.Last().bSuppressedPrimaryQueueCreation == Entry.bSuppressedPrimaryQueueCreation
		&& QueueSuppressionHistoryEntries.Last().bSuppressedFollowUpQueueCreation == Entry.bSuppressedFollowUpQueueCreation
		&& QueueSuppressionHistoryEntries.Last().PrimaryQueueSuppressionReason == Entry.PrimaryQueueSuppressionReason
		&& QueueSuppressionHistoryEntries.Last().FollowUpQueueSuppressionReason == Entry.FollowUpQueueSuppressionReason
		&& QueueSuppressionHistoryEntries.Last().PreferredGuidanceLane == Entry.PreferredGuidanceLane
		&& QueueSuppressionHistoryEntries.Last().PreferredRecoveryAction == Entry.PreferredRecoveryAction
		&& QueueSuppressionHistoryEntries.Last().DominantDeferralReasonLabel == Entry.DominantDeferralReasonLabel;
	if (bMatchesLastEntry)
	{
		return;
	}

	QueueSuppressionHistoryEntries.Add(Entry);
	constexpr int32 MaxRetainedQueueSuppressionEntries = 16;
	if (QueueSuppressionHistoryEntries.Num() > MaxRetainedQueueSuppressionEntries)
	{
		const int32 ExcessCount = QueueSuppressionHistoryEntries.Num() - MaxRetainedQueueSuppressionEntries;
		QueueSuppressionHistoryEntries.RemoveAt(0, ExcessCount, EAllowShrinking::No);
	}
	SelectedQueueSuppressionIndex = QueueSuppressionHistoryEntries.Num() - 1;
}

void UHyperTwistCoachDashboardWidget::RecordClosureRecoverySnapshot()
{
	const int32 HistoricalKeepCount =
		CachedCoachSchedulePolicySummary.HistoricalFollowUpContinuationCount;
	const int32 HistoricalSuppressCount =
		CachedCoachSchedulePolicySummary.HistoricalBorderlineFollowUpSuppressionCount;
	const FHyperTwistCoachSignal* ClosureRecoverySignal = CachedCoachSignals.FindByPredicate(
		[](const FHyperTwistCoachSignal& Signal)
		{
			return Signal.SignalId == TEXT("closure_history_follow_up_continuation")
				|| Signal.SignalId == TEXT("closure_history_recommended_suppression");
		}
	);
	const bool bHasClosureSignal = ClosureRecoverySignal != nullptr;

	FHyperTwistCoachDashboardClosureRecoveryEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.HistoricalFollowUpContinuationCount = HistoricalKeepCount;
	Entry.HistoricalBorderlineFollowUpSuppressionCount = HistoricalSuppressCount;
	Entry.bFollowUpContinuationFromRecoveryHistory =
		CachedCoachSchedulePolicySummary.bFollowUpContinuationFromRecoveryHistory;
	Entry.bBorderlineFollowUpSuppressedByRecoveryHistory =
		CachedCoachSchedulePolicySummary.bBorderlineFollowUpSuppressedByRecoveryHistory;
	Entry.PreferredGuidanceLane = CachedCoachPanelState.PreferredGuidanceLane;
	Entry.PreferredGuidanceSourceLabel = CachedCoachPanelState.PreferredGuidanceSourceLabel;
	Entry.ClosurePolicyLine = CachedCoachSchedulePolicySummary.ClosurePolicyLine;
	if (bHasClosureSignal)
	{
		Entry.ActiveSignalId = ClosureRecoverySignal->SignalId;
		Entry.ActiveSignalHeadline = ClosureRecoverySignal->Headline;
		Entry.ActiveSignalDetail = ClosureRecoverySignal->Detail;
		Entry.ActiveSignalScore = ClosureRecoverySignal->Score;
		Entry.bActiveSignalPromoted =
			CachedCoachBrief.Signals.Num() > 0
			&& CachedCoachBrief.Signals[0].SignalId == ClosureRecoverySignal->SignalId;
	}

	const bool bHasClosureRecoveryHistory =
		HistoricalKeepCount > 0
		|| HistoricalSuppressCount > 0
		|| Entry.bFollowUpContinuationFromRecoveryHistory
		|| Entry.bBorderlineFollowUpSuppressedByRecoveryHistory
		|| bHasClosureSignal;
	if (!bHasClosureRecoveryHistory || !Entry.IsStructurallyValid())
	{
		return;
	}

	const bool bMatchesLastEntry = ClosureRecoveryHistoryEntries.Num() > 0
		&& ClosureRecoveryHistoryEntries.Last().HistoricalFollowUpContinuationCount
			== Entry.HistoricalFollowUpContinuationCount
		&& ClosureRecoveryHistoryEntries.Last().HistoricalBorderlineFollowUpSuppressionCount
			== Entry.HistoricalBorderlineFollowUpSuppressionCount
		&& ClosureRecoveryHistoryEntries.Last().bFollowUpContinuationFromRecoveryHistory
			== Entry.bFollowUpContinuationFromRecoveryHistory
		&& ClosureRecoveryHistoryEntries.Last().bBorderlineFollowUpSuppressedByRecoveryHistory
			== Entry.bBorderlineFollowUpSuppressedByRecoveryHistory
		&& ClosureRecoveryHistoryEntries.Last().PreferredGuidanceLane
			== Entry.PreferredGuidanceLane
		&& ClosureRecoveryHistoryEntries.Last().PreferredGuidanceSourceLabel
			== Entry.PreferredGuidanceSourceLabel
		&& ClosureRecoveryHistoryEntries.Last().ClosurePolicyLine
			== Entry.ClosurePolicyLine
		&& ClosureRecoveryHistoryEntries.Last().ActiveSignalId
			== Entry.ActiveSignalId
		&& ClosureRecoveryHistoryEntries.Last().bActiveSignalPromoted
			== Entry.bActiveSignalPromoted;
	if (bMatchesLastEntry)
	{
		return;
	}

	ClosureRecoveryHistoryEntries.Add(Entry);
	constexpr int32 MaxRetainedClosureRecoveryEntries = 16;
	if (ClosureRecoveryHistoryEntries.Num() > MaxRetainedClosureRecoveryEntries)
	{
		const int32 ExcessCount =
			ClosureRecoveryHistoryEntries.Num() - MaxRetainedClosureRecoveryEntries;
		ClosureRecoveryHistoryEntries.RemoveAt(0, ExcessCount, EAllowShrinking::No);
	}
	SelectedClosureRecoveryIndex = ClosureRecoveryHistoryEntries.Num() - 1;
}

void UHyperTwistCoachDashboardWidget::SyncTemplateLaunchHistoryFromRepository()
{
	const FString PreviouslySelectedSessionId =
		SelectedTemplateLaunchHistoryIndex >= 0
		&& SelectedTemplateLaunchHistoryIndex < TemplateLaunchHistoryEntries.Num()
			? TemplateLaunchHistoryEntries[SelectedTemplateLaunchHistoryIndex].SourceSessionId
			: FString();

	CachedTemplateLaunchAnalyticsUserId.Reset();
	CachedTemplateLaunchScopedStats.Reset();
	TemplateLaunchHistoryEntries.Reset();
	SelectedTemplateLaunchHistoryIndex = INDEX_NONE;

	FString HistoryUserId = !DefaultUserId.IsEmpty()
		? DefaultUserId
		: RetainedRunRecapUserId;
	if (HistoryUserId.IsEmpty() && CachedRunState.Session.IsStructurallyValid())
	{
		HistoryUserId = CachedRunState.Session.UserId;
	}
	if (HistoryUserId.IsEmpty() && ActiveTemplateLaunchProvenance.IsStructurallyValid())
	{
		HistoryUserId = ActiveTemplateLaunchProvenance.UserId;
	}
	if (HistoryUserId.IsEmpty() && RetainedTemplateLaunchProvenance.IsStructurallyValid())
	{
		HistoryUserId = RetainedTemplateLaunchProvenance.UserId;
	}
	if (HistoryUserId.IsEmpty() && CachedDefaultUserTrainingSessionTemplates.Num() > 0)
	{
		HistoryUserId = CachedDefaultUserTrainingSessionTemplates[0].UserId;
	}
	if (HistoryUserId.IsEmpty() && CachedActiveTrainingSessionTemplates.Num() > 0)
	{
		HistoryUserId = CachedActiveTrainingSessionTemplates[0].UserId;
	}
	if (HistoryUserId.IsEmpty())
	{
		return;
	}

	const FHyperTwistTrainingRepositoryState RepositoryState =
		UHyperTwistTrainingRuntimeLibrary::GetTrainingRepositoryState(this);
	CachedTemplateLaunchAnalyticsUserId = HistoryUserId;
	CachedTemplateLaunchScopedStats =
		UHyperTwistTrainingRepositoryLibrary::ListTemplateLaunchScopedStatsForUser(
			RepositoryState,
			HistoryUserId,
			FString());
	const TArray<FHyperTwistTrainingRunRecord> UserRunRecords =
		UHyperTwistTrainingRepositoryLibrary::ListRunRecordsForDeck(
			RepositoryState,
			HistoryUserId,
			FString());
	TArray<FHyperTwistCoachDashboardTemplateLaunchHistoryEntry> ReverseOrderedEntries;
	constexpr int32 MaxRetainedTemplateLaunchHistoryEntries = 16;
	ReverseOrderedEntries.Reserve(MaxRetainedTemplateLaunchHistoryEntries);
	for (const FHyperTwistTrainingRunRecord& RunRecord : UserRunRecords)
	{
		if (!RunRecord.IsStructurallyValid()
			|| !RunRecord.TemplateLaunchProvenance.IsStructurallyValid()
			|| (RunRecord.Summary.SessionState != EHyperTwistTrainingSessionState::Completed
				&& RunRecord.Summary.SessionState != EHyperTwistTrainingSessionState::Aborted))
		{
			continue;
		}

		FHyperTwistCoachDashboardTemplateLaunchHistoryEntry Entry =
			HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchHistoryEntry(RunRecord);
		if (!Entry.IsStructurallyValid())
		{
			continue;
		}

		ReverseOrderedEntries.Add(MoveTemp(Entry));
		if (ReverseOrderedEntries.Num() >= MaxRetainedTemplateLaunchHistoryEntries)
		{
			break;
		}
	}

	for (int32 Index = ReverseOrderedEntries.Num() - 1; Index >= 0; --Index)
	{
		TemplateLaunchHistoryEntries.Add(ReverseOrderedEntries[Index]);
	}

	if (!PreviouslySelectedSessionId.IsEmpty())
	{
		const int32 MatchingIndex = TemplateLaunchHistoryEntries.IndexOfByPredicate(
			[&PreviouslySelectedSessionId](
				const FHyperTwistCoachDashboardTemplateLaunchHistoryEntry& Candidate)
			{
				return Candidate.SourceSessionId == PreviouslySelectedSessionId;
			}
		);
		if (MatchingIndex >= 0)
		{
			SelectedTemplateLaunchHistoryIndex = MatchingIndex;
		}
	}

	SyncSelectedTemplateLaunchHistoryEntry();
}

void UHyperTwistCoachDashboardWidget::RecordMethodDrillFollowUpHistoryEntry(
	const FHyperTwistTrainingSessionSummary& CompletedRunRecap
)
{
	if (CompletedRunRecap.TrainingSessionId.IsEmpty()
		|| !ActiveMethodDrillFollowUpLaunchDiagnosticPacket.IsStructurallyValid()
		|| !ActiveMethodDrillFollowUpLaunchTemplate.IsStructurallyValid())
	{
		return;
	}

	FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.SourceRunId = ActiveMethodDrillFollowUpLaunchDiagnosticPacket.RunId;
	Entry.SourceDrillId = ActiveMethodDrillFollowUpLaunchDiagnosticPacket.DrillId;
	Entry.SourceSessionId = CompletedRunRecap.TrainingSessionId;
	Entry.StageLabel = ActiveMethodDrillFollowUpLaunchDiagnosticPacket.StageLabel;
	Entry.DiagnosticState = ActiveMethodDrillFollowUpLaunchDiagnosticPacket.DiagnosticState;
	Entry.RecommendedReviewGrade =
		ActiveMethodDrillFollowUpLaunchDiagnosticPacket.RecommendedReviewGrade;
	Entry.TemplateKind = ActiveMethodDrillFollowUpLaunchTemplate.TemplateKind;
	Entry.SuggestedMode = ActiveMethodDrillFollowUpLaunchTemplate.SuggestedMode;
	Entry.SuggestedSelectionPolicy =
		ActiveMethodDrillFollowUpLaunchTemplate.SuggestedSelectionPolicy;
	Entry.FocusCaseCount = ActiveMethodDrillFollowUpLaunchDiagnosticPacket.FocusCaseIds.Num();
	Entry.LaunchedCaseCount = CompletedRunRecap.CompletedAttemptCount > 0
		? FMath::Max(CompletedRunRecap.CompletedAttemptCount, 1)
		: ActiveMethodDrillFollowUpLaunchTemplate.RecommendedCaseCount;
	Entry.CompletedAttemptCount = CompletedRunRecap.CompletedAttemptCount;
	Entry.TotalMistakes = CompletedRunRecap.TotalMistakes;
	Entry.SuccessRate = CompletedRunRecap.SuccessRate;
	Entry.PacketStructureLabel = ActiveMethodDrillFollowUpLaunchPacketStructureLabel;
	Entry.PacketLaneLabel = ActiveMethodDrillFollowUpLaunchPacketLaneLabel;
	Entry.PacketStanceLabel = ActiveMethodDrillFollowUpLaunchPacketStanceLabel;
	Entry.bBoundaryPending =
		ActiveMethodDrillFollowUpLaunchDiagnosticPacket.bBoundaryTriggeredByPendingCases;
	Entry.bBoundaryRepeatBurden =
		ActiveMethodDrillFollowUpLaunchDiagnosticPacket.bBoundaryTriggeredByRepeatBurden;
	Entry.bBoundaryAssistance =
		ActiveMethodDrillFollowUpLaunchDiagnosticPacket.bBoundaryTriggeredByAssistance;
	Entry.bPacketProvenStrongContinuation =
		Entry.PacketStanceLabel.Equals(TEXT("strong continuation"), ESearchCase::IgnoreCase);
	Entry.bPacketProvenWeakRedirect =
		Entry.PacketStanceLabel.Equals(TEXT("weak redirect"), ESearchCase::IgnoreCase);
	if (!Entry.IsStructurallyValid())
	{
		return;
	}

	const bool bAlreadyRecorded = MethodDrillFollowUpHistoryEntries.ContainsByPredicate(
		[&Entry](const FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry& Candidate)
		{
			return Candidate.SourceRunId == Entry.SourceRunId
				&& Candidate.SourceSessionId == Entry.SourceSessionId;
		}
	);
	if (bAlreadyRecorded)
	{
		return;
	}

	MethodDrillFollowUpHistoryEntries.Add(Entry);
	constexpr int32 MaxRetainedMethodDrillFollowUpHistoryEntries = 16;
	if (MethodDrillFollowUpHistoryEntries.Num() > MaxRetainedMethodDrillFollowUpHistoryEntries)
	{
		const int32 ExcessCount =
			MethodDrillFollowUpHistoryEntries.Num() - MaxRetainedMethodDrillFollowUpHistoryEntries;
		MethodDrillFollowUpHistoryEntries.RemoveAt(0, ExcessCount, EAllowShrinking::No);
	}
	SelectedMethodDrillFollowUpHistoryIndex = MethodDrillFollowUpHistoryEntries.Num() - 1;
}

void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnapshot(
	const FHyperTwistCoachDashboardQueueRecoveryWeighting& QueueRecoveryWeighting,
	const FString& QueueRecoveryStatusLine,
	const FString& HandoffRecommendationKindLabel,
	const FString& HandoffRecommendationStatusLine,
	const bool bUsedMethodDrillRecoveryMemoryForHandoff,
	const bool bSuppressGeneratedGuidancePacketSurface
)
{
	const bool bHasMethodDrillRecoveryHistory =
		CachedCoachPanelState.MethodDrillRecoveryHistoryCount > 0;
	const bool bDrillRecoverySourceActive =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
			== TEXT("coach-memory-method-drill-recovery-strong")
		|| CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
			== TEXT("coach-memory-method-drill-recovery-weak");
	const bool bPacketStructureRecoverySourceActive =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow")
		|| CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
	const bool bReliableTrustedPlanRecoverySourceActive =
		HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
			CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel);
	const bool bReliableAlignedTrustedPlanRecoverySourceActive =
		HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
			CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel);
	if (!bHasMethodDrillRecoveryHistory
		&& !QueueRecoveryWeighting.bHasMethodDrillMemorySignal
		&& !QueueRecoveryWeighting.bHasReliableTrustedPlanSignal
		&& !QueueRecoveryWeighting.bHasReliableAlignedTrustedPlanSignal
		&& !bUsedMethodDrillRecoveryMemoryForHandoff
		&& !bDrillRecoverySourceActive
		&& !bPacketStructureRecoverySourceActive
		&& !bReliableTrustedPlanRecoverySourceActive
		&& !bReliableAlignedTrustedPlanRecoverySourceActive
		&& QueueRecoveryWeighting.NarrowMethodDrillPacketStructureLaunchCount <= 0
		&& QueueRecoveryWeighting.BroadMethodDrillPacketStructurePromoteCount <= 0)
	{
		return;
	}

	FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry Entry;
	Entry.RecordedAtUtc = FDateTime::UtcNow().ToIso8601();
	Entry.PreferredRecoveryAction = CachedCoachPanelState.PreferredQueueRecoveryAction;
	Entry.PreferredRecoveryActionSourceLabel =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel;
	Entry.RecommendedHandoffKindLabel =
		HandoffRecommendationKindLabel.IsEmpty() ? TEXT("none") : HandoffRecommendationKindLabel;
	Entry.QueueRecoveryStatusLine = QueueRecoveryStatusLine;
	Entry.HandoffRecommendationStatusLine = HandoffRecommendationStatusLine;
	Entry.MethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.MethodDrillRecoveryHistoryCount;
	Entry.StrongMethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount;
	Entry.WeakMethodDrillRecoveryHistoryCount =
		CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount;
	Entry.MethodDrillRecoveryAverageOutcomeScore =
		CachedCoachPanelState.MethodDrillRecoveryAverageOutcomeScore;
	Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount =
		QueueRecoveryWeighting.NarrowMethodDrillPacketStructureLaunchCount;
	Entry.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount =
		QueueRecoveryWeighting.NarrowMethodDrillPacketStructureLaunchReducedCount;
	Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount =
		QueueRecoveryWeighting.BroadMethodDrillPacketStructurePromoteCount;
	Entry.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount =
		QueueRecoveryWeighting.BroadMethodDrillPacketStructurePromoteReducedCount;
	Entry.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount =
		CachedCoachPanelState.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore;
	Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore =
		CachedCoachPanelState
			.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore;
	Entry.bStrongPressureDominant =
		Entry.MethodDrillRecoveryHistoryCount >= 2
		&& Entry.StrongMethodDrillRecoveryHistoryCount
			>= Entry.WeakMethodDrillRecoveryHistoryCount
		&& Entry.MethodDrillRecoveryAverageOutcomeScore >= 55.0f;
	Entry.bWeakPressureDominant =
		Entry.MethodDrillRecoveryHistoryCount >= 2
		&& Entry.WeakMethodDrillRecoveryHistoryCount
			> Entry.StrongMethodDrillRecoveryHistoryCount
		&& Entry.MethodDrillRecoveryAverageOutcomeScore <= 45.0f;
	Entry.bNarrowPacketStructureRecoveryDominant =
		Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount > 0
		&& Entry.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount * 2
			>= Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount
		&& Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount
			>= Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount;
	Entry.bBroadPacketStructureRecoveryDominant =
		Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount > 0
		&& Entry.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount * 2
			>= Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount
		&& Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount
			>= Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount;
	Entry.bReliableTrustedTightStructurePlanDominant =
		Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount >= 2
		&& Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore >= 60.0f
		&& Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
			>= Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.bReliableTrustedBroadStructurePlanDominant =
		Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount >= 2
		&& Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore >= 60.0f
		&& Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
			>= Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.bReliableAlignedTrustedTightStructurePlanDominant =
		Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount >= 2
		&& Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore
			>= 60.0f
		&& Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
			>= Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.bReliableAlignedTrustedBroadStructurePlanDominant =
		Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount >= 2
		&& Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore
			>= 60.0f
		&& Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
			>= Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount;
	Entry.bReliableAlignedTrustedTightStructurePlanOutcomeDominant =
		Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount >= 2
		&& Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore
			>= 60.0f
		&& Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount
			>= Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.bReliableAlignedTrustedBroadStructurePlanOutcomeDominant =
		Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount >= 2
		&& Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore
			>= 58.0f
		&& Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount
			>= Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
	Entry.bUsedMethodDrillRecoveryMemoryForRecovery =
		QueueRecoveryWeighting.bHasMethodDrillMemorySignal;
	Entry.bUsedMethodDrillRecoveryMemoryForHandoff =
		bUsedMethodDrillRecoveryMemoryForHandoff;
	auto SourceUsesStrongRetainedMethodDrillRecoveryPosture = [](const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("method-drill-recovery-posture-strong"))
			|| SourceLabel.Contains(TEXT("method-drill-recovery-packet-strong"));
	};
	auto SourceUsesWeakRetainedMethodDrillRecoveryPosture = [](const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("method-drill-recovery-posture-weak"))
			|| SourceLabel.Contains(TEXT("method-drill-recovery-packet-weak"));
	};
	auto SourceUsesGenericMethodDrillRecoveryMemory = [](const FString& SourceLabel)
	{
		return SourceLabel.Contains(TEXT("method-drill-recovery-strong"))
			|| SourceLabel.Contains(TEXT("method-drill-recovery-weak"))
			|| SourceLabel.Contains(TEXT("method-drill-recovery-memory-strong"))
			|| SourceLabel.Contains(TEXT("method-drill-recovery-memory-weak"));
	};
	const FString GuidanceSourceLabel = CachedCoachPanelState.PreferredGuidanceSourceLabel;
	const auto ApplyGeneratedPlanSnapshot =
		[&Entry](
			const bool bUseReliableAlignedTrustedTightPlanSource,
			const bool bUseReliableAlignedTrustedBroadPlanSource,
			const bool bUseReliableTrustedTightPlanSource,
			const bool bUseReliableTrustedBroadPlanSource,
			const EHyperTwistTrainingDeliveryMode SuggestedMode,
			const EHyperTwistTrainingSelectionPolicy SuggestedSelectionPolicy)
	{
		Entry.GeneratedPlanSuggestedMode = SuggestedMode;
		Entry.GeneratedPlanSuggestedSelectionPolicy = SuggestedSelectionPolicy;
		Entry.GeneratedPlanPostureLabel =
			HyperTwistCoachDashboardWidgetInternal::DescribeCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedTightStructureContinuationPosture =
			Entry.bNarrowPacketStructureRecoveryDominant
			&& HyperTwistCoachDashboardWidgetInternal::IsTightCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedBroadStructureRedirectPosture =
			Entry.bBroadPacketStructureRecoveryDominant
			&& HyperTwistCoachDashboardWidgetInternal::IsBroadCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture =
			bUseReliableTrustedTightPlanSource
			&& HyperTwistCoachDashboardWidgetInternal::IsTightCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture =
			bUseReliableTrustedBroadPlanSource
			&& HyperTwistCoachDashboardWidgetInternal::IsBroadCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture =
			bUseReliableAlignedTrustedTightPlanSource
			&& HyperTwistCoachDashboardWidgetInternal::IsTightCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
		Entry.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture =
			bUseReliableAlignedTrustedBroadPlanSource
			&& HyperTwistCoachDashboardWidgetInternal::IsBroadCoachPlanPosture(
				SuggestedMode,
				SuggestedSelectionPolicy);
	};
	const bool bStrongPacketPosture =
		SourceUsesStrongRetainedMethodDrillRecoveryPosture(GuidanceSourceLabel)
		|| SourceUsesStrongRetainedMethodDrillRecoveryPosture(
			Entry.PreferredRecoveryActionSourceLabel
		);
	const bool bWeakPacketPosture =
		SourceUsesWeakRetainedMethodDrillRecoveryPosture(GuidanceSourceLabel)
		|| SourceUsesWeakRetainedMethodDrillRecoveryPosture(
			Entry.PreferredRecoveryActionSourceLabel
		);
	const bool bGenericRecoveryPacket =
		!bStrongPacketPosture
		&& !bWeakPacketPosture
		&& (
			SourceUsesGenericMethodDrillRecoveryMemory(GuidanceSourceLabel)
			|| SourceUsesGenericMethodDrillRecoveryMemory(
				Entry.PreferredRecoveryActionSourceLabel
			)
		);
	const bool bReliableTrustedTightPlanSource =
		HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
			GuidanceSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel(
			Entry.PreferredRecoveryActionSourceLabel);
	const bool bReliableAlignedTrustedTightPlanSource =
		HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
			GuidanceSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedTightMethodDrillRecoveryPlanSourceLabel(
			Entry.PreferredRecoveryActionSourceLabel);
	const bool bReliableTrustedBroadPlanSource =
		HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			GuidanceSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			Entry.PreferredRecoveryActionSourceLabel);
	const bool bReliableAlignedTrustedBroadPlanSource =
		HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			GuidanceSourceLabel)
		|| HyperTwistCoachDashboardWidgetInternal::IsReliableAlignedTrustedBroadMethodDrillRecoveryPlanSourceLabel(
			Entry.PreferredRecoveryActionSourceLabel);
	Entry.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture = bStrongPacketPosture;
	Entry.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture = bWeakPacketPosture;
	Entry.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory = bGenericRecoveryPacket;
	if (!bSuppressGeneratedGuidancePacketSurface)
	{
		if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("queue"), ESearchCase::IgnoreCase))
		{
			if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedQueueEntry =
					FindSelectedQueueEntry())
			{
				Entry.GeneratedGuidancePacketKindLabel = TEXT("queue-entry");
				Entry.GeneratedGuidancePacketSourceLabel = SelectedQueueEntry->SourceLabel;
				Entry.GeneratedGuidancePacketHeadline = SelectedQueueEntry->Headline;
				Entry.GeneratedGuidancePacketActionLabel =
					SelectedQueueEntry->Headline.IsEmpty()
						? SelectedQueueEntry->SourceLabel
						: SelectedQueueEntry->Headline;
				Entry.GeneratedGuidancePacketFocusCaseCount = SelectedQueueEntry->FocusCaseIds.Num();
				ApplyGeneratedPlanSnapshot(
					bReliableAlignedTrustedTightPlanSource,
					bReliableAlignedTrustedBroadPlanSource,
					bReliableTrustedTightPlanSource,
					bReliableTrustedBroadPlanSource,
					SelectedQueueEntry->SuggestedMode,
					SelectedQueueEntry->SuggestedSelectionPolicy);
			}
		}
		else if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("follow-up"), ESearchCase::IgnoreCase))
		{
			Entry.GeneratedGuidancePacketKindLabel = TEXT("follow-up-packet");
			Entry.GeneratedGuidancePacketSourceLabel = GuidanceSourceLabel;
			Entry.GeneratedGuidancePacketHeadline = CachedCoachFollowUpBrief.Headline;
			Entry.GeneratedGuidancePacketActionLabel = CachedCoachFollowUpBrief.PrimaryActionLabel;
			Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachFollowUpBrief.FocusCaseIds.Num();
			ApplyGeneratedPlanSnapshot(
				bReliableAlignedTrustedTightPlanSource,
				bReliableAlignedTrustedBroadPlanSource,
				bReliableTrustedTightPlanSource,
				bReliableTrustedBroadPlanSource,
				CachedCoachFollowUpBrief.SuggestedMode,
				CachedCoachFollowUpBrief.SuggestedSelectionPolicy);
		}
		else if (Entry.RecommendedHandoffKindLabel.Equals(TEXT("recommended"), ESearchCase::IgnoreCase))
		{
			Entry.GeneratedGuidancePacketKindLabel = TEXT("recommended-brief");
			Entry.GeneratedGuidancePacketSourceLabel = GuidanceSourceLabel;
			Entry.GeneratedGuidancePacketHeadline = CachedCoachBrief.Headline;
			Entry.GeneratedGuidancePacketActionLabel = CachedCoachBrief.PrimaryActionLabel;
			Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachBrief.FocusCaseIds.Num();
			ApplyGeneratedPlanSnapshot(
				bReliableAlignedTrustedTightPlanSource,
				bReliableAlignedTrustedBroadPlanSource,
				bReliableTrustedTightPlanSource,
				bReliableTrustedBroadPlanSource,
				CachedCoachBrief.SuggestedMode,
				CachedCoachBrief.SuggestedSelectionPolicy);
		}
		if (Entry.GeneratedGuidancePacketKindLabel.IsEmpty())
		{
			if (!CachedCoachFollowUpBrief.Headline.IsEmpty()
				|| !CachedCoachFollowUpBrief.PrimaryActionLabel.IsEmpty()
				|| CachedCoachFollowUpBrief.FocusCaseIds.Num() > 0)
			{
				Entry.GeneratedGuidancePacketKindLabel = TEXT("follow-up-packet");
				Entry.GeneratedGuidancePacketSourceLabel = GuidanceSourceLabel;
				Entry.GeneratedGuidancePacketHeadline = CachedCoachFollowUpBrief.Headline;
				Entry.GeneratedGuidancePacketActionLabel = CachedCoachFollowUpBrief.PrimaryActionLabel;
				Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachFollowUpBrief.FocusCaseIds.Num();
				ApplyGeneratedPlanSnapshot(
					bReliableAlignedTrustedTightPlanSource,
					bReliableAlignedTrustedBroadPlanSource,
					bReliableTrustedTightPlanSource,
					bReliableTrustedBroadPlanSource,
					CachedCoachFollowUpBrief.SuggestedMode,
					CachedCoachFollowUpBrief.SuggestedSelectionPolicy);
			}
			else if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedQueueEntry =
					FindSelectedQueueEntry())
			{
				Entry.GeneratedGuidancePacketKindLabel = TEXT("queue-entry");
				Entry.GeneratedGuidancePacketSourceLabel = SelectedQueueEntry->SourceLabel;
				Entry.GeneratedGuidancePacketHeadline = SelectedQueueEntry->Headline;
				Entry.GeneratedGuidancePacketActionLabel =
					SelectedQueueEntry->Headline.IsEmpty()
						? SelectedQueueEntry->SourceLabel
						: SelectedQueueEntry->Headline;
				Entry.GeneratedGuidancePacketFocusCaseCount = SelectedQueueEntry->FocusCaseIds.Num();
				ApplyGeneratedPlanSnapshot(
					bReliableAlignedTrustedTightPlanSource,
					bReliableAlignedTrustedBroadPlanSource,
					bReliableTrustedTightPlanSource,
					bReliableTrustedBroadPlanSource,
					SelectedQueueEntry->SuggestedMode,
					SelectedQueueEntry->SuggestedSelectionPolicy);
			}
			else if (!CachedCoachBrief.Headline.IsEmpty()
				|| !CachedCoachBrief.PrimaryActionLabel.IsEmpty()
				|| CachedCoachBrief.FocusCaseIds.Num() > 0)
			{
				Entry.GeneratedGuidancePacketKindLabel = TEXT("recommended-brief");
				Entry.GeneratedGuidancePacketSourceLabel = GuidanceSourceLabel;
				Entry.GeneratedGuidancePacketHeadline = CachedCoachBrief.Headline;
				Entry.GeneratedGuidancePacketActionLabel = CachedCoachBrief.PrimaryActionLabel;
				Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachBrief.FocusCaseIds.Num();
				ApplyGeneratedPlanSnapshot(
					bReliableAlignedTrustedTightPlanSource,
					bReliableAlignedTrustedBroadPlanSource,
					bReliableTrustedTightPlanSource,
					bReliableTrustedBroadPlanSource,
					CachedCoachBrief.SuggestedMode,
					CachedCoachBrief.SuggestedSelectionPolicy);
			}
		}
	}
	if (!Entry.IsStructurallyValid())
	{
		return;
	}

	const bool bMatchesLastEntry = MethodDrillRecoveryMemoryHistoryEntries.Num() > 0
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().PreferredRecoveryAction
			== Entry.PreferredRecoveryAction
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().PreferredRecoveryActionSourceLabel
			== Entry.PreferredRecoveryActionSourceLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().RecommendedHandoffKindLabel
			== Entry.RecommendedHandoffKindLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().QueueRecoveryStatusLine
			== Entry.QueueRecoveryStatusLine
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().HandoffRecommendationStatusLine
			== Entry.HandoffRecommendationStatusLine
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().MethodDrillRecoveryHistoryCount
			== Entry.MethodDrillRecoveryHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().StrongMethodDrillRecoveryHistoryCount
			== Entry.StrongMethodDrillRecoveryHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().WeakMethodDrillRecoveryHistoryCount
			== Entry.WeakMethodDrillRecoveryHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().NarrowMethodDrillPacketStructureRecoveryLaunchCount
			== Entry.NarrowMethodDrillPacketStructureRecoveryLaunchCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount
			== Entry.NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().BroadMethodDrillPacketStructureRecoveryPromoteCount
			== Entry.BroadMethodDrillPacketStructureRecoveryPromoteCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().BroadMethodDrillPacketStructureRecoveryPromoteReducedCount
			== Entry.BroadMethodDrillPacketStructureRecoveryPromoteReducedCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().TrustedTightMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.TrustedTightMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
			== Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount
			== Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount
			== Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().MethodDrillRecoveryAverageOutcomeScore,
			Entry.MethodDrillRecoveryAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore,
			Entry.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore)
		&& FMath::IsNearlyEqual(
			MethodDrillRecoveryMemoryHistoryEntries.Last().ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore,
			Entry.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore)
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bStrongPressureDominant
			== Entry.bStrongPressureDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bWeakPressureDominant
			== Entry.bWeakPressureDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bNarrowPacketStructureRecoveryDominant
			== Entry.bNarrowPacketStructureRecoveryDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bBroadPacketStructureRecoveryDominant
			== Entry.bBroadPacketStructureRecoveryDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableTrustedTightStructurePlanDominant
			== Entry.bReliableTrustedTightStructurePlanDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableTrustedBroadStructurePlanDominant
			== Entry.bReliableTrustedBroadStructurePlanDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableAlignedTrustedTightStructurePlanDominant
			== Entry.bReliableAlignedTrustedTightStructurePlanDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableAlignedTrustedBroadStructurePlanDominant
			== Entry.bReliableAlignedTrustedBroadStructurePlanDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableAlignedTrustedTightStructurePlanOutcomeDominant
			== Entry.bReliableAlignedTrustedTightStructurePlanOutcomeDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bReliableAlignedTrustedBroadStructurePlanOutcomeDominant
			== Entry.bReliableAlignedTrustedBroadStructurePlanOutcomeDominant
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedGuidancePacketKindLabel
			== Entry.GeneratedGuidancePacketKindLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedGuidancePacketSourceLabel
			== Entry.GeneratedGuidancePacketSourceLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedGuidancePacketHeadline
			== Entry.GeneratedGuidancePacketHeadline
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedGuidancePacketActionLabel
			== Entry.GeneratedGuidancePacketActionLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedGuidancePacketFocusCaseCount
			== Entry.GeneratedGuidancePacketFocusCaseCount
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedPlanSuggestedMode
			== Entry.GeneratedPlanSuggestedMode
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedPlanSuggestedSelectionPolicy
			== Entry.GeneratedPlanSuggestedSelectionPolicy
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().GeneratedPlanPostureLabel
			== Entry.GeneratedPlanPostureLabel
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture
			== Entry.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture
			== Entry.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPacketUsedGenericMethodDrillRecoveryMemory
			== Entry.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedTightStructureContinuationPosture
			== Entry.bGeneratedPlanUsedTightStructureContinuationPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedBroadStructureRedirectPosture
			== Entry.bGeneratedPlanUsedBroadStructureRedirectPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture
			== Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture
			== Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture
			== Entry.bGeneratedPlanUsedReliableAlignedTrustedTightStructureContinuationPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture
			== Entry.bGeneratedPlanUsedReliableAlignedTrustedBroadStructureRedirectPosture
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bUsedMethodDrillRecoveryMemoryForRecovery
			== Entry.bUsedMethodDrillRecoveryMemoryForRecovery
		&& MethodDrillRecoveryMemoryHistoryEntries.Last().bUsedMethodDrillRecoveryMemoryForHandoff
			== Entry.bUsedMethodDrillRecoveryMemoryForHandoff;
	if (bMatchesLastEntry)
	{
		return;
	}

	MethodDrillRecoveryMemoryHistoryEntries.Add(Entry);
	constexpr int32 MaxRetainedMethodDrillRecoveryMemoryHistoryEntries = 16;
	if (MethodDrillRecoveryMemoryHistoryEntries.Num()
		> MaxRetainedMethodDrillRecoveryMemoryHistoryEntries)
	{
		const int32 ExcessCount =
			MethodDrillRecoveryMemoryHistoryEntries.Num()
			- MaxRetainedMethodDrillRecoveryMemoryHistoryEntries;
		MethodDrillRecoveryMemoryHistoryEntries.RemoveAt(
			0,
			ExcessCount,
			EAllowShrinking::No);
	}
	SelectedMethodDrillRecoveryMemoryHistoryIndex =
		MethodDrillRecoveryMemoryHistoryEntries.Num() - 1;
}

void UHyperTwistCoachDashboardWidget::UpdateDashboardPresentation()
{
	const bool bHasActiveRun = CachedRunState.Session.IsStructurallyValid()
		&& CachedRunState.ActiveDeck.IsStructurallyValid();
	const FHyperTwistTrainingCase& CurrentTrainingCase = CachedRunState.CurrentSelection.TrainingCase;
	const FString ActiveCaseId = CachedRunState.CurrentSelection.TrainingCase.CaseId.IsEmpty()
		? TEXT("n/a")
		: CachedRunState.CurrentSelection.TrainingCase.CaseId;
	const FString ActiveDeckLabel = CachedRunState.ActiveDeck.Title.IsEmpty()
		? (CachedRunState.ActiveDeck.DeckId.IsEmpty() ? TEXT("n/a") : CachedRunState.ActiveDeck.DeckId)
		: CachedRunState.ActiveDeck.Title;
	const bool bHasRunnableCurrentCase = bHasActiveRun && CachedRunState.CurrentSelection.TrainingCase.IsStructurallyValid();
	int32 ParsedAttemptOverrideMs = 0;
	const bool bHasParsedAttemptOverride = TryParseAttemptTimeOverride(ParsedAttemptOverrideMs);
	const int32 ResolvedSuccessTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Success);
	const int32 ResolvedFailureTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Failure);
	const int32 ResolvedTimeoutTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::Timeout);
	const int32 ResolvedDnfTimeMs = ResolveAttemptTimeMs(EHyperTwistTrainingAttemptResult::DNF);
	const FHyperTwistTrainingTimingPolicy* TimingPolicy = FindActiveTimingPolicy();
	const bool bHasInspectionWindow = TimingPolicy != nullptr
		&& TimingPolicy->bInspectionEnabled
		&& TimingPolicy->InspectionDurationMs > 0;
	const int32 InspectionLimitMs = bHasInspectionWindow ? FMath::Max(TimingPolicy->InspectionDurationMs, 0) : 0;
	const bool bLiveInspectionPhase = IsLiveAttemptInspectionPhase();
	const bool bLivePausedPhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Paused;
	const bool bLiveSolvePhase = bHasLiveAttemptTimer
		&& LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Solving;
	const int32 MaxManualSplitCaptureCount = GetMaxManualSplitCaptureCount();
	const FHyperTwistTrainingSplitPhaseDefinition* NextSplitPhaseDefinition = FindNextSplitPhaseToCapture();
	const FString NextSplitLabel = NextSplitPhaseDefinition == nullptr
		? TEXT("none")
		: (NextSplitPhaseDefinition->Label.IsEmpty()
			? NextSplitPhaseDefinition->PhaseId
			: NextSplitPhaseDefinition->Label);
	FString CapturedSplitSummary = TEXT("none");
	if (LiveAttemptSplitCaptures.Num() > 0)
	{
		TArray<FString> CapturedSplitParts;
		CapturedSplitParts.Reserve(LiveAttemptSplitCaptures.Num());
		for (const FHyperTwistTrainingSplitCapture& SplitCapture : LiveAttemptSplitCaptures)
		{
			const FString Label = SplitCapture.Label.IsEmpty() ? SplitCapture.PhaseId : SplitCapture.Label;
			CapturedSplitParts.Add(FString::Printf(TEXT("%s@%d"), *Label, SplitCapture.TimestampMs));
		}
		CapturedSplitSummary = FString::Join(CapturedSplitParts, TEXT(" | "));
	}
	const FString FinalSplitLabel =
		TimingPolicy != nullptr
		&& TimingPolicy->SplitPhases.IsValidIndex(MaxManualSplitCaptureCount)
		? (TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].Label.IsEmpty()
			? TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].PhaseId
			: TimingPolicy->SplitPhases[MaxManualSplitCaptureCount].Label)
		: TEXT("solve end");
	const FString RunningSolveLabel =
		TimingPolicy != nullptr && TimingPolicy->bHideRunningTime && bLiveSolvePhase
		? TEXT("hidden")
		: FString::FromInt(LiveAttemptSolveElapsedMs);
	const EHyperTwistTrainingPenalty LiveInspectionPenalty =
		(bHasInspectionWindow
			&& TimingPolicy->bInspectionPenaltiesEnabled
			&& LiveAttemptInspectionElapsedMs > InspectionLimitMs
			&& LiveAttemptInspectionElapsedMs <= InspectionLimitMs + 2000)
		? EHyperTwistTrainingPenalty::Plus2
		: ((bHasInspectionWindow
			&& TimingPolicy->bInspectionPenaltiesEnabled
			&& LiveAttemptInspectionElapsedMs > InspectionLimitMs + 2000)
			? EHyperTwistTrainingPenalty::DNF
			: EHyperTwistTrainingPenalty::None);
	const FString VerificationNotePreview = CachedRepositoryRoundTripVerification.VerificationNotes.Num() > 0
		? CachedRepositoryRoundTripVerification.VerificationNotes[0]
		: TEXT("none");
	const FHyperTwistTrainingAttempt* ReviewedAttempt =
		SelectedAttemptIndex >= 0 && SelectedAttemptIndex < CachedRunState.Attempts.Num()
		? &CachedRunState.Attempts[SelectedAttemptIndex]
		: nullptr;
	FString ReviewedAttemptPhaseSummary = TEXT("none");
	if (ReviewedAttempt != nullptr && ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings.Num() > 0)
	{
		TArray<FString> PhaseParts;
		PhaseParts.Reserve(ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings.Num());
		for (const FHyperTwistPhaseTiming& PhaseTiming : ReviewedAttempt->TimingBreakdown.DerivedPhaseTimings)
		{
			PhaseParts.Add(FString::Printf(
				TEXT("%s %d-%d (%d ms)"),
				PhaseTiming.PhaseKind.IsEmpty() ? TEXT("phase") : *PhaseTiming.PhaseKind,
				PhaseTiming.StartedAtMs,
				PhaseTiming.EndedAtMs,
				PhaseTiming.DurationMs
			));
		}
		ReviewedAttemptPhaseSummary = FString::Join(PhaseParts, TEXT(" | "));
	}
	const FString ReviewedAttemptOrdinal = ReviewedAttempt != nullptr
		? FString::Printf(TEXT("%d/%d"), SelectedAttemptIndex + 1, CachedRunState.Attempts.Num())
		: TEXT("none");
	const bool bHasSessionScopedLastStep = !LastStepResult.SessionSummary.TrainingSessionId.IsEmpty()
		&& LastStepResult.SessionSummary.TrainingSessionId == CachedRunState.Session.TrainingSessionId;
	const bool bLastStepCompletedRun = bHasSessionScopedLastStep
		&& (LastStepResult.AttemptResolution.UpdatedSession.SessionState
			== EHyperTwistTrainingSessionState::Completed
			|| LastStepResult.AttemptResolution.UpdatedSession.SessionState
				== EHyperTwistTrainingSessionState::Aborted);
	const bool bHasNextCaseFromLastStep = bHasSessionScopedLastStep
		&& LastStepResult.AttemptResolution.NextCaseSelection.IsStructurallyValid();
	const bool bGeneratedModeLaunchDeck =
		HyperTwistCoachDashboardWidgetInternal::IsGeneratedModeLaunchDeck(CachedRunState);
	const bool bCanExecuteGeneratedModeLaunch =
		bGeneratedModeLaunchDeck
		&& CachedCoachPanelState.bCanExecuteActiveGeneratedModeLaunchRequest;
	const bool bRecognitionAssistedCurrentRun =
		CachedRunState.Session.Mode == EHyperTwistTrainingDeliveryMode::RecognitionAssisted;
	const bool bRecognitionSessionOpenForCurrentRun =
		!bRecognitionAssistedCurrentRun || CachedRecognitionSessionState.bSessionOpen;
	const bool bRecognitionServiceReadyForCurrentRun =
		!bRecognitionAssistedCurrentRun || CachedRecognitionSessionState.ServiceHealth.bReady;
	const FString RecognitionRunBlockedReason =
		!CachedRecognitionSessionState.LastError.IsEmpty()
			? CachedRecognitionSessionState.LastError
			: (!CachedRecognitionSessionState.ServiceHealth.LastError.IsEmpty()
				? CachedRecognitionSessionState.ServiceHealth.LastError
				: TEXT("recognition-session-not-open"));
	const bool bCanContinueCurrentRun = !bHasLiveAttemptTimer
		&& bHasRunnableCurrentCase
		&& !bLastStepCompletedRun
		&& (!bRecognitionAssistedCurrentRun
			|| bRecognitionSessionOpenForCurrentRun
			|| bRecognitionServiceReadyForCurrentRun)
		&& (!bGeneratedModeLaunchDeck || bCanExecuteGeneratedModeLaunch);
	const bool bCanLaunchCoachRun = !bHasLiveAttemptTimer
		&& (
			CachedCoachPanelState.bCanStartQueuedRun
			|| CachedCoachPanelState.bCanStartCoachFollowUpRun
			|| CachedCoachPanelState.bCanStartCoachRecommendedRun
		);
	FString TransitionLaunchLabel = CachedCoachPanelState.PrimaryActionLabel;
	if (TransitionLaunchLabel.IsEmpty())
	{
		TransitionLaunchLabel = TEXT("Launch Coach Run");
	}
	FString TransitionStatusLine;
	if (bLiveInspectionPhase)
	{
		TransitionStatusLine = FString::Printf(
			TEXT("Transition: inspection is live on case %s. Click Start Solve when ready, or cancel the timer."),
			*ActiveCaseId
		);
	}
	else if (bLiveSolvePhase)
	{
		TransitionStatusLine = FString::Printf(
			TEXT("Transition: solve is live on case %s. Capture splits if needed, then stop with the final result."),
			*ActiveCaseId
		);
	}
	else if (bLastStepCompletedRun)
	{
		if (bCanLaunchCoachRun)
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: run completed after case %s. Use the next-step action to launch the next coach-directed run, or clear the finished run."),
				LastStepResult.SessionSummary.LastCaseId.IsEmpty() ? TEXT("n/a") : *LastStepResult.SessionSummary.LastCaseId
			);
		}
		else
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: run completed after case %s. Clear the finished run or relaunch from coach guidance when another run is available."),
				LastStepResult.SessionSummary.LastCaseId.IsEmpty() ? TEXT("n/a") : *LastStepResult.SessionSummary.LastCaseId
			);
		}
	}
	else if (bGeneratedModeLaunchDeck && !bCanExecuteGeneratedModeLaunch)
	{
		TransitionStatusLine = CachedCoachPanelState.ActiveGeneratedModeExecutionBlockedReason.IsEmpty()
			? TEXT("Transition: generated-mode selectors are still incomplete. Finish the active selector choices before executing the owned generated run.")
			: FString::Printf(
				TEXT("Transition: %s"),
				*CachedCoachPanelState.ActiveGeneratedModeExecutionBlockedReason
			);
	}
	else if (bRecognitionAssistedCurrentRun && !bRecognitionSessionOpenForCurrentRun)
	{
		TransitionStatusLine = bRecognitionServiceReadyForCurrentRun
			? FString::Printf(
				TEXT("Transition: recognition-assisted run is staged on %s. Continue will prime the recognition session and begin the attempt."),
				*(CachedRunState.CurrentSelection.TrainingCase.PromptLabel.IsEmpty()
					? ActiveCaseId
					: CachedRunState.CurrentSelection.TrainingCase.PromptLabel)
			)
			: FString::Printf(
				TEXT("Transition: recognition-assisted run is blocked until the recognition sidecar is ready (%s)."),
				*RecognitionRunBlockedReason
			);
	}
	else if (bCanContinueCurrentRun)
	{
		const FHyperTwistTrainingCase& TransitionCase = CachedRunState.CurrentSelection.TrainingCase;
		const FString TransitionPrompt = TransitionCase.PromptLabel.IsEmpty()
			? ActiveCaseId
			: TransitionCase.PromptLabel;
		if (bGeneratedModeLaunchDeck)
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: generated-mode request is staged on %s. Execute the owned generated run%s."),
				*TransitionPrompt,
				CachedCoachPanelState.bActiveGeneratedModeExecutionWillRefreshLaunchRequest
					? TEXT("; the stored request will refresh on execute")
					: TEXT(" when ready")
			);
		}
		else if (bHasNextCaseFromLastStep)
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: next case loaded after the last attempt. Continue the run to begin %s."),
				*TransitionPrompt
			);
		}
		else if (CachedRunSummary.AttemptCount > 0)
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: the current run is ready for another attempt on %s."),
				*TransitionPrompt
			);
		}
		else
		{
			TransitionStatusLine = FString::Printf(
				TEXT("Transition: the run is staged on %s. Start the first timed attempt when ready."),
				*TransitionPrompt
			);
		}
	}
	else if (bHasActiveRun)
	{
		TransitionStatusLine =
			TEXT("Transition: this run has no runnable current case. Complete, clear, or relaunch from coach guidance.");
	}
	else if (bCanLaunchCoachRun)
	{
		TransitionStatusLine = FString::Printf(
			TEXT("Transition: no run is active. Use the next-step action to %s."),
			*TransitionLaunchLabel
		);
	}
	else
	{
		TransitionStatusLine =
			TEXT("Transition: no run is active. Start recommended, follow-up, or queued coaching work from this screen.");
	}
	FString ContinueRunLabel = bHasLiveAttemptTimer
		? (bLiveInspectionPhase
			? TEXT("Start Solve")
			: (bLiveSolvePhase ? TEXT("Pause Timer") : (bLivePausedPhase ? TEXT("Resume Solve") : TEXT("Attempt Active"))))
		: (bGeneratedModeLaunchDeck
			? (bCanExecuteGeneratedModeLaunch ? TEXT("Execute Generated Run") : TEXT("Resolve Selectors"))
			: (bRecognitionAssistedCurrentRun && !bRecognitionSessionOpenForCurrentRun
				? (bRecognitionServiceReadyForCurrentRun ? TEXT("Prime Recognition") : TEXT("Recognition Blocked"))
			: (bHasNextCaseFromLastStep
				? TEXT("Continue Run")
				: (bCanContinueCurrentRun
					? (CachedRunSummary.AttemptCount > 0 ? TEXT("Start Next Attempt") : TEXT("Start First Attempt"))
					: TransitionLaunchLabel))));
	const bool bHasMethodDrillRun = CachedMethodDrillRunState.IsStructurallyValid();
	const bool bHasMethodDrillDiagnosticPacket = CachedMethodDrillDiagnosticPacket.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpTemplate = CachedMethodDrillFollowUpTemplate.IsStructurallyValid();
	const bool bHasMethodDrillFollowUpDeck = CachedMethodDrillFollowUpDeck.IsStructurallyValid();
	const bool bMethodDrillLifecycleClosed =
		bHasMethodDrillRun
		&& (CachedMethodDrillRunState.LifecycleState == EHyperTwistTrainingDrillLifecycleState::Completed
			|| CachedMethodDrillRunState.LifecycleState == EHyperTwistTrainingDrillLifecycleState::Aborted);
	const bool bCanLaunchMethodDrillFollowUp =
		!bHasLiveAttemptTimer
		&& !bHasActiveRun
		&& bMethodDrillLifecycleClosed
		&& bHasMethodDrillDiagnosticPacket
		&& bHasMethodDrillFollowUpTemplate
		&& bHasMethodDrillFollowUpDeck;
	const auto BuildCaseIdPreview = [](const TArray<FString>& CaseIds) -> FString
	{
		if (CaseIds.Num() <= 0)
		{
			return TEXT("none");
		}

		TArray<FString> PreviewCaseIds;
		const int32 PreviewCount = FMath::Min(CaseIds.Num(), 3);
		PreviewCaseIds.Reserve(PreviewCount + 1);
		for (int32 CaseIndex = 0; CaseIndex < PreviewCount; ++CaseIndex)
		{
			PreviewCaseIds.Add(CaseIds[CaseIndex]);
		}
		if (CaseIds.Num() > PreviewCount)
		{
			PreviewCaseIds.Add(FString::Printf(TEXT("+%d more"), CaseIds.Num() - PreviewCount));
		}
		return FString::Join(PreviewCaseIds, TEXT(", "));
	};
	const FHyperTwistTrainingMethodDrillCaseComparisonPacket* PrimaryMethodDrillCase =
		bHasMethodDrillDiagnosticPacket && CachedMethodDrillDiagnosticPacket.CasePackets.Num() > 0
			? &CachedMethodDrillDiagnosticPacket.CasePackets[0]
			: nullptr;
	const FString MethodDrillFocusPreview = BuildCaseIdPreview(
		CachedMethodDrillDiagnosticPacket.FocusCaseIds);
	const FString MethodDrillTemplateLabel = bHasMethodDrillFollowUpTemplate
		? (CachedMethodDrillFollowUpTemplate.Title.IsEmpty()
			? CachedMethodDrillFollowUpTemplate.TemplateId
			: CachedMethodDrillFollowUpTemplate.Title)
		: TEXT("n/a");
	FString MethodDrillDiagnosticsStatusLine;
	if (!bHasMethodDrillDiagnosticPacket)
	{
		MethodDrillDiagnosticsStatusLine = bHasMethodDrillRun
			? FString::Printf(
				TEXT("Method drill: %s is active, but no diagnostic packet is available yet."),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					CachedMethodDrillRunState.LifecycleState))
			: TEXT("Method drill: no active drill diagnostics are available yet.");
	}
	else
	{
		MethodDrillDiagnosticsStatusLine = FString::Printf(
			TEXT("Method drill: %s | %s | review %s | focus %d | pending %d | assisted %d | repeat burden %d | deferred %d | follow-up %s"),
			CachedMethodDrillDiagnosticPacket.StageLabel.IsEmpty()
				? (CachedMethodDrillDiagnosticPacket.DrillId.IsEmpty()
					? TEXT("drill")
					: *CachedMethodDrillDiagnosticPacket.DrillId)
				: *CachedMethodDrillDiagnosticPacket.StageLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.DiagnosticState),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.RecommendedReviewGrade),
			CachedMethodDrillDiagnosticPacket.FocusCaseIds.Num(),
			CachedMethodDrillDiagnosticPacket.PendingCaseCount,
			CachedMethodDrillDiagnosticPacket.AssistedCompletionCount,
			CachedMethodDrillDiagnosticPacket.RepeatBurdenCaseCount,
			CachedMethodDrillDiagnosticPacket.DeferredCaseCount,
			bHasMethodDrillFollowUpTemplate ? TEXT("ready") : TEXT("not ready")
		);
	}
	FString MethodDrillDiagnosticsDetailLine;
	if (!bHasMethodDrillDiagnosticPacket)
	{
		MethodDrillDiagnosticsDetailLine =
			TEXT("Method drill detail: a completed or resumed method-drill run will surface its owned diagnostic packet and follow-up template here.");
	}
	else
	{
		MethodDrillDiagnosticsDetailLine = FString::Printf(
			TEXT("Lifecycle: %s | mode: %s | visibility: %s | boundary: %s | template: %s | kind: %s | suggested mode: %s | selection: %s | recommended %d | guidance: %s | focus: %s%s%s"),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.LifecycleState),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.DrillMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				CachedMethodDrillDiagnosticPacket.VisibilityPolicy),
			CachedMethodDrillDiagnosticPacket.BoundaryReason.IsEmpty()
				? TEXT("n/a")
				: *CachedMethodDrillDiagnosticPacket.BoundaryReason,
			*MethodDrillTemplateLabel,
			bHasMethodDrillFollowUpTemplate
				? *HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					CachedMethodDrillFollowUpTemplate.TemplateKind)
				: TEXT("n/a"),
			bHasMethodDrillFollowUpTemplate
				? *HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					CachedMethodDrillFollowUpTemplate.SuggestedMode)
				: TEXT("n/a"),
			bHasMethodDrillFollowUpTemplate
				? *HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					CachedMethodDrillFollowUpTemplate.SuggestedSelectionPolicy)
				: TEXT("n/a"),
			bHasMethodDrillFollowUpTemplate ? CachedMethodDrillFollowUpTemplate.RecommendedCaseCount : 0,
			bHasMethodDrillFollowUpTemplate && !CachedMethodDrillFollowUpTemplate.GuidanceLabel.IsEmpty()
				? *CachedMethodDrillFollowUpTemplate.GuidanceLabel
				: TEXT("n/a"),
			*MethodDrillFocusPreview,
			PrimaryMethodDrillCase != nullptr ? TEXT(" || Top case: ") : TEXT(""),
			PrimaryMethodDrillCase != nullptr
				? *FString::Printf(
					TEXT("%s [%s | grade %s | attempts %d | repeats %d | reveals %d]"),
					*PrimaryMethodDrillCase->CaseId,
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
						PrimaryMethodDrillCase->DiagnosticState),
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
						PrimaryMethodDrillCase->RecommendedReviewGrade),
					PrimaryMethodDrillCase->AttemptCount,
					PrimaryMethodDrillCase->RepeatCount,
					PrimaryMethodDrillCase->RevealCount)
				: TEXT("")
		);
	}
	FString StartMethodDrillFollowUpLabel = TEXT("Launch Drill Follow-Up");
	if (bHasLiveAttemptTimer)
	{
		StartMethodDrillFollowUpLabel = TEXT("Drill Follow-Up Busy");
	}
	else if (bHasActiveRun)
	{
		StartMethodDrillFollowUpLabel = TEXT("Clear Run For Drill Follow-Up");
	}
	else if (bHasMethodDrillRun && !bMethodDrillLifecycleClosed)
	{
		StartMethodDrillFollowUpLabel = TEXT("Finish Drill Before Follow-Up");
	}
	else if (bHasMethodDrillDiagnosticPacket && CachedMethodDrillDiagnosticPacket.bNeedsFollowUpTemplate
		&& !bHasMethodDrillFollowUpTemplate)
	{
		StartMethodDrillFollowUpLabel = TEXT("Follow-Up Template Missing");
	}
	else if (bHasMethodDrillFollowUpTemplate && !bHasMethodDrillFollowUpDeck)
	{
		StartMethodDrillFollowUpLabel = TEXT("No Drill Follow-Up Deck");
	}
	else if (!bHasMethodDrillDiagnosticPacket)
	{
		StartMethodDrillFollowUpLabel = TEXT("No Drill Follow-Up");
	}
	const FHyperTwistCoachDashboardMethodDrillFollowUpWeighting MethodDrillFollowUpWeighting =
		BuildMethodDrillFollowUpWeighting();
	const FHyperTwistCoachDashboardMethodDrillFollowUpHistoryEntry* SelectedMethodDrillFollowUpHistoryEntry =
		SelectedMethodDrillFollowUpHistoryIndex >= 0
		&& SelectedMethodDrillFollowUpHistoryIndex < MethodDrillFollowUpHistoryEntries.Num()
			? &MethodDrillFollowUpHistoryEntries[SelectedMethodDrillFollowUpHistoryIndex]
			: nullptr;
	const FString MethodDrillOutcomePreferenceLine = !MethodDrillFollowUpWeighting.IsStructurallyValid()
		? TEXT("no retained drill follow-up history yet")
		: (MethodDrillFollowUpWeighting.bPreferDrillFollowUp
			? (MethodDrillFollowUpWeighting.bUsedUpstreamNarrowStructureSignal
				? TEXT("retained drill-follow-up packet structure history favors staying narrow with drill follow-up")
				: TEXT("retained drill history favors staying narrow with drill follow-up"))
			: (MethodDrillFollowUpWeighting.bPreferCoachHandoff
				? (MethodDrillFollowUpWeighting.bUsedUpstreamBroadStructureSignal
					? TEXT("retained drill-follow-up packet structure history favors handing control back to broader coach guidance")
					: TEXT("retained drill history favors handing control back to broader coach guidance"))
				: TEXT("retained drill history is balanced")));
	const FString MethodDrillFollowUpHistoryStatusLine =
		SelectedMethodDrillFollowUpHistoryEntry != nullptr
			? FString::Printf(
				TEXT("Drill follow-up history: %d entries | selected %d/%d | Stage: %s | review %s | Recorded: %s"),
				MethodDrillFollowUpHistoryEntries.Num(),
				SelectedMethodDrillFollowUpHistoryIndex + 1,
				MethodDrillFollowUpHistoryEntries.Num(),
				SelectedMethodDrillFollowUpHistoryEntry->StageLabel.IsEmpty()
					? TEXT("n/a")
					: *SelectedMethodDrillFollowUpHistoryEntry->StageLabel,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedMethodDrillFollowUpHistoryEntry->RecommendedReviewGrade),
				*SelectedMethodDrillFollowUpHistoryEntry->RecordedAtUtc)
			: TEXT("Drill follow-up history: no retained drill follow-up outcomes recorded yet.");
	const FString MethodDrillFollowUpHistoryDetailLine =
		SelectedMethodDrillFollowUpHistoryEntry != nullptr
			? FString::Printf(
				TEXT("State: %s | template: %s | mode: %s | selection: %s | focus %d | launched %d | success %.2f | attempts %d | mistakes %d | packet structure: %s | packet lane: %s | packet stance: %s | pending: %s | repeat burden: %s | assistance: %s"),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedMethodDrillFollowUpHistoryEntry->DiagnosticState),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedMethodDrillFollowUpHistoryEntry->TemplateKind),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedMethodDrillFollowUpHistoryEntry->SuggestedMode),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedMethodDrillFollowUpHistoryEntry->SuggestedSelectionPolicy),
				SelectedMethodDrillFollowUpHistoryEntry->FocusCaseCount,
				SelectedMethodDrillFollowUpHistoryEntry->LaunchedCaseCount,
				SelectedMethodDrillFollowUpHistoryEntry->SuccessRate,
				SelectedMethodDrillFollowUpHistoryEntry->CompletedAttemptCount,
				SelectedMethodDrillFollowUpHistoryEntry->TotalMistakes,
				SelectedMethodDrillFollowUpHistoryEntry->PacketStructureLabel.IsEmpty()
					? TEXT("default")
					: *SelectedMethodDrillFollowUpHistoryEntry->PacketStructureLabel,
				SelectedMethodDrillFollowUpHistoryEntry->PacketLaneLabel.IsEmpty()
					? TEXT("none")
					: *SelectedMethodDrillFollowUpHistoryEntry->PacketLaneLabel,
				SelectedMethodDrillFollowUpHistoryEntry->PacketStanceLabel.IsEmpty()
					? TEXT("none")
					: *SelectedMethodDrillFollowUpHistoryEntry->PacketStanceLabel,
				SelectedMethodDrillFollowUpHistoryEntry->bBoundaryPending ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillFollowUpHistoryEntry->bBoundaryRepeatBurden ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillFollowUpHistoryEntry->bBoundaryAssistance ? TEXT("yes") : TEXT("no"))
			: TEXT("Drill follow-up history detail: once drill-derived follow-up runs complete, their recap outcomes will accumulate here and feed later drill-vs-handoff judgment.");
	if (MethodDrillFollowUpWeighting.IsStructurallyValid())
	{
		MethodDrillDiagnosticsStatusLine = FString::Printf(
			TEXT("%s | history: %s"),
			*MethodDrillDiagnosticsStatusLine,
			*MethodDrillOutcomePreferenceLine
		);
		MethodDrillDiagnosticsDetailLine = FString::Printf(
			TEXT("%s || History match %d | strong %d | weak %d | avg success %.2f | avg mistakes %.2f | strong packet cont %d | weak packet redirect %d | queue/follow-up/recommended-first %d/%d/%d | redirect packets %d | upstream narrow/broad packet structure %d/%d avg %.1f/%.1f"),
			*MethodDrillDiagnosticsDetailLine,
			MethodDrillFollowUpWeighting.MatchingHistoryCount,
			MethodDrillFollowUpWeighting.StrongOutcomeCount,
			MethodDrillFollowUpWeighting.WeakOutcomeCount,
			MethodDrillFollowUpWeighting.AverageSuccessRate,
			MethodDrillFollowUpWeighting.AverageMistakes,
			MethodDrillFollowUpWeighting.StrongPacketContinuationCount,
			MethodDrillFollowUpWeighting.WeakPacketRedirectCount,
			MethodDrillFollowUpWeighting.QueueEntryFirstStructureCount,
			MethodDrillFollowUpWeighting.FollowUpPacketFirstStructureCount,
			MethodDrillFollowUpWeighting.RecommendedBriefFirstStructureCount,
			MethodDrillFollowUpWeighting.RecommendedRedirectStructureCount,
			MethodDrillFollowUpWeighting.UpstreamNarrowPacketStructureHistoryCount,
			MethodDrillFollowUpWeighting.UpstreamBroadPacketStructureHistoryCount,
			MethodDrillFollowUpWeighting.UpstreamNarrowPacketStructureAverageOutcomeScore,
			MethodDrillFollowUpWeighting.UpstreamBroadPacketStructureAverageOutcomeScore
		);
	}
	if (bCanLaunchMethodDrillFollowUp && MethodDrillFollowUpWeighting.bPreferDrillFollowUp)
	{
		StartMethodDrillFollowUpLabel = TEXT("Launch Preferred Drill Follow-Up");
	}
	else if (bCanLaunchMethodDrillFollowUp && MethodDrillFollowUpWeighting.bPreferCoachHandoff)
	{
		StartMethodDrillFollowUpLabel = TEXT("Drill Follow-Up Optional");
	}
	DisplayedMethodDrillDiagnosticsStatusLine = MethodDrillDiagnosticsStatusLine;
	DisplayedMethodDrillDiagnosticsDetailLine = MethodDrillDiagnosticsDetailLine;
	DisplayedMethodDrillFollowUpActionLabel = StartMethodDrillFollowUpLabel;
	const bool bMethodDrillUpstreamStrongSource =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-strong")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-strong");
	const bool bMethodDrillUpstreamWeakSource =
		CachedCoachPanelState.PreferredGuidanceSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-weak")
		|| CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-follow-up-weak");
	const FString MethodDrillUpstreamMemoryLine =
		CachedCoachPanelState.MethodDrillFollowUpHistoryCount > 0
			? FString::Printf(
				TEXT(" | Upstream drill memory count %d | strong %d | weak %d | avg outcome %.1f%s%s"),
				CachedCoachPanelState.MethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.StrongMethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.WeakMethodDrillFollowUpHistoryCount,
				CachedCoachPanelState.MethodDrillFollowUpAverageOutcomeScore,
				bMethodDrillUpstreamStrongSource
					? TEXT(" | Successful drill follow-up history is actively reinforcing narrow continuation.")
					: TEXT(""),
				bMethodDrillUpstreamWeakSource
					? TEXT(" | Weak drill follow-up history is actively pushing control back toward broader coach guidance.")
					: TEXT("")
			)
			: FString();
	const bool bHasCurrentRunRecap = bHasActiveRun
		&& (CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const FHyperTwistTrainingSessionSummary* DisplayedRunRecap = bHasCurrentRunRecap
		? &CachedRunSummary
		: (bHasRetainedRunRecap ? &RetainedRunRecapSummary : nullptr);
	const FHyperTwistTrainingDeck* DisplayedRunRecapDeck = bHasCurrentRunRecap
		? &CachedRunState.ActiveDeck
		: (bHasRetainedRunRecap ? &RetainedRunRecapDeck : nullptr);
	const EHyperTwistTrainingDeliveryMode DisplayedRunRecapMode = bHasCurrentRunRecap
		? CachedRunState.Session.Mode
		: RetainedRunRecapMode;
	const bool bHasDisplayedRunRecap = DisplayedRunRecap != nullptr
		&& !DisplayedRunRecap->TrainingSessionId.IsEmpty();
	const FString RunRecapSourceLabel = bHasCurrentRunRecap
		? TEXT("current run")
		: TEXT("last completed run");
	const bool bHasActiveTemplateLaunchForDisplayedRun =
		bHasCurrentRunRecap
		&& DisplayedRunRecap != nullptr
		&& !ActiveTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == ActiveTemplateLaunchSessionId
		&& ActiveTemplateLaunchProvenance.IsStructurallyValid();
	const bool bHasDisplayedRetainedTemplateLaunch =
		!bHasCurrentRunRecap
		&& bHasRetainedTemplateLaunch
		&& DisplayedRunRecap != nullptr
		&& !RetainedTemplateLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == RetainedTemplateLaunchSessionId
		&& RetainedTemplateLaunchProvenance.IsStructurallyValid();
	const FHyperTwistTrainingTemplateLaunchProvenance* DisplayedTemplateLaunch =
		bHasActiveTemplateLaunchForDisplayedRun
			? &ActiveTemplateLaunchProvenance
			: (bHasDisplayedRetainedTemplateLaunch ? &RetainedTemplateLaunchProvenance : nullptr);
	const FString DisplayedTemplateLaunchUserId = DisplayedTemplateLaunch != nullptr
		? (DisplayedTemplateLaunch->UserId.IsEmpty()
			? (bHasCurrentRunRecap ? CachedRunState.Session.UserId : RetainedRunRecapUserId)
			: DisplayedTemplateLaunch->UserId)
		: FString();
	const FHyperTwistTrainingTemplateLaunchScopedStats* DisplayedTemplateLaunchStats =
		DisplayedTemplateLaunch != nullptr
			? FindCachedTemplateLaunchScopedStats(
				DisplayedTemplateLaunch->TemplateId,
				DisplayedTemplateLaunchUserId)
			: nullptr;
	const FString DisplayedTemplateLaunchSelectionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			DisplayedTemplateLaunch != nullptr
				&& DisplayedTemplateLaunch->SelectionProvenance.IsStructurallyValid()
					? &DisplayedTemplateLaunch->SelectionProvenance
					: nullptr
		);
	const bool bDisplayedTemplateLaunchUsesReviewLane =
		DisplayedTemplateLaunch != nullptr
		&& (DisplayedTemplateLaunch->bPreferReviewRun
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::ReviewPlan
			|| DisplayedTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::Coach);
	const bool bCanRepeatDisplayedRun = !bHasLiveAttemptTimer
		&& RetainedRunRecapDeck.IsStructurallyValid()
		&& (!bHasActiveRun
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted);
	const bool bCanDismissStoredRecap = !bHasCurrentRunRecap && bHasRetainedRunRecap;
	const bool bHasActiveGuidanceComparison =
		bHasCurrentRunRecap
		&& DisplayedRunRecap != nullptr
		&& !ActiveGuidanceLaunchSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == ActiveGuidanceLaunchSessionId
		&& ActiveGuidanceLaunchLane != EHyperTwistCoachDashboardGuidancePreviewLane::None;
	const bool bHasDisplayedRetainedGuidanceComparison =
		!bHasCurrentRunRecap
		&& bHasRetainedGuidanceComparison
		&& DisplayedRunRecap != nullptr
		&& !RetainedGuidanceComparisonSessionId.IsEmpty()
		&& DisplayedRunRecap->TrainingSessionId == RetainedGuidanceComparisonSessionId
		&& RetainedGuidanceComparisonLane != EHyperTwistCoachDashboardGuidancePreviewLane::None;
	const FHyperTwistCoachBrief* DisplayedGuidanceComparisonBrief = bHasActiveGuidanceComparison
		? &ActiveGuidanceLaunchBrief
		: (bHasDisplayedRetainedGuidanceComparison ? &RetainedGuidanceComparisonBrief : nullptr);
	const FHyperTwistTrainingDeck* DisplayedGuidanceComparisonDeck = bHasActiveGuidanceComparison
		? &ActiveGuidanceLaunchDeck
		: (bHasDisplayedRetainedGuidanceComparison ? &RetainedGuidanceComparisonDeck : nullptr);
	const FString DisplayedGuidanceComparisonSelectedCaseId = bHasActiveGuidanceComparison
		? ActiveGuidanceLaunchSelectedCaseId
		: (bHasDisplayedRetainedGuidanceComparison ? RetainedGuidanceComparisonSelectedCaseId : FString());
	const EHyperTwistCoachDashboardGuidancePreviewLane DisplayedGuidanceComparisonLane = bHasActiveGuidanceComparison
		? ActiveGuidanceLaunchLane
		: (bHasDisplayedRetainedGuidanceComparison
			? RetainedGuidanceComparisonLane
			: EHyperTwistCoachDashboardGuidancePreviewLane::None);
	const bool bDisplayedGuidanceComparisonSingleCase = bHasActiveGuidanceComparison
		? bActiveGuidanceLaunchSingleCase
		: (bHasDisplayedRetainedGuidanceComparison ? bRetainedGuidanceComparisonSingleCase : false);
	FHyperTwistTrainingTemplateLaunchSelectionProvenance PreferredTemplateLaunchSelectionProvenance;
	const FHyperTwistTrainingSessionTemplate* PreferredTemplateLaunch =
		FindPreferredDashboardTemplateLaunch(&PreferredTemplateLaunchSelectionProvenance);
	int32 EligibleTemplateLaunchCount = 0;
	for (const FHyperTwistTrainingSessionTemplate& SessionTemplate : CachedActiveTrainingSessionTemplates)
	{
		if (HyperTwistCoachDashboardWidgetInternal::ScoreTemplateForDashboardLaunch(SessionTemplate) > 0)
		{
			EligibleTemplateLaunchCount += 1;
		}
	}
	const bool bHasPreferredTemplateLaunch = PreferredTemplateLaunch != nullptr;
	const bool bPreferredTemplateLaunchUsesReviewLane =
		bHasPreferredTemplateLaunch
		&& (PreferredTemplateLaunch->bPreferReviewRun
			|| PreferredTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::ReviewPlan
			|| PreferredTemplateLaunch->TemplateKind == EHyperTwistTrainingSessionTemplateKind::Coach);
	const FString PreferredTemplateLaunchTitle = bHasPreferredTemplateLaunch
		? (PreferredTemplateLaunch->Title.IsEmpty()
			? PreferredTemplateLaunch->TemplateId
			: PreferredTemplateLaunch->Title)
		: TEXT("n/a");
	const FString PreferredTemplateLaunchUserId = bHasPreferredTemplateLaunch
		? (PreferredTemplateLaunch->UserId.IsEmpty() ? DefaultUserId : PreferredTemplateLaunch->UserId)
		: FString();
	const FString PreferredTemplateLaunchFocusPreview = bHasPreferredTemplateLaunch
		? BuildCaseIdPreview(PreferredTemplateLaunch->FocusCaseIds)
		: TEXT("none");
	const FHyperTwistTrainingTemplateLaunchScopedStats* PreferredTemplateLaunchStats =
		bHasPreferredTemplateLaunch
			? FindCachedTemplateLaunchScopedStats(
				PreferredTemplateLaunch->TemplateId,
				PreferredTemplateLaunchUserId)
			: nullptr;
	const FString PreferredTemplateLaunchSelectionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			PreferredTemplateLaunchSelectionProvenance.IsStructurallyValid()
				? &PreferredTemplateLaunchSelectionProvenance
				: nullptr
		);
	const FString PreferredTemplateLaunchComparablePeerConfidenceStatusClause =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchComparablePeerConfidenceStatusClause(
			PreferredTemplateLaunchSelectionProvenance.IsStructurallyValid()
				? &PreferredTemplateLaunchSelectionProvenance
				: nullptr,
			PreferredTemplateLaunchStats
		);
	const bool bCanLaunchPreferredTemplate =
		!bHasLiveAttemptTimer && !bHasActiveRun && bHasPreferredTemplateLaunch;
	FString TemplateLaunchStatusLine;
	if (!bHasPreferredTemplateLaunch)
	{
		TemplateLaunchStatusLine = FString::Printf(
			TEXT("Template launch: no active review/recovery template is ready in the dashboard cache. Eligible %d of %d active templates."),
			EligibleTemplateLaunchCount,
			CachedActiveTrainingSessionTemplates.Num()
		);
	}
	else if (bHasLiveAttemptTimer)
	{
		TemplateLaunchStatusLine = FString::Printf(
			TEXT("Template launch: %s is ready, but a live attempt is active. Past outcomes: %s."),
			*PreferredTemplateLaunchTitle,
			*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
				PreferredTemplateLaunchStats)
		);
	}
	else if (bHasActiveRun)
	{
		TemplateLaunchStatusLine = FString::Printf(
			TEXT("Template launch: %s is ready, but clear or complete the active run first. Past outcomes: %s."),
			*PreferredTemplateLaunchTitle,
			*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
				PreferredTemplateLaunchStats)
		);
	}
	else
	{
		TemplateLaunchStatusLine = FString::Printf(
			TEXT("Template launch: %s is ready on %s. Eligible %d of %d active templates. Past outcomes: %s."),
			*PreferredTemplateLaunchTitle,
			PreferredTemplateLaunch->FocusDeckId.IsEmpty()
				? TEXT("n/a")
				: *PreferredTemplateLaunch->FocusDeckId,
			EligibleTemplateLaunchCount,
			CachedActiveTrainingSessionTemplates.Num(),
			*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
				PreferredTemplateLaunchStats)
		);
	}
	if (!PreferredTemplateLaunchComparablePeerConfidenceStatusClause.IsEmpty())
	{
		TemplateLaunchStatusLine += TEXT(" ");
		TemplateLaunchStatusLine += PreferredTemplateLaunchComparablePeerConfidenceStatusClause;
	}
	FString TemplateLaunchDetailLine;
	if (!bHasPreferredTemplateLaunch)
	{
		TemplateLaunchDetailLine =
			TEXT("Template launch detail: this dashboard only surfaces active review-plan, recovery, or coach-review templates from the current session-template cache.");
	}
	else
	{
		TemplateLaunchDetailLine = FString::Printf(
			TEXT("Template: %s | id: %s | kind: %s | mode: %s | selection: %s | recommended %d | focus cases: %s | guidance: %s | method: %s | user: %s | source plan: %s | review-backed: %s | short set: %s | Past detail: %s"),
			*PreferredTemplateLaunchTitle,
			PreferredTemplateLaunch->TemplateId.IsEmpty()
				? TEXT("n/a")
				: *PreferredTemplateLaunch->TemplateId,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				PreferredTemplateLaunch->TemplateKind),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				PreferredTemplateLaunch->SuggestedMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				PreferredTemplateLaunch->SuggestedSelectionPolicy),
			PreferredTemplateLaunch->RecommendedCaseCount,
			*PreferredTemplateLaunchFocusPreview,
			PreferredTemplateLaunch->GuidanceLabel.IsEmpty()
				? TEXT("n/a")
				: *PreferredTemplateLaunch->GuidanceLabel,
			PreferredTemplateLaunch->MethodSegmentId.IsEmpty()
				? TEXT("n/a")
				: *PreferredTemplateLaunch->MethodSegmentId,
			PreferredTemplateLaunch->UserId.IsEmpty()
				? TEXT("n/a")
				: *PreferredTemplateLaunch->UserId,
			PreferredTemplateLaunch->SourceReviewPlanId.IsEmpty()
				? TEXT("none")
				: *PreferredTemplateLaunch->SourceReviewPlanId,
			bPreferredTemplateLaunchUsesReviewLane ? TEXT("yes") : TEXT("no"),
			PreferredTemplateLaunch->bPreferShortReviewSet ? TEXT("yes") : TEXT("no"),
			*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsDetailFragment(
				PreferredTemplateLaunchStats)
		);
		if (!PreferredTemplateLaunchSelectionDetail.IsEmpty())
		{
			TemplateLaunchDetailLine += TEXT(" | ");
			TemplateLaunchDetailLine += PreferredTemplateLaunchSelectionDetail;
		}
	}
	const FHyperTwistCoachDashboardTemplateLaunchHistoryEntry* SelectedTemplateLaunchHistoryEntry =
		SelectedTemplateLaunchHistoryIndex >= 0
		&& SelectedTemplateLaunchHistoryIndex < TemplateLaunchHistoryEntries.Num()
			? &TemplateLaunchHistoryEntries[SelectedTemplateLaunchHistoryIndex]
			: nullptr;
	const FHyperTwistTrainingTemplateLaunchScopedStats* SelectedTemplateLaunchHistoryStats =
		SelectedTemplateLaunchHistoryEntry != nullptr
			? FindCachedTemplateLaunchScopedStats(
				SelectedTemplateLaunchHistoryEntry->TemplateId,
				SelectedTemplateLaunchHistoryEntry->UserId)
			: nullptr;
	const FString SelectedTemplateLaunchHistorySelectionDetail =
		HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchSelectionDetailFragment(
			SelectedTemplateLaunchHistoryEntry != nullptr
				&& SelectedTemplateLaunchHistoryEntry->SelectionProvenance.IsStructurallyValid()
					? &SelectedTemplateLaunchHistoryEntry->SelectionProvenance
					: nullptr
		);
	const FString TemplateLaunchHistoryStatusLine =
		SelectedTemplateLaunchHistoryEntry != nullptr
			? FString::Printf(
				TEXT("Template launch history: %d entries | selected %d/%d | Template: %s | State: %s | Completed: %s | Aggregate: %s"),
				TemplateLaunchHistoryEntries.Num(),
				SelectedTemplateLaunchHistoryIndex + 1,
				TemplateLaunchHistoryEntries.Num(),
				SelectedTemplateLaunchHistoryEntry->TemplateId.IsEmpty()
					? TEXT("n/a")
					: *SelectedTemplateLaunchHistoryEntry->TemplateId,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedTemplateLaunchHistoryEntry->SessionState),
				SelectedTemplateLaunchHistoryEntry->CompletedAtUtc.IsEmpty()
					? TEXT("n/a")
					: *SelectedTemplateLaunchHistoryEntry->CompletedAtUtc,
				*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
					SelectedTemplateLaunchHistoryStats))
			: TEXT("Template launch history: no completed template-backed runs retained yet.");
	FString TemplateLaunchHistoryDetailLine =
		SelectedTemplateLaunchHistoryEntry != nullptr
			? FString::Printf(
				TEXT("Title: %s | kind: %s | mode: %s | selection: %s | deck: %s | user: %s | source plan: %s | recommended %d | focus %d | attempts %d | success %.2f | mistakes %d | review-backed: %s | coach-review: %s | short set: %s | Aggregate detail: %s"),
				SelectedTemplateLaunchHistoryEntry->TemplateTitle.IsEmpty()
					? TEXT("n/a")
					: *SelectedTemplateLaunchHistoryEntry->TemplateTitle,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedTemplateLaunchHistoryEntry->TemplateKind),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedTemplateLaunchHistoryEntry->SuggestedMode),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedTemplateLaunchHistoryEntry->SuggestedSelectionPolicy),
				SelectedTemplateLaunchHistoryEntry->FocusDeckId.IsEmpty()
					? TEXT("n/a")
					: *SelectedTemplateLaunchHistoryEntry->FocusDeckId,
				SelectedTemplateLaunchHistoryEntry->UserId.IsEmpty()
					? TEXT("n/a")
					: *SelectedTemplateLaunchHistoryEntry->UserId,
				SelectedTemplateLaunchHistoryEntry->SourceReviewPlanId.IsEmpty()
					? TEXT("none")
					: *SelectedTemplateLaunchHistoryEntry->SourceReviewPlanId,
				SelectedTemplateLaunchHistoryEntry->RecommendedCaseCount,
				SelectedTemplateLaunchHistoryEntry->FocusCaseCount,
				SelectedTemplateLaunchHistoryEntry->CompletedAttemptCount,
				SelectedTemplateLaunchHistoryEntry->SuccessRate,
				SelectedTemplateLaunchHistoryEntry->TotalMistakes,
				SelectedTemplateLaunchHistoryEntry->bPreferReviewRun ? TEXT("yes") : TEXT("no"),
				SelectedTemplateLaunchHistoryEntry->bCoachReview ? TEXT("yes") : TEXT("no"),
				SelectedTemplateLaunchHistoryEntry->bPreferShortReviewSet ? TEXT("yes") : TEXT("no"),
				*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsDetailFragment(
					SelectedTemplateLaunchHistoryStats))
			: TEXT("Template launch history detail: completed runs started through the dashboard template lane will accumulate here with template id, template kind, and source review-plan provenance.");
	if (!SelectedTemplateLaunchHistorySelectionDetail.IsEmpty())
	{
		TemplateLaunchHistoryDetailLine += TEXT(" | ");
		TemplateLaunchHistoryDetailLine += SelectedTemplateLaunchHistorySelectionDetail;
	}
	const bool bCanUseCoachHandoff = !bHasLiveAttemptTimer && !bHasActiveRun;
	FString CoachHandoffStatusLine;
	if (bHasLiveAttemptTimer)
	{
		CoachHandoffStatusLine =
			TEXT("Coach handoff: disabled while a live attempt is running or under inspection.");
	}
	else if (bHasActiveRun)
	{
		CoachHandoffStatusLine =
			TEXT("Coach handoff: finish, clear, or complete the active run before launching another coach-directed run.");
	}
	else
	{
		const FString QueueLine = CachedCoachPanelState.bCanStartQueuedRun
			? FString::Printf(
				TEXT("queue ready from %s"),
				CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
					? TEXT("n/a")
					: *CachedCoachPanelState.NextQueueSourceLabel
			)
			: TEXT("queue not ready");
		const FString FollowUpLine = CachedCoachPanelState.bCanStartCoachFollowUpRun
			? FString::Printf(
				TEXT("follow-up %s (%d cases)"),
				CachedCoachFollowUpBrief.Headline.IsEmpty() ? TEXT("ready") : *CachedCoachFollowUpBrief.Headline,
				CachedCoachFollowUpBrief.FocusCaseIds.Num()
			)
			: TEXT("follow-up not ready");
		const FString RecommendedLine = CachedCoachPanelState.bCanStartCoachRecommendedRun
			? FString::Printf(
				TEXT("recommended %s (%d cases)"),
				CachedCoachBrief.Headline.IsEmpty() ? TEXT("ready") : *CachedCoachBrief.Headline,
				CachedCoachBrief.FocusCaseIds.Num()
			)
			: TEXT("recommended not ready");
		CoachHandoffStatusLine = FString::Printf(
			TEXT("Coach handoff: %s | %s | %s"),
			*QueueLine,
			*FollowUpLine,
			*RecommendedLine
		);
	}
	const HyperTwistCoachDashboardWidgetInternal::FClosureRecoveryDashboardBias HandoffClosureBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveClosureRecoveryDashboardBias(
			ClosureRecoveryHistoryEntries
		);
	const FString HandoffMemorySourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bDashboardHandoffMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsDashboardHandoffGuidanceSource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bQueueLooksFollowUpOrRecovery =
		CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("follow-up"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("queue-recovery"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("closure_history_follow_up"));
	const bool bQueueLooksRecommendedOrPrimary =
		CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("primary"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("recommended"))
		|| CachedCoachPanelState.NextQueueSourceLabel.Contains(TEXT("closure_history_recommended"));
	HyperTwistCoachDashboardWidgetInternal::FHandoffHistoryDashboardBias HandoffHistoryBias =
		HyperTwistCoachDashboardWidgetInternal::DeriveHandoffHistoryDashboardBias(
			HandoffHistoryEntries
		);
	const FHyperTwistCoachSignal* DeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"));
	const bool bHasDeferredFirstSuppressionSignal =
		DeferredFirstSuppressionSignal != nullptr;
	const bool bDeferredFirstSuppressionSignalPromoted =
		CachedCoachBrief.Signals.Num() > 0
		&& CachedCoachBrief.Signals[0].SignalId
			== TEXT("queue_suppression_deferred_first_continuation");
	HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind HandoffRecommendationKind =
		HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None;
	DisplayedCoachHandoffRecommendationKind = EHyperTwistTrainingCoachHandoffKind::None;
	bDisplayedCoachHandoffRecommendationUsedDeferredFirstSuppressionSignal = false;
	bDisplayedCoachHandoffRecommendationUsedMethodDrillWeighting = false;
	bDisplayedCoachHandoffRecommendationUsedAlignedTightPacketAcceptedHistory = false;
	bDisplayedCoachHandoffRecommendationUsedAlignedBroadPacketAcceptedHistory = false;
	bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust = false;
	bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory = false;
	bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory = false;
	DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel.Reset();
	FString CoachHandoffRecommendationStatusLine;
	FString CoachHandoffRecommendationDetailLine;
	const bool bQueueReadyForHandoff = CachedCoachPanelState.bCanStartQueuedRun;
	const bool bFollowUpReadyForHandoff =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		&& CachedCoachPanelState.bHasFollowUpGuidance;
	const bool bRecommendedReadyForHandoff =
		CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const int32 AcceptedAlignedTightPacketOutcomeTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore
				>= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore
								>= 80.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedBroadPacketOutcomeTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore
				>= 58.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore
								>= 78.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedTightPacketRetainedTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore
				>= 65.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore
								>= 82.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedBroadPacketRetainedTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore
				>= 63.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore
								>= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableTrustBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
					- CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore
								>= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedBroadPacketReliableTrustBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore
				>= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
					- CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
					+ (CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore
								>= 78.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount >= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedBroadPacketReliableOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
				>= 66.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 AcceptedAlignedTightPacketReliableCompositeBias =
		FMath::Max(
			AcceptedAlignedTightPacketReliableTrustBias,
			AcceptedAlignedTightPacketReliableOutcomeBias);
	const int32 AcceptedAlignedBroadPacketReliableCompositeBias =
		FMath::Max(
			AcceptedAlignedBroadPacketReliableTrustBias,
			AcceptedAlignedBroadPacketReliableOutcomeBias);
	const int32 ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore
						   >= 80.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
				>= 60.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
						   >= 78.0f
						? 1
						: 0),
				1,
				3)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore
				>= 70.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactAcceptedBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedAverageScore
				>= 64.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactAcceptedBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedAverageScore
				>= 62.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedAverageScore
						   >= 80.0f
						? 1
						: 0),
				1,
				4)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactCompositeBias = FMath::Max(
		ReliableAcceptedAlignedTightPacketExactAcceptedBias,
		(ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias > 0
			&& ReliableAcceptedAlignedTightPacketExactOutcomeBias > 0)
			? FMath::Clamp(
				FMath::Min(
					ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias,
					ReliableAcceptedAlignedTightPacketExactOutcomeBias) + 1,
				1,
				4)
			: 0);
	const int32 ReliableAcceptedAlignedBroadPacketExactCompositeBias = FMath::Max(
		ReliableAcceptedAlignedBroadPacketExactAcceptedBias,
		(ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias > 0
			&& ReliableAcceptedAlignedBroadPacketExactOutcomeBias > 0)
			? FMath::Clamp(
				FMath::Min(
					ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias,
					ReliableAcceptedAlignedBroadPacketExactOutcomeBias) + 1,
				1,
				4)
			: 0);
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias =
		(CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
				>= 2
			&& CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAverageScore
				>= 74.0f)
			? FMath::Clamp(
				CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAverageScore
						   >= 88.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAverageScore
				>= 72.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount >= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedAverageScore
				>= 66.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedAverageScore
				>= 64.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedAverageScore
						   >= 82.0f
						? 1
						: 0),
				1,
				5)
			: 0;
	const int32 ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableAverageScore
				>= 70.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableAverageScore
						   >= 86.0f
						? 1
						: 0),
				1,
				6)
			: 0;
	const int32 ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias =
		(CachedCoachPanelState
				 .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
				>= 2
			&& CachedCoachPanelState
					.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableAverageScore
				>= 68.0f)
			? FMath::Clamp(
				CachedCoachPanelState
						.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount
					- CachedCoachPanelState
							.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount
					+ (CachedCoachPanelState
							   .AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableAverageScore
						   >= 84.0f
						? 1
						: 0),
				1,
				6)
			: 0;
	if (AcceptedAlignedTightPacketOutcomeTrustBias
		> AcceptedAlignedBroadPacketOutcomeTrustBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketOutcomeTrustBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketOutcomeTrustBias * 2;
		}
	}
	else if (AcceptedAlignedBroadPacketOutcomeTrustBias
		> AcceptedAlignedTightPacketOutcomeTrustBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketOutcomeTrustBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketOutcomeTrustBias * 2;
		}
	}
	if (AcceptedAlignedTightPacketRetainedTrustBias
		> AcceptedAlignedBroadPacketRetainedTrustBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketRetainedTrustBias * 3;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketRetainedTrustBias;
		}
	}
	else if (AcceptedAlignedBroadPacketRetainedTrustBias
		> AcceptedAlignedTightPacketRetainedTrustBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketRetainedTrustBias * 3;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketRetainedTrustBias;
		}
	}
	if (AcceptedAlignedTightPacketReliableCompositeBias
		> AcceptedAlignedBroadPacketReliableCompositeBias)
	{
		HandoffHistoryBias.FollowUpScore += AcceptedAlignedTightPacketReliableCompositeBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedTightPacketReliableCompositeBias * 2;
		}
	}
	else if (AcceptedAlignedBroadPacketReliableCompositeBias
		> AcceptedAlignedTightPacketReliableCompositeBias)
	{
		HandoffHistoryBias.RecommendedScore += AcceptedAlignedBroadPacketReliableCompositeBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += AcceptedAlignedBroadPacketReliableCompositeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias
		> ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias
		> ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeBias)
	{
		HandoffHistoryBias.FollowUpScore += ReliableAcceptedAlignedTightPacketExactOutcomeBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedTightPacketExactOutcomeBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeBias)
	{
		HandoffHistoryBias.RecommendedScore += ReliableAcceptedAlignedBroadPacketExactOutcomeBias * 4;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedBroadPacketExactOutcomeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactCompositeBias
		> ReliableAcceptedAlignedBroadPacketExactCompositeBias)
	{
		HandoffHistoryBias.FollowUpScore += ReliableAcceptedAlignedTightPacketExactCompositeBias * 5;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedTightPacketExactCompositeBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactCompositeBias
		> ReliableAcceptedAlignedTightPacketExactCompositeBias)
	{
		HandoffHistoryBias.RecommendedScore += ReliableAcceptedAlignedBroadPacketExactCompositeBias * 5;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore += ReliableAcceptedAlignedBroadPacketExactCompositeBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias * 6;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias * 6;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias * 7;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias * 7;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias * 2;
		}
	}
	if (ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias
		> ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias)
	{
		HandoffHistoryBias.FollowUpScore +=
			ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias * 8;
		if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias * 2;
		}
	}
	else if (ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias
		> ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias)
	{
		HandoffHistoryBias.RecommendedScore +=
			ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias * 8;
		if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
		{
			HandoffHistoryBias.QueueScore +=
				ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias * 2;
		}
	}
	{
		HandoffHistoryBias.PreferredKind =
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None;
		int32 BestScore = 0;
		int32 BestAcceptedDeltaCount = 0;
		auto ConsiderKind = [&BestScore, &BestAcceptedDeltaCount, &HandoffHistoryBias](
			const HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind Kind,
			const int32 Score,
			const int32 AcceptedDeltaCount)
		{
			if (Score <= 0)
			{
				return;
			}

			if (Score > BestScore
				|| (Score == BestScore && AcceptedDeltaCount > BestAcceptedDeltaCount))
			{
				BestScore = Score;
				BestAcceptedDeltaCount = AcceptedDeltaCount;
				HandoffHistoryBias.PreferredKind = Kind;
			}
		};

		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue,
			HandoffHistoryBias.QueueScore,
			HandoffHistoryBias.QueueAcceptedDeltaCount);
		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp,
			HandoffHistoryBias.FollowUpScore,
			HandoffHistoryBias.FollowUpAcceptedDeltaCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount);
		ConsiderKind(
			HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended,
			HandoffHistoryBias.RecommendedScore,
			HandoffHistoryBias.RecommendedAcceptedDeltaCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount
				+ CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount);
	}
	bool bHandoffRecommendationUsedHistory = false;
	bool bHandoffRecommendationUsedDeferredOverflowHistory = false;
	bool bHandoffRecommendationUsedDeferredFirstSuppressionSignal = false;
	bool bHandoffRecommendationUsedMethodDrillWeighting = false;
	bool bHandoffRecommendationUsedMethodDrillRecoveryMemory = false;
	bool bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = false;
	bool bHandoffRecommendationUsedPlanComparisonHistory = false;
	bool bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture = false;
	bool bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture = false;
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		CurrentMethodDrillRecoveryMemoryBias =
			HyperTwistCoachDashboardWidgetInternal::ResolveMethodDrillRecoveryMemoryBias(
				CachedCoachPanelState.MethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount,
				CachedCoachPanelState.MethodDrillRecoveryAverageOutcomeScore
			);
	const bool bStrongMethodDrillRecoveryMemory =
		CurrentMethodDrillRecoveryMemoryBias
		== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong;
	const bool bWeakMethodDrillRecoveryMemory =
		CurrentMethodDrillRecoveryMemoryBias
		== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak;
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		RetainedMethodDrillRecoveryMemoryHandoffBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveRetainedMethodDrillRecoveryMemoryBias(
				MethodDrillRecoveryMemoryHistoryEntries,
				false
			);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPacketDashboardBias
		MethodDrillRecoveryPacketHandoffBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPacketDashboardBias(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPlanComparisonSummary
		MethodDrillRecoveryPlanComparisonSummary =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanComparisonSummary(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const int32 MethodDrillRecoveryPlanTightTrust =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanTightTrust(
			MethodDrillRecoveryPlanComparisonSummary);
	const int32 MethodDrillRecoveryPlanBroadTrust =
		HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPlanBroadTrust(
			MethodDrillRecoveryPlanComparisonSummary);
	const bool bHasReliableTrustedTightPlanComparisonHistory =
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanSourceCount > 0;
	const bool bHasReliableTrustedBroadPlanComparisonHistory =
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanSourceCount > 0;
	const bool bHasReliableTrustedPlanComparisonHistory =
		bHasReliableTrustedTightPlanComparisonHistory
		|| bHasReliableTrustedBroadPlanComparisonHistory;
	const bool bPlanComparisonPrefersTightContinuation =
		HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanTightContinuation(
			MethodDrillRecoveryPlanComparisonSummary);
	const bool bPlanComparisonPrefersBroadRedirect =
		HyperTwistCoachDashboardWidgetInternal::PrefersMethodDrillRecoveryPlanBroadRedirect(
			MethodDrillRecoveryPlanComparisonSummary);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		EffectiveMethodDrillRecoveryMemoryHandoffBias =
			RetainedMethodDrillRecoveryMemoryHandoffBias
				!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None
				? RetainedMethodDrillRecoveryMemoryHandoffBias
				: CurrentMethodDrillRecoveryMemoryBias;
	auto UsesStrongRetainedMethodDrillRecoveryPostureForKind = [
		&HandoffHistoryBias
	](const HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind Kind)
	{
		switch (Kind)
		{
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue:
			return HandoffHistoryBias.StrongRetainedMethodDrillQueueAcceptedDeltaCount > 0
				|| HandoffHistoryBias.StrongRetainedMethodDrillQueueRecommendationCount > 0;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp:
			return HandoffHistoryBias.StrongRetainedMethodDrillFollowUpAcceptedDeltaCount > 0
				|| HandoffHistoryBias.StrongRetainedMethodDrillFollowUpRecommendationCount > 0;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended:
			return HandoffHistoryBias.StrongRetainedMethodDrillRecommendedAcceptedDeltaCount > 0
				|| HandoffHistoryBias.StrongRetainedMethodDrillRecommendedRecommendationCount > 0;
		default:
			return false;
		}
	};
	auto UsesWeakRetainedMethodDrillRecoveryPostureForKind = [
		&HandoffHistoryBias
	](const HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind Kind)
	{
		switch (Kind)
		{
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue:
			return HandoffHistoryBias.WeakRetainedMethodDrillQueueAcceptedDeltaCount > 0
				|| HandoffHistoryBias.WeakRetainedMethodDrillQueueRecommendationCount > 0;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp:
			return HandoffHistoryBias.WeakRetainedMethodDrillFollowUpAcceptedDeltaCount > 0
				|| HandoffHistoryBias.WeakRetainedMethodDrillFollowUpRecommendationCount > 0;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended:
			return HandoffHistoryBias.WeakRetainedMethodDrillRecommendedAcceptedDeltaCount > 0
				|| HandoffHistoryBias.WeakRetainedMethodDrillRecommendedRecommendationCount > 0;
		default:
			return false;
		}
	};
	const bool bPacketPrefersQueueContinuation =
		MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind
			== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
		&& bQueueReadyForHandoff
		&& bQueueLooksFollowUpOrRecovery;
	const bool bPacketPrefersFollowUpContinuation =
		MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind
			== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
		&& bFollowUpReadyForHandoff;
	const bool bPacketPrefersQueueRedirect =
		MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind
			== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
		&& bQueueReadyForHandoff
		&& bQueueLooksRecommendedOrPrimary;
	const bool bPacketPrefersRecommendedRedirect =
		MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind
			== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
		&& bRecommendedReadyForHandoff;
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		MethodDrillRecoveryPacketHandoffSourceBias =
			(bPacketPrefersQueueContinuation || bPacketPrefersFollowUpContinuation)
				? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
				: ((bPacketPrefersQueueRedirect || bPacketPrefersRecommendedRedirect)
					? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
					: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None);
	if (!bCanUseCoachHandoff)
	{
		CoachHandoffRecommendationStatusLine =
			bHasLiveAttemptTimer
				? TEXT("Recommendation: wait for the live attempt to finish before applying closure-aware handoff.")
				: TEXT("Recommendation: finish or clear the current run before applying closure-aware handoff.");
		CoachHandoffRecommendationDetailLine =
			TEXT("Handoff recommendation detail: closure-history pressure is retained, but handoff choice is paused while the dashboard is busy.");
	}
	else
	{
		if (bHasDeferredFirstSuppressionSignal
			&& (bFollowUpReadyForHandoff
				|| (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)))
		{
			if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
				bHandoffRecommendationUsedDeferredFirstSuppressionSignal = true;
			}
			else if (bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedDeferredFirstSuppressionSignal = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedDeferredFirstSuppressionSignal = true;
			}
		}
		else if (bCanLaunchMethodDrillFollowUp
			&& MethodDrillFollowUpWeighting.IsStructurallyValid()
			&& MethodDrillFollowUpWeighting.bPreferDrillFollowUp
			&& (bFollowUpReadyForHandoff
				|| (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)))
		{
			if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bPlanComparisonPrefersTightContinuation && bPacketPrefersQueueContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation && bPacketPrefersFollowUpContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation && bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPacketPrefersQueueContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (bPacketPrefersFollowUpContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
				&& bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
		}
		else if (bStrongMethodDrillRecoveryMemory
			&& (bFollowUpReadyForHandoff
				|| (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)))
		{
			if (bPlanComparisonPrefersTightContinuation && bPacketPrefersQueueContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation && bPacketPrefersFollowUpContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation && bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersTightContinuation
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPacketPrefersQueueContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (bPacketPrefersFollowUpContinuation)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
				&& bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
		}
		else if (MethodDrillFollowUpWeighting.IsStructurallyValid()
			&& MethodDrillFollowUpWeighting.bPreferCoachHandoff
			&& (bRecommendedReadyForHandoff
				|| (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)))
		{
			if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect && bPacketPrefersRecommendedRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect && bPacketPrefersQueueRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect && bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPacketPrefersRecommendedRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (bPacketPrefersQueueRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillWeighting = true;
			}
		}
		else if (bWeakMethodDrillRecoveryMemory
			&& (bRecommendedReadyForHandoff
				|| (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)))
		{
			if (bPlanComparisonPrefersBroadRedirect && bPacketPrefersRecommendedRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect && bPacketPrefersQueueRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect && bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPlanComparisonPrefersBroadRedirect
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedPlanComparisonHistory = true;
			}
			else if (bPacketPrefersRecommendedRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (bPacketPrefersQueueRedirect)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedMethodDrillRecoveryMemory = true;
			}
		}
		else if (HandoffClosureBias.bHasSignal
			&& HandoffClosureBias.ContinuationBias >= HandoffClosureBias.SuppressionBias + 2)
		{
			if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
				&& bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
			}
			else if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
				&& bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksFollowUpOrRecovery)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
			}
			else if (bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
			}
		}
		else if (HandoffClosureBias.bHasSignal
			&& HandoffClosureBias.SuppressionBias >= HandoffClosureBias.ContinuationBias + 2)
		{
			if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
			}
			else if (HandoffHistoryBias.PreferredDeferredOverflowKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
				bHandoffRecommendationUsedDeferredOverflowHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff
				&& bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (bQueueReadyForHandoff && bQueueLooksRecommendedOrPrimary)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
			}
			else if (bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
			}
		}

		if (HandoffRecommendationKind
			== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None)
		{
			if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue
				&& bQueueReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp
				&& bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (HandoffHistoryBias.PreferredKind
					== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended
				&& bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
				bHandoffRecommendationUsedHistory = true;
			}
			else if (bQueueReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue;
			}
			else if (bFollowUpReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp;
			}
			else if (bRecommendedReadyForHandoff)
			{
				HandoffRecommendationKind =
					HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended;
			}
		}

		switch (HandoffRecommendationKind)
		{
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue:
			CoachHandoffRecommendationStatusLine = FString::Printf(
				TEXT("Recommendation: start the queued coach run next. Source: %s"),
				CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
					? TEXT("n/a")
					: *CachedCoachPanelState.NextQueueSourceLabel
			);
			break;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp:
			CoachHandoffRecommendationStatusLine = TEXT(
				"Recommendation: continue with a follow-up coach run next."
			);
			break;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended:
			CoachHandoffRecommendationStatusLine = TEXT(
				"Recommendation: redirect into the recommended coach run next."
			);
			break;
		default:
			CoachHandoffRecommendationStatusLine =
				TEXT("Recommendation: no coach-directed handoff is currently ready.");
			break;
		}
		if (EffectiveMethodDrillRecoveryMemoryHandoffBias
			!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None)
		{
			CoachHandoffRecommendationStatusLine += FString::Printf(
				TEXT(" | Posture: %s"),
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
					EffectiveMethodDrillRecoveryMemoryHandoffBias)
			);
		}
		switch (HandoffRecommendationKind)
		{
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue:
			DisplayedCoachHandoffRecommendationKind = EHyperTwistTrainingCoachHandoffKind::Queue;
			break;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp:
			DisplayedCoachHandoffRecommendationKind = EHyperTwistTrainingCoachHandoffKind::FollowUp;
			break;
		case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended:
			DisplayedCoachHandoffRecommendationKind =
				EHyperTwistTrainingCoachHandoffKind::Recommended;
			break;
		default:
			DisplayedCoachHandoffRecommendationKind = EHyperTwistTrainingCoachHandoffKind::None;
			break;
		}
		bDisplayedCoachHandoffRecommendationUsedDeferredFirstSuppressionSignal =
			bHandoffRecommendationUsedDeferredFirstSuppressionSignal;
		bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture =
			!bHandoffRecommendationUsedDeferredFirstSuppressionSignal
			&& HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& EffectiveMethodDrillRecoveryMemoryHandoffBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
			&& UsesStrongRetainedMethodDrillRecoveryPostureForKind(HandoffRecommendationKind)
			&& (bHandoffRecommendationUsedHistory
				|| bHandoffRecommendationUsedMethodDrillRecoveryMemory);
		bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture =
			!bHandoffRecommendationUsedDeferredFirstSuppressionSignal
			&& HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& EffectiveMethodDrillRecoveryMemoryHandoffBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
			&& UsesWeakRetainedMethodDrillRecoveryPostureForKind(HandoffRecommendationKind)
			&& (bHandoffRecommendationUsedHistory
				|| bHandoffRecommendationUsedMethodDrillRecoveryMemory);
		bDisplayedCoachHandoffRecommendationUsedMethodDrillWeighting =
			bHandoffRecommendationUsedMethodDrillWeighting
			|| bHandoffRecommendationUsedMethodDrillRecoveryMemory
			|| bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture
			|| bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture;
		bDisplayedCoachHandoffRecommendationUsedAlignedTightPacketAcceptedHistory =
			HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount > 0
			&& HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount
				>= HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedAlignedBroadPacketAcceptedHistory =
			HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount > 0
			&& HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount
				>= HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust =
			AcceptedAlignedTightPacketOutcomeTrustBias
				> AcceptedAlignedBroadPacketOutcomeTrustBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust =
			AcceptedAlignedBroadPacketOutcomeTrustBias
				> AcceptedAlignedTightPacketOutcomeTrustBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust =
			AcceptedAlignedTightPacketReliableCompositeBias
				> AcceptedAlignedBroadPacketReliableCompositeBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust =
			AcceptedAlignedBroadPacketReliableCompositeBias
				> AcceptedAlignedTightPacketReliableCompositeBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory =
			AcceptedAlignedTightPacketReliableOutcomeBias
				> AcceptedAlignedBroadPacketReliableOutcomeBias
			&& AcceptedAlignedTightPacketReliableOutcomeBias
				>= AcceptedAlignedTightPacketReliableTrustBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory =
			AcceptedAlignedBroadPacketReliableOutcomeBias
				> AcceptedAlignedTightPacketReliableOutcomeBias
			&& AcceptedAlignedBroadPacketReliableOutcomeBias
				>= AcceptedAlignedBroadPacketReliableTrustBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
				== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory =
			ReliableAcceptedAlignedTightPacketExactCompositeBias
				> ReliableAcceptedAlignedBroadPacketExactCompositeBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory =
			ReliableAcceptedAlignedBroadPacketExactCompositeBias
				> ReliableAcceptedAlignedTightPacketExactCompositeBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory =
			ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias
				> ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory =
			ReliableAcceptedAlignedBroadPacketExactOutcomeHistoryBias
				> ReliableAcceptedAlignedTightPacketExactOutcomeHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory =
			ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias
				> ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory =
			ReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistoryBias
				> ReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory =
			ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias
				> ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::FollowUp
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksFollowUpOrRecovery));
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory =
			ReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistoryBias
				> ReliableAcceptedAlignedTightPacketExactOutcomeReliableHistoryBias
			&& (DisplayedCoachHandoffRecommendationKind
					== EHyperTwistTrainingCoachHandoffKind::Recommended
				|| (DisplayedCoachHandoffRecommendationKind
						== EHyperTwistTrainingCoachHandoffKind::Queue
					&& bQueueLooksRecommendedOrPrimary));
		const bool bHandoffRecommendationUsedStrongMethodDrillFollowUpPacket =
			bHandoffRecommendationUsedMethodDrillWeighting
			&& HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& MethodDrillFollowUpWeighting.bPreferDrillFollowUp
			&& MethodDrillFollowUpWeighting.StrongPacketContinuationCount > 0
			&& MethodDrillFollowUpWeighting.StrongPacketContinuationCount
				>= MethodDrillFollowUpWeighting.WeakPacketRedirectCount;
		const bool bHandoffRecommendationUsedWeakMethodDrillFollowUpPacket =
			bHandoffRecommendationUsedMethodDrillWeighting
			&& HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& MethodDrillFollowUpWeighting.bPreferCoachHandoff
			&& MethodDrillFollowUpWeighting.WeakPacketRedirectCount > 0
			&& MethodDrillFollowUpWeighting.WeakPacketRedirectCount
				>= MethodDrillFollowUpWeighting.StrongPacketContinuationCount;
		const bool bHandoffRecommendationUsedTightMethodDrillRecoveryStructurePlan =
			HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& EffectiveMethodDrillRecoveryMemoryHandoffBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
			&& ((MethodDrillRecoveryPacketHandoffBias.TightContinuationPlanCount > 0
					&& MethodDrillRecoveryPacketHandoffBias.TightContinuationPlanCount
						>= MethodDrillRecoveryPacketHandoffBias.BroadRedirectPlanCount
					&& (bHandoffRecommendationUsedMethodDrillRecoveryMemory
						|| bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture
						|| bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory))
				|| HyperTwistCoachDashboardWidgetInternal::IsTightMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel));
		const bool bHandoffRecommendationUsedBroadMethodDrillRecoveryStructurePlan =
			HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None
			&& EffectiveMethodDrillRecoveryMemoryHandoffBias
				== HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
			&& ((MethodDrillRecoveryPacketHandoffBias.BroadRedirectPlanCount > 0
					&& MethodDrillRecoveryPacketHandoffBias.BroadRedirectPlanCount
						>= MethodDrillRecoveryPacketHandoffBias.TightContinuationPlanCount
					&& (bHandoffRecommendationUsedMethodDrillRecoveryMemory
						|| bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture
						|| bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory))
				|| HyperTwistCoachDashboardWidgetInternal::IsBroadMethodDrillRecoveryPlanSourceLabel(
					CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel));
		if (bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture
			|| bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture)
		{
			DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel =
				HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
					DisplayedCoachHandoffRecommendationKind,
					false,
					false,
					bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture
						? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
						: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak,
					true,
					bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory,
					false,
					false,
					bHandoffRecommendationUsedTightMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedBroadMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedPlanComparisonHistory,
					(bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersTightContinuation
							&& bHasReliableTrustedTightPlanComparisonHistory)
						|| (bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersBroadRedirect
							&& bHasReliableTrustedBroadPlanComparisonHistory)
				);
		}
		else if (bHandoffRecommendationUsedMethodDrillRecoveryMemory
			&& EffectiveMethodDrillRecoveryMemoryHandoffBias
				!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None)
		{
			DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel =
				HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
					DisplayedCoachHandoffRecommendationKind,
					false,
					false,
					EffectiveMethodDrillRecoveryMemoryHandoffBias,
					false,
					bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory,
					false,
					false,
					bHandoffRecommendationUsedTightMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedBroadMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedPlanComparisonHistory,
					(bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersTightContinuation
							&& bHasReliableTrustedTightPlanComparisonHistory)
						|| (bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersBroadRedirect
							&& bHasReliableTrustedBroadPlanComparisonHistory)
				);
		}
		else if (bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory
			&& MethodDrillRecoveryPacketHandoffSourceBias
				!= HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None)
		{
			DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel =
				HyperTwistCoachDashboardWidgetInternal::DashboardHandoffSourceLabel(
					DisplayedCoachHandoffRecommendationKind,
					false,
					false,
					MethodDrillRecoveryPacketHandoffSourceBias,
					false,
					true,
					false,
					false,
					bHandoffRecommendationUsedTightMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedBroadMethodDrillRecoveryStructurePlan,
					bHandoffRecommendationUsedPlanComparisonHistory,
					(bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersTightContinuation
							&& bHasReliableTrustedTightPlanComparisonHistory)
						|| (bHandoffRecommendationUsedPlanComparisonHistory
							&& bPlanComparisonPrefersBroadRedirect
							&& bHasReliableTrustedBroadPlanComparisonHistory)
				);
		}
		else if (bHandoffRecommendationUsedStrongMethodDrillFollowUpPacket
			|| bHandoffRecommendationUsedWeakMethodDrillFollowUpPacket)
		{
			DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel =
				HyperTwistCoachDashboardWidgetInternal::DashboardMethodDrillFollowUpPacketSourceLabel(
					DisplayedCoachHandoffRecommendationKind,
					bHandoffRecommendationUsedStrongMethodDrillFollowUpPacket
						? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
						: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
				);
		}

		CoachHandoffRecommendationDetailLine = FString::Printf(
			TEXT("Closure continuation bias %d | Closure suppression bias %d | Queue ready: %s | Follow-up ready: %s | Recommended ready: %s | Preferred lane: %s | Memory source: %s%s%s%s%s%s%s%s | Launch bias: %s from %s | broadened/tightened history %d/%d | deferred tightened launches %d | deferred launch cases %d%s | Handoff history preferred: %s"),
			HandoffClosureBias.ContinuationBias,
			HandoffClosureBias.SuppressionBias,
			bQueueReadyForHandoff ? TEXT("yes") : TEXT("no"),
			bFollowUpReadyForHandoff ? TEXT("yes") : TEXT("no"),
			bRecommendedReadyForHandoff ? TEXT("yes") : TEXT("no"),
			*HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
				CachedCoachPanelState.PreferredGuidanceLane),
			*HandoffMemorySourceLabel,
			bDashboardHandoffMemorySource
				? TEXT(" | Accepted dashboard handoffs are actively reinforcing this recommendation.")
				: TEXT(""),
			bHandoffRecommendationUsedDeferredOverflowHistory
				? TEXT(" | Deferred-overflow handoff history directly tipped the recommendation.")
				: TEXT(""),
			bHandoffRecommendationUsedHistory
				? TEXT(" | Retained handoff history actively weighted this recommendation.")
				: TEXT(""),
			bHandoffRecommendationUsedMethodDrillWeighting
				? (MethodDrillFollowUpWeighting.bPreferDrillFollowUp
					? TEXT(" | Retained drill-follow-up history directly tipped this handoff toward narrow continuation.")
					: TEXT(" | Retained drill-follow-up history directly tipped this handoff back toward broader coach guidance."))
				: TEXT(""),
			bHandoffRecommendationUsedMethodDrillRecoveryMemory
				? (bStrongMethodDrillRecoveryMemory
					? TEXT(" | Upstream strong drill-driven recovery memory directly tipped this handoff toward narrow continuation.")
					: TEXT(" | Upstream weak drill-driven recovery memory directly tipped this handoff back toward broader coach guidance."))
				: TEXT(""),
			bHandoffRecommendationUsedMethodDrillRecoveryPacketHistory
				? TEXT(" | Retained drill-recovery packet history directly tipped this handoff branch.")
				: TEXT(""),
			bHandoffRecommendationUsedDeferredFirstSuppressionSignal
				? (bDeferredFirstSuppressionSignalPromoted
					? TEXT(" | Deferred-first queue suppression is promoted and keeping narrowed follow-up continuation ahead.")
					: TEXT(" | Deferred-first queue suppression is explicitly keeping narrowed follow-up continuation ahead."))
				: TEXT(""),
			*HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
				CachedCoachPanelState.PreferredLaunchBudgetBias),
			*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredLaunchBudgetSourceLabel),
			CachedCoachPanelState.BroadenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.TightenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.DeferredTightenedLaunchHistoryCount,
			CachedCoachPanelState.DeferredLaunchHistoryCaseCount,
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
				== TEXT("recommendation-history-deferred-tightened-launch")
				? TEXT(" | Deferred overflow memory is directly reinforcing this handoff.")
				: TEXT(""),
			*HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
				HandoffHistoryBias.PreferredKind)
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | accepted q/f/r %d/%d/%d | deferred-overflow accepted q/f/r %d/%d/%d | deferred-first recommendation q/f/r %d/%d/%d | recommended q/f/r %d/%d/%d"),
			HandoffHistoryBias.QueueAcceptedDeltaCount,
			HandoffHistoryBias.FollowUpAcceptedDeltaCount,
			HandoffHistoryBias.RecommendedAcceptedDeltaCount,
			HandoffHistoryBias.DeferredOverflowQueueAcceptedDeltaCount,
			HandoffHistoryBias.DeferredOverflowFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.DeferredOverflowRecommendedAcceptedDeltaCount,
			HandoffHistoryBias.DeferredFirstQueueRecommendationCount,
			HandoffHistoryBias.DeferredFirstFollowUpRecommendationCount,
			HandoffHistoryBias.DeferredFirstRecommendedRecommendationCount,
			HandoffHistoryBias.QueueRecommendationCount,
			HandoffHistoryBias.FollowUpRecommendationCount,
			HandoffHistoryBias.RecommendedRecommendationCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | aligned guidance accepted follow-up/recommended %d/%d | aligned packet accepted follow-up/recommended %d/%d"),
			HandoffHistoryBias.AlignedTightFollowUpOutcomeAcceptedDeltaCount,
			HandoffHistoryBias.AlignedBroadRecommendedOutcomeAcceptedDeltaCount,
			HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount,
			HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | accepted aligned packet outcomes tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | accepted aligned packet trust tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet trust tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet launched-plan outcomes tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet handoff completion tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet exact lane outcomes tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet exact branch tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactAcceptedAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactAcceptedAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet exact branch launched-plan outcomes tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet exact branch acceptance tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeAcceptedAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeAcceptedAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted packet exact branch reliability tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableExactOutcomeReliableAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableExactOutcomeReliableAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable accepted aligned packet handoff history follow-up/recommended %d/%d"),
			HandoffHistoryBias.ReliableAcceptedAlignedTightFollowUpPacketAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAcceptedAlignedBroadRecommendedPacketAcceptedDeltaCount
		);
		if (HandoffHistoryBias.AlignedTightFollowUpOutcomeAcceptedDeltaCount > 0
			&& HandoffHistoryBias.PreferredKind
				== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned tight follow-up handoffs are directly reinforcing narrow continuation.");
		}
		else if (HandoffHistoryBias.AlignedBroadRecommendedOutcomeAcceptedDeltaCount > 0
			&& HandoffHistoryBias.PreferredKind
				== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned broad recommended handoffs are directly reinforcing broader redirect.");
		}
		if (HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount > 0
			&& HandoffHistoryBias.PreferredKind
				== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned tight packet follow-up-first handoffs are reinforcing the retained narrow branch.");
		}
		else if (HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount > 0
			&& HandoffHistoryBias.PreferredKind
				== HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned broad packet recommended-first handoffs are reinforcing the retained broad branch.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned tight packet trust is now directly reinforcing narrow continuation.");
		}
		else if (
			bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned broad packet trust is now directly reinforcing broader redirect.");
		}
		else if (bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned tight packet outcome trust is tipping this handoff toward narrow continuation.");
		}
		else if (
			bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Accepted aligned broad packet outcome trust is tipping this handoff back toward broader redirect.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned tight launched-plan outcomes are reinforcing accepted narrow continuation.");
		}
		else if (
			bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned broad launched-plan outcomes are reinforcing accepted broader redirect.");
		}
		if (ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias
			> ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned tight packet completion history is now reinforcing narrow continuation.");
		}
		else if (ReliableAcceptedAlignedBroadPacketOutcomeAcceptedBias
			> ReliableAcceptedAlignedTightPacketOutcomeAcceptedBias)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned broad packet completion history is now reinforcing broader redirect.");
		}
		if (ReliableAcceptedAlignedTightPacketExactOutcomeBias
			> ReliableAcceptedAlignedBroadPacketExactOutcomeBias)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned tight packet exact launched-plan outcomes are now reinforcing narrow continuation.");
		}
		else if (ReliableAcceptedAlignedBroadPacketExactOutcomeBias
			> ReliableAcceptedAlignedTightPacketExactOutcomeBias)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable accepted aligned broad packet exact launched-plan outcomes are now reinforcing broader redirect.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned tight packet branch history is now hardening narrow continuation.");
		}
		else if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned broad packet branch history is now hardening broader redirect.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned tight packet launched-plan outcomes are now promoting narrow continuation as a stronger retained branch.");
		}
		else if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned broad packet launched-plan outcomes are now promoting broader redirect as a stronger retained branch.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned tight packet branch acceptance is now hardening narrow continuation beyond raw launched-plan outcomes.");
		}
		else if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned broad packet branch acceptance is now hardening broader redirect beyond raw launched-plan outcomes.");
		}
		if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned tight packet branch reliability is now hardening narrow continuation beyond acceptance-backed branch history.");
		}
		else if (bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Reliable exact accepted aligned broad packet branch reliability is now hardening broader redirect beyond acceptance-backed branch history.");
		}
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | upstream drill recovery strong/weak/history %d/%d/%d avg %.1f"),
			CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount,
			CachedCoachPanelState.WeakMethodDrillRecoveryHistoryCount,
			CachedCoachPanelState.MethodDrillRecoveryHistoryCount,
			CachedCoachPanelState.MethodDrillRecoveryAverageOutcomeScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | retained drill-recovery stance: %s"),
			*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
				EffectiveMethodDrillRecoveryMemoryHandoffBias)
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | packet history queue/follow-up/recommended %d/%d/%d | strong packet queue/follow-up %d/%d | weak packet recommended %d | tight/broad plan posture %d/%d | packet preferred: %s"),
			MethodDrillRecoveryPacketHandoffBias.QueueEntryHistoryCount,
			MethodDrillRecoveryPacketHandoffBias.FollowUpPacketHistoryCount,
			MethodDrillRecoveryPacketHandoffBias.RecommendedBriefHistoryCount,
			MethodDrillRecoveryPacketHandoffBias.StrongQueueEntryCount,
			MethodDrillRecoveryPacketHandoffBias.StrongFollowUpPacketCount,
			MethodDrillRecoveryPacketHandoffBias.WeakRecommendedBriefCount,
			MethodDrillRecoveryPacketHandoffBias.TightContinuationPlanCount,
			MethodDrillRecoveryPacketHandoffBias.BroadRedirectPlanCount,
			*HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
				MethodDrillRecoveryPacketHandoffBias.PreferredHandoffKind)
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | plan-source tight aligned/diverged %d/%d | broad aligned/diverged %d/%d | reliable trusted tight aligned/diverged %d/%d | reliable trusted broad aligned/diverged %d/%d | plan preferred: %s"),
			MethodDrillRecoveryPlanComparisonSummary.TightPlanAlignedCount,
			MethodDrillRecoveryPlanComparisonSummary.TightPlanDivergedCount,
			MethodDrillRecoveryPlanComparisonSummary.BroadPlanAlignedCount,
			MethodDrillRecoveryPlanComparisonSummary.BroadPlanDivergedCount,
			MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanAlignedCount,
			MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanDivergedCount,
			MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanAlignedCount,
			MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanDivergedCount,
			*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanComparisonPreference(
				MethodDrillRecoveryPlanComparisonSummary)
		);
		if (bHandoffRecommendationUsedPlanComparisonHistory)
		{
			CoachHandoffRecommendationDetailLine +=
				bPlanComparisonPrefersTightContinuation
					? (bHasReliableTrustedPlanComparisonHistory
						? TEXT(" | Reliable retained plan-alignment history directly tipped this handoff toward trusted tight continuation.")
						: TEXT(" | Retained plan-alignment history directly tipped this handoff toward trusted tight continuation."))
					: (bHasReliableTrustedPlanComparisonHistory
						? TEXT(" | Reliable retained plan-alignment history directly tipped this handoff back toward trusted broad redirect.")
						: TEXT(" | Retained plan-alignment history directly tipped this handoff back toward trusted broad redirect."));
		}
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable trusted plan history tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
			CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
			CachedCoachPanelState.ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			CachedCoachPanelState.ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | aligned reliable handoff outcomes tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState
				.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
			CachedCoachPanelState
				.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
			CachedCoachPanelState
				.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore,
			CachedCoachPanelState
				.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | aligned reliable plan history tight/broad %d/%d avg %.1f/%.1f"),
			CachedCoachPanelState.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
			CachedCoachPanelState.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
			CachedCoachPanelState
				.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
			CachedCoachPanelState
				.ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore
		);
		if (CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome"))
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Successful aligned reliable tight launched-plan outcomes directly tipped this handoff toward tighter continuation.");
		}
		else if (CachedCoachPanelState.PreferredCoachHandoffSourceLabel
			== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome"))
		{
			CoachHandoffRecommendationDetailLine +=
				TEXT(" | Successful aligned reliable broad launched-plan outcomes directly tipped this handoff back toward broader redirect.");
		}
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | aligned reliable tight accepted q/f/r %d/%d/%d, broad accepted q/f/r %d/%d/%d"),
			HandoffHistoryBias.ReliableAlignedTrustedTightQueueAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAlignedTrustedTightFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAlignedTrustedTightRecommendedAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadQueueAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadRecommendedAcceptedDeltaCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | aligned reliable tight recommendation q/f/r %d/%d/%d, broad recommendation q/f/r %d/%d/%d"),
			HandoffHistoryBias.ReliableAlignedTrustedTightQueueRecommendationCount,
			HandoffHistoryBias.ReliableAlignedTrustedTightFollowUpRecommendationCount,
			HandoffHistoryBias.ReliableAlignedTrustedTightRecommendedRecommendationCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadQueueRecommendationCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadFollowUpRecommendationCount,
			HandoffHistoryBias.ReliableAlignedTrustedBroadRecommendedRecommendationCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable trusted tight accepted q/f/r %d/%d/%d, broad accepted q/f/r %d/%d/%d"),
			HandoffHistoryBias.ReliableTrustedTightQueueAcceptedDeltaCount,
			HandoffHistoryBias.ReliableTrustedTightFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.ReliableTrustedTightRecommendedAcceptedDeltaCount,
			HandoffHistoryBias.ReliableTrustedBroadQueueAcceptedDeltaCount,
			HandoffHistoryBias.ReliableTrustedBroadFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.ReliableTrustedBroadRecommendedAcceptedDeltaCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | reliable trusted tight recommendation q/f/r %d/%d/%d, broad recommendation q/f/r %d/%d/%d"),
			HandoffHistoryBias.ReliableTrustedTightQueueRecommendationCount,
			HandoffHistoryBias.ReliableTrustedTightFollowUpRecommendationCount,
			HandoffHistoryBias.ReliableTrustedTightRecommendedRecommendationCount,
			HandoffHistoryBias.ReliableTrustedBroadQueueRecommendationCount,
			HandoffHistoryBias.ReliableTrustedBroadFollowUpRecommendationCount,
			HandoffHistoryBias.ReliableTrustedBroadRecommendedRecommendationCount
		);
		CoachHandoffRecommendationDetailLine += FString::Printf(
			TEXT(" | strong posture q/f/r %d/%d/%d, weak posture q/f/r %d/%d/%d"),
			HandoffHistoryBias.StrongRetainedMethodDrillQueueAcceptedDeltaCount,
			HandoffHistoryBias.StrongRetainedMethodDrillFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.StrongRetainedMethodDrillRecommendedAcceptedDeltaCount,
			HandoffHistoryBias.WeakRetainedMethodDrillQueueAcceptedDeltaCount,
			HandoffHistoryBias.WeakRetainedMethodDrillFollowUpAcceptedDeltaCount,
			HandoffHistoryBias.WeakRetainedMethodDrillRecommendedAcceptedDeltaCount
		);
		if (bCanLaunchMethodDrillFollowUp && MethodDrillFollowUpWeighting.IsStructurallyValid())
		{
			CoachHandoffRecommendationDetailLine += MethodDrillFollowUpWeighting.bPreferDrillFollowUp
				? (MethodDrillFollowUpWeighting.bUsedUpstreamNarrowStructureSignal
					? TEXT(" | Upstream narrow drill-follow-up packet structure history directly tipped this branch toward tighter drill continuation.")
					: TEXT(" | Drill history says stay narrow with drill-derived follow-up before broader coach handoff."))
				: (MethodDrillFollowUpWeighting.bPreferCoachHandoff
					? (MethodDrillFollowUpWeighting.bUsedUpstreamBroadStructureSignal
						? TEXT(" | Upstream broad drill-follow-up packet structure history directly tipped this branch back toward broader coach guidance.")
						: TEXT(" | Drill history says broader coach handoff is now stronger than another narrow drill follow-up."))
					: TEXT(" | Drill history is balanced against broader coach handoff."));
			CoachHandoffRecommendationDetailLine += FString::Printf(
				TEXT(" | upstream packet structure narrow/broad %d/%d avg %.1f/%.1f"),
				MethodDrillFollowUpWeighting.UpstreamNarrowPacketStructureHistoryCount,
				MethodDrillFollowUpWeighting.UpstreamBroadPacketStructureHistoryCount,
				MethodDrillFollowUpWeighting.UpstreamNarrowPacketStructureAverageOutcomeScore,
				MethodDrillFollowUpWeighting.UpstreamBroadPacketStructureAverageOutcomeScore
			);
		}
		if (MethodDrillRecoveryPacketHandoffBias.bHasSignal)
		{
			CoachHandoffRecommendationDetailLine += MethodDrillRecoveryPacketHandoffBias.bHasStrongContinuationSignal
				? TEXT(" | Retained drill-recovery packet history is reinforcing narrower queue/follow-up continuation.")
				: (MethodDrillRecoveryPacketHandoffBias.bHasWeakRedirectSignal
					? TEXT(" | Retained drill-recovery packet history is reinforcing broader recommended redirect.")
					: TEXT(" | Retained drill-recovery packet history is present but balanced."));
		}
		if (!MethodDrillUpstreamMemoryLine.IsEmpty())
		{
			CoachHandoffRecommendationDetailLine += MethodDrillUpstreamMemoryLine;
		}
	}
	const bool bHandoffRecommendationUsedReliableTrustedTightPlanHistory =
		bHandoffRecommendationUsedPlanComparisonHistory
		&& bPlanComparisonPrefersTightContinuation
		&& bHasReliableTrustedTightPlanComparisonHistory;
	const bool bHandoffRecommendationUsedReliableTrustedBroadPlanHistory =
		bHandoffRecommendationUsedPlanComparisonHistory
		&& bPlanComparisonPrefersBroadRedirect
		&& bHasReliableTrustedBroadPlanComparisonHistory;
	const bool bHandoffRecommendationUsedReliableAlignedTrustedTightPlanHistory =
		bHandoffRecommendationUsedPlanComparisonHistory
		&& bPlanComparisonPrefersTightContinuation
		&& MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanSourceCount > 0;
	const bool bHandoffRecommendationUsedReliableAlignedTrustedBroadPlanHistory =
		bHandoffRecommendationUsedPlanComparisonHistory
		&& bPlanComparisonPrefersBroadRedirect
		&& MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanSourceCount > 0;
	const bool bHandoffRecommendationUsedReliableAlignedTrustedTightPlanOutcomeHistory =
		CachedCoachPanelState.PreferredCoachHandoffSourceLabel
		== TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable-aligned-outcome");
	const bool bHandoffRecommendationUsedReliableAlignedTrustedBroadPlanOutcomeHistory =
		CachedCoachPanelState.PreferredCoachHandoffSourceLabel
		== TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable-aligned-outcome");
	FString QueuedRunLabel = CachedCoachPanelState.NextQueueSourceLabel.IsEmpty()
		? TEXT("Start Queue")
		: FString::Printf(TEXT("Queue: %s"), *CachedCoachPanelState.NextQueueSourceLabel);
	FString FollowUpRunLabel = CachedCoachFollowUpBrief.PrimaryActionLabel.IsEmpty()
		? TEXT("Start Follow-Up")
		: CachedCoachFollowUpBrief.PrimaryActionLabel;
	FString RecommendedRunLabel = CachedCoachBrief.PrimaryActionLabel.IsEmpty()
		? TEXT("Start Recommended")
		: CachedCoachBrief.PrimaryActionLabel;
	switch (HandoffRecommendationKind)
	{
	case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Queue:
		QueuedRunLabel = FString::Printf(TEXT("Recommended: %s"), *QueuedRunLabel);
		break;
	case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::FollowUp:
		FollowUpRunLabel = FString::Printf(TEXT("Recommended: %s"), *FollowUpRunLabel);
		break;
	case HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::Recommended:
		RecommendedRunLabel = FString::Printf(TEXT("Recommended: %s"), *RecommendedRunLabel);
		break;
	default:
		break;
	}
	const FHyperTwistCoachDashboardHandoffHistoryEntry* SelectedHandoffHistoryEntry =
		SelectedHandoffHistoryIndex >= 0
		&& SelectedHandoffHistoryIndex < HandoffHistoryEntries.Num()
		? &HandoffHistoryEntries[SelectedHandoffHistoryIndex]
		: nullptr;
	const FString SelectedHandoffRetainedPostureLine =
		SelectedHandoffHistoryEntry == nullptr
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
				SelectedHandoffHistoryEntry->bUsedStrongRetainedMethodDrillRecoveryPosture,
				SelectedHandoffHistoryEntry->bUsedWeakRetainedMethodDrillRecoveryPosture);
	const FString SelectedHandoffReliablePlanLine = [&]() -> FString
	{
		if (SelectedHandoffHistoryEntry == nullptr)
		{
			return TEXT("none");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableAlignedTrustedTightStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted tight launched-plan continuation");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableAlignedTrustedBroadStructurePlanOutcomeHistory)
		{
			return TEXT("aligned trusted broad launched-plan redirect");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableAlignedTrustedTightStructurePlanHistory)
		{
			return TEXT("aligned trusted tight continuation");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableAlignedTrustedBroadStructurePlanHistory)
		{
			return TEXT("aligned trusted broad redirect");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableTrustedTightStructurePlanHistory)
		{
			return TEXT("trusted tight continuation");
		}
		if (SelectedHandoffHistoryEntry->bUsedReliableTrustedBroadStructurePlanHistory)
		{
			return TEXT("trusted broad redirect");
		}
		return TEXT("none");
	}();
	const FString SelectedHandoffQueueSourceLine =
		SelectedHandoffHistoryEntry == nullptr || SelectedHandoffHistoryEntry->QueueSourceLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedHandoffHistoryEntry->QueueSourceLabel;
	const FString SelectedHandoffPreferredLaneLine =
		SelectedHandoffHistoryEntry == nullptr
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::DescribeGuidanceLane(
				SelectedHandoffHistoryEntry->PreferredGuidanceLane);
	const FString SelectedHandoffMemorySourceLine =
		SelectedHandoffHistoryEntry == nullptr
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedHandoffHistoryEntry->PreferredGuidanceSourceLabel);
	const FString SelectedHandoffRecoveryActionLine =
		SelectedHandoffHistoryEntry == nullptr
			? TEXT("none")
			: (SelectedHandoffHistoryEntry->PreferredRecoveryAction
				== EHyperTwistTrainingQueueRecoveryAction::None
				? TEXT("none")
				: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
					SelectedHandoffHistoryEntry->PreferredRecoveryAction));
	const FString SelectedHandoffRecoverySourceLine =
		SelectedHandoffHistoryEntry == nullptr
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedHandoffHistoryEntry->PreferredRecoveryActionSourceLabel);
	const FString HandoffHistoryStatusLine =
		SelectedHandoffHistoryEntry != nullptr
		? FString::Printf(
			TEXT("Handoff history: %d entries | selected %d/%d | Recommendation: %s | Stance: %s | Reliable plan: %s | Recorded: %s"),
			HandoffHistoryEntries.Num(),
			SelectedHandoffHistoryIndex + 1,
			HandoffHistoryEntries.Num(),
			SelectedHandoffHistoryEntry->RecommendedHandoffKindLabel.IsEmpty()
				? TEXT("none")
				: *SelectedHandoffHistoryEntry->RecommendedHandoffKindLabel,
			*SelectedHandoffRetainedPostureLine,
			*SelectedHandoffReliablePlanLine,
			*SelectedHandoffHistoryEntry->RecordedAtUtc
		)
		: TEXT("Handoff history: no retained handoff-pattern shifts recorded yet.");
	const FString HandoffHistoryDetailLine =
		SelectedHandoffHistoryEntry != nullptr
		? FString::Printf(
			TEXT("Accepted queued/follow-up/recommended: %d/%d/%d | aligned guidance accepted follow-up/recommended: %d/%d | aligned packet accepted follow-up/recommended: %d/%d | reliable accepted aligned packet handoff follow-up/recommended: %d/%d | deferred-overflow queued/follow-up/recommended: %d/%d/%d | drill-driven queued/follow-up/recommended: %d/%d/%d | aligned reliable handoff outcomes tight/broad %d/%d avg %.1f/%.1f | deferred-first suppression recommendation used: %s | drill weighting used: %s | reliable trusted plan: %s | retained posture: %s | queue source: %s | preferred lane: %s | memory source: %s | recovery action: %s | recovery source: %s | closure continuation bias %d | closure suppression bias %d | readiness queue/follow-up/recommended: %s/%s/%s || %s"),
			SelectedHandoffHistoryEntry->AcceptedQueuedHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedFollowUpHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedRecommendedHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedAlignedTightFollowUpOutcomeHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedAlignedBroadRecommendedOutcomeHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedAlignedTightFollowUpPacketHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedAlignedBroadRecommendedPacketHandoffCount,
			SelectedHandoffHistoryEntry->ReliableAcceptedAlignedTightFollowUpPacketOutcomeHandoffCount,
			SelectedHandoffHistoryEntry->ReliableAcceptedAlignedBroadRecommendedPacketOutcomeHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedDeferredOverflowQueuedHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedDeferredOverflowFollowUpHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedDeferredOverflowRecommendedHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedMethodDrillQueuedHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedMethodDrillFollowUpHandoffCount,
			SelectedHandoffHistoryEntry->AcceptedMethodDrillRecommendedHandoffCount,
			SelectedHandoffHistoryEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			SelectedHandoffHistoryEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			SelectedHandoffHistoryEntry->ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			SelectedHandoffHistoryEntry->ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			SelectedHandoffHistoryEntry->bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
			SelectedHandoffHistoryEntry->bUsedMethodDrillWeighting ? TEXT("yes") : TEXT("no"),
			*SelectedHandoffReliablePlanLine,
			*SelectedHandoffRetainedPostureLine,
			*SelectedHandoffQueueSourceLine,
			*SelectedHandoffPreferredLaneLine,
			*SelectedHandoffMemorySourceLine,
			*SelectedHandoffRecoveryActionLine,
			*SelectedHandoffRecoverySourceLine,
			SelectedHandoffHistoryEntry->ClosureContinuationBias,
			SelectedHandoffHistoryEntry->ClosureSuppressionBias,
			SelectedHandoffHistoryEntry->bQueueReady ? TEXT("yes") : TEXT("no"),
			SelectedHandoffHistoryEntry->bFollowUpReady ? TEXT("yes") : TEXT("no"),
			SelectedHandoffHistoryEntry->bRecommendedReady ? TEXT("yes") : TEXT("no"),
			SelectedHandoffHistoryEntry->RecommendationDetailLine.IsEmpty()
				? *SelectedHandoffHistoryEntry->RecommendationStatusLine
				: *SelectedHandoffHistoryEntry->RecommendationDetailLine
		)
		: TEXT("Handoff history detail: retained recommendation shifts and accepted queued/follow-up/recommended handoff patterns will accumulate here over time.");
	const auto BuildDeckPreviewLine = [](const FHyperTwistTrainingDeck& Deck, const FHyperTwistCoachBrief& Brief, const TCHAR* EmptyPrefix)
	{
		if (Deck.IsStructurallyValid())
		{
			TArray<FString> PreviewCaseParts;
			const int32 PreviewCaseCount = FMath::Min(Deck.Cases.Num(), 3);
			for (int32 CaseIndex = 0; CaseIndex < PreviewCaseCount; ++CaseIndex)
			{
				const FHyperTwistTrainingCase& PreviewCase = Deck.Cases[CaseIndex];
				PreviewCaseParts.Add(
					PreviewCase.PromptLabel.IsEmpty() ? PreviewCase.CaseId : PreviewCase.PromptLabel
				);
			}
			const FString PreviewCases = PreviewCaseParts.Num() > 0
				? FString::Join(PreviewCaseParts, TEXT(" | "))
				: TEXT("none");
			return FString::Printf(
				TEXT("Deck preview: %s | Deck: %s | Cases: %d | Selection: %s | Difficulty: %s | Subset: %s | Preview: %s"),
				Deck.Title.IsEmpty() ? TEXT("n/a") : *Deck.Title,
				Deck.DeckId.IsEmpty() ? TEXT("n/a") : *Deck.DeckId,
				Deck.Cases.Num(),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(Deck.SelectionPolicy),
				Deck.DifficultyBand.IsEmpty() ? TEXT("n/a") : *Deck.DifficultyBand,
				Deck.SubsetId.IsEmpty() ? TEXT("n/a") : *Deck.SubsetId,
				*PreviewCases
			);
		}

		if (!Brief.UserId.IsEmpty() && !Brief.Headline.IsEmpty())
		{
			return FString::Printf(
				TEXT("%s: %s | Deck: %s | Method: %s | Focus cases: %d | Action: %s"),
				EmptyPrefix,
				*Brief.Headline,
				Brief.FocusDeckId.IsEmpty() ? TEXT("n/a") : *Brief.FocusDeckId,
				Brief.FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *Brief.FocusMethodSegmentId,
				Brief.FocusCaseIds.Num(),
				Brief.PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : *Brief.PrimaryActionLabel
			);
		}

		return FString::Printf(TEXT("%s: no guidance available"), EmptyPrefix);
	};
	FString RecommendedDeckPreviewLine = BuildDeckPreviewLine(
		CachedCoachPanelState.bCanStartCoachRecommendedRun
			? CachedCoachRecommendedDeck
			: FHyperTwistTrainingDeck(),
		CachedCoachPanelState.bCanStartCoachRecommendedRun
			? CachedCoachBrief
			: FHyperTwistCoachBrief(),
		TEXT("Recommended guidance")
	);
	FString FollowUpDeckPreviewLine = BuildDeckPreviewLine(
		(CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
			? CachedCoachFollowUpDeck
			: FHyperTwistTrainingDeck(),
		(CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
			? CachedCoachFollowUpBrief
			: FHyperTwistCoachBrief(),
		TEXT("Follow-up guidance")
	);
	const FHyperTwistTrainingDeck* ActivePreviewDeck = GetActiveGuidancePreviewDeck();
	const FHyperTwistTrainingCase* SelectedGuidancePreviewCase =
		ActivePreviewDeck != nullptr
		&& SelectedGuidancePreviewCaseIndex >= 0
		&& SelectedGuidancePreviewCaseIndex < ActivePreviewDeck->Cases.Num()
		? &ActivePreviewDeck->Cases[SelectedGuidancePreviewCaseIndex]
		: nullptr;
	const FHyperTwistCoachBrief* ActivePreviewBrief = GetActiveGuidancePreviewBrief();
	const FString ActivePreviewLaneLabel =
		ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		? TEXT("recommended")
		: (ActiveGuidancePreviewLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? TEXT("follow-up")
			: TEXT("none"));
	const FHyperTwistCoachDashboardGuidanceLanePreference GuidanceLanePreference =
		BuildGuidanceLanePreference();
	const FString PreferredGuidanceLaneLabel =
		GuidanceLanePreference.PreferredLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		? TEXT("recommended")
		: (GuidanceLanePreference.PreferredLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? TEXT("follow-up")
			: TEXT("none"));
	const FString GuidancePreferenceSourceLabel = [&]() -> FString
	{
		if (GuidanceLanePreference.bHasDecisionSignal)
		{
			if (GuidanceLanePreference.bHasReliableAlignedPlanOutcomeSignal)
			{
				return GuidanceLanePreference.bHasClosureHistorySignal
					? TEXT("decision + closure-history + aligned-plan-outcome")
					: TEXT("decision + aligned-plan-outcome");
			}
			return GuidanceLanePreference.bHasClosureHistorySignal
				? TEXT("decision + closure-history")
				: TEXT("decision-informed");
		}
		if (GuidanceLanePreference.bHasReliableAlignedPlanOutcomeSignal)
		{
			return TEXT("aligned-plan-outcome + memory");
		}
		if (GuidanceLanePreference.bHasClosureHistorySignal)
		{
			return TEXT("closure-history + memory");
		}
		return CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			? TEXT("availability fallback")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredGuidanceSourceLabel);
	}();
	FString GuidancePreferenceStatusLine =
		GuidanceLanePreference.IsStructurallyValid()
		? FString::Printf(
			TEXT("Preference: next surfaced lane %s | Active preview: %s | Source: %s"),
			*PreferredGuidanceLaneLabel,
			*ActivePreviewLaneLabel,
			*GuidancePreferenceSourceLabel
		)
		: TEXT("Preference: no coach preview lane is currently available.");
	FString GuidancePreferenceDetailLine =
		GuidanceLanePreference.IsStructurallyValid()
		? FString::Printf(
			TEXT("Recommended lane: %d decisions | Continue bias %d | Avg success %.2f | Closure suppress bias %d || Follow-up lane: %d decisions | Continue bias %d | Avg success %.2f | Closure continuation bias %d | Launch bias: %s from %s | broadened/tightened history %d/%d | deferred tightened launches %d | deferred launch cases %d%s | The dashboard adopts this preferred lane whenever it needs to surface the next guidance preview."),
			GuidanceLanePreference.RecommendedDecisionCount,
			GuidanceLanePreference.RecommendedContinueBias,
			GuidanceLanePreference.RecommendedAverageSuccessRate,
			GuidanceLanePreference.ClosureSuppressionBias,
			GuidanceLanePreference.FollowUpDecisionCount,
			GuidanceLanePreference.FollowUpContinueBias,
			GuidanceLanePreference.FollowUpAverageSuccessRate,
			GuidanceLanePreference.ClosureContinuationBias,
			*HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
				CachedCoachPanelState.PreferredLaunchBudgetBias),
			*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredLaunchBudgetSourceLabel),
			CachedCoachPanelState.BroadenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.TightenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.DeferredTightenedLaunchHistoryCount,
			CachedCoachPanelState.DeferredLaunchHistoryCaseCount,
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
				== TEXT("recommendation-history-deferred-tightened-launch")
				? TEXT(" | Deferred overflow memory is actively steering the surfaced lane.")
				: TEXT("")
		)
		: TEXT("Preference detail: build recommended or follow-up guidance to let the dashboard choose a next surfaced lane.");
	if (!MethodDrillUpstreamMemoryLine.IsEmpty())
	{
		GuidancePreferenceDetailLine += MethodDrillUpstreamMemoryLine;
	}
	if (GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias > 0
		|| GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f, continuation bias %d) | broad history %d (avg %.2f, redirect bias %d)%s"),
			GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			GuidanceLanePreference.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias,
			GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			GuidanceLanePreference.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias,
			GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias
					> GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias
				? TEXT(" | Tight launched-plan trust is currently reinforcing the follow-up lane.")
				: (GuidanceLanePreference.ReliableAlignedTrustedBroadRedirectBias
						> GuidanceLanePreference.ReliableAlignedTrustedTightContinuationBias
					? TEXT(" | Broad launched-plan redirect trust is currently reinforcing the recommended lane.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount > 0
		|| CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan lane outcomes: tight->follow-up %d (avg %.2f) | broad->recommended %d (avg %.2f)%s"),
			CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeHistoryCount,
			CachedCoachPanelState.ReliableAlignedTrustedTightFollowUpGuidanceOutcomeAverageScore,
			CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeHistoryCount,
			CachedCoachPanelState.ReliableAlignedTrustedBroadRecommendedGuidanceOutcomeAverageScore,
			HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpGuidanceSourceLabel(
					CachedCoachPanelState.PreferredGuidanceSourceLabel)
				? TEXT(" | Follow-up is currently being reinforced by aligned tight launched-plan lane outcomes.")
				: (HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedGuidanceSourceLabel(
							CachedCoachPanelState.PreferredGuidanceSourceLabel)
					? TEXT(" | Recommended is currently being reinforced by aligned broad launched-plan lane outcomes.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Aligned retained packet outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeHistoryCount,
			CachedCoachPanelState.AlignedTightFollowUpPacketStructureOutcomeAverageScore,
			CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeHistoryCount,
			CachedCoachPanelState.AlignedBroadRecommendedPacketStructureOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel
					== TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
				? TEXT(" | Follow-up is currently being reinforced by retained aligned tight packet outcomes.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel
							== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
					? TEXT(" | Recommended is currently being reinforced by retained aligned broad packet outcomes.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Accepted aligned packet outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel
					== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
				? TEXT(" | Follow-up is currently being reinforced by accepted aligned tight packet outcomes.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel
							== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome")
					? TEXT(" | Recommended is currently being reinforced by accepted aligned broad packet outcomes.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Accepted aligned packet trust outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustOutcomeAverageScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
				? TEXT(" | Follow-up is currently being reinforced by retained accepted aligned tight packet trust.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
							TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
					? TEXT(" | Recommended is currently being reinforced by retained accepted aligned broad packet trust.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet trust: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)%s"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableAverageOutcomeScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableAverageOutcomeScore,
			CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
					TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-reliable-"))
				? TEXT(" | Follow-up is currently being reinforced by reliable accepted aligned tight packet trust.")
				: (CachedCoachPanelState.PreferredGuidanceSourceLabel.StartsWith(
							TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-reliable-"))
					? TEXT(" | Recommended is currently being reinforced by reliable accepted aligned broad packet trust.")
					: TEXT(""))
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount > 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount
			> 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet launched-plan outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAverageScore
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount
			> 0
		|| CachedCoachPanelState
				.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount > 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet handoff completion: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableOutcomeAcceptedAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableOutcomeAcceptedAverageScore
		);
	}
	if (CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount
			> 0
		|| CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount
			> 0)
	{
		GuidancePreferenceDetailLine += FString::Printf(
			TEXT(" | Reliable accepted aligned packet exact lane outcomes: tight follow-up-first %d (avg %.2f) | broad recommended-first %d (avg %.2f)"),
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedTightFollowUpPacketTrustReliableLaneOutcomeAverageScore,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeHistoryCount,
			CachedCoachPanelState.AcceptedAlignedBroadRecommendedPacketTrustReliableLaneOutcomeAverageScore
		);
	}
	const bool bQueueRecoveryMemorySource =
		HyperTwistCoachDashboardWidgetInternal::IsQueueRecoveryMemorySource(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const bool bQueueRecoveryFollowUp =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp;
	const bool bQueueRecoveryRecommended =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::Recommended;
	const FString QueueRecoveryLaneLabel =
		bQueueRecoveryFollowUp
			? TEXT("follow-up")
			: (bQueueRecoveryRecommended
				? TEXT("recommended")
				: TEXT("none"));
	const FString QueueRecoverySourceLabel =
		HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel);
	const FString QueueRecoveryActionSourceLabel =
		CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredQueueRecoveryActionSourceLabel);
	const FHyperTwistCoachDashboardQueueRecoveryWeighting QueueRecoveryWeighting = BuildQueueRecoveryWeighting();
	const HyperTwistCoachDashboardWidgetInternal::FMethodDrillRecoveryPacketDashboardBias
		MethodDrillRecoveryPacketQueueBias =
			HyperTwistCoachDashboardWidgetInternal::DeriveMethodDrillRecoveryPacketDashboardBias(
				MethodDrillRecoveryMemoryHistoryEntries
			);
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		QueueRecoveryMethodDrillMemoryBias =
			HyperTwistCoachDashboardWidgetInternal::ResolveMethodDrillRecoveryMemoryBias(
				QueueRecoveryWeighting.MethodDrillUpstreamHistoryCount,
				QueueRecoveryWeighting.MethodDrillUpstreamStrongCount,
				QueueRecoveryWeighting.MethodDrillUpstreamWeakCount,
				QueueRecoveryWeighting.MethodDrillUpstreamAverageOutcomeScore
			);
	const bool bQueueRecoveryUsedPlanComparisonHistory =
		(QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			&& bPlanComparisonPrefersTightContinuation)
		|| (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred
			&& bPlanComparisonPrefersBroadRedirect);
	const FHyperTwistCoachSignal* QueueDeferredFirstSuppressionSignal =
		HyperTwistCoachDashboardWidgetInternal::FindCoachSignalById(
			CachedCoachSignals,
			TEXT("queue_suppression_deferred_first_continuation"));
	const bool bHasDeferredFirstQueueSuppressionSignal =
		QueueDeferredFirstSuppressionSignal != nullptr;
	const bool bCanLaunchQueueRecovery =
		CachedCoachPanelState.bCanStartQueuedRun
		|| (CachedCoachPanelState.bCanStartCoachFollowUpRun && CachedCoachPanelState.bHasFollowUpGuidance)
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	const bool bUpstreamPrefersPromoteRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryAction
		== EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred;
	const bool bUpstreamPrefersLaunchRecovery =
		CachedCoachPanelState.PreferredQueueRecoveryAction
		== EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
	const bool bPreferLaunchRecoveryAction =
		!FindFirstDeferredQueueEntryId().IsEmpty()
		&& bCanLaunchQueueRecovery
		&& !(bHasDeferredFirstQueueSuppressionSignal && bQueueRecoveryFollowUp)
		&& (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
			|| (!QueueRecoveryWeighting.IsStructurallyValid() && bUpstreamPrefersLaunchRecovery));
	const FString QueueRecoveryWeightingLabel =
		QueueRecoveryWeighting.PreferredActionKind
			== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::PromoteDeferred
			? TEXT("prefer promote-deferred recovery")
			: (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT("prefer launch-recovery")
				: TEXT("no learned preference"));
	const FString QueueRecoveryUpstreamActionLabel = bUpstreamPrefersPromoteRecovery
		? TEXT("prefer promote-deferred recovery")
		: (bUpstreamPrefersLaunchRecovery
			? TEXT("prefer launch-recovery")
			: TEXT("no upstream preference"));
	const FString QueueRecoveryMethodDrillStatus = [&]() -> FString
	{
		if (MethodDrillRecoveryPacketQueueBias.bHasSignal)
		{
			return MethodDrillRecoveryPacketQueueBias.LaunchRecoveryBias
					>= MethodDrillRecoveryPacketQueueBias.PromoteRecoveryBias
				? TEXT(" | Retained drill-recovery packet history is reinforcing launch recovery.")
				: TEXT(" | Retained drill-recovery packet history is reinforcing promote-deferred recovery.");
		}
		if (QueueRecoveryWeighting.bHasReliableAlignedTrustedPlanHandoffOutcomeSignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Aligned reliable trusted tight launched-plan outcomes are reinforcing launch recovery.")
				: TEXT(" | Aligned reliable trusted broad launched-plan outcomes are reinforcing promote-deferred recovery.");
		}
		if (QueueRecoveryWeighting.bHasReliableAlignedTrustedPlanOutcomeSignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Prior aligned reliable trusted tight plan recovery outcomes are reinforcing launch recovery.")
				: TEXT(" | Prior aligned reliable trusted broad plan recovery outcomes are reinforcing promote-deferred recovery.");
		}
		if (QueueRecoveryWeighting.bHasReliableTrustedPlanOutcomeSignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Prior reliable trusted tight plan recovery outcomes are reinforcing launch recovery.")
				: TEXT(" | Prior reliable trusted broad plan recovery outcomes are reinforcing promote-deferred recovery.");
		}
		if (bQueueRecoveryUsedPlanComparisonHistory)
		{
			if (QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery)
			{
				if (MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanSourceCount > 0)
				{
					return TEXT(" | Aligned reliable retained plan-alignment history is reinforcing trusted tight continuation recovery.");
				}
				return bHasReliableTrustedPlanComparisonHistory
					? TEXT(" | Reliable retained plan-alignment history is reinforcing trusted tight continuation recovery.")
					: TEXT(" | Retained plan-alignment history is reinforcing trusted tight continuation recovery.");
			}
			if (MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanSourceCount > 0)
			{
				return TEXT(" | Aligned reliable retained plan-alignment history is reinforcing trusted broad redirect recovery.");
			}
			return bHasReliableTrustedPlanComparisonHistory
				? TEXT(" | Reliable retained plan-alignment history is reinforcing trusted broad redirect recovery.")
				: TEXT(" | Retained plan-alignment history is reinforcing trusted broad redirect recovery.");
		}
		if (QueueRecoveryWeighting.bHasMethodDrillMemorySignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Upstream drill-driven recovery memory is reinforcing launch recovery.")
				: TEXT(" | Upstream drill-driven recovery memory is reinforcing promote-deferred recovery.");
		}
		if (QueueRecoveryWeighting.bHasMethodDrillOutcomeSignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Prior drill-weighted recovery outcomes are reinforcing launch recovery.")
				: TEXT(" | Prior drill-weighted recovery outcomes are reinforcing promote-deferred recovery.");
		}
		if (QueueRecoveryWeighting.bHasMethodDrillSignal)
		{
			return QueueRecoveryWeighting.PreferredActionKind
					== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT(" | Drill-driven accepted handoff history is reinforcing launch recovery.")
				: TEXT(" | Drill-driven accepted handoff history is present, but promote-deferred recovery still holds.");
		}
		return TEXT("");
	}();
	const bool bHasQueueRecoveryFriction =
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals
		|| CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals
		|| CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview
		|| CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork
		|| CachedCoachQueueExecutionSummary.bHasCompletionGap;
	const bool bHasClosedLoopIdleCoachActionability = IsCoachLoopActionabilityClosed();
	const bool bShouldPresentClosedLoopIdleDashboard =
		bHasClosedLoopIdleCoachActionability
		&& (
			bQueueRecoveryMemorySource
			|| !CachedCoachPanelState.PreferredGuidanceSourceLabel.IsEmpty()
			|| HandoffRecommendationKind
				!= HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None);
	FString QueueRecoveryStatusLine = bQueueRecoveryMemorySource
		? FString::Printf(
			TEXT("Recovery: %s lane | Source: %s | Action: %s | Mode: %s | Selection: %s | Upstream: %s | Learned: %s | Stance: %s%s%s"),
			*QueueRecoveryLaneLabel,
			*QueueRecoverySourceLabel,
			CachedCoachPanelState.PrimaryActionLabel.IsEmpty()
				? TEXT("n/a")
				: *CachedCoachPanelState.PrimaryActionLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedCoachPanelState.SuggestedMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedCoachPanelState.SuggestedSelectionPolicy),
			*QueueRecoveryUpstreamActionLabel,
			*QueueRecoveryWeightingLabel,
			*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
				QueueRecoveryMethodDrillMemoryBias),
			bHasDeferredFirstQueueSuppressionSignal && bQueueRecoveryFollowUp
				? TEXT(" | Deferred-first suppression is keeping narrowed follow-up recovery primary.")
				: TEXT(""),
			*QueueRecoveryMethodDrillStatus
		)
		: (bHasQueueRecoveryFriction
			? FString::Printf(
				TEXT("Recovery: queue friction is present, but no queue-memory recovery override is currently active | Upstream: %s | Learned: %s | Stance: %s%s%s"),
				*QueueRecoveryUpstreamActionLabel,
				*QueueRecoveryWeightingLabel,
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
					QueueRecoveryMethodDrillMemoryBias),
				bHasDeferredFirstQueueSuppressionSignal
					? TEXT(" | Deferred-first suppression is still visible in the live coaching signal.")
					: TEXT(""),
				*QueueRecoveryMethodDrillStatus
			)
			: FString::Printf(
				TEXT("Recovery: no queue-memory recovery override is currently active | Upstream: %s | Learned: %s | Stance: %s%s%s"),
				*QueueRecoveryUpstreamActionLabel,
				*QueueRecoveryWeightingLabel,
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
					QueueRecoveryMethodDrillMemoryBias),
				bHasDeferredFirstQueueSuppressionSignal
					? TEXT(" | Deferred-first suppression is still visible in the live coaching signal.")
					: TEXT(""),
				*QueueRecoveryMethodDrillStatus
			));
	const FString QueueRecoveryDeferredFirstDetail =
		bHasDeferredFirstQueueSuppressionSignal
			? FString::Printf(
				TEXT(" | Deferred-first suppression score %.2f | %s"),
				QueueDeferredFirstSuppressionSignal->Score,
				QueueDeferredFirstSuppressionSignal->Detail.IsEmpty()
					? TEXT("no signal detail")
					: *QueueDeferredFirstSuppressionSignal->Detail)
			: TEXT("");
	FString QueueRecoveryDetailLine = FString::Printf(
			TEXT("Deferred events %d | Promoted %d | Manual %d | Pressure %.2f | Dominant reason: %s | Follow-up deferrals: %s | Archive-aware deferrals: %s | Completion gap: %s | Upstream action source: %s%s || Learned promote %d/%d reduced, %d failed, avg delta %.2f | launch %d/%d reduced, %d failed, avg delta %.2f | deferred-first promote/launch reduced %d/%d over %d/%d | drill-driven outcome promote/launch reduced %d/%d over %d/%d | aligned reliable outcome promote/launch reduced %d/%d over %d/%d | reliable trusted outcome promote/launch reduced %d/%d over %d/%d | retained strong-launch %d/%d, weak-promote %d/%d | drill-driven bias promote/launch %d/%d | aligned reliable handoff-outcome bias promote/launch %d/%d | aligned reliable plan bias promote/launch %d/%d | reliable trusted plan bias promote/launch %d/%d | packet history queue/follow-up/recommended %d/%d/%d | packet-plan posture tight/broad %d/%d | plan-source tight aligned/diverged %d/%d | broad aligned/diverged %d/%d | aligned reliable tight aligned/diverged %d/%d | aligned reliable broad aligned/diverged %d/%d | reliable trusted tight aligned/diverged %d/%d | reliable trusted broad aligned/diverged %d/%d | plan preferred: %s | packet bias promote/launch %d/%d | upstream drill recovery strong/weak/history %d/%d/%d avg %.1f | aligned reliable outcome history tight/broad %d/%d avg %.1f/%.1f | aligned reliable plan history tight/broad %d/%d avg %.1f/%.1f | reliable trusted plan history tight/broad %d/%d avg %.1f/%.1f | retained drill-recovery stance: %s"),
		CachedCoachQueueExecutionSummary.DeferredEventCount,
		CachedCoachQueueExecutionSummary.PromotedEventCount,
		CachedCoachQueueExecutionSummary.ManualRescheduleEventCount,
		CachedCoachSchedulePolicySummary.ReschedulePressureScore,
		CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
			? TEXT("n/a")
			: *CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel,
		CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals ? TEXT("yes") : TEXT("no"),
		CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals ? TEXT("yes") : TEXT("no"),
		CachedCoachQueueExecutionSummary.bHasCompletionGap ? TEXT("yes") : TEXT("no"),
		*QueueRecoveryActionSourceLabel,
		*QueueRecoveryDeferredFirstDetail,
		QueueRecoveryWeighting.PromoteReducedCount,
		QueueRecoveryWeighting.PromoteCount,
		QueueRecoveryWeighting.PromoteFailureCount,
		QueueRecoveryWeighting.PromoteAveragePressureDelta,
		QueueRecoveryWeighting.LaunchReducedCount,
		QueueRecoveryWeighting.LaunchCount,
		QueueRecoveryWeighting.LaunchFailureCount,
		QueueRecoveryWeighting.LaunchAveragePressureDelta,
		QueueRecoveryWeighting.DeferredFirstPromoteReducedCount,
		QueueRecoveryWeighting.DeferredFirstLaunchReducedCount,
		QueueRecoveryWeighting.DeferredFirstPromoteCount,
		QueueRecoveryWeighting.DeferredFirstLaunchCount,
		QueueRecoveryWeighting.MethodDrillPromoteReducedCount,
		QueueRecoveryWeighting.MethodDrillLaunchReducedCount,
		QueueRecoveryWeighting.MethodDrillPromoteCount,
		QueueRecoveryWeighting.MethodDrillLaunchCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanPromoteReducedCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanLaunchReducedCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanPromoteCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanLaunchCount,
		QueueRecoveryWeighting.ReliableTrustedBroadPlanPromoteReducedCount,
		QueueRecoveryWeighting.ReliableTrustedTightPlanLaunchReducedCount,
		QueueRecoveryWeighting.ReliableTrustedBroadPlanPromoteCount,
		QueueRecoveryWeighting.ReliableTrustedTightPlanLaunchCount,
		QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchReducedCount,
		QueueRecoveryWeighting.StrongRetainedMethodDrillLaunchCount,
		QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteReducedCount,
		QueueRecoveryWeighting.WeakRetainedMethodDrillPromoteCount,
		QueueRecoveryWeighting.MethodDrillPromoteBiasCount,
		QueueRecoveryWeighting.MethodDrillLaunchBiasCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanOutcomeBiasCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanOutcomeBiasCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanBiasCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanBiasCount,
		QueueRecoveryWeighting.ReliableTrustedBroadPlanBiasCount,
		QueueRecoveryWeighting.ReliableTrustedTightPlanBiasCount,
		MethodDrillRecoveryPacketQueueBias.QueueEntryHistoryCount,
		MethodDrillRecoveryPacketQueueBias.FollowUpPacketHistoryCount,
		MethodDrillRecoveryPacketQueueBias.RecommendedBriefHistoryCount,
		MethodDrillRecoveryPacketQueueBias.TightContinuationPlanCount,
		MethodDrillRecoveryPacketQueueBias.BroadRedirectPlanCount,
		MethodDrillRecoveryPlanComparisonSummary.TightPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.TightPlanDivergedCount,
		MethodDrillRecoveryPlanComparisonSummary.BroadPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.BroadPlanDivergedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanDivergedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanDivergedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanDivergedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanAlignedCount,
		MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanDivergedCount,
		*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanComparisonPreference(
			MethodDrillRecoveryPlanComparisonSummary),
		MethodDrillRecoveryPacketQueueBias.PromoteRecoveryBias,
		MethodDrillRecoveryPacketQueueBias.LaunchRecoveryBias,
		QueueRecoveryWeighting.MethodDrillUpstreamStrongCount,
		QueueRecoveryWeighting.MethodDrillUpstreamWeakCount,
		QueueRecoveryWeighting.MethodDrillUpstreamHistoryCount,
		QueueRecoveryWeighting.MethodDrillUpstreamAverageOutcomeScore,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanHistoryCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanHistoryCount,
		QueueRecoveryWeighting.ReliableAlignedTrustedTightPlanAverageOutcomeScore,
		QueueRecoveryWeighting.ReliableAlignedTrustedBroadPlanAverageOutcomeScore,
		QueueRecoveryWeighting.ReliableTrustedTightPlanHistoryCount,
		QueueRecoveryWeighting.ReliableTrustedBroadPlanHistoryCount,
		QueueRecoveryWeighting.ReliableTrustedTightPlanAverageOutcomeScore,
		QueueRecoveryWeighting.ReliableTrustedBroadPlanAverageOutcomeScore,
		*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
			QueueRecoveryMethodDrillMemoryBias)
	);
	if (bQueueRecoveryUsedPlanComparisonHistory)
	{
		QueueRecoveryDetailLine += FString::Printf(
			TEXT(" | %splan-alignment trust tight/broad %d/%d is actively tipping %s"),
			bHasReliableTrustedPlanComparisonHistory ? TEXT("reliable ") : TEXT(""),
			MethodDrillRecoveryPlanTightTrust,
			MethodDrillRecoveryPlanBroadTrust,
			QueueRecoveryWeighting.PreferredActionKind
				== FHyperTwistCoachDashboardQueueRecoveryOutcome::EActionKind::LaunchRecovery
				? TEXT("trusted tight continuation recovery")
				: TEXT("trusted broad redirect recovery")
		);
	}
	if (bShouldPresentClosedLoopIdleDashboard)
	{
		RecommendedDeckPreviewLine =
			TEXT("Recommended guidance: no active recommended guidance; the coach-to-review loop is closed and idle.");
		FollowUpDeckPreviewLine =
			TEXT("Follow-up guidance: no active follow-up guidance; the coach-to-review loop is closed and idle.");
		GuidancePreferenceStatusLine =
			TEXT("Preference: the coach-to-review loop is closed and idle; no coach preview lane is active.");
		GuidancePreferenceDetailLine =
			TEXT("Preference detail: retained lane history remains inspectable, but no recommended or follow-up preview is currently active.");
		TransitionStatusLine =
			TEXT("Transition: the coach-to-review loop is closed and idle. No queued, follow-up, or recommended continuation remains.");
		ContinueRunLabel = TEXT("Loop Idle");
		QueuedRunLabel = TEXT("Queue Idle");
		FollowUpRunLabel = TEXT("Follow-Up Idle");
		RecommendedRunLabel = TEXT("Recommended Idle");
		QueueRecoveryStatusLine =
			TEXT("Recovery: closed and idle; no queue-memory recovery override is active.");
		QueueRecoveryDetailLine =
			TEXT("Recovery detail: no deferred queue work, no completion gap, and no actionable continuation remains in the retained handoff surface.");
		HandoffRecommendationKind = HyperTwistCoachDashboardWidgetInternal::EHandoffRecommendationKind::None;
		DisplayedCoachHandoffRecommendationKind = EHyperTwistTrainingCoachHandoffKind::None;
		bDisplayedCoachHandoffRecommendationUsedDeferredFirstSuppressionSignal = false;
		bDisplayedCoachHandoffRecommendationUsedMethodDrillWeighting = false;
		bDisplayedCoachHandoffRecommendationUsedAlignedTightPacketAcceptedHistory = false;
		bDisplayedCoachHandoffRecommendationUsedAlignedBroadPacketAcceptedHistory = false;
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedTightPacketOutcomeTrust = false;
		bDisplayedCoachHandoffRecommendationUsedAcceptedAlignedBroadPacketOutcomeTrust = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeTrust = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeTrust = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeAcceptedHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeAcceptedHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketExactOutcomeReliableHistory = false;
		bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketExactOutcomeReliableHistory = false;
		DisplayedCoachHandoffMethodDrillRecoveryMemoryStartActionSourceLabel.Reset();
		CoachHandoffStatusLine =
			TEXT("Coach handoff: closed and idle; no queued, follow-up, or recommended continuation is active.");
		CoachHandoffRecommendationStatusLine =
			TEXT("Handoff recommendation: none; the coach-to-review loop is idle.");
		CoachHandoffRecommendationDetailLine =
			TEXT("Handoff detail: retained closure history remains inspectable, but no queued, follow-up, or recommended continuation is active.");
	}
	DisplayedRecommendedDeckPreviewLine = RecommendedDeckPreviewLine;
	DisplayedFollowUpDeckPreviewLine = FollowUpDeckPreviewLine;
	DisplayedCoachHandoffRecommendationStatusLine = CoachHandoffRecommendationStatusLine;
	DisplayedCoachHandoffRecommendationDetailLine = CoachHandoffRecommendationDetailLine;
	DisplayedCoachHandoffStatusLine = CoachHandoffStatusLine;
	DisplayedTransitionStatusLine = TransitionStatusLine;
	DisplayedContinueRunLabel = ContinueRunLabel;
	DisplayedQueuedRunLabel = QueuedRunLabel;
	DisplayedFollowUpRunLabel = FollowUpRunLabel;
	DisplayedRecommendedRunLabel = RecommendedRunLabel;
	RecordCoachHandoffHistorySnapshot(
		HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
			HandoffRecommendationKind),
		CoachHandoffRecommendationStatusLine,
		CoachHandoffRecommendationDetailLine,
		CachedCoachPanelState.NextQueueSourceLabel,
		HandoffClosureBias.ContinuationBias,
		HandoffClosureBias.SuppressionBias,
		!bShouldPresentClosedLoopIdleDashboard && bQueueReadyForHandoff,
		!bShouldPresentClosedLoopIdleDashboard && bFollowUpReadyForHandoff,
		!bShouldPresentClosedLoopIdleDashboard && bRecommendedReadyForHandoff,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedDeferredFirstSuppressionSignal,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedMethodDrillWeighting,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedStrongRetainedMethodDrillRecoveryPosture,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedWeakRetainedMethodDrillRecoveryPosture,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableTrustedTightPlanHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableTrustedBroadPlanHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableAlignedTrustedTightPlanHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableAlignedTrustedBroadPlanHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableAlignedTrustedTightPlanOutcomeHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bHandoffRecommendationUsedReliableAlignedTrustedBroadPlanOutcomeHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedTightPacketOutcomeHistory,
		!bShouldPresentClosedLoopIdleDashboard
			&& bDisplayedCoachHandoffRecommendationUsedReliableAcceptedAlignedBroadPacketOutcomeHistory
	);
	RecordMethodDrillRecoveryMemoryHistorySnapshot(
		QueueRecoveryWeighting,
		QueueRecoveryStatusLine,
		HyperTwistCoachDashboardWidgetInternal::DescribeHandoffRecommendationKind(
			HandoffRecommendationKind),
		CoachHandoffRecommendationStatusLine,
		bHandoffRecommendationUsedMethodDrillRecoveryMemory,
		bShouldPresentClosedLoopIdleDashboard
	);
	const bool bHasPrimaryQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedPrimaryQueueCreation
		&& !CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason.IsEmpty();
	const bool bHasFollowUpQueueSuppression =
		CachedCoachSessionQueueSummary.bSuppressedFollowUpQueueCreation
		&& !CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason.IsEmpty();
	const FString QueueSuppressionDetailLine =
		bHasPrimaryQueueSuppression && bHasFollowUpQueueSuppression
			? FString::Printf(
				TEXT("Suppression: %s | %s"),
				*CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason,
				*CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason
			)
			: (bHasPrimaryQueueSuppression
				? FString::Printf(
					TEXT("Suppression: %s"),
					*CachedCoachSessionQueueSummary.PrimaryQueueSuppressionReason
				)
				: (bHasFollowUpQueueSuppression
					? FString::Printf(
						TEXT("Suppression: %s"),
						*CachedCoachSessionQueueSummary.FollowUpQueueSuppressionReason
					)
					: TEXT("Suppression: no recovery-driven queue entries are currently being omitted")));
	DisplayedQueueRecoveryStatusLine = QueueRecoveryStatusLine;
	DisplayedQueueRecoveryDetailLine = QueueRecoveryDetailLine;
	DisplayedQueueSuppressionDetailLine = QueueSuppressionDetailLine;
	const FHyperTwistCoachDashboardQueueSuppressionEntry* SelectedQueueSuppressionEntry =
		SelectedQueueSuppressionIndex >= 0
		&& SelectedQueueSuppressionIndex < QueueSuppressionHistoryEntries.Num()
		? &QueueSuppressionHistoryEntries[SelectedQueueSuppressionIndex]
		: nullptr;
	const FString SelectedQueueSuppressionLaneLabel =
		SelectedQueueSuppressionEntry != nullptr
		? (SelectedQueueSuppressionEntry->PreferredGuidanceLane
			== EHyperTwistTrainingCoachGuidanceLane::FollowUp
			? TEXT("follow-up")
			: (SelectedQueueSuppressionEntry->PreferredGuidanceLane
				== EHyperTwistTrainingCoachGuidanceLane::Recommended
				? TEXT("recommended")
				: TEXT("none")))
		: TEXT("none");
	const FString QueueSuppressionHistoryStatusLine =
		SelectedQueueSuppressionEntry != nullptr
		? FString::Printf(
			TEXT("Suppression history: %d entries | selected %d/%d | Lane: %s | Recovery: %s | Recorded: %s"),
			QueueSuppressionHistoryEntries.Num(),
			SelectedQueueSuppressionIndex + 1,
			QueueSuppressionHistoryEntries.Num(),
			*SelectedQueueSuppressionLaneLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedQueueSuppressionEntry->PreferredRecoveryAction
			),
			*SelectedQueueSuppressionEntry->RecordedAtUtc
		)
		: TEXT("Suppression history: no retained recovery-driven queue suppressions recorded yet.");
	const FString QueueSuppressionHistoryDetailLine =
		SelectedQueueSuppressionEntry != nullptr
		? FString::Printf(
			TEXT("Queue total %d | Ready %d | Pressure %.2f | Dominant reason: %s | Primary: %s | Follow-up: %s"),
			SelectedQueueSuppressionEntry->TotalQueueEntryCount,
			SelectedQueueSuppressionEntry->ReadyQueueEntryCount,
			SelectedQueueSuppressionEntry->PressureScore,
			SelectedQueueSuppressionEntry->DominantDeferralReasonLabel.IsEmpty()
				? TEXT("n/a")
				: *SelectedQueueSuppressionEntry->DominantDeferralReasonLabel,
			SelectedQueueSuppressionEntry->PrimaryQueueSuppressionReason.IsEmpty()
				? TEXT("not suppressed")
				: *SelectedQueueSuppressionEntry->PrimaryQueueSuppressionReason,
			SelectedQueueSuppressionEntry->FollowUpQueueSuppressionReason.IsEmpty()
				? TEXT("not suppressed")
				: *SelectedQueueSuppressionEntry->FollowUpQueueSuppressionReason
		)
		: TEXT("Suppression detail: when recovery-driven queue gating omits a competing follow-up or recommended lane, that omission will be retained here for later review.");
	const FString QueueRecoveryOutcomeStatusLine = !bHasQueueRecoveryOutcome || !QueueRecoveryOutcome.IsStructurallyValid()
		? TEXT("Outcome: no queue-recovery action has been applied yet.")
		: (!QueueRecoveryOutcome.bSucceeded
			? FString::Printf(
				TEXT("Outcome: %s failed | Source: %s"),
				*QueueRecoveryOutcome.AppliedActionLabel,
				QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel
			)
			: (QueueRecoveryOutcome.bReducedFriction
				? FString::Printf(
					TEXT("Outcome: %s reduced queue friction | Source: %s"),
					*QueueRecoveryOutcome.AppliedActionLabel,
					QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel
				)
				: (QueueRecoveryOutcome.bShiftedFriction
					? FString::Printf(
						TEXT("Outcome: %s shifted queue friction without a full reduction | Source: %s"),
						*QueueRecoveryOutcome.AppliedActionLabel,
						QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel
					)
					: FString::Printf(
						TEXT("Outcome: %s applied with no immediate friction change | Source: %s"),
						*QueueRecoveryOutcome.AppliedActionLabel,
						QueueRecoveryOutcome.SourceLabel.IsEmpty() ? TEXT("n/a") : *QueueRecoveryOutcome.SourceLabel
					))));
	const FString QueueRecoveryOutcomeDetailLine = !bHasQueueRecoveryOutcome || !QueueRecoveryOutcome.IsStructurallyValid()
		? TEXT("Outcome detail: apply a queue-recovery action to compare before/after pressure, deferred count, blocked follow-up state, and completion-gap state.")
		: FString::Printf(
			TEXT("Recorded: %s | Pressure %.2f -> %.2f | Deferred %d -> %d | Blocked follow-up %s -> %s | Outstanding deferred %s -> %s | Completion gap %s -> %s | deferred-first weighted: %s | drill-weighted: %s | packet-structure recovery: %s | retained posture: %s | reliable trusted plan recovery: %s"),
			*QueueRecoveryOutcome.RecordedAtUtc,
			QueueRecoveryOutcome.BeforePressureScore,
			QueueRecoveryOutcome.AfterPressureScore,
			QueueRecoveryOutcome.BeforeDeferredEventCount,
			QueueRecoveryOutcome.AfterDeferredEventCount,
			QueueRecoveryOutcome.bBeforeBlockedFollowUp ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bAfterBlockedFollowUp ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bBeforeOutstandingDeferred ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bAfterOutstandingDeferred ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bBeforeCompletionGap ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bAfterCompletionGap ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bUsedMethodDrillHandoffSignal ? TEXT("yes") : TEXT("no"),
			QueueRecoveryOutcome.bUsedNarrowMethodDrillPacketStructureRecovery
				? TEXT("narrow continuation")
				: (QueueRecoveryOutcome.bUsedBroadMethodDrillPacketStructureRecovery
					? TEXT("broad redirect")
					: TEXT("none")),
			*HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
				QueueRecoveryOutcome.bUsedStrongRetainedMethodDrillRecoveryPosture,
				QueueRecoveryOutcome.bUsedWeakRetainedMethodDrillRecoveryPosture),
			QueueRecoveryOutcome.bUsedReliableAlignedTrustedTightStructurePlanRecovery
				? TEXT("aligned reliable tight continuation")
				: (QueueRecoveryOutcome.bUsedReliableAlignedTrustedBroadStructurePlanRecovery
					? TEXT("aligned reliable broad redirect")
					: (QueueRecoveryOutcome.bUsedReliableTrustedTightStructurePlanRecovery
						? TEXT("trusted tight continuation")
						: (QueueRecoveryOutcome.bUsedReliableTrustedBroadStructurePlanRecovery
							? TEXT("trusted broad redirect")
							: TEXT("none"))))
		);
	TArray<int32> MethodDrillRecoveryHistoryIndices;
	HyperTwistCoachDashboardWidgetInternal::CollectMethodDrillRecoveryOutcomeIndices(
		QueueRecoveryOutcomeHistory,
		MethodDrillRecoveryHistoryIndices
	);
	const int32 SelectedMethodDrillRecoveryHistoryPosition =
		MethodDrillRecoveryHistoryIndices.IndexOfByKey(SelectedMethodDrillRecoveryOutcomeIndex);
	const FHyperTwistCoachDashboardQueueRecoveryOutcome* SelectedMethodDrillRecoveryOutcome =
		SelectedMethodDrillRecoveryOutcomeIndex >= 0
		&& SelectedMethodDrillRecoveryOutcomeIndex < QueueRecoveryOutcomeHistory.Num()
			? &QueueRecoveryOutcomeHistory[SelectedMethodDrillRecoveryOutcomeIndex]
			: nullptr;
	const FString MethodDrillRecoveryHistoryVerdictLine =
		SelectedMethodDrillRecoveryOutcome == nullptr || !SelectedMethodDrillRecoveryOutcome->IsStructurallyValid()
			? TEXT("n/a")
			: (!SelectedMethodDrillRecoveryOutcome->bSucceeded
				? TEXT("failed")
				: (SelectedMethodDrillRecoveryOutcome->bReducedFriction
					? TEXT("reduced friction")
					: (SelectedMethodDrillRecoveryOutcome->bShiftedFriction
						? TEXT("shifted friction")
						: TEXT("no immediate change"))));
	const FString MethodDrillRecoveryHistorySourceLine =
		SelectedMethodDrillRecoveryOutcome == nullptr
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedMethodDrillRecoveryOutcome->SourceLabel);
	const FString MethodDrillRecoveryHistoryStatusLine =
		SelectedMethodDrillRecoveryOutcome != nullptr
		&& SelectedMethodDrillRecoveryOutcome->IsStructurallyValid()
		&& SelectedMethodDrillRecoveryHistoryPosition != INDEX_NONE
			? FString::Printf(
				TEXT("Drill recovery history: %d entries | selected %d/%d | %s | %s | Packet recovery: %s | Stance: %s | Recorded: %s"),
				MethodDrillRecoveryHistoryIndices.Num(),
				SelectedMethodDrillRecoveryHistoryPosition + 1,
				MethodDrillRecoveryHistoryIndices.Num(),
				*SelectedMethodDrillRecoveryOutcome->AppliedActionLabel,
				*MethodDrillRecoveryHistoryVerdictLine,
				SelectedMethodDrillRecoveryOutcome->bUsedNarrowMethodDrillPacketStructureRecovery
					? TEXT("narrow continuation")
					: (SelectedMethodDrillRecoveryOutcome->bUsedBroadMethodDrillPacketStructureRecovery
						? TEXT("broad redirect")
						: TEXT("none")),
				*HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
					SelectedMethodDrillRecoveryOutcome->bUsedStrongRetainedMethodDrillRecoveryPosture,
					SelectedMethodDrillRecoveryOutcome->bUsedWeakRetainedMethodDrillRecoveryPosture),
				*SelectedMethodDrillRecoveryOutcome->RecordedAtUtc)
			: TEXT("Drill recovery history: no retained drill-weighted queue-recovery outcomes recorded yet.");
	const FString MethodDrillRecoveryHistoryDetailLine =
		SelectedMethodDrillRecoveryOutcome != nullptr
		&& SelectedMethodDrillRecoveryOutcome->IsStructurallyValid()
			? FString::Printf(
				TEXT("Source: %s | Pressure %.2f -> %.2f | Deferred %d -> %d | Blocked follow-up %s -> %s | Outstanding deferred %s -> %s | Completion gap %s -> %s | deferred-first weighted: %s | packet-structure recovery: %s | retained posture: %s"),
				*MethodDrillRecoveryHistorySourceLine,
				SelectedMethodDrillRecoveryOutcome->BeforePressureScore,
				SelectedMethodDrillRecoveryOutcome->AfterPressureScore,
				SelectedMethodDrillRecoveryOutcome->BeforeDeferredEventCount,
				SelectedMethodDrillRecoveryOutcome->AfterDeferredEventCount,
				SelectedMethodDrillRecoveryOutcome->bBeforeBlockedFollowUp ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bAfterBlockedFollowUp ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bBeforeOutstandingDeferred ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bAfterOutstandingDeferred ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bBeforeCompletionGap ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bAfterCompletionGap ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bUsedDeferredFirstSuppressionSignal ? TEXT("yes") : TEXT("no"),
				SelectedMethodDrillRecoveryOutcome->bUsedNarrowMethodDrillPacketStructureRecovery
					? TEXT("narrow continuation")
					: (SelectedMethodDrillRecoveryOutcome->bUsedBroadMethodDrillPacketStructureRecovery
						? TEXT("broad redirect")
						: TEXT("none")),
				*HyperTwistCoachDashboardWidgetInternal::DescribeRetainedMethodDrillRecoveryPosture(
					SelectedMethodDrillRecoveryOutcome->bUsedStrongRetainedMethodDrillRecoveryPosture,
					SelectedMethodDrillRecoveryOutcome->bUsedWeakRetainedMethodDrillRecoveryPosture))
			: TEXT("Drill recovery detail: when drill-weighted queue recovery actions are applied, their retained before/after friction outcomes will accumulate here for later comparison against generic recovery.");
	const FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry*
		SelectedMethodDrillRecoveryMemoryHistoryEntry =
			SelectedMethodDrillRecoveryMemoryHistoryIndex >= 0
			&& SelectedMethodDrillRecoveryMemoryHistoryIndex
				< MethodDrillRecoveryMemoryHistoryEntries.Num()
				? &MethodDrillRecoveryMemoryHistoryEntries[
					SelectedMethodDrillRecoveryMemoryHistoryIndex]
				: nullptr;
	const FString MethodDrillRecoveryMemoryActionLabel =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
		|| SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryAction
			== EHyperTwistTrainingQueueRecoveryAction::None
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryAction);
	const FString MethodDrillRecoveryMemorySourceLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
		|| SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryActionSourceLabel);
	const FString MethodDrillRecoveryMemoryDominantPressureLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			? TEXT("n/a")
			: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bStrongPressureDominant
				? TEXT("strong")
				: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bWeakPressureDominant
					? TEXT("weak")
					: TEXT("balanced")));
	const HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias
		SelectedMethodDrillRecoveryMemoryHistoryBias =
			SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
				? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None
				: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bStrongPressureDominant
					? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Strong
					: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bWeakPressureDominant
						? HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::Weak
						: HyperTwistCoachDashboardWidgetInternal::EMethodDrillRecoveryMemoryBias::None));
	const FString MethodDrillRecoveryMemoryGeneratedPacketKindLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("none")
			: SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketKindLabel;
	const FString MethodDrillRecoveryMemoryGeneratedPacketSourceLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketSourceLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketSourceLabel);
	const FString MethodDrillRecoveryMemoryGeneratedPacketHeadlineLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketHeadline.IsEmpty()
			? TEXT("n/a")
			: SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketHeadline;
	const FString MethodDrillRecoveryMemoryGeneratedPacketActionLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketActionLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketActionLabel;
	const FString MethodDrillRecoveryMemoryGeneratedPlanModeLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedPlanSuggestedMode);
	const FString MethodDrillRecoveryMemoryGeneratedPlanSelectionLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketKindLabel.IsEmpty()
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedPlanSuggestedSelectionPolicy);
	const FString MethodDrillRecoveryMemoryGeneratedPlanPostureLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedPlanPostureLabel.IsEmpty()
			? TEXT("n/a")
			: SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedPlanPostureLabel;
	const FString MethodDrillRecoveryMemoryPlanSourceLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			|| SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryActionSourceLabel.IsEmpty()
			? TEXT("none")
			: HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanSourceLabel(
				SelectedMethodDrillRecoveryMemoryHistoryEntry->PreferredRecoveryActionSourceLabel);
	const FString MethodDrillRecoveryMemoryPlanAlignmentLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			? TEXT("n/a")
			: HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanAlignment(
				*SelectedMethodDrillRecoveryMemoryHistoryEntry);
	const FString MethodDrillRecoveryMemoryGeneratedPacketStanceLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr
			? TEXT("n/a")
			: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture
				? TEXT("strong retained drill-recovery continuation")
				: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture
					? TEXT("weak retained drill-recovery redirect")
					: (SelectedMethodDrillRecoveryMemoryHistoryEntry->bGeneratedPacketUsedGenericMethodDrillRecoveryMemory
						? TEXT("generic drill-recovery memory")
						: TEXT("none"))));
	const FString MethodDrillRecoveryMemoryReliablePlanLine = [&]() -> FString
	{
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry == nullptr)
		{
			return TEXT("n/a");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableAlignedTrustedTightStructurePlanOutcomeDominant)
		{
			return TEXT("aligned reliable trusted tight launched-plan continuation");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableAlignedTrustedBroadStructurePlanOutcomeDominant)
		{
			return TEXT("aligned reliable trusted broad launched-plan redirect");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableAlignedTrustedTightStructurePlanDominant)
		{
			return TEXT("aligned reliable trusted tight continuation");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableAlignedTrustedBroadStructurePlanDominant)
		{
			return TEXT("aligned reliable trusted broad redirect");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableTrustedTightStructurePlanDominant)
		{
			return TEXT("reliable trusted tight continuation");
		}
		if (SelectedMethodDrillRecoveryMemoryHistoryEntry->bReliableTrustedBroadStructurePlanDominant)
		{
			return TEXT("reliable trusted broad redirect");
		}
		return TEXT("none");
	}();
	const FString MethodDrillRecoveryMemoryHistoryStatusLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry != nullptr
		&& SelectedMethodDrillRecoveryMemoryHistoryEntry->IsStructurallyValid()
			? FString::Printf(
				TEXT("Drill recovery memory history: %d entries | selected %d/%d | %s | %s | Packet: %s | Stance: %s | Plan source: %s | Plan align: %s | Reliable stance: %s | Plan: %s | Recorded: %s"),
				MethodDrillRecoveryMemoryHistoryEntries.Num(),
				SelectedMethodDrillRecoveryMemoryHistoryIndex + 1,
				MethodDrillRecoveryMemoryHistoryEntries.Num(),
				*MethodDrillRecoveryMemoryActionLabel,
				*SelectedMethodDrillRecoveryMemoryHistoryEntry->RecommendedHandoffKindLabel,
				*MethodDrillRecoveryMemoryGeneratedPacketKindLine,
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
					SelectedMethodDrillRecoveryMemoryHistoryBias),
				*MethodDrillRecoveryMemoryPlanSourceLine,
				*MethodDrillRecoveryMemoryPlanAlignmentLine,
				*MethodDrillRecoveryMemoryReliablePlanLine,
				*MethodDrillRecoveryMemoryGeneratedPlanPostureLine,
				*SelectedMethodDrillRecoveryMemoryHistoryEntry->RecordedAtUtc)
			: TEXT("Drill recovery memory history: no retained upstream drill-recovery memory shifts recorded yet.");
	const FString MethodDrillRecoveryMemoryHistoryDetailLine =
		SelectedMethodDrillRecoveryMemoryHistoryEntry != nullptr
		&& SelectedMethodDrillRecoveryMemoryHistoryEntry->IsStructurallyValid()
			? FString::Printf(
				TEXT("Source: %s | Strong/weak/history %d/%d/%d avg %.1f | Structure recovery narrow %d/%d broad %d/%d | Trusted plan history tight/broad %d/%d avg %.1f/%.1f | Aligned reliable plan outcome history tight/broad %d/%d avg %.1f/%.1f | Aligned reliable plan history tight/broad %d/%d avg %.1f/%.1f | Reliable trusted plan history tight/broad %d/%d avg %.1f/%.1f | Dominant pressure: %s | Structure bias: %s | Reliable stance: %s | Stance: %s | Recovery memory tipped: %s | Handoff memory tipped: %s | Packet kind: %s | Packet source: %s | Packet headline: %s | Packet action: %s | Packet focus %d | Plan mode: %s | Plan selection: %s | Plan posture: %s | Plan source: %s | Plan alignment: %s | Plan comparison tight aligned/diverged %d/%d broad aligned/diverged %d/%d aligned reliable tight aligned/diverged %d/%d aligned reliable broad aligned/diverged %d/%d reliable tight aligned/diverged %d/%d reliable broad aligned/diverged %d/%d | Plan preferred: %s | Tight/broad structure plan: %s/%s | Packet stance: %s | Recovery posture: %s | Handoff posture: %s"),
				*MethodDrillRecoveryMemorySourceLine,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->StrongMethodDrillRecoveryHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->WeakMethodDrillRecoveryHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->MethodDrillRecoveryHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->MethodDrillRecoveryAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->NarrowMethodDrillPacketStructureRecoveryLaunchCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->NarrowMethodDrillPacketStructureRecoveryLaunchReducedCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->BroadMethodDrillPacketStructureRecoveryPromoteCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->BroadMethodDrillPacketStructureRecoveryPromoteReducedCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->TrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->TrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->TrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->TrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeAverageScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanOutcomeAverageScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableAlignedTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableTrustedTightMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableTrustedBroadMethodDrillRecoveryStructurePlanHistoryCount,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableTrustedTightMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				SelectedMethodDrillRecoveryMemoryHistoryEntry
					->ReliableTrustedBroadMethodDrillRecoveryStructurePlanAverageOutcomeScore,
				*MethodDrillRecoveryMemoryDominantPressureLine,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->bNarrowPacketStructureRecoveryDominant
					? TEXT("narrow continuation")
					: (SelectedMethodDrillRecoveryMemoryHistoryEntry
							->bBroadPacketStructureRecoveryDominant
						? TEXT("broad redirect")
						: TEXT("none")),
				*MethodDrillRecoveryMemoryReliablePlanLine,
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryMemoryBias(
					SelectedMethodDrillRecoveryMemoryHistoryBias),
				SelectedMethodDrillRecoveryMemoryHistoryEntry->bUsedMethodDrillRecoveryMemoryForRecovery
					? TEXT("yes")
					: TEXT("no"),
				SelectedMethodDrillRecoveryMemoryHistoryEntry->bUsedMethodDrillRecoveryMemoryForHandoff
					? TEXT("yes")
					: TEXT("no"),
				*MethodDrillRecoveryMemoryGeneratedPacketKindLine,
				*MethodDrillRecoveryMemoryGeneratedPacketSourceLine,
				*MethodDrillRecoveryMemoryGeneratedPacketHeadlineLine,
				*MethodDrillRecoveryMemoryGeneratedPacketActionLine,
				SelectedMethodDrillRecoveryMemoryHistoryEntry->GeneratedGuidancePacketFocusCaseCount,
				*MethodDrillRecoveryMemoryGeneratedPlanModeLine,
				*MethodDrillRecoveryMemoryGeneratedPlanSelectionLine,
				*MethodDrillRecoveryMemoryGeneratedPlanPostureLine,
				*MethodDrillRecoveryMemoryPlanSourceLine,
				*MethodDrillRecoveryMemoryPlanAlignmentLine,
				MethodDrillRecoveryPlanComparisonSummary.TightPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.TightPlanDivergedCount,
				MethodDrillRecoveryPlanComparisonSummary.BroadPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.BroadPlanDivergedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedTightPlanDivergedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableAlignedTrustedBroadPlanDivergedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedTightPlanDivergedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanAlignedCount,
				MethodDrillRecoveryPlanComparisonSummary.ReliableTrustedBroadPlanDivergedCount,
				*HyperTwistCoachDashboardWidgetInternal::DescribeMethodDrillRecoveryPlanComparisonPreference(
					MethodDrillRecoveryPlanComparisonSummary),
				SelectedMethodDrillRecoveryMemoryHistoryEntry
						->bGeneratedPlanUsedTightStructureContinuationPosture
					? TEXT("yes")
					: TEXT("no"),
				SelectedMethodDrillRecoveryMemoryHistoryEntry
						->bGeneratedPlanUsedBroadStructureRedirectPosture
					? TEXT("yes")
					: TEXT("no"),
				*MethodDrillRecoveryMemoryGeneratedPacketStanceLine,
				*SelectedMethodDrillRecoveryMemoryHistoryEntry->QueueRecoveryStatusLine,
				*SelectedMethodDrillRecoveryMemoryHistoryEntry->HandoffRecommendationStatusLine)
			: TEXT("Drill recovery memory detail: retained upstream strong-vs-weak drill-recovery pressure, resulting generated packet lane, and resulting plan-source vs generated-plan alignment will accumulate here for later comparison.");
	const FString PreferredDeferredRecoveryEntryId = FindFirstDeferredQueueEntryId();
	const bool bCanApplyQueueRecovery =
		!bShouldPresentClosedLoopIdleDashboard
		&& !bHasLiveAttemptTimer
		&& (bQueueRecoveryMemorySource || bHasQueueRecoveryFriction)
		&& (!PreferredDeferredRecoveryEntryId.IsEmpty()
			|| CachedCoachPanelState.bCanStartQueuedRun
			|| (bQueueRecoveryFollowUp
				&& CachedCoachPanelState.bCanStartCoachFollowUpRun
				&& CachedCoachPanelState.bHasFollowUpGuidance)
			|| (bQueueRecoveryRecommended
				&& CachedCoachPanelState.bCanStartCoachRecommendedRun)
			|| (!bQueueRecoveryMemorySource
				&& (CachedCoachPanelState.bCanStartCoachFollowUpRun
					|| CachedCoachPanelState.bCanStartCoachRecommendedRun)));
	const FString QueueRecoveryActionLabel =
		bShouldPresentClosedLoopIdleDashboard
		? TEXT("No Recovery Action")
		: (!PreferredDeferredRecoveryEntryId.IsEmpty() && !bPreferLaunchRecoveryAction
		? (bQueueRecoveryFollowUp
			? TEXT("Promote Follow-Up Recovery")
			: (bQueueRecoveryRecommended
				? TEXT("Promote Recommended Recovery")
				: TEXT("Promote Recovery")))
		: (bQueueRecoveryFollowUp
			? TEXT("Start Follow-Up Recovery")
			: (bQueueRecoveryRecommended
				? TEXT("Start Recommended Recovery")
				: (CachedCoachPanelState.bCanStartQueuedRun
					? TEXT("Launch Queue Recovery")
					: TEXT("Apply Recovery")))));
	FString GuidancePreviewSelectionLine =
		SelectedGuidancePreviewCase != nullptr && ActivePreviewDeck != nullptr
		? FString::Printf(
			TEXT("Active preview: %s | case %d/%d | deck %s"),
			*ActivePreviewLaneLabel,
			SelectedGuidancePreviewCaseIndex + 1,
			ActivePreviewDeck->Cases.Num(),
			ActivePreviewDeck->Title.IsEmpty() ? *ActivePreviewDeck->DeckId : *ActivePreviewDeck->Title
		)
		: FString::Printf(TEXT("Active preview: %s | build a coach deck preview to inspect specific cases"), *ActivePreviewLaneLabel);
	FString GuidancePreviewCaseDetailLine =
		SelectedGuidancePreviewCase != nullptr
		? FString::Printf(
			TEXT("Preview case: %s | Prompt: %s | Kind: %s | Subset: %s | Target: %d ms | Scramble: %s | Canonical: %s"),
			SelectedGuidancePreviewCase->CaseId.IsEmpty() ? TEXT("n/a") : *SelectedGuidancePreviewCase->CaseId,
			SelectedGuidancePreviewCase->PromptLabel.IsEmpty() ? TEXT("n/a") : *SelectedGuidancePreviewCase->PromptLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedGuidancePreviewCase->PromptKind),
			SelectedGuidancePreviewCase->SubsetId.IsEmpty() ? TEXT("n/a") : *SelectedGuidancePreviewCase->SubsetId,
			SelectedGuidancePreviewCase->TimeTargetMs,
			SelectedGuidancePreviewCase->ScrambleNotation.IsEmpty() ? TEXT("n/a") : *SelectedGuidancePreviewCase->ScrambleNotation,
			SelectedGuidancePreviewCase->CanonicalNotation.IsEmpty() ? TEXT("n/a") : *SelectedGuidancePreviewCase->CanonicalNotation
		)
		: TEXT("Preview case: none selected yet.");
	bool bSelectedPreviewCaseIsExplicitFocus = false;
	int32 SelectedPreviewCaseSignalCount = 0;
	FString SelectedPreviewCaseSignalLine = TEXT("none");
	FString SignalSummaryLine = TEXT("none");
	if (ActivePreviewBrief != nullptr)
	{
		if (SelectedGuidancePreviewCase != nullptr)
		{
			bSelectedPreviewCaseIsExplicitFocus =
				ActivePreviewBrief->FocusCaseIds.Contains(SelectedGuidancePreviewCase->CaseId);
		}

		TArray<FString> SignalSummaryParts;
		SignalSummaryParts.Reserve(FMath::Min(ActivePreviewBrief->Signals.Num(), 2));
		for (const FHyperTwistCoachSignal& Signal : ActivePreviewBrief->Signals)
		{
			if (SelectedGuidancePreviewCase != nullptr
				&& Signal.SuggestedCaseIds.Contains(SelectedGuidancePreviewCase->CaseId))
			{
				++SelectedPreviewCaseSignalCount;
				if (SelectedPreviewCaseSignalLine == TEXT("none"))
				{
					SelectedPreviewCaseSignalLine = FString::Printf(
						TEXT("%s | %s"),
						Signal.Headline.IsEmpty() ? TEXT("signal") : *Signal.Headline,
						Signal.Detail.IsEmpty() ? TEXT("no detail") : *Signal.Detail
					);
				}
			}

			if (SignalSummaryParts.Num() < 2)
			{
				SignalSummaryParts.Add(FString::Printf(
					TEXT("%s (%.2f)"),
					Signal.Headline.IsEmpty() ? TEXT("signal") : *Signal.Headline,
					Signal.Score
				));
			}
		}

		if (SignalSummaryParts.Num() > 0)
		{
			SignalSummaryLine = FString::Join(SignalSummaryParts, TEXT(" | "));
		}
	}
	FString GuidanceRationaleStatusLine =
		ActivePreviewBrief != nullptr
		? FString::Printf(
			TEXT("Rationale: %s lane | Priority: %s (%.2f) | Focus: %s | Mode: %s | Selection: %s"),
			*ActivePreviewLaneLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ActivePreviewBrief->Priority),
			ActivePreviewBrief->PriorityScore,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ActivePreviewBrief->FocusLane),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ActivePreviewBrief->SuggestedMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ActivePreviewBrief->SuggestedSelectionPolicy)
		)
		: FString::Printf(
			TEXT("Rationale: %s lane | build a recommended or follow-up preview to inspect the coach rationale"),
			*ActivePreviewLaneLabel
		);
	FString GuidanceRationaleDetailLine =
		ActivePreviewBrief != nullptr
		? FString::Printf(
			TEXT("Brief: %s | Action: %s | Deck: %s | Method: %s | Focus cases: %d | Review: %s | Cadence: %s | Variety: %s | Guidance source: %s | Launch bias: %s from %s | broadened/tightened history %d/%d | deferred tightened launches %d | deferred launch cases %d%s | Selected focus: %s | Matching signals: %d | Case signal: %s | Top signals: %s"),
			ActivePreviewBrief->Headline.IsEmpty() ? TEXT("n/a") : *ActivePreviewBrief->Headline,
			ActivePreviewBrief->PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : *ActivePreviewBrief->PrimaryActionLabel,
			ActivePreviewBrief->FocusDeckId.IsEmpty() ? TEXT("n/a") : *ActivePreviewBrief->FocusDeckId,
			ActivePreviewBrief->FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *ActivePreviewBrief->FocusMethodSegmentId,
			ActivePreviewBrief->FocusCaseIds.Num(),
			ActivePreviewBrief->bNeedsCoachReview ? TEXT("yes") : TEXT("no"),
			ActivePreviewBrief->bNeedsCadenceRecovery ? TEXT("yes") : TEXT("no"),
			ActivePreviewBrief->bNeedsVarietyRotation ? TEXT("yes") : TEXT("no"),
			*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredGuidanceSourceLabel),
			*HyperTwistCoachDashboardWidgetInternal::DescribeLaunchBudgetBias(
				CachedCoachPanelState.PreferredLaunchBudgetBias),
			*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				CachedCoachPanelState.PreferredLaunchBudgetSourceLabel),
			CachedCoachPanelState.BroadenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.TightenedLaunchBudgetHistoryCount,
			CachedCoachPanelState.DeferredTightenedLaunchHistoryCount,
			CachedCoachPanelState.DeferredLaunchHistoryCaseCount,
			CachedCoachPanelState.PreferredLaunchBudgetSourceLabel
				== TEXT("recommendation-history-deferred-tightened-launch")
				? TEXT(" | This preview is being shaped by remembered deferred overflow continuation.")
				: TEXT(""),
			bSelectedPreviewCaseIsExplicitFocus ? TEXT("yes") : TEXT("no"),
			SelectedPreviewCaseSignalCount,
			*SelectedPreviewCaseSignalLine,
			*SignalSummaryLine
		)
		: TEXT("Rationale detail: unavailable until a guidance preview lane is active.");
	if (bShouldPresentClosedLoopIdleDashboard)
	{
		GuidancePreviewSelectionLine =
			TEXT("Active preview: none | the coach-to-review loop is closed and idle.");
		GuidancePreviewCaseDetailLine =
			TEXT("Preview case: no active guidance preview remains in the closed-loop idle state.");
		GuidanceRationaleStatusLine =
			TEXT("Rationale: closed-loop idle state | no active guidance preview remains.");
		GuidanceRationaleDetailLine =
			TEXT("Rationale detail: retained coach memory and history remain available for inspection, but no live preview packet is active.");
	}
	const FString GuidanceComparisonLaneLabel =
		DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
		? TEXT("recommended")
		: (DisplayedGuidanceComparisonLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
			? TEXT("follow-up")
			: TEXT("none"));
	const bool bDisplayedComparisonSelectedCaseMatchesLastCase =
		DisplayedRunRecap != nullptr
		&& !DisplayedGuidanceComparisonSelectedCaseId.IsEmpty()
		&& DisplayedRunRecap->LastCaseId == DisplayedGuidanceComparisonSelectedCaseId;
	const int32 GuidanceComparisonExpectedCaseCount =
		DisplayedGuidanceComparisonDeck != nullptr ? DisplayedGuidanceComparisonDeck->Cases.Num() : 0;
	FString GuidanceComparisonStatusLine =
		DisplayedRunRecap != nullptr
		&& DisplayedGuidanceComparisonBrief != nullptr
		&& DisplayedGuidanceComparisonDeck != nullptr
		? FString::Printf(
			TEXT("Comparison: %s recap vs %s preview | Scope: %s | Focus lane: %s | Expected cases: %d | Completed attempts: %d | Success rate: %.2f"),
			*RunRecapSourceLabel,
			*GuidanceComparisonLaneLabel,
			bDisplayedGuidanceComparisonSingleCase ? TEXT("selected case") : TEXT("full preview deck"),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedGuidanceComparisonBrief->FocusLane),
			GuidanceComparisonExpectedCaseCount,
			DisplayedRunRecap->CompletedAttemptCount,
			DisplayedRunRecap->SuccessRate
		)
		: TEXT("Comparison: complete a run launched from previewed guidance to compare the recap against the original coach intent.");
	FString GuidanceComparisonDetailLine =
		DisplayedRunRecap != nullptr
		&& DisplayedGuidanceComparisonBrief != nullptr
		&& DisplayedGuidanceComparisonDeck != nullptr
		? FString::Printf(
			TEXT("Launch brief: %s | Action: %s | Preview deck: %s | Actual deck: %s | Mode expected/actual: %s / %s | Selection expected/actual: %s / %s | Selected case: %s | Last case matched: %s | Focus cases: %d | Last case: %s"),
			DisplayedGuidanceComparisonBrief->Headline.IsEmpty() ? TEXT("n/a") : *DisplayedGuidanceComparisonBrief->Headline,
			DisplayedGuidanceComparisonBrief->PrimaryActionLabel.IsEmpty() ? TEXT("n/a") : *DisplayedGuidanceComparisonBrief->PrimaryActionLabel,
			DisplayedGuidanceComparisonDeck->Title.IsEmpty() ? *DisplayedGuidanceComparisonDeck->DeckId : *DisplayedGuidanceComparisonDeck->Title,
			DisplayedRunRecapDeck != nullptr
				? (DisplayedRunRecapDeck->Title.IsEmpty() ? *DisplayedRunRecapDeck->DeckId : *DisplayedRunRecapDeck->Title)
				: TEXT("n/a"),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedGuidanceComparisonBrief->SuggestedMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecapMode),
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedGuidanceComparisonBrief->SuggestedSelectionPolicy),
			DisplayedRunRecapDeck != nullptr
				? *HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecapDeck->SelectionPolicy)
				: TEXT("n/a"),
			DisplayedGuidanceComparisonSelectedCaseId.IsEmpty() ? TEXT("n/a") : *DisplayedGuidanceComparisonSelectedCaseId,
			bDisplayedComparisonSelectedCaseMatchesLastCase ? TEXT("yes") : TEXT("no"),
			DisplayedGuidanceComparisonBrief->FocusCaseIds.Num(),
			DisplayedRunRecap->LastCaseId.IsEmpty() ? TEXT("n/a") : *DisplayedRunRecap->LastCaseId
		)
		: TEXT("Comparison detail: no preview-launched recap is currently selected.");
	if (bHasClosedLoopIdleCoachActionability
		&& (DisplayedRunRecap == nullptr
			|| DisplayedGuidanceComparisonBrief == nullptr
			|| DisplayedGuidanceComparisonDeck == nullptr))
	{
		GuidanceComparisonStatusLine =
			TEXT("Comparison: retained comparison history remains inspectable, but no preview-launched recap is currently selected in the closed-loop idle state.");
		GuidanceComparisonDetailLine =
			TEXT("Comparison detail: the coach-to-review loop is closed and idle, so no live recommended or follow-up comparison target remains active.");
	}
	const int32 DisplayedGuidanceComparisonNonSuccessCount =
		DisplayedRunRecap != nullptr
		? (DisplayedRunRecap->FailureCount + DisplayedRunRecap->TimeoutCount + DisplayedRunRecap->DNFCount)
		: 0;
	FString GuidanceOutcomeStatusLine =
		TEXT("Outcome: complete a run launched from previewed guidance to derive a repeat, broaden, or redirect verdict.");
	FString GuidanceOutcomeDetailLine =
		TEXT("Outcome detail: no preview-launched recap is currently selected.");
	if (DisplayedRunRecap != nullptr
		&& DisplayedGuidanceComparisonBrief != nullptr
		&& DisplayedGuidanceComparisonDeck != nullptr
		&& DisplayedRunRecap->CompletedAttemptCount > 0)
	{
		if (bDisplayedGuidanceComparisonSingleCase)
		{
			if (DisplayedRunRecap->SuccessRate >= 0.85f
				&& DisplayedRunRecap->TimeoutCount == 0
				&& DisplayedRunRecap->DNFCount == 0
				&& DisplayedRunRecap->TotalMistakes <= 1)
			{
				GuidanceOutcomeStatusLine =
					TEXT("Outcome: broaden guidance. The selected case looks stable enough to expand back to the wider preview deck.");
				GuidanceOutcomeDetailLine = FString::Printf(
					TEXT("Recommendation: move from the single-case launch into the broader %s preview deck or the next coach-directed handoff. Success rate %.2f across %d completed attempts with %d mistakes."),
					*GuidanceComparisonLaneLabel,
					DisplayedRunRecap->SuccessRate,
					DisplayedRunRecap->CompletedAttemptCount,
					DisplayedRunRecap->TotalMistakes
				);
			}
			else if (DisplayedRunRecap->SuccessRate >= 0.5f)
			{
				GuidanceOutcomeStatusLine =
					TEXT("Outcome: stabilize, then broaden. The selected case is moving, but it is not yet clean enough for a wider shift.");
				GuidanceOutcomeDetailLine = FString::Printf(
					TEXT("Recommendation: repeat the selected preview case or a very small scope before broadening. Success rate %.2f with %d non-success outcomes and %d mistakes."),
					DisplayedRunRecap->SuccessRate,
					DisplayedGuidanceComparisonNonSuccessCount,
					DisplayedRunRecap->TotalMistakes
				);
			}
			else
			{
				GuidanceOutcomeStatusLine =
					TEXT("Outcome: repeat selected focus. The previewed case is still weak enough that broadening would be premature.");
				GuidanceOutcomeDetailLine = FString::Printf(
					TEXT("Recommendation: stay on the selected preview case until the recap is cleaner. Success rate %.2f with %d non-success outcomes and %d mistakes."),
					DisplayedRunRecap->SuccessRate,
					DisplayedGuidanceComparisonNonSuccessCount,
					DisplayedRunRecap->TotalMistakes
				);
			}
		}
		else if (DisplayedRunRecap->SuccessRate >= 0.8f
			&& DisplayedGuidanceComparisonNonSuccessCount <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 4)
			&& DisplayedRunRecap->TotalMistakes <= FMath::Max(1, DisplayedRunRecap->CompletedAttemptCount / 2))
		{
			GuidanceOutcomeStatusLine =
				TEXT("Outcome: change guidance. The full preview deck looks stable enough to move on from this exact focus.");
			GuidanceOutcomeDetailLine = FString::Printf(
				TEXT("Recommendation: use follow-up, queued, or recommended coach handoff rather than repeating the same deck. Success rate %.2f across %d completed attempts with %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				DisplayedRunRecap->CompletedAttemptCount,
				DisplayedRunRecap->TotalMistakes
			);
		}
		else if (DisplayedRunRecap->SuccessRate >= 0.55f)
		{
			GuidanceOutcomeStatusLine =
				TEXT("Outcome: repeat and stabilize. The deck is moving, but not cleanly enough to abandon this scope.");
			GuidanceOutcomeDetailLine = FString::Printf(
				TEXT("Recommendation: repeat the preview deck or stay near this focus before changing guidance. Success rate %.2f with %d non-success outcomes and %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				DisplayedGuidanceComparisonNonSuccessCount,
				DisplayedRunRecap->TotalMistakes
			);
		}
		else
		{
			GuidanceOutcomeStatusLine =
				TEXT("Outcome: narrow or redirect guidance. The broad preview scope is still too unstable.");
			GuidanceOutcomeDetailLine = FString::Printf(
				TEXT("Recommendation: narrow back to a smaller focus case set or switch guidance lanes before repeating the full deck. Success rate %.2f with %d non-success outcomes and %d mistakes."),
				DisplayedRunRecap->SuccessRate,
				DisplayedGuidanceComparisonNonSuccessCount,
				DisplayedRunRecap->TotalMistakes
			);
		}
	}
	const EHyperTwistCoachDashboardOutcomeAction BaseGuidanceOutcomeAction = DeriveGuidanceOutcomeAction();
	const FHyperTwistCoachDashboardDecisionWeighting GuidanceDecisionWeighting =
		BuildGuidanceDecisionWeighting(BaseGuidanceOutcomeAction);
	const EHyperTwistCoachDashboardOutcomeAction GuidanceOutcomeAction =
		GuidanceDecisionWeighting.WeightedAction != EHyperTwistCoachDashboardOutcomeAction::None
			? GuidanceDecisionWeighting.WeightedAction
			: BaseGuidanceOutcomeAction;
	if (GuidanceDecisionWeighting.bUsedClosureHistorySignal)
	{
		GuidanceOutcomeStatusLine += TEXT(" Closure-recovery history adjusted this recommendation.");
	}
	if (GuidanceDecisionWeighting.bUsedDeferredOverflowSignal)
	{
		GuidanceOutcomeStatusLine +=
			TEXT(" Deferred-overflow continuation history adjusted this recommendation.");
	}
	const bool bCanRedirectGuidanceOutcome =
		CachedCoachPanelState.bCanStartCoachFollowUpRun
		|| CachedCoachPanelState.bCanStartQueuedRun
		|| CachedCoachPanelState.bCanStartCoachRecommendedRun;
	bool bCanApplyGuidanceOutcomeAction =
		GuidanceOutcomeAction != EHyperTwistCoachDashboardOutcomeAction::None
		&& !bHasLiveAttemptTimer
		&& (!bHasActiveRun
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Completed
			|| CachedRunState.Session.SessionState == EHyperTwistTrainingSessionState::Aborted)
		&& (GuidanceOutcomeAction != EHyperTwistCoachDashboardOutcomeAction::RedirectCoachGuidance
			|| bCanRedirectGuidanceOutcome);
	FString GuidanceOutcomeActionLabel = BuildGuidanceOutcomeActionLabel(GuidanceOutcomeAction);
	FString GuidanceDecisionWeightingStatusLine =
		GuidanceDecisionWeighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Weighting: %d matching decisions | Base: %s | Weighted: %s | Last applied: %s"),
			GuidanceDecisionWeighting.MatchingDecisionCount,
			*BuildGuidanceOutcomeActionLabel(GuidanceDecisionWeighting.BaseAction),
			*BuildGuidanceOutcomeActionLabel(GuidanceDecisionWeighting.WeightedAction),
			*BuildGuidanceOutcomeActionLabel(GuidanceDecisionWeighting.LastAppliedAction)
		)
		: TEXT("Weighting: no matching authored decision history yet; the current outcome action is recap-derived only.");
	FString GuidanceDecisionWeightingDetailLine =
		GuidanceDecisionWeighting.IsStructurallyValid()
		? FString::Printf(
			TEXT("Decision weighting for this lane/scope: repeat case %d | repeat deck %d | broaden %d | redirect %d | Avg success %.2f | Avg launch cases %.2f | broadened launches %d (avg %.2f) | tightened launches %d (avg %.2f) | Closure continue bias %d | Closure suppress bias %d | Deferred overflow bias %d | Deferred overflow cases %d | %s"),
			GuidanceDecisionWeighting.RepeatSelectedCaseCount,
			GuidanceDecisionWeighting.RepeatPreviewDeckCount,
			GuidanceDecisionWeighting.BroadenPreviewDeckCount,
			GuidanceDecisionWeighting.RedirectCoachGuidanceCount,
			GuidanceDecisionWeighting.AverageSuccessRate,
			GuidanceDecisionWeighting.AverageLaunchCaseCount,
			GuidanceDecisionWeighting.BroadenedLaunchCount,
			GuidanceDecisionWeighting.BroadenedLaunchAverageSuccessRate,
			GuidanceDecisionWeighting.TightenedLaunchCount,
			GuidanceDecisionWeighting.TightenedLaunchAverageSuccessRate,
			GuidanceDecisionWeighting.ClosureContinuationBias,
			GuidanceDecisionWeighting.ClosureSuppressionBias,
			GuidanceDecisionWeighting.DeferredOverflowContinuationBias,
			GuidanceDecisionWeighting.DeferredOverflowCaseCount,
			GuidanceDecisionWeighting.bHasOverride
				? (GuidanceDecisionWeighting.bUsedDeferredOverflowSignal
					? TEXT("Deferred-overflow continuation history and authored choices adjusted the current guidance-outcome action.")
					: (GuidanceDecisionWeighting.bUsedClosureHistorySignal
						? TEXT("Recent closure-recovery history and authored choices adjusted the current guidance-outcome action.")
						: TEXT("Recent authored choices adjusted the current guidance-outcome action.")))
				: TEXT("Recent authored choices reinforced the recap-derived guidance-outcome action.")
		)
		: TEXT("Weighting detail: apply outcome actions on the same guidance lane and scope to let the dashboard bias future recommendations.");
	if (GuidanceDecisionWeighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
		|| GuidanceDecisionWeighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
		|| GuidanceDecisionWeighting.ReliableAlignedTrustedTightContinuationDecisionCount > 0
		|| GuidanceDecisionWeighting.ReliableAlignedTrustedBroadRedirectDecisionCount > 0)
	{
		GuidanceDecisionWeightingDetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f, continuation decisions %d) | broad history %d (avg %.2f, redirect decisions %d)%s"),
			GuidanceDecisionWeighting.ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			GuidanceDecisionWeighting.ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			GuidanceDecisionWeighting.ReliableAlignedTrustedTightContinuationDecisionCount,
			GuidanceDecisionWeighting.ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			GuidanceDecisionWeighting.ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			GuidanceDecisionWeighting.ReliableAlignedTrustedBroadRedirectDecisionCount,
			GuidanceDecisionWeighting.bUsedReliableAlignedPlanOutcomeSignal
				? TEXT(" | Aligned launched-plan trust adjusted the current guidance-outcome action.")
				: TEXT("")
		);
	}
	if (bHasClosedLoopIdleCoachActionability)
	{
		GuidanceOutcomeStatusLine =
			TEXT("Outcome: retained comparison history remains inspectable, but the coach-to-review loop is closed and idle.");
		GuidanceOutcomeDetailLine =
			TEXT("Outcome detail: no live repeat, broaden, or redirect action remains while the closed-loop idle boundary holds.");
		GuidanceOutcomeActionLabel = TEXT("Loop Idle");
		bCanApplyGuidanceOutcomeAction = false;
		GuidanceDecisionWeightingStatusLine =
			TEXT("Weighting: retained outcome history remains inspectable, but no live guidance-outcome action is active.");
		GuidanceDecisionWeightingDetailLine =
			TEXT("Weighting detail: closed-loop idle preserves authored outcome history for review, but it is not surfacing another repeat, broaden, or redirect action.");
	}
	const FHyperTwistCoachDashboardDecisionHistoryEntry* SelectedGuidanceDecisionEntry =
		SelectedGuidanceDecisionIndex >= 0
		&& SelectedGuidanceDecisionIndex < GuidanceDecisionHistoryEntries.Num()
		? &GuidanceDecisionHistoryEntries[SelectedGuidanceDecisionIndex]
		: nullptr;
	const FString GuidanceDecisionLaneLabel =
		SelectedGuidanceDecisionEntry != nullptr
		? (SelectedGuidanceDecisionEntry->GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::Recommended
			? TEXT("recommended")
			: (SelectedGuidanceDecisionEntry->GuidanceLane == EHyperTwistCoachDashboardGuidancePreviewLane::FollowUp
				? TEXT("follow-up")
				: TEXT("none")))
		: TEXT("none");
	FString GuidanceDecisionHistoryStatusLine =
		SelectedGuidanceDecisionEntry != nullptr
		? FString::Printf(
			TEXT("Decision history: %d entries | selected %d/%d | Lane: %s | Scope: %s | Recorded: %s"),
			GuidanceDecisionHistoryEntries.Num(),
			SelectedGuidanceDecisionIndex + 1,
			GuidanceDecisionHistoryEntries.Num(),
			*GuidanceDecisionLaneLabel,
			SelectedGuidanceDecisionEntry->bSingleCaseScope ? TEXT("selected case") : TEXT("preview deck"),
			*SelectedGuidanceDecisionEntry->RecordedAtUtc
		)
		: TEXT("Decision history: no applied guidance-outcome decisions recorded yet.");
	FString GuidanceDecisionHistoryDetailLine =
		SelectedGuidanceDecisionEntry != nullptr
		? FString::Printf(
			TEXT("Session: %s | Brief: %s | Recommended: %s | Applied: %s | Selected case: %s | Launch cases: %d/%d | Scope: %s | Success rate: %.2f | Completed attempts: %d | Mistakes: %d | Budget reason: %s"),
			*SelectedGuidanceDecisionEntry->SourceSessionId,
			SelectedGuidanceDecisionEntry->BriefHeadline.IsEmpty() ? TEXT("n/a") : *SelectedGuidanceDecisionEntry->BriefHeadline,
			*SelectedGuidanceDecisionEntry->RecommendedActionLabel,
			*SelectedGuidanceDecisionEntry->AppliedActionLabel,
			SelectedGuidanceDecisionEntry->SelectedCaseId.IsEmpty() ? TEXT("n/a") : *SelectedGuidanceDecisionEntry->SelectedCaseId,
			SelectedGuidanceDecisionEntry->LaunchedCaseCount,
			SelectedGuidanceDecisionEntry->ReferenceCaseCount,
			SelectedGuidanceDecisionEntry->bBroadenedLaunchScope
				? TEXT("broadened")
				: (SelectedGuidanceDecisionEntry->bTightenedLaunchScope
					? TEXT("tightened")
					: TEXT("steady")),
			SelectedGuidanceDecisionEntry->SuccessRate,
			SelectedGuidanceDecisionEntry->CompletedAttemptCount,
			SelectedGuidanceDecisionEntry->TotalMistakes,
			SelectedGuidanceDecisionEntry->LaunchBudgetReasonLine.IsEmpty()
				? TEXT("n/a")
				: *SelectedGuidanceDecisionEntry->LaunchBudgetReasonLine
		)
		: TEXT("Decision detail: apply a guidance outcome from the dashboard to retain the authored choice history.");
	if (bHasClosedLoopIdleCoachActionability && SelectedGuidanceDecisionEntry == nullptr)
	{
		GuidanceDecisionHistoryStatusLine =
			TEXT("Decision history: no applied guidance-outcome decisions are selected; retained decision history remains inspectable in the closed-loop idle state.");
		GuidanceDecisionHistoryDetailLine =
			TEXT("Decision detail: the coach-to-review loop is closed and idle, so no live guidance-outcome action is being surfaced for application.");
	}
	if (SelectedGuidanceDecisionEntry != nullptr
		&& (SelectedGuidanceDecisionEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount > 0
			|| SelectedGuidanceDecisionEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount > 0
			|| SelectedGuidanceDecisionEntry->bUsedReliableAlignedTrustedTightPlanOutcomeHistory
			|| SelectedGuidanceDecisionEntry->bUsedReliableAlignedTrustedBroadPlanOutcomeHistory))
	{
		GuidanceDecisionHistoryDetailLine += FString::Printf(
			TEXT(" | Aligned launched-plan trust: tight history %d (avg %.2f) | broad history %d (avg %.2f)%s"),
			SelectedGuidanceDecisionEntry->ReliableAlignedTrustedTightPlanOutcomeHistoryCount,
			SelectedGuidanceDecisionEntry->ReliableAlignedTrustedTightPlanOutcomeAverageScore,
			SelectedGuidanceDecisionEntry->ReliableAlignedTrustedBroadPlanOutcomeHistoryCount,
			SelectedGuidanceDecisionEntry->ReliableAlignedTrustedBroadPlanOutcomeAverageScore,
			SelectedGuidanceDecisionEntry->bUsedReliableAlignedTrustedTightPlanOutcomeHistory
				? TEXT(" | This decision was taken while tight aligned launched-plan trust was active.")
				: (SelectedGuidanceDecisionEntry->bUsedReliableAlignedTrustedBroadPlanOutcomeHistory
					? TEXT(" | This decision was taken while broad aligned launched-plan redirect trust was active.")
					: TEXT(""))
		);
	}
	const bool bCanStartPreviewDeck =
		!bHasLiveAttemptTimer && !bHasActiveRun && ActivePreviewDeck != nullptr && ActivePreviewDeck->IsStructurallyValid();
	const bool bCanStartPreviewCase = bCanStartPreviewDeck && SelectedGuidancePreviewCase != nullptr;

	if (HeadlineTextBlock != nullptr)
	{
		HeadlineTextBlock->SetText(FText::FromString(CachedCoachPanelState.Headline));
	}
	if (SecondaryTextBlock != nullptr)
	{
		SecondaryTextBlock->SetText(FText::FromString(CachedCoachPanelState.SecondaryLine));
	}
	if (FocusTextBlock != nullptr)
	{
		const FString FocusLine = FString::Printf(
			TEXT("Focus deck: %s | Method: %s | Cases: %d%s"),
			CachedCoachPanelState.FocusDeckId.IsEmpty() ? TEXT("n/a") : *CachedCoachPanelState.FocusDeckId,
			CachedCoachPanelState.FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *CachedCoachPanelState.FocusMethodSegmentId,
			CachedCoachPanelState.FocusCaseCount,
			CachedCoachPanelState.SuggestedLaunchCaseBudget > 0
				? *FString::Printf(
					TEXT(" | Launch cases: %d"),
					CachedCoachPanelState.SuggestedLaunchCaseBudget)
				: TEXT("")
		);
		FocusTextBlock->SetText(FText::FromString(CachedCoachPanelState.LaunchBudgetReasonLine.IsEmpty()
			? FocusLine
			: FString::Printf(
				TEXT("%s\nBudget reason: %s"),
				*FocusLine,
				*CachedCoachPanelState.LaunchBudgetReasonLine
			)));
	}
	if (ActiveRunHeaderTextBlock != nullptr)
	{
		ActiveRunHeaderTextBlock->SetText(FText::FromString(TEXT("[Active Run]")));
	}
	const FString ActiveRunLine = bHasActiveRun
		? FString::Printf(
			TEXT("Session: %s | State: %s | Deck: %s | Mode: %s | Current case: %s | Remaining: %d"),
			*CachedRunState.Session.TrainingSessionId,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.SessionState),
			*ActiveDeckLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CachedRunState.Session.Mode),
			*ActiveCaseId,
			CachedRunState.RemainingCaseIds.Num()
		)
		: (bHasClosedLoopIdleCoachActionability
			? TEXT("No active run. The coach-to-review loop is closed and idle.")
			: TEXT("No active run. Queue and coach guidance are ready for launch from this screen."));
	DisplayedActiveRunStatusLine = ActiveRunLine;
	if (ActiveRunStatusTextBlock != nullptr)
	{
		ActiveRunStatusTextBlock->SetText(FText::FromString(DisplayedActiveRunStatusLine));
	}
	DisplayedActiveRunSummaryLine = FString::Printf(
		TEXT("Attempts: %d total | %d completed | Success %d | Failure %d | Timeout %d | DNF %d | Best %d ms | Avg %d ms | Last case: %s"),
		CachedRunSummary.AttemptCount,
		CachedRunSummary.CompletedAttemptCount,
		CachedRunSummary.SuccessCount,
		CachedRunSummary.FailureCount,
		CachedRunSummary.TimeoutCount,
		CachedRunSummary.DNFCount,
		CachedRunSummary.BestTotalTimeMs,
		CachedRunSummary.AverageTotalTimeMs,
		CachedRunSummary.LastCaseId.IsEmpty() ? TEXT("n/a") : *CachedRunSummary.LastCaseId
	);
	if (ActiveRunSummaryTextBlock != nullptr)
	{
		ActiveRunSummaryTextBlock->SetText(FText::FromString(DisplayedActiveRunSummaryLine));
	}
	if (RunRecapHeaderTextBlock != nullptr)
	{
		RunRecapHeaderTextBlock->SetText(FText::FromString(TEXT("[Run Recap]")));
	}
	if (bHasDisplayedRunRecap)
	{
		DisplayedRunRecapStatusLine =
			DisplayedTemplateLaunch != nullptr
				? FString::Printf(
					TEXT("Source: %s | Session: %s | Deck: %s | State: %s | Completed at: %s | Template: %s (%s) | Source plan: %s"),
					*RunRecapSourceLabel,
					*DisplayedRunRecap->TrainingSessionId,
					DisplayedRunRecap->DeckId.IsEmpty() ? TEXT("n/a") : *DisplayedRunRecap->DeckId,
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecap->SessionState),
					DisplayedRunRecap->LastCompletedAtUtc.IsEmpty()
						? TEXT("n/a")
						: *DisplayedRunRecap->LastCompletedAtUtc,
					DisplayedTemplateLaunch->TemplateId.IsEmpty()
						? TEXT("n/a")
						: *DisplayedTemplateLaunch->TemplateId,
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
						DisplayedTemplateLaunch->TemplateKind),
					DisplayedTemplateLaunch->SourceReviewPlanId.IsEmpty()
						? TEXT("none")
						: *DisplayedTemplateLaunch->SourceReviewPlanId)
				: FString::Printf(
					TEXT("Source: %s | Session: %s | Deck: %s | State: %s | Completed at: %s"),
					*RunRecapSourceLabel,
					*DisplayedRunRecap->TrainingSessionId,
					DisplayedRunRecap->DeckId.IsEmpty() ? TEXT("n/a") : *DisplayedRunRecap->DeckId,
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(DisplayedRunRecap->SessionState),
					DisplayedRunRecap->LastCompletedAtUtc.IsEmpty()
						? TEXT("n/a")
						: *DisplayedRunRecap->LastCompletedAtUtc);
	}
	else if (bHasActiveRun)
	{
		DisplayedRunRecapStatusLine =
			TEXT("Source: active run | recap will stabilize here when the run completes or aborts.");
	}
	else
	{
		DisplayedRunRecapStatusLine =
			TEXT("Source: none yet | complete a run to retain a session recap on this dashboard.");
	}
	if (RunRecapStatusTextBlock != nullptr)
	{
		RunRecapStatusTextBlock->SetText(FText::FromString(DisplayedRunRecapStatusLine));
	}
	if (bHasDisplayedRunRecap)
	{
		DisplayedRunRecapDetailLine =
			DisplayedTemplateLaunch != nullptr
				? FString::Printf(
					TEXT("Attempts %d/%d | Success %d | Failure %d | Timeout %d | DNF %d | Aborted %d | Success rate %.2f | Best %d ms | Avg %d ms | Avg raw %d ms | Avg inspection %d ms | Mistakes %d | Last case %s | Template title %s | Template mode %s | Template selection %s | Recommended %d | Focus %d | Review-backed %s | Template aggregate %s | Template detail %s"),
					DisplayedRunRecap->CompletedAttemptCount,
					DisplayedRunRecap->AttemptCount,
					DisplayedRunRecap->SuccessCount,
					DisplayedRunRecap->FailureCount,
					DisplayedRunRecap->TimeoutCount,
					DisplayedRunRecap->DNFCount,
					DisplayedRunRecap->AbortedCount,
					DisplayedRunRecap->SuccessRate,
					DisplayedRunRecap->BestTotalTimeMs,
					DisplayedRunRecap->AverageTotalTimeMs,
					DisplayedRunRecap->AverageRawSolveTimeMs,
					DisplayedRunRecap->AverageInspectionTimeMs,
					DisplayedRunRecap->TotalMistakes,
					DisplayedRunRecap->LastCaseId.IsEmpty() ? TEXT("n/a") : *DisplayedRunRecap->LastCaseId,
					DisplayedTemplateLaunch->Title.IsEmpty()
						? TEXT("n/a")
						: *DisplayedTemplateLaunch->Title,
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
						DisplayedTemplateLaunch->SuggestedMode),
					*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(
						DisplayedTemplateLaunch->SuggestedSelectionPolicy),
					DisplayedTemplateLaunch->RecommendedCaseCount,
					DisplayedTemplateLaunch->FocusCaseIds.Num(),
					bDisplayedTemplateLaunchUsesReviewLane ? TEXT("yes") : TEXT("no"),
					*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsOutcomeFragment(
						DisplayedTemplateLaunchStats),
					*HyperTwistCoachDashboardWidgetInternal::BuildTemplateLaunchAnalyticsDetailFragment(
						DisplayedTemplateLaunchStats))
				: FString::Printf(
					TEXT("Attempts %d/%d | Success %d | Failure %d | Timeout %d | DNF %d | Aborted %d | Success rate %.2f | Best %d ms | Avg %d ms | Avg raw %d ms | Avg inspection %d ms | Mistakes %d | Last case %s"),
					DisplayedRunRecap->CompletedAttemptCount,
					DisplayedRunRecap->AttemptCount,
					DisplayedRunRecap->SuccessCount,
					DisplayedRunRecap->FailureCount,
					DisplayedRunRecap->TimeoutCount,
					DisplayedRunRecap->DNFCount,
					DisplayedRunRecap->AbortedCount,
					DisplayedRunRecap->SuccessRate,
					DisplayedRunRecap->BestTotalTimeMs,
					DisplayedRunRecap->AverageTotalTimeMs,
					DisplayedRunRecap->AverageRawSolveTimeMs,
					DisplayedRunRecap->AverageInspectionTimeMs,
					DisplayedRunRecap->TotalMistakes,
					DisplayedRunRecap->LastCaseId.IsEmpty() ? TEXT("n/a") : *DisplayedRunRecap->LastCaseId);
		if (!DisplayedTemplateLaunchSelectionDetail.IsEmpty())
		{
			DisplayedRunRecapDetailLine += TEXT(" | ");
			DisplayedRunRecapDetailLine += DisplayedTemplateLaunchSelectionDetail;
		}
	}
	else
	{
		DisplayedRunRecapDetailLine =
			TEXT("Recap detail: unavailable until a run has been completed or explicitly aborted.");
	}
	if (RunRecapDetailTextBlock != nullptr)
	{
		RunRecapDetailTextBlock->SetText(FText::FromString(DisplayedRunRecapDetailLine));
	}
	if (GuidanceComparisonHeaderTextBlock != nullptr)
	{
		GuidanceComparisonHeaderTextBlock->SetText(FText::FromString(TEXT("[Guidance Comparison]")));
	}
	if (GuidanceComparisonStatusTextBlock != nullptr)
	{
		GuidanceComparisonStatusTextBlock->SetText(FText::FromString(GuidanceComparisonStatusLine));
	}
	if (GuidanceComparisonDetailTextBlock != nullptr)
	{
		GuidanceComparisonDetailTextBlock->SetText(FText::FromString(GuidanceComparisonDetailLine));
	}
	if (GuidanceOutcomeHeaderTextBlock != nullptr)
	{
		GuidanceOutcomeHeaderTextBlock->SetText(FText::FromString(TEXT("[Guidance Outcome]")));
	}
	if (GuidanceOutcomeStatusTextBlock != nullptr)
	{
		GuidanceOutcomeStatusTextBlock->SetText(FText::FromString(GuidanceOutcomeStatusLine));
	}
	if (GuidanceOutcomeDetailTextBlock != nullptr)
	{
		GuidanceOutcomeDetailTextBlock->SetText(FText::FromString(GuidanceOutcomeDetailLine));
	}
	if (GuidanceOutcomeActionButtonLabel != nullptr)
	{
		GuidanceOutcomeActionButtonLabel->SetText(FText::FromString(GuidanceOutcomeActionLabel));
	}
	if (GuidanceOutcomeActionButton != nullptr)
	{
		GuidanceOutcomeActionButton->SetIsEnabled(bCanApplyGuidanceOutcomeAction);
	}
	if (GuidanceDecisionWeightingHeaderTextBlock != nullptr)
	{
		GuidanceDecisionWeightingHeaderTextBlock->SetText(FText::FromString(TEXT("[Decision Weighting]")));
	}
	if (GuidanceDecisionWeightingStatusTextBlock != nullptr)
	{
		GuidanceDecisionWeightingStatusTextBlock->SetText(FText::FromString(GuidanceDecisionWeightingStatusLine));
	}
	if (GuidanceDecisionWeightingDetailTextBlock != nullptr)
	{
		GuidanceDecisionWeightingDetailTextBlock->SetText(FText::FromString(GuidanceDecisionWeightingDetailLine));
	}
	if (GuidancePreferenceHeaderTextBlock != nullptr)
	{
		GuidancePreferenceHeaderTextBlock->SetText(FText::FromString(TEXT("[Guidance Preference]")));
	}
	if (GuidancePreferenceStatusTextBlock != nullptr)
	{
		GuidancePreferenceStatusTextBlock->SetText(FText::FromString(GuidancePreferenceStatusLine));
	}
	if (GuidancePreferenceDetailTextBlock != nullptr)
	{
		GuidancePreferenceDetailTextBlock->SetText(FText::FromString(GuidancePreferenceDetailLine));
	}
	if (GuidanceDecisionHistoryHeaderTextBlock != nullptr)
	{
		GuidanceDecisionHistoryHeaderTextBlock->SetText(FText::FromString(TEXT("[Decision History]")));
	}
	DisplayedGuidanceDecisionHistoryStatusLine = GuidanceDecisionHistoryStatusLine;
	if (GuidanceDecisionHistoryStatusTextBlock != nullptr)
	{
		GuidanceDecisionHistoryStatusTextBlock->SetText(FText::FromString(GuidanceDecisionHistoryStatusLine));
	}
	DisplayedGuidanceDecisionHistoryDetailLine = GuidanceDecisionHistoryDetailLine;
	if (GuidanceDecisionHistoryDetailTextBlock != nullptr)
	{
		GuidanceDecisionHistoryDetailTextBlock->SetText(FText::FromString(GuidanceDecisionHistoryDetailLine));
	}
	if (PreviousGuidanceDecisionButtonLabel != nullptr)
	{
		DisplayedPreviousGuidanceDecisionNavigationLabel = TEXT("Prev Decision");
		PreviousGuidanceDecisionButtonLabel->SetText(FText::FromString(
			DisplayedPreviousGuidanceDecisionNavigationLabel));
	}
	if (PreviousGuidanceDecisionButton != nullptr)
	{
		PreviousGuidanceDecisionButton->SetIsEnabled(GuidanceDecisionHistoryEntries.Num() > 1);
	}
	if (NextGuidanceDecisionButtonLabel != nullptr)
	{
		DisplayedNextGuidanceDecisionNavigationLabel = TEXT("Next Decision");
		NextGuidanceDecisionButtonLabel->SetText(FText::FromString(
			DisplayedNextGuidanceDecisionNavigationLabel));
	}
	if (NextGuidanceDecisionButton != nullptr)
	{
		NextGuidanceDecisionButton->SetIsEnabled(GuidanceDecisionHistoryEntries.Num() > 1);
	}
	if (RepeatRunButtonLabel != nullptr)
	{
		DisplayedRepeatRunActionLabel = TEXT("Repeat Run");
		RepeatRunButtonLabel->SetText(FText::FromString(DisplayedRepeatRunActionLabel));
	}
	else
	{
		DisplayedRepeatRunActionLabel = TEXT("Repeat Run");
	}
	if (RepeatRunButton != nullptr)
	{
		RepeatRunButton->SetIsEnabled(bCanRepeatDisplayedRun);
	}
	if (DismissRecapButtonLabel != nullptr)
	{
		DisplayedDismissRecapActionLabel = TEXT("Dismiss Recap");
		DismissRecapButtonLabel->SetText(FText::FromString(DisplayedDismissRecapActionLabel));
	}
	else
	{
		DisplayedDismissRecapActionLabel = TEXT("Dismiss Recap");
	}
	if (DismissRecapButton != nullptr)
	{
		DismissRecapButton->SetIsEnabled(bCanDismissStoredRecap);
	}
	if (CoachHandoffHeaderTextBlock != nullptr)
	{
		CoachHandoffHeaderTextBlock->SetText(FText::FromString(TEXT("[Coach Handoff]")));
	}
	if (CoachHandoffStatusTextBlock != nullptr)
	{
		CoachHandoffStatusTextBlock->SetText(FText::FromString(CoachHandoffStatusLine));
	}
	if (CoachHandoffRecommendationHeaderTextBlock != nullptr)
	{
		CoachHandoffRecommendationHeaderTextBlock->SetText(FText::FromString(TEXT("[Handoff Recommendation]")));
	}
	if (CoachHandoffRecommendationStatusTextBlock != nullptr)
	{
		CoachHandoffRecommendationStatusTextBlock->SetText(FText::FromString(CoachHandoffRecommendationStatusLine));
	}
	if (CoachHandoffRecommendationDetailTextBlock != nullptr)
	{
		CoachHandoffRecommendationDetailTextBlock->SetText(FText::FromString(CoachHandoffRecommendationDetailLine));
	}
	DisplayedTemplateLaunchStatusLine = TemplateLaunchStatusLine;
	DisplayedTemplateLaunchDetailLine = TemplateLaunchDetailLine;
	if (TemplateLaunchHeaderTextBlock != nullptr)
	{
		TemplateLaunchHeaderTextBlock->SetText(FText::FromString(TEXT("[Template Launch]")));
	}
	if (TemplateLaunchStatusTextBlock != nullptr)
	{
		TemplateLaunchStatusTextBlock->SetText(FText::FromString(TemplateLaunchStatusLine));
	}
	if (TemplateLaunchDetailTextBlock != nullptr)
	{
		TemplateLaunchDetailTextBlock->SetText(FText::FromString(TemplateLaunchDetailLine));
	}
	if (TemplateLaunchHistoryHeaderTextBlock != nullptr)
	{
		TemplateLaunchHistoryHeaderTextBlock->SetText(FText::FromString(
			TEXT("[Template Launch History]")));
	}
	DisplayedTemplateLaunchHistoryStatusLine = TemplateLaunchHistoryStatusLine;
	if (TemplateLaunchHistoryStatusTextBlock != nullptr)
	{
		TemplateLaunchHistoryStatusTextBlock->SetText(FText::FromString(
			TemplateLaunchHistoryStatusLine));
	}
	DisplayedTemplateLaunchHistoryDetailLine = TemplateLaunchHistoryDetailLine;
	if (TemplateLaunchHistoryDetailTextBlock != nullptr)
	{
		TemplateLaunchHistoryDetailTextBlock->SetText(FText::FromString(
			TemplateLaunchHistoryDetailLine));
	}
	if (PreviousTemplateLaunchHistoryButtonLabel != nullptr)
	{
		DisplayedPreviousTemplateLaunchNavigationLabel = TEXT("Prev Template Launch");
		PreviousTemplateLaunchHistoryButtonLabel->SetText(FText::FromString(
			DisplayedPreviousTemplateLaunchNavigationLabel));
	}
	if (PreviousTemplateLaunchHistoryButton != nullptr)
	{
		PreviousTemplateLaunchHistoryButton->SetIsEnabled(TemplateLaunchHistoryEntries.Num() > 1);
	}
	if (NextTemplateLaunchHistoryButtonLabel != nullptr)
	{
		DisplayedNextTemplateLaunchNavigationLabel = TEXT("Next Template Launch");
		NextTemplateLaunchHistoryButtonLabel->SetText(FText::FromString(
			DisplayedNextTemplateLaunchNavigationLabel));
	}
	if (NextTemplateLaunchHistoryButton != nullptr)
	{
		NextTemplateLaunchHistoryButton->SetIsEnabled(TemplateLaunchHistoryEntries.Num() > 1);
	}
	if (HandoffHistoryHeaderTextBlock != nullptr)
	{
		HandoffHistoryHeaderTextBlock->SetText(FText::FromString(TEXT("[Handoff History]")));
	}
	DisplayedHandoffHistoryStatusLine = HandoffHistoryStatusLine;
	if (HandoffHistoryStatusTextBlock != nullptr)
	{
		HandoffHistoryStatusTextBlock->SetText(FText::FromString(HandoffHistoryStatusLine));
	}
	DisplayedHandoffHistoryDetailLine = HandoffHistoryDetailLine;
	if (HandoffHistoryDetailTextBlock != nullptr)
	{
		HandoffHistoryDetailTextBlock->SetText(FText::FromString(HandoffHistoryDetailLine));
	}
	if (PreviousHandoffHistoryButtonLabel != nullptr)
	{
		DisplayedPreviousHandoffHistoryNavigationLabel = TEXT("Prev Handoff");
		PreviousHandoffHistoryButtonLabel->SetText(FText::FromString(
			DisplayedPreviousHandoffHistoryNavigationLabel));
	}
	if (PreviousHandoffHistoryButton != nullptr)
	{
		PreviousHandoffHistoryButton->SetIsEnabled(HandoffHistoryEntries.Num() > 1);
	}
	if (NextHandoffHistoryButtonLabel != nullptr)
	{
		DisplayedNextHandoffHistoryNavigationLabel = TEXT("Next Handoff");
		NextHandoffHistoryButtonLabel->SetText(FText::FromString(
			DisplayedNextHandoffHistoryNavigationLabel));
	}
	if (NextHandoffHistoryButton != nullptr)
	{
		NextHandoffHistoryButton->SetIsEnabled(HandoffHistoryEntries.Num() > 1);
	}
	if (GuidanceReviewHeaderTextBlock != nullptr)
	{
		GuidanceReviewHeaderTextBlock->SetText(FText::FromString(TEXT("[Guidance Review]")));
	}
	if (GuidanceRationaleHeaderTextBlock != nullptr)
	{
		GuidanceRationaleHeaderTextBlock->SetText(FText::FromString(TEXT("[Guidance Rationale]")));
	}
	if (GuidanceRationaleStatusTextBlock != nullptr)
	{
		GuidanceRationaleStatusTextBlock->SetText(FText::FromString(GuidanceRationaleStatusLine));
	}
	if (GuidanceRationaleDetailTextBlock != nullptr)
	{
		GuidanceRationaleDetailTextBlock->SetText(FText::FromString(GuidanceRationaleDetailLine));
	}
	if (GuidancePreviewSelectionTextBlock != nullptr)
	{
		GuidancePreviewSelectionTextBlock->SetText(FText::FromString(GuidancePreviewSelectionLine));
	}
	if (RecommendedDeckPreviewTextBlock != nullptr)
	{
		RecommendedDeckPreviewTextBlock->SetText(FText::FromString(RecommendedDeckPreviewLine));
	}
	if (FollowUpDeckPreviewTextBlock != nullptr)
	{
		FollowUpDeckPreviewTextBlock->SetText(FText::FromString(FollowUpDeckPreviewLine));
	}
	if (GuidancePreviewCaseDetailTextBlock != nullptr)
	{
		GuidancePreviewCaseDetailTextBlock->SetText(FText::FromString(GuidancePreviewCaseDetailLine));
	}
	if (MethodDrillDiagnosticsHeaderTextBlock != nullptr)
	{
		MethodDrillDiagnosticsHeaderTextBlock->SetText(FText::FromString(TEXT("[Method Drill Diagnostics]")));
	}
	if (MethodDrillDiagnosticsStatusTextBlock != nullptr)
	{
		MethodDrillDiagnosticsStatusTextBlock->SetText(FText::FromString(MethodDrillDiagnosticsStatusLine));
	}
	if (MethodDrillDiagnosticsDetailTextBlock != nullptr)
	{
		MethodDrillDiagnosticsDetailTextBlock->SetText(FText::FromString(MethodDrillDiagnosticsDetailLine));
	}
	if (StartMethodDrillFollowUpButtonLabel != nullptr)
	{
		StartMethodDrillFollowUpButtonLabel->SetText(FText::FromString(
			DisplayedMethodDrillFollowUpActionLabel));
	}
	if (StartMethodDrillFollowUpButton != nullptr)
	{
		StartMethodDrillFollowUpButton->SetIsEnabled(bCanLaunchMethodDrillFollowUp);
	}
	if (MethodDrillFollowUpHistoryHeaderTextBlock != nullptr)
	{
		MethodDrillFollowUpHistoryHeaderTextBlock->SetText(FText::FromString(
			TEXT("[Method Drill Follow-Up History]")));
	}
   DisplayedMethodDrillFollowUpHistoryStatusLine = MethodDrillFollowUpHistoryStatusLine;
	if (MethodDrillFollowUpHistoryStatusTextBlock != nullptr)
	{
		MethodDrillFollowUpHistoryStatusTextBlock->SetText(FText::FromString(
			MethodDrillFollowUpHistoryStatusLine));
	}
   DisplayedMethodDrillFollowUpHistoryDetailLine = MethodDrillFollowUpHistoryDetailLine;
	if (MethodDrillFollowUpHistoryDetailTextBlock != nullptr)
	{
		MethodDrillFollowUpHistoryDetailTextBlock->SetText(FText::FromString(
			MethodDrillFollowUpHistoryDetailLine));
	}
	if (PreviousMethodDrillFollowUpHistoryButtonLabel != nullptr)
	{
		DisplayedPreviousMethodDrillFollowUpNavigationLabel = TEXT("Prev Drill Follow-Up");
		PreviousMethodDrillFollowUpHistoryButtonLabel->SetText(FText::FromString(
			DisplayedPreviousMethodDrillFollowUpNavigationLabel));
	}
	if (PreviousMethodDrillFollowUpHistoryButton != nullptr)
	{
		PreviousMethodDrillFollowUpHistoryButton->SetIsEnabled(
			MethodDrillFollowUpHistoryEntries.Num() > 1);
	}
	if (NextMethodDrillFollowUpHistoryButtonLabel != nullptr)
	{
		DisplayedNextMethodDrillFollowUpNavigationLabel = TEXT("Next Drill Follow-Up");
		NextMethodDrillFollowUpHistoryButtonLabel->SetText(FText::FromString(
			DisplayedNextMethodDrillFollowUpNavigationLabel));
	}
	if (NextMethodDrillFollowUpHistoryButton != nullptr)
	{
		NextMethodDrillFollowUpHistoryButton->SetIsEnabled(
			MethodDrillFollowUpHistoryEntries.Num() > 1);
	}
	if (StartQueuedRunButtonLabel != nullptr)
	{
		StartQueuedRunButtonLabel->SetText(FText::FromString(QueuedRunLabel));
	}
	if (StartQueuedRunButton != nullptr)
	{
		StartQueuedRunButton->SetIsEnabled(bCanUseCoachHandoff && bQueueReadyForHandoff);
	}
	if (StartFollowUpRunButtonLabel != nullptr)
	{
		StartFollowUpRunButtonLabel->SetText(FText::FromString(FollowUpRunLabel));
	}
	if (StartFollowUpRunButton != nullptr)
	{
		StartFollowUpRunButton->SetIsEnabled(bCanUseCoachHandoff && bFollowUpReadyForHandoff);
	}
	if (StartRecommendedRunButtonLabel != nullptr)
	{
		StartRecommendedRunButtonLabel->SetText(FText::FromString(RecommendedRunLabel));
	}
	if (StartRecommendedRunButton != nullptr)
	{
		StartRecommendedRunButton->SetIsEnabled(bCanUseCoachHandoff && bRecommendedReadyForHandoff);
	}
	FString TemplateLaunchButtonLabel = TEXT("No Template");
	if (bHasPreferredTemplateLaunch)
	{
		TemplateLaunchButtonLabel =
			PreferredTemplateLaunchTitle.Len() <= 28
				? PreferredTemplateLaunchTitle
				: (bPreferredTemplateLaunchUsesReviewLane
					? TEXT("Launch Review Template")
					: TEXT("Launch Recovery Template"));
	}
	if (bHasLiveAttemptTimer && bHasPreferredTemplateLaunch)
	{
		TemplateLaunchButtonLabel = TEXT("Template Busy");
	}
	else if (bHasActiveRun && bHasPreferredTemplateLaunch)
	{
		TemplateLaunchButtonLabel = TEXT("Clear Run For Template");
	}
	DisplayedTemplateLaunchActionLabel = TemplateLaunchButtonLabel;
	if (StartTemplateLaunchButtonLabel != nullptr)
	{
		StartTemplateLaunchButtonLabel->SetText(FText::FromString(DisplayedTemplateLaunchActionLabel));
	}
	if (StartTemplateLaunchButton != nullptr)
	{
		StartTemplateLaunchButton->SetIsEnabled(bCanLaunchPreferredTemplate);
	}
	DisplayedPreviewRecommendedActionLabel = TEXT("Preview Recommended");
	if (PreviewRecommendedButtonLabel != nullptr)
	{
		PreviewRecommendedButtonLabel->SetText(FText::FromString(
			DisplayedPreviewRecommendedActionLabel));
	}
	if (PreviewRecommendedButton != nullptr)
	{
		PreviewRecommendedButton->SetIsEnabled(
			!bHasLiveAttemptTimer && CachedCoachPanelState.bCanStartCoachRecommendedRun
		);
	}
	DisplayedPreviewFollowUpActionLabel = TEXT("Preview Follow-Up");
	if (PreviewFollowUpButtonLabel != nullptr)
	{
		PreviewFollowUpButtonLabel->SetText(FText::FromString(
			DisplayedPreviewFollowUpActionLabel));
	}
	if (PreviewFollowUpButton != nullptr)
	{
		PreviewFollowUpButton->SetIsEnabled(
			!bHasLiveAttemptTimer
			&& CachedCoachPanelState.bCanStartCoachFollowUpRun
			&& CachedCoachPanelState.bHasFollowUpGuidance
		);
	}
	if (PreviousGuidanceCaseButtonLabel != nullptr)
	{
		DisplayedPreviousGuidanceCaseNavigationLabel = TEXT("Prev Guidance Case");
		PreviousGuidanceCaseButtonLabel->SetText(FText::FromString(
			DisplayedPreviousGuidanceCaseNavigationLabel));
	}
	if (PreviousGuidanceCaseButton != nullptr)
	{
		PreviousGuidanceCaseButton->SetIsEnabled(
			ActivePreviewDeck != nullptr && ActivePreviewDeck->Cases.Num() > 1
		);
	}
	if (NextGuidanceCaseButtonLabel != nullptr)
	{
		DisplayedNextGuidanceCaseNavigationLabel = TEXT("Next Guidance Case");
		NextGuidanceCaseButtonLabel->SetText(FText::FromString(
			DisplayedNextGuidanceCaseNavigationLabel));
	}
	if (NextGuidanceCaseButton != nullptr)
	{
		NextGuidanceCaseButton->SetIsEnabled(
			ActivePreviewDeck != nullptr && ActivePreviewDeck->Cases.Num() > 1
		);
	}
	if (StartPreviewDeckButtonLabel != nullptr)
	{
		DisplayedStartPreviewDeckActionLabel = TEXT("Start Preview Deck");
		StartPreviewDeckButtonLabel->SetText(FText::FromString(
			DisplayedStartPreviewDeckActionLabel));
	}
	if (StartPreviewDeckButton != nullptr)
	{
		StartPreviewDeckButton->SetIsEnabled(bCanStartPreviewDeck);
	}
	if (StartPreviewCaseButtonLabel != nullptr)
	{
		DisplayedStartPreviewCaseActionLabel = TEXT("Start Selected Preview Case");
		StartPreviewCaseButtonLabel->SetText(FText::FromString(
			DisplayedStartPreviewCaseActionLabel));
	}
	if (StartPreviewCaseButton != nullptr)
	{
		StartPreviewCaseButton->SetIsEnabled(bCanStartPreviewCase);
	}
	if (LastAttemptTextBlock != nullptr)
	{
		DisplayedLastAttemptReviewSummaryLine = ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Attempt review: %s | case %s | result %s | completed at %s | latest submission: %s"),
				*ReviewedAttemptOrdinal,
				ReviewedAttempt->CaseId.IsEmpty() ? TEXT("n/a") : *ReviewedAttempt->CaseId,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ReviewedAttempt->Result),
				ReviewedAttempt->CompletedAtUtc.IsEmpty()
					? TEXT("n/a")
					: *ReviewedAttempt->CompletedAtUtc,
				bHasSessionScopedLastStep ? TEXT("yes") : TEXT("no")
			)
			: TEXT("Attempt review: no attempts recorded in the active run yet.");
		LastAttemptTextBlock->SetText(FText::FromString(DisplayedLastAttemptReviewSummaryLine));
	}
	if (LastAttemptTimingTextBlock != nullptr)
	{
		DisplayedLastAttemptTimingLine = ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Reviewed timing: inspection %d ms | raw solve %d ms | final %d ms | penalty %s | split captures %d | did-not-finish: %s"),
				ReviewedAttempt->TimingBreakdown.InspectionElapsedMs,
				ReviewedAttempt->TimingBreakdown.RawSolveTimeMs,
				ReviewedAttempt->TimingBreakdown.FinalTimeMs,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ReviewedAttempt->TimingBreakdown.AppliedPenalty),
				ReviewedAttempt->TimingBreakdown.SplitCaptures.Num(),
				ReviewedAttempt->TimingBreakdown.bDidNotFinish ? TEXT("yes") : TEXT("no")
			)
			: TEXT("Reviewed timing: unavailable until the active run records an attempt.");
		LastAttemptTimingTextBlock->SetText(FText::FromString(DisplayedLastAttemptTimingLine));
	}
	if (LastAttemptPhaseTextBlock != nullptr)
	{
		DisplayedLastAttemptDerivedPhaseLine = ReviewedAttempt != nullptr
			? FString::Printf(
				TEXT("Reviewed derived phases: %s"),
				*ReviewedAttemptPhaseSummary
			)
			: TEXT("Reviewed derived phases: none yet.");
		LastAttemptPhaseTextBlock->SetText(FText::FromString(DisplayedLastAttemptDerivedPhaseLine));
	}
	if (CurrentCaseHeaderTextBlock != nullptr)
	{
		CurrentCaseHeaderTextBlock->SetText(FText::FromString(TEXT("[Current Case]")));
	}
	FString CurrentCasePromptLine;
	if (bHasRunnableCurrentCase)
	{
		CurrentCasePromptLine = FString::Printf(
			TEXT("Prompt: %s | Kind: %s | Subset: %s | Target: %d ms | Attempts on selection: %d | Successes on selection: %d"),
			CurrentTrainingCase.PromptLabel.IsEmpty() ? TEXT("n/a") : *CurrentTrainingCase.PromptLabel,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(CurrentTrainingCase.PromptKind),
			CurrentTrainingCase.SubsetId.IsEmpty() ? TEXT("n/a") : *CurrentTrainingCase.SubsetId,
			CurrentTrainingCase.TimeTargetMs,
			CachedRunState.CurrentSelection.AttemptCount,
			CachedRunState.CurrentSelection.SuccessCount
		);
	}
	else
	{
		CurrentCasePromptLine = TEXT("Prompt: no active current case is loaded.");
	}
	DisplayedCurrentCasePromptLine = CurrentCasePromptLine;
	if (CurrentCasePromptTextBlock != nullptr)
	{
		CurrentCasePromptTextBlock->SetText(FText::FromString(DisplayedCurrentCasePromptLine));
	}
	FString CurrentCaseNotationLine;
	if (bHasRunnableCurrentCase)
	{
		const FString TagLine = CurrentTrainingCase.Tags.Num() > 0
			? FString::Join(CurrentTrainingCase.Tags, TEXT(", "))
			: TEXT("n/a");
		CurrentCaseNotationLine = FString::Printf(
			TEXT("Scramble: %s\nCanonical: %s\nTags: %s"),
			CurrentTrainingCase.ScrambleNotation.IsEmpty() ? TEXT("n/a") : *CurrentTrainingCase.ScrambleNotation,
			CurrentTrainingCase.CanonicalNotation.IsEmpty() ? TEXT("n/a") : *CurrentTrainingCase.CanonicalNotation,
			*TagLine
		);
	}
	else
	{
		CurrentCaseNotationLine = TEXT("Scramble / notation: unavailable until a run is active.");
	}
	DisplayedCurrentCaseNotationLine = CurrentCaseNotationLine;
	if (CurrentCaseNotationTextBlock != nullptr)
	{
		CurrentCaseNotationTextBlock->SetText(FText::FromString(DisplayedCurrentCaseNotationLine));
	}
	if (TransitionHeaderTextBlock != nullptr)
	{
		TransitionHeaderTextBlock->SetText(FText::FromString(TEXT("[Next Step]")));
	}
	if (TransitionStatusTextBlock != nullptr)
	{
		TransitionStatusTextBlock->SetText(FText::FromString(TransitionStatusLine));
	}
	if (AttemptControlHeaderTextBlock != nullptr)
	{
		AttemptControlHeaderTextBlock->SetText(FText::FromString(TEXT("[Attempt Controls]")));
	}
	DisplayedAttemptInputStatusLine = FString::Printf(
		TEXT("Attempt ms input: %s | Target %d | Avg %d | Success %d | Failure %d | Timeout %d | DNF %d"),
		bHasParsedAttemptOverride ? *FString::FromInt(ParsedAttemptOverrideMs) : TEXT("auto"),
		CurrentTrainingCase.TimeTargetMs,
		CachedRunSummary.AverageTotalTimeMs,
		ResolvedSuccessTimeMs,
		ResolvedFailureTimeMs,
		ResolvedTimeoutTimeMs,
		ResolvedDnfTimeMs
	);
	if (AttemptInputStatusTextBlock != nullptr)
	{
		AttemptInputStatusTextBlock->SetText(FText::FromString(DisplayedAttemptInputStatusLine));
	}
	if (TimerHeaderTextBlock != nullptr)
	{
		TimerHeaderTextBlock->SetText(FText::FromString(TEXT("[Live Timer]")));
	}
	if (bLiveInspectionPhase)
	{
		const int32 RemainingInspectionMs = bHasInspectionWindow
			? FMath::Max(InspectionLimitMs - LiveAttemptInspectionElapsedMs, 0)
			: 0;
		DisplayedTimerStatusLine = FString::Printf(
			TEXT("Phase: inspection | elapsed %d ms | remaining %d ms | pending penalty: %s | click Start Solve when ready"),
			LiveAttemptInspectionElapsedMs,
			RemainingInspectionMs,
			*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(LiveInspectionPenalty)
		);
	}
	else if (bLiveSolvePhase)
	{
		DisplayedTimerStatusLine = FString::Printf(
			TEXT("Phase: solving | inspection %d ms | solve %s ms | finish with Success / Failure / Timeout / DNF"),
			LiveAttemptInspectionElapsedMs,
			*RunningSolveLabel
		);
	}
	else if (bLivePausedPhase)
	{
		DisplayedTimerStatusLine = FString::Printf(
			TEXT("Phase: paused | inspection %d ms | solve %d ms | click Resume Solve or Cancel Timer"),
			LiveAttemptInspectionElapsedMs,
			LiveAttemptSolveElapsedMs
		);
	}
	else
	{
		const FString InspectionLabel = bHasInspectionWindow
			? FString::Printf(TEXT("inspection target %d ms"), InspectionLimitMs)
			: TEXT("no inspection window");
		DisplayedTimerStatusLine = FString::Printf(
			TEXT("Timer idle | %s | start a live attempt for less-synthetic run entry"),
			*InspectionLabel
		);
	}
	if (TimerStatusTextBlock != nullptr)
	{
		TimerStatusTextBlock->SetText(FText::FromString(DisplayedTimerStatusLine));
	}
	if (SplitHeaderTextBlock != nullptr)
	{
		SplitHeaderTextBlock->SetText(FText::FromString(TEXT("[Split Capture]")));
	}
	if (SplitStatusTextBlock != nullptr)
	{
		if (MaxManualSplitCaptureCount <= 0)
		{
			DisplayedSplitCaptureStatusLine =
				TEXT("Split capture: no manual split phases are configured for this timing policy.");
		}
		else
		{
			const FString SplitStateLine = FString::Printf(
				TEXT("Manual splits %d/%d | Next: %s | Final auto-close: %s | Captured: %s"),
				LiveAttemptSplitCaptures.Num(),
				MaxManualSplitCaptureCount,
				*NextSplitLabel,
				*FinalSplitLabel,
				*CapturedSplitSummary
			);
			if (bLiveSolvePhase)
			{
				DisplayedSplitCaptureStatusLine =
					SplitStateLine + TEXT(" | capture phase ends during solve; final phase closes on attempt stop");
			}
			else if (bLivePausedPhase)
			{
				DisplayedSplitCaptureStatusLine =
					SplitStateLine + TEXT(" | split capture is paused; resume solve to capture the next phase");
			}
			else if (bLiveInspectionPhase)
			{
				DisplayedSplitCaptureStatusLine =
					SplitStateLine + TEXT(" | split capture unlocks after solve start");
			}
			else
			{
				DisplayedSplitCaptureStatusLine =
					SplitStateLine + TEXT(" | start a live attempt to record manual split boundaries");
			}
		}
		SplitStatusTextBlock->SetText(FText::FromString(DisplayedSplitCaptureStatusLine));
	}
	if (AttemptTimeTextBox != nullptr)
	{
		const FString HintLabel = CurrentTrainingCase.TimeTargetMs > 0
			? FString::Printf(TEXT("Enter attempt ms (target %d)"), CurrentTrainingCase.TimeTargetMs)
			: TEXT("Enter attempt ms");
		DisplayedAttemptTimeHintLabel = HintLabel;
		AttemptTimeTextBox->SetHintText(FText::FromString(DisplayedAttemptTimeHintLabel));
		AttemptTimeTextBox->SetIsEnabled(!bHasLiveAttemptTimer && bHasRunnableCurrentCase);
	}
	if (FollowUpTextBlock != nullptr)
	{
		const FString FollowUpLine =
			(!CachedCoachFollowUpBrief.UserId.IsEmpty() && !CachedCoachFollowUpBrief.Headline.IsEmpty())
			? FString::Printf(
				TEXT("Follow-up: %s | Action: %s | Cases: %d"),
				*CachedCoachFollowUpBrief.Headline,
				CachedCoachFollowUpBrief.PrimaryActionLabel.IsEmpty()
					? TEXT("n/a")
					: *CachedCoachFollowUpBrief.PrimaryActionLabel,
				CachedCoachFollowUpBrief.FocusCaseIds.Num()
			)
			: TEXT("Follow-up: none queued beyond the current coach chain");
		FollowUpTextBlock->SetText(FText::FromString(FollowUpLine));
	}
	if (QueueStatusTextBlock != nullptr)
	{
		DisplayedQueueStatusLine = CachedCoachPanelState.QueueStatusLine;
		QueueStatusTextBlock->SetText(FText::FromString(DisplayedQueueStatusLine));
	}
	if (QueueSelectionTextBlock != nullptr)
	{
		if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry())
		{
			DisplayedSelectedQueueSummaryLine = FString::Printf(
				TEXT("Selected queue item %d/%d | Source: %s | State: %s | Priority: %s (%.1f)"),
				SelectedQueueEntryIndex + 1,
				CachedCoachSessionQueueState.Entries.Num(),
				SelectedEntry->SourceLabel.IsEmpty() ? TEXT("n/a") : *SelectedEntry->SourceLabel,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->EntryState),
				SelectedEntry->PriorityLabel.IsEmpty() ? TEXT("n/a") : *SelectedEntry->PriorityLabel,
				SelectedEntry->PriorityScore
			);
			QueueSelectionTextBlock->SetText(FText::FromString(DisplayedSelectedQueueSummaryLine));
		}
		else
		{
			DisplayedSelectedQueueSummaryLine = TEXT("Selected queue item: none");
			QueueSelectionTextBlock->SetText(FText::FromString(DisplayedSelectedQueueSummaryLine));
		}
	}
	if (QueueEntryDetailTextBlock != nullptr)
	{
		if (const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry())
		{
			const FString DeferredLabel = SelectedEntry->DeferredUntilUtc.IsEmpty()
				? TEXT("n/a")
				: SelectedEntry->DeferredUntilUtc;
			const FString DeferralReason = SelectedEntry->DeferralReasonLabel.IsEmpty()
				? TEXT("n/a")
				: SelectedEntry->DeferralReasonLabel;
			DisplayedSelectedQueueEntryDetailLine = FString::Printf(
				TEXT("Headline: %s | Deck: %s | Method: %s | Cases: %d | Mode: %s | Policy: %s | Deferred until: %s | Reason: %s | Follow-up: %s | Archive tune: %s | Pinned: %s"),
				*SelectedEntry->Headline,
				SelectedEntry->FocusDeckId.IsEmpty() ? TEXT("n/a") : *SelectedEntry->FocusDeckId,
				SelectedEntry->FocusMethodSegmentId.IsEmpty() ? TEXT("n/a") : *SelectedEntry->FocusMethodSegmentId,
				SelectedEntry->FocusCaseIds.Num(),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->SuggestedMode),
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(SelectedEntry->SuggestedSelectionPolicy),
				*DeferredLabel,
				*DeferralReason,
				SelectedEntry->bRequiresFollowUp ? TEXT("yes") : TEXT("no"),
				SelectedEntry->bRequiresArchiveRetentionTuning ? TEXT("yes") : TEXT("no"),
				SelectedEntry->bPinned ? TEXT("yes") : TEXT("no")
			);
			QueueEntryDetailTextBlock->SetText(FText::FromString(DisplayedSelectedQueueEntryDetailLine));
		}
		else
		{
			DisplayedSelectedQueueEntryDetailLine = TEXT("Queue entry detail: no queue entry selected");
			QueueEntryDetailTextBlock->SetText(FText::FromString(DisplayedSelectedQueueEntryDetailLine));
		}
	}
	if (QueueCountsTextBlock != nullptr)
	{
		DisplayedQueueCountsLine = FString::Printf(
			TEXT("Signals: %d | Ready: %d | Deferred: %d | In-progress: %d | Completed: %d"),
			CachedCoachPanelState.SignalCount,
			CachedCoachSessionQueueState.ReadyEntryCount,
			CachedCoachSessionQueueState.DeferredEntryCount,
			CachedCoachSessionQueueState.InProgressEntryCount,
			CachedCoachSessionQueueState.CompletedEntryCount
		);
		QueueCountsTextBlock->SetText(FText::FromString(DisplayedQueueCountsLine));
	}
	if (QueueExecutionTextBlock != nullptr)
	{
		DisplayedQueueExecutionLine = FString::Printf(
			TEXT("Execution: queued %d | started %d | completed %d | deferred %d | promoted %d | manual reschedules %d | outstanding deferred: %s | completion gap: %s | archive-aware friction: %s | blocked follow-up friction: %s"),
			CachedCoachQueueExecutionSummary.QueuedEventCount,
			CachedCoachQueueExecutionSummary.StartedEventCount,
			CachedCoachQueueExecutionSummary.CompletedEventCount,
			CachedCoachQueueExecutionSummary.DeferredEventCount,
			CachedCoachQueueExecutionSummary.PromotedEventCount,
			CachedCoachQueueExecutionSummary.ManualRescheduleEventCount,
			CachedCoachQueueExecutionSummary.bHasOutstandingDeferredWork ? TEXT("yes") : TEXT("no"),
			CachedCoachQueueExecutionSummary.bHasCompletionGap ? TEXT("yes") : TEXT("no"),
			CachedCoachQueueExecutionSummary.bHasArchiveAwareFriction ? TEXT("yes") : TEXT("no"),
			CachedCoachQueueExecutionSummary.bHasBlockedFollowUpFriction ? TEXT("yes") : TEXT("no")
		);
		QueueExecutionTextBlock->SetText(FText::FromString(DisplayedQueueExecutionLine));
	}
	if (ScheduleHeaderTextBlock != nullptr)
	{
		ScheduleHeaderTextBlock->SetText(FText::FromString(TEXT("[Schedule / Friction]")));
	}
	if (ScheduleStatusTextBlock != nullptr)
	{
		DisplayedScheduleStatusLine = FString::Printf(
			TEXT("Horizon: %s | Immediate %d | Deferred %d | Archive-aware %d | Follow-up %d | Pinned %d | Immediate window: %s | Deferred window: %s | Blocked follow-up: %s"),
			CachedCoachScheduleHorizonSummary.CurrentHorizonLabel.IsEmpty()
				? TEXT("n/a")
				: *CachedCoachScheduleHorizonSummary.CurrentHorizonLabel,
			CachedCoachScheduleHorizonSummary.ImmediateEntryCount,
			CachedCoachScheduleHorizonSummary.DeferredEntryCount,
			CachedCoachScheduleHorizonSummary.ArchiveAwareEntryCount,
			CachedCoachScheduleHorizonSummary.FollowUpEntryCount,
			CachedCoachScheduleHorizonSummary.PinnedEntryCount,
			CachedCoachScheduleHorizonSummary.bHasImmediateWindow ? TEXT("yes") : TEXT("no"),
			CachedCoachScheduleHorizonSummary.bHasDeferredWindow ? TEXT("yes") : TEXT("no"),
			CachedCoachScheduleHorizonSummary.bHasBlockedFollowUp ? TEXT("yes") : TEXT("no")
		);
		ScheduleStatusTextBlock->SetText(FText::FromString(DisplayedScheduleStatusLine));
	}
	if (SchedulePolicyTextBlock != nullptr)
	{
		DisplayedSchedulePolicyLine = FString::Printf(
			TEXT("Policy: immediate %d | pending %d | deferred %d | manual %d | earliest deferred: %s | dominant reason: %s | pressure %.2f | manual allowed: %s | expired deferrals: %s | review needed: %s | archive-aware: %s | blocked follow-up: %s | closure: %s"),
			CachedCoachSchedulePolicySummary.ImmediateEntryCount,
			CachedCoachSchedulePolicySummary.PendingEntryCount,
			CachedCoachSchedulePolicySummary.DeferredEntryCount,
			CachedCoachSchedulePolicySummary.ManualRescheduleEntryCount,
			CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc.IsEmpty()
				? TEXT("n/a")
				: *CachedCoachSchedulePolicySummary.EarliestDeferredUntilUtc,
			CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel.IsEmpty()
				? TEXT("n/a")
				: *CachedCoachSchedulePolicySummary.DominantDeferralReasonLabel,
			CachedCoachSchedulePolicySummary.ReschedulePressureScore,
			CachedCoachSchedulePolicySummary.bAllowsManualReschedule ? TEXT("yes") : TEXT("no"),
			CachedCoachSchedulePolicySummary.bHasExpiredDeferrals ? TEXT("yes") : TEXT("no"),
			CachedCoachSchedulePolicySummary.bNeedsManualRescheduleReview ? TEXT("yes") : TEXT("no"),
			CachedCoachSchedulePolicySummary.bHasArchiveAwareDeferrals ? TEXT("yes") : TEXT("no"),
			CachedCoachSchedulePolicySummary.bHasBlockedFollowUpDeferrals ? TEXT("yes") : TEXT("no"),
			CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
				? TEXT("n/a")
				: *CachedCoachSchedulePolicySummary.ClosurePolicyLine
		);
		SchedulePolicyTextBlock->SetText(FText::FromString(DisplayedSchedulePolicyLine));
	}
	const int32 ClosureKeepHistoryCount =
		CachedCoachSchedulePolicySummary.HistoricalFollowUpContinuationCount;
	const int32 ClosureSuppressHistoryCount =
		CachedCoachSchedulePolicySummary.HistoricalBorderlineFollowUpSuppressionCount;
	const bool bHasClosureRecoveryHistory =
		ClosureKeepHistoryCount > 0 || ClosureSuppressHistoryCount > 0;
	const FHyperTwistCoachSignal* ClosureRecoverySignal = CachedCoachSignals.FindByPredicate(
		[](const FHyperTwistCoachSignal& Signal)
		{
			return Signal.SignalId == TEXT("closure_history_follow_up_continuation")
				|| Signal.SignalId == TEXT("closure_history_recommended_suppression");
		}
	);
	const bool bClosureRecoverySignalPromoted =
		ClosureRecoverySignal != nullptr
		&& CachedCoachBrief.Signals.Num() > 0
		&& CachedCoachBrief.Signals[0].SignalId == ClosureRecoverySignal->SignalId;
	const FString ClosureGuidanceLaneLabel =
		CachedCoachPanelState.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::FollowUp
			? TEXT("follow-up")
			: (CachedCoachPanelState.PreferredGuidanceLane
				== EHyperTwistTrainingCoachGuidanceLane::Recommended
				? TEXT("recommended")
				: TEXT("none"));
	const FString ClosureRecoveryHistoryLabel =
		ClosureKeepHistoryCount > ClosureSuppressHistoryCount
			? TEXT("follow-up continuity history is dominant")
			: (ClosureSuppressHistoryCount > ClosureKeepHistoryCount
				? TEXT("recommended-side suppression history is dominant")
				: (bHasClosureRecoveryHistory
					? TEXT("retained closure history is balanced")
					: TEXT("no retained closure history")));
	const FString ClosureRecoveryStatusLine =
		ClosureRecoverySignal != nullptr
			? FString::Printf(
				TEXT("Closure recovery: %s | promoted: %s | headline: %s | priority: %s | score %.1f"),
				*ClosureRecoveryHistoryLabel,
				bClosureRecoverySignalPromoted ? TEXT("yes") : TEXT("no"),
				ClosureRecoverySignal->Headline.IsEmpty()
					? TEXT("n/a")
					: *ClosureRecoverySignal->Headline,
				*HyperTwistCoachDashboardWidgetInternal::EnumDisplayName(ClosureRecoverySignal->Priority),
				ClosureRecoverySignal->Score
			)
			: (bHasClosureRecoveryHistory
				? FString::Printf(
					TEXT("Closure recovery: retained history is present without an active closure-history signal | policy: %s"),
					CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
						? TEXT("n/a")
						: *CachedCoachSchedulePolicySummary.ClosurePolicyLine
				)
				: TEXT("Closure recovery: no retained closure-recovery history is recorded yet."));
	const FString ClosureRecoveryDetailLine = FString::Printf(
		TEXT("Policy: %s | keep %d | suppress %d | continuation active: %s | borderline suppression active: %s | guidance lane: %s | source: %s%s%s"),
		CachedCoachSchedulePolicySummary.ClosurePolicyLine.IsEmpty()
			? TEXT("n/a")
			: *CachedCoachSchedulePolicySummary.ClosurePolicyLine,
		ClosureKeepHistoryCount,
		ClosureSuppressHistoryCount,
		CachedCoachSchedulePolicySummary.bFollowUpContinuationFromRecoveryHistory
			? TEXT("yes")
			: TEXT("no"),
		CachedCoachSchedulePolicySummary.bBorderlineFollowUpSuppressedByRecoveryHistory
			? TEXT("yes")
			: TEXT("no"),
		*ClosureGuidanceLaneLabel,
		*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
			CachedCoachPanelState.PreferredGuidanceSourceLabel),
		ClosureRecoverySignal != nullptr ? TEXT(" || Signal detail: ") : TEXT(""),
		ClosureRecoverySignal != nullptr
			? *ClosureRecoverySignal->Detail
			: TEXT("")
	);
	DisplayedClosureRecoveryStatusLine = ClosureRecoveryStatusLine;
	DisplayedClosureRecoveryDetailLine = ClosureRecoveryDetailLine;
	const FHyperTwistCoachDashboardClosureRecoveryEntry* SelectedClosureRecoveryEntry =
		SelectedClosureRecoveryIndex >= 0
		&& SelectedClosureRecoveryIndex < ClosureRecoveryHistoryEntries.Num()
		? &ClosureRecoveryHistoryEntries[SelectedClosureRecoveryIndex]
		: nullptr;
	const FString SelectedClosureHistoryLaneLabel =
		SelectedClosureRecoveryEntry != nullptr
		? (SelectedClosureRecoveryEntry->PreferredGuidanceLane
			== EHyperTwistTrainingCoachGuidanceLane::FollowUp
			? TEXT("follow-up")
			: (SelectedClosureRecoveryEntry->PreferredGuidanceLane
				== EHyperTwistTrainingCoachGuidanceLane::Recommended
				? TEXT("recommended")
				: TEXT("none")))
		: TEXT("none");
	const FString ClosureRecoveryHistoryStatusLine =
		SelectedClosureRecoveryEntry != nullptr
		? FString::Printf(
			TEXT("Closure history: %d entries | selected %d/%d | Lane: %s | Recorded: %s"),
			ClosureRecoveryHistoryEntries.Num(),
			SelectedClosureRecoveryIndex + 1,
			ClosureRecoveryHistoryEntries.Num(),
			*SelectedClosureHistoryLaneLabel,
			*SelectedClosureRecoveryEntry->RecordedAtUtc
		)
		: TEXT("Closure history: no retained closure-recovery shifts recorded yet.");
	const FString ClosureRecoveryHistoryDetailLine =
		SelectedClosureRecoveryEntry != nullptr
		? FString::Printf(
			TEXT("Policy: %s | keep %d | suppress %d | continuation active: %s | borderline suppression active: %s | source: %s | promoted: %s | signal: %s%s%s"),
			SelectedClosureRecoveryEntry->ClosurePolicyLine.IsEmpty()
				? TEXT("n/a")
				: *SelectedClosureRecoveryEntry->ClosurePolicyLine,
			SelectedClosureRecoveryEntry->HistoricalFollowUpContinuationCount,
			SelectedClosureRecoveryEntry->HistoricalBorderlineFollowUpSuppressionCount,
			SelectedClosureRecoveryEntry->bFollowUpContinuationFromRecoveryHistory
				? TEXT("yes")
				: TEXT("no"),
			SelectedClosureRecoveryEntry->bBorderlineFollowUpSuppressedByRecoveryHistory
				? TEXT("yes")
				: TEXT("no"),
			*HyperTwistCoachDashboardWidgetInternal::DescribeCoachMemorySourceLabel(
				SelectedClosureRecoveryEntry->PreferredGuidanceSourceLabel),
			SelectedClosureRecoveryEntry->bActiveSignalPromoted ? TEXT("yes") : TEXT("no"),
			SelectedClosureRecoveryEntry->ActiveSignalHeadline.IsEmpty()
				? TEXT("n/a")
				: *SelectedClosureRecoveryEntry->ActiveSignalHeadline,
			SelectedClosureRecoveryEntry->ActiveSignalDetail.IsEmpty() ? TEXT("") : TEXT(" || detail: "),
			SelectedClosureRecoveryEntry->ActiveSignalDetail.IsEmpty()
				? TEXT("")
				: *SelectedClosureRecoveryEntry->ActiveSignalDetail
		)
		: TEXT("Closure history detail: retained keep-vs-suppress shifts will accumulate here as recovery history changes the closure posture over time.");
	if (ClosureRecoveryHeaderTextBlock != nullptr)
	{
		ClosureRecoveryHeaderTextBlock->SetText(FText::FromString(TEXT("[Closure Recovery]")));
	}
	if (ClosureRecoveryStatusTextBlock != nullptr)
	{
		ClosureRecoveryStatusTextBlock->SetText(FText::FromString(DisplayedClosureRecoveryStatusLine));
	}
	if (ClosureRecoveryDetailTextBlock != nullptr)
	{
		ClosureRecoveryDetailTextBlock->SetText(FText::FromString(DisplayedClosureRecoveryDetailLine));
	}
	if (ClosureRecoveryHistoryHeaderTextBlock != nullptr)
	{
		ClosureRecoveryHistoryHeaderTextBlock->SetText(FText::FromString(TEXT("[Closure Recovery History]")));
	}
	if (ClosureRecoveryHistoryStatusTextBlock != nullptr)
	{
		ClosureRecoveryHistoryStatusTextBlock->SetText(FText::FromString(ClosureRecoveryHistoryStatusLine));
	}
	if (ClosureRecoveryHistoryDetailTextBlock != nullptr)
	{
		ClosureRecoveryHistoryDetailTextBlock->SetText(FText::FromString(ClosureRecoveryHistoryDetailLine));
	}
	if (PreviousClosureRecoveryButtonLabel != nullptr)
	{
		DisplayedPreviousClosureRecoveryNavigationLabel = TEXT("Prev Closure");
		PreviousClosureRecoveryButtonLabel->SetText(
			FText::FromString(DisplayedPreviousClosureRecoveryNavigationLabel));
	}
	if (PreviousClosureRecoveryButton != nullptr)
	{
		PreviousClosureRecoveryButton->SetIsEnabled(ClosureRecoveryHistoryEntries.Num() > 1);
	}
	if (NextClosureRecoveryButtonLabel != nullptr)
	{
		DisplayedNextClosureRecoveryNavigationLabel = TEXT("Next Closure");
		NextClosureRecoveryButtonLabel->SetText(
			FText::FromString(DisplayedNextClosureRecoveryNavigationLabel));
	}
	if (NextClosureRecoveryButton != nullptr)
	{
		NextClosureRecoveryButton->SetIsEnabled(ClosureRecoveryHistoryEntries.Num() > 1);
	}
	if (QueueRecoveryHeaderTextBlock != nullptr)
	{
		QueueRecoveryHeaderTextBlock->SetText(FText::FromString(TEXT("[Queue Recovery]")));
	}
	if (QueueRecoveryStatusTextBlock != nullptr)
	{
		QueueRecoveryStatusTextBlock->SetText(FText::FromString(QueueRecoveryStatusLine));
	}
	if (QueueRecoveryDetailTextBlock != nullptr)
	{
		QueueRecoveryDetailTextBlock->SetText(FText::FromString(FString::Printf(
			TEXT("%s || %s"),
			*QueueRecoveryDetailLine,
			*QueueSuppressionDetailLine
		)));
	}
	if (QueueRecoveryOutcomeHeaderTextBlock != nullptr)
	{
		QueueRecoveryOutcomeHeaderTextBlock->SetText(FText::FromString(TEXT("[Queue Recovery Outcome]")));
	}
	if (QueueRecoveryOutcomeStatusTextBlock != nullptr)
	{
		QueueRecoveryOutcomeStatusTextBlock->SetText(FText::FromString(QueueRecoveryOutcomeStatusLine));
	}
	if (QueueRecoveryOutcomeDetailTextBlock != nullptr)
	{
		QueueRecoveryOutcomeDetailTextBlock->SetText(FText::FromString(QueueRecoveryOutcomeDetailLine));
	}
	if (MethodDrillRecoveryHistoryHeaderTextBlock != nullptr)
	{
		MethodDrillRecoveryHistoryHeaderTextBlock->SetText(FText::FromString(
			TEXT("[Drill Recovery History]")));
	}
   DisplayedMethodDrillRecoveryOutcomeHistoryStatusLine = MethodDrillRecoveryHistoryStatusLine;
	if (MethodDrillRecoveryHistoryStatusTextBlock != nullptr)
	{
		MethodDrillRecoveryHistoryStatusTextBlock->SetText(FText::FromString(
			MethodDrillRecoveryHistoryStatusLine));
	}
 DisplayedMethodDrillRecoveryOutcomeHistoryDetailLine = MethodDrillRecoveryHistoryDetailLine;
	if (MethodDrillRecoveryHistoryDetailTextBlock != nullptr)
	{
		MethodDrillRecoveryHistoryDetailTextBlock->SetText(FText::FromString(
			MethodDrillRecoveryHistoryDetailLine));
	}
	if (PreviousMethodDrillRecoveryHistoryButtonLabel != nullptr)
	{
		DisplayedPreviousMethodDrillRecoveryNavigationLabel = TEXT("Prev Drill Recovery");
		PreviousMethodDrillRecoveryHistoryButtonLabel->SetText(FText::FromString(
			DisplayedPreviousMethodDrillRecoveryNavigationLabel));
	}
	if (PreviousMethodDrillRecoveryHistoryButton != nullptr)
	{
		PreviousMethodDrillRecoveryHistoryButton->SetIsEnabled(
			MethodDrillRecoveryHistoryIndices.Num() > 1);
	}
	if (NextMethodDrillRecoveryHistoryButtonLabel != nullptr)
	{
		DisplayedNextMethodDrillRecoveryNavigationLabel = TEXT("Next Drill Recovery");
		NextMethodDrillRecoveryHistoryButtonLabel->SetText(FText::FromString(
			DisplayedNextMethodDrillRecoveryNavigationLabel));
	}
	if (NextMethodDrillRecoveryHistoryButton != nullptr)
	{
		NextMethodDrillRecoveryHistoryButton->SetIsEnabled(
			MethodDrillRecoveryHistoryIndices.Num() > 1);
	}
	if (MethodDrillRecoveryMemoryHistoryHeaderTextBlock != nullptr)
	{
		MethodDrillRecoveryMemoryHistoryHeaderTextBlock->SetText(FText::FromString(
			TEXT("[Drill Recovery Memory History]")));
	}
  DisplayedMethodDrillRecoveryMemoryHistoryStatusLine = MethodDrillRecoveryMemoryHistoryStatusLine;
	if (MethodDrillRecoveryMemoryHistoryStatusTextBlock != nullptr)
	{
		MethodDrillRecoveryMemoryHistoryStatusTextBlock->SetText(FText::FromString(
			MethodDrillRecoveryMemoryHistoryStatusLine));
	}
  DisplayedMethodDrillRecoveryMemoryHistoryDetailLine = MethodDrillRecoveryMemoryHistoryDetailLine;
	if (MethodDrillRecoveryMemoryHistoryDetailTextBlock != nullptr)
	{
		MethodDrillRecoveryMemoryHistoryDetailTextBlock->SetText(FText::FromString(
			MethodDrillRecoveryMemoryHistoryDetailLine));
	}
	if (PreviousMethodDrillRecoveryMemoryHistoryButtonLabel != nullptr)
	{
		DisplayedPreviousMethodDrillRecoveryMemoryNavigationLabel = TEXT("Prev Drill Memory");
		PreviousMethodDrillRecoveryMemoryHistoryButtonLabel->SetText(FText::FromString(
			DisplayedPreviousMethodDrillRecoveryMemoryNavigationLabel));
	}
	if (PreviousMethodDrillRecoveryMemoryHistoryButton != nullptr)
	{
		PreviousMethodDrillRecoveryMemoryHistoryButton->SetIsEnabled(
			MethodDrillRecoveryMemoryHistoryEntries.Num() > 1);
	}
	if (NextMethodDrillRecoveryMemoryHistoryButtonLabel != nullptr)
	{
		DisplayedNextMethodDrillRecoveryMemoryNavigationLabel = TEXT("Next Drill Memory");
		NextMethodDrillRecoveryMemoryHistoryButtonLabel->SetText(FText::FromString(
			DisplayedNextMethodDrillRecoveryMemoryNavigationLabel));
	}
	if (NextMethodDrillRecoveryMemoryHistoryButton != nullptr)
	{
		NextMethodDrillRecoveryMemoryHistoryButton->SetIsEnabled(
			MethodDrillRecoveryMemoryHistoryEntries.Num() > 1);
	}
	if (QueueSuppressionHistoryHeaderTextBlock != nullptr)
	{
		QueueSuppressionHistoryHeaderTextBlock->SetText(FText::FromString(TEXT("[Queue Suppression History]")));
	}
	if (QueueSuppressionHistoryStatusTextBlock != nullptr)
	{
		QueueSuppressionHistoryStatusTextBlock->SetText(FText::FromString(QueueSuppressionHistoryStatusLine));
	}
	if (QueueSuppressionHistoryDetailTextBlock != nullptr)
	{
		QueueSuppressionHistoryDetailTextBlock->SetText(FText::FromString(QueueSuppressionHistoryDetailLine));
	}
	if (PreviousQueueSuppressionButtonLabel != nullptr)
	{
		DisplayedPreviousQueueSuppressionNavigationLabel = TEXT("Prev Suppression");
		PreviousQueueSuppressionButtonLabel->SetText(
			FText::FromString(DisplayedPreviousQueueSuppressionNavigationLabel));
	}
	if (PreviousQueueSuppressionButton != nullptr)
	{
		PreviousQueueSuppressionButton->SetIsEnabled(QueueSuppressionHistoryEntries.Num() > 1);
	}
	if (NextQueueSuppressionButtonLabel != nullptr)
	{
		DisplayedNextQueueSuppressionNavigationLabel = TEXT("Next Suppression");
		NextQueueSuppressionButtonLabel->SetText(
			FText::FromString(DisplayedNextQueueSuppressionNavigationLabel));
	}
	if (NextQueueSuppressionButton != nullptr)
	{
		NextQueueSuppressionButton->SetIsEnabled(QueueSuppressionHistoryEntries.Num() > 1);
	}
	if (VerificationStatusTextBlock != nullptr)
	{
		DisplayedVerificationStatusLine = CachedCoachPanelState.VerificationStatusLine;
		VerificationStatusTextBlock->SetText(FText::FromString(DisplayedVerificationStatusLine));
	}
	if (RecognitionStatusTextBlock != nullptr)
	{
		DisplayedRecognitionStatusLine = CachedCoachPanelState.RecognitionStatusLine;
		RecognitionStatusTextBlock->SetText(FText::FromString(DisplayedRecognitionStatusLine));
	}
	if (RecognitionDetailTextBlock != nullptr)
	{
		DisplayedRecognitionDetailLine = CachedCoachPanelState.RecognitionDetailLine;
		RecognitionDetailTextBlock->SetText(FText::FromString(DisplayedRecognitionDetailLine));
	}
	if (ReviewPolicyStatusTextBlock != nullptr)
	{
		DisplayedReviewPolicyStatusLine = CachedCoachPanelState.ReviewPolicyStatusLine;
		ReviewPolicyStatusTextBlock->SetText(FText::FromString(DisplayedReviewPolicyStatusLine));
	}
	if (ReviewPolicyDetailTextBlock != nullptr)
	{
		DisplayedReviewPolicyDetailLine = CachedCoachPanelState.ReviewPolicyDetailLine;
		ReviewPolicyDetailTextBlock->SetText(FText::FromString(DisplayedReviewPolicyDetailLine));
	}
	if (VerificationHeaderTextBlock != nullptr)
	{
		VerificationHeaderTextBlock->SetText(FText::FromString(TEXT("[Repository Verification]")));
	}
	if (VerificationDetailTextBlock != nullptr)
	{
		DisplayedVerificationDetailLine =
			HyperTwistCoachDashboardWidgetInternal::BuildDisplayedRepositoryVerificationDetailLine(
				CachedRepositoryRoundTripVerification,
				VerificationNotePreview,
				CachedCoachPanelState);
		VerificationDetailTextBlock->SetText(FText::FromString(DisplayedVerificationDetailLine));
	}

	FString PrimaryLabel = CachedCoachPanelState.PrimaryActionLabel;
	if (PrimaryLabel.IsEmpty())
	{
		PrimaryLabel = TEXT("Refresh");
	}
	if (PrimaryActionButtonLabel != nullptr)
	{
		DisplayedPrimaryActionLabel = PrimaryLabel;
		PrimaryActionButtonLabel->SetText(FText::FromString(DisplayedPrimaryActionLabel));
	}
	if (PrimaryActionButton != nullptr)
	{
		PrimaryActionButton->SetIsEnabled(
			!bHasLiveAttemptTimer
			&& (
				CachedCoachPanelState.bCanStartQueuedRun
				|| CachedCoachPanelState.bCanStartCoachFollowUpRun
				|| CachedCoachPanelState.bCanStartCoachRecommendedRun
			)
		);
	}

	if (VerifyButtonLabel != nullptr)
	{
		DisplayedVerificationActionLabel = TEXT("Verify");
		VerifyButtonLabel->SetText(FText::FromString(DisplayedVerificationActionLabel));
	}
	if (DeferButtonLabel != nullptr)
	{
		DisplayedDeferQueueActionLabel = TEXT("Defer 24h");
		DeferButtonLabel->SetText(FText::FromString(DisplayedDeferQueueActionLabel));
	}
	if (DeferButton != nullptr)
	{
		DeferButton->SetIsEnabled(!bHasLiveAttemptTimer && FindSelectedQueueEntry() != nullptr);
	}
	if (PromoteButtonLabel != nullptr)
	{
		DisplayedPromoteQueueActionLabel = TEXT("Promote Deferred");
		PromoteButtonLabel->SetText(FText::FromString(DisplayedPromoteQueueActionLabel));
	}
	if (PromoteButton != nullptr)
	{
		PromoteButton->SetIsEnabled(!bHasLiveAttemptTimer && !FindFirstDeferredQueueEntryId().IsEmpty());
	}
	if (QueueRecoveryActionButtonLabel != nullptr)
	{
		DisplayedQueueRecoveryActionLabel = QueueRecoveryActionLabel;
		QueueRecoveryActionButtonLabel->SetText(FText::FromString(DisplayedQueueRecoveryActionLabel));
	}
	if (QueueRecoveryActionButton != nullptr)
	{
		QueueRecoveryActionButton->SetIsEnabled(bCanApplyQueueRecovery);
	}
	if (CompleteRunButtonLabel != nullptr)
	{
		DisplayedCompleteRunControlLabel = TEXT("Complete Run");
		CompleteRunButtonLabel->SetText(FText::FromString(DisplayedCompleteRunControlLabel));
	}
	if (CompleteRunButton != nullptr)
	{
		CompleteRunButton->SetIsEnabled(bHasActiveRun && !bHasLiveAttemptTimer);
	}
	if (ContinueRunButtonLabel != nullptr)
	{
		ContinueRunButtonLabel->SetText(FText::FromString(ContinueRunLabel));
	}
	if (ContinueRunButton != nullptr)
	{
		ContinueRunButton->SetIsEnabled(
			(!bHasLiveAttemptTimer && bCanContinueCurrentRun)
			|| (bLiveInspectionPhase && bHasRunnableCurrentCase)
			|| bCanLaunchCoachRun
		);
	}
	if (ClearRunButtonLabel != nullptr)
	{
		DisplayedClearRunControlLabel = TEXT("Clear Run");
		ClearRunButtonLabel->SetText(FText::FromString(DisplayedClearRunControlLabel));
	}
	if (ClearRunButton != nullptr)
	{
		ClearRunButton->SetIsEnabled(bHasActiveRun && !bHasLiveAttemptTimer);
	}
	if (RecordSuccessButtonLabel != nullptr)
	{
		DisplayedRecordSuccessActionLabel =
			bLiveSolvePhase ? TEXT("Stop Success") : TEXT("Record Success");
		RecordSuccessButtonLabel->SetText(FText::FromString(DisplayedRecordSuccessActionLabel));
	}
	if (RecordSuccessButton != nullptr)
	{
		RecordSuccessButton->SetIsEnabled(bLiveSolvePhase || (!bHasLiveAttemptTimer && bHasRunnableCurrentCase));
	}
	if (RecordFailureButtonLabel != nullptr)
	{
		DisplayedRecordFailureActionLabel =
			bLiveSolvePhase ? TEXT("Stop Failure") : TEXT("Record Failure");
		RecordFailureButtonLabel->SetText(FText::FromString(DisplayedRecordFailureActionLabel));
	}
	if (RecordFailureButton != nullptr)
	{
		RecordFailureButton->SetIsEnabled(bLiveSolvePhase || (!bHasLiveAttemptTimer && bHasRunnableCurrentCase));
	}
	if (RecordTimeoutButtonLabel != nullptr)
	{
		DisplayedRecordTimeoutActionLabel =
			bLiveSolvePhase ? TEXT("Stop Timeout") : TEXT("Record Timeout");
		RecordTimeoutButtonLabel->SetText(FText::FromString(DisplayedRecordTimeoutActionLabel));
	}
	if (RecordTimeoutButton != nullptr)
	{
		RecordTimeoutButton->SetIsEnabled(bLiveSolvePhase || (!bHasLiveAttemptTimer && bHasRunnableCurrentCase));
	}
	if (RecordDnfButtonLabel != nullptr)
	{
		DisplayedRecordDnfActionLabel =
			bLiveSolvePhase ? TEXT("Stop DNF") : TEXT("Record DNF");
		RecordDnfButtonLabel->SetText(FText::FromString(DisplayedRecordDnfActionLabel));
	}
	if (RecordDnfButton != nullptr)
	{
		RecordDnfButton->SetIsEnabled(bLiveSolvePhase || (!bHasLiveAttemptTimer && bHasRunnableCurrentCase));
	}
	if (UseTargetTimeButtonLabel != nullptr)
	{
		DisplayedUseTargetTimeLabel = TEXT("Use Target");
		UseTargetTimeButtonLabel->SetText(FText::FromString(DisplayedUseTargetTimeLabel));
	}
	if (UseTargetTimeButton != nullptr)
	{
		UseTargetTimeButton->SetIsEnabled(
			!bHasLiveAttemptTimer && bHasRunnableCurrentCase && CurrentTrainingCase.TimeTargetMs > 0
		);
	}
	if (UseAverageTimeButtonLabel != nullptr)
	{
		DisplayedUseAverageTimeLabel = TEXT("Use Avg");
		UseAverageTimeButtonLabel->SetText(FText::FromString(DisplayedUseAverageTimeLabel));
	}
	if (UseAverageTimeButton != nullptr)
	{
		UseAverageTimeButton->SetIsEnabled(
			!bHasLiveAttemptTimer && bHasActiveRun && CachedRunSummary.AverageTotalTimeMs > 0
		);
	}
	if (StartTimerButtonLabel != nullptr)
	{
		DisplayedStartTimerControlLabel =
			bLiveInspectionPhase ? TEXT("Start Solve")
			: (bLiveSolvePhase ? TEXT("Pause Timer") : (bLivePausedPhase ? TEXT("Resume Solve") : TEXT("Start Attempt")));
		StartTimerButtonLabel->SetText(FText::FromString(DisplayedStartTimerControlLabel));
	}
	if (StartTimerButton != nullptr)
	{
		StartTimerButton->SetIsEnabled(
			bHasRunnableCurrentCase
			&& (!bHasLiveAttemptTimer || bLiveInspectionPhase || bLiveSolvePhase || bLivePausedPhase)
		);
	}
	if (CancelTimerButtonLabel != nullptr)
	{
		DisplayedCancelTimerControlLabel = TEXT("Cancel Timer");
		CancelTimerButtonLabel->SetText(FText::FromString(DisplayedCancelTimerControlLabel));
	}
	if (CancelTimerButton != nullptr)
	{
		CancelTimerButton->SetIsEnabled(bHasLiveAttemptTimer);
	}
	if (CaptureSplitButtonLabel != nullptr)
	{
		const FString CaptureSplitLabel = NextSplitPhaseDefinition == nullptr
			? TEXT("All Splits Captured")
			: FString::Printf(TEXT("Capture %s"), *NextSplitLabel);
		DisplayedCaptureSplitControlLabel = CaptureSplitLabel;
		CaptureSplitButtonLabel->SetText(FText::FromString(DisplayedCaptureSplitControlLabel));
	}
	if (CaptureSplitButton != nullptr)
	{
		CaptureSplitButton->SetIsEnabled(bLiveSolvePhase && NextSplitPhaseDefinition != nullptr);
	}
	if (UndoSplitButtonLabel != nullptr)
	{
		DisplayedUndoSplitControlLabel = TEXT("Undo Split");
		UndoSplitButtonLabel->SetText(FText::FromString(DisplayedUndoSplitControlLabel));
	}
	if (UndoSplitButton != nullptr)
	{
		UndoSplitButton->SetIsEnabled(bLiveSolvePhase && LiveAttemptSplitCaptures.Num() > 0);
	}
	if (PreviousAttemptButtonLabel != nullptr)
	{
		DisplayedPreviousAttemptNavigationLabel = TEXT("Prev Attempt");
		PreviousAttemptButtonLabel->SetText(FText::FromString(DisplayedPreviousAttemptNavigationLabel));
	}
	if (PreviousAttemptButton != nullptr)
	{
		PreviousAttemptButton->SetIsEnabled(CachedRunState.Attempts.Num() > 1);
	}
	if (NextAttemptButtonLabel != nullptr)
	{
		DisplayedNextAttemptNavigationLabel = TEXT("Next Attempt");
		NextAttemptButtonLabel->SetText(FText::FromString(DisplayedNextAttemptNavigationLabel));
	}
	if (NextAttemptButton != nullptr)
	{
		NextAttemptButton->SetIsEnabled(CachedRunState.Attempts.Num() > 1);
	}
	if (PreviousQueueButtonLabel != nullptr)
	{
		DisplayedPreviousQueueNavigationLabel = TEXT("Prev Queue");
		PreviousQueueButtonLabel->SetText(FText::FromString(DisplayedPreviousQueueNavigationLabel));
	}
	if (PreviousQueueButton != nullptr)
	{
		PreviousQueueButton->SetIsEnabled(!bHasLiveAttemptTimer && CachedCoachSessionQueueState.Entries.Num() > 1);
	}
	if (StartSelectedButtonLabel != nullptr)
	{
		DisplayedStartSelectedQueueActionLabel = TEXT("Start Selected");
		StartSelectedButtonLabel->SetText(FText::FromString(DisplayedStartSelectedQueueActionLabel));
	}
	if (StartSelectedButton != nullptr)
	{
		const FHyperTwistTrainingCoachSessionQueueStateEntry* SelectedEntry = FindSelectedQueueEntry();
		const bool bSelectedRunnable = SelectedEntry != nullptr
			&& (SelectedEntry->EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Ready
				|| (SelectedEntry->EntryState == EHyperTwistTrainingCoachSessionQueueEntryState::Pending
					&& SelectedEntry->bCanStartImmediately));
		StartSelectedButton->SetIsEnabled(!bHasLiveAttemptTimer && bSelectedRunnable);
	}
	if (NextQueueButtonLabel != nullptr)
	{
		DisplayedNextQueueNavigationLabel = TEXT("Next Queue");
		NextQueueButtonLabel->SetText(FText::FromString(DisplayedNextQueueNavigationLabel));
	}
	if (NextQueueButton != nullptr)
	{
		NextQueueButton->SetIsEnabled(!bHasLiveAttemptTimer && CachedCoachSessionQueueState.Entries.Num() > 1);
	}
}

void UHyperTwistCoachDashboardWidget::RefreshLiveAttemptClock()
{
	SyncLiveAttemptStateFromSubsystem();
}

void UHyperTwistCoachDashboardWidget::SyncLiveAttemptStateFromSubsystem()
{
	if (UHyperTwistTrainingSubsystem* TrainingSubsystem = UHyperTwistTrainingRuntimeLibrary::GetTrainingSubsystem(this))
	{
		const FHyperTwistTrainingLiveTimerState LiveTimerState = TrainingSubsystem->GetActiveLiveTimerState();
		bHasLiveAttemptTimer = LiveTimerState.IsActive();
		LiveAttemptPhase = LiveTimerState.Phase == EHyperTwistTrainingLiveTimerPhase::Inspection
			? EHyperTwistCoachDashboardAttemptPhase::Inspection
			: (LiveTimerState.Phase == EHyperTwistTrainingLiveTimerPhase::Paused
				? EHyperTwistCoachDashboardAttemptPhase::Paused
				: (LiveTimerState.Phase == EHyperTwistTrainingLiveTimerPhase::Solving
					? EHyperTwistCoachDashboardAttemptPhase::Solving
					: EHyperTwistCoachDashboardAttemptPhase::Idle));
		LiveAttemptInspectionElapsedMs = FMath::Max(LiveTimerState.InspectionElapsedMs, 0);
		LiveAttemptSolveElapsedMs = FMath::Max(LiveTimerState.SolveElapsedMs, 0);
		LiveAttemptDisplayedMs = FMath::Max(LiveTimerState.DisplayedElapsedMs, 0);
		LiveAttemptSplitCaptures = LiveTimerState.SplitCaptures;
		return;
	}

	bHasLiveAttemptTimer = false;
	LiveAttemptPhase = EHyperTwistCoachDashboardAttemptPhase::Idle;
	LiveAttemptInspectionElapsedMs = 0;
	LiveAttemptSolveElapsedMs = 0;
	LiveAttemptDisplayedMs = 0;
	LiveAttemptSplitCaptures.Reset();
}

FString UHyperTwistCoachDashboardWidget::BuildDefaultDeferredUntilUtc() const
{
	const FDateTime DeferredTimeUtc =
		FDateTime::UtcNow() + FTimespan::FromHours(FMath::Max(DefaultDeferredHours, 1));
	return DeferredTimeUtc.ToIso8601();
}

FString UHyperTwistCoachDashboardWidget::FindFirstDeferredQueueEntryId() const
{
	return UHyperTwistTrainingCoachLibrary::DeriveCoachQueueControlSurface(
		CachedCoachSessionQueueState,
		CachedCoachPanelState
	)
		.PromoteTargetEntryId;
}

bool UHyperTwistCoachDashboardWidget::TryParseAttemptTimeOverride(int32& OutTimeMs) const
{
	OutTimeMs = 0;
	if (AttemptTimeTextBox == nullptr)
	{
		return false;
	}

	const FString RawText = AttemptTimeTextBox->GetText().ToString().TrimStartAndEnd();
	if (RawText.IsEmpty())
	{
		return false;
	}

	int32 ParsedValue = 0;
	if (!LexTryParseString(ParsedValue, *RawText))
	{
		return false;
	}

	OutTimeMs = FMath::Max(ParsedValue, 0);
	return true;
}

int32 UHyperTwistCoachDashboardWidget::ResolveAttemptTimeMs(const EHyperTwistTrainingAttemptResult Result) const
{
	int32 ParsedOverrideMs = 0;
	if (TryParseAttemptTimeOverride(ParsedOverrideMs))
	{
		return ParsedOverrideMs;
	}

	const int32 TargetTimeMs = FMath::Max(CachedRunState.CurrentSelection.TrainingCase.TimeTargetMs, 0);
	const int32 AverageTimeMs = FMath::Max(CachedRunSummary.AverageTotalTimeMs, 0);

	switch (Result)
	{
	case EHyperTwistTrainingAttemptResult::Success:
		if (TargetTimeMs > 0)
		{
			return TargetTimeMs;
		}
		if (AverageTimeMs > 0)
		{
			return AverageTimeMs;
		}
		return FMath::Max(DefaultSuccessAttemptTimeMs, 1);

	case EHyperTwistTrainingAttemptResult::Failure:
		if (AverageTimeMs > 0)
		{
			return FMath::Max(AverageTimeMs, DefaultFailureAttemptTimeMs);
		}
		if (TargetTimeMs > 0)
		{
			return FMath::Max(TargetTimeMs * 2, DefaultFailureAttemptTimeMs);
		}
		return FMath::Max(DefaultFailureAttemptTimeMs, 1);

	case EHyperTwistTrainingAttemptResult::Timeout:
		if (TargetTimeMs > 0)
		{
			return FMath::Max(TargetTimeMs * 2, DefaultTimeoutAttemptTimeMs);
		}
		return FMath::Max(DefaultTimeoutAttemptTimeMs, 1);

	case EHyperTwistTrainingAttemptResult::DNF:
		if (TargetTimeMs > 0)
		{
			return FMath::Max(TargetTimeMs * 2, DefaultDnfAttemptTimeMs);
		}
		return FMath::Max(DefaultDnfAttemptTimeMs, 1);

	default:
		return FMath::Max(DefaultFailureAttemptTimeMs, 1);
	}
}

void UHyperTwistCoachDashboardWidget::SetAttemptTimeText(const int32 TimeMs)
{
	if (AttemptTimeTextBox != nullptr)
	{
		AttemptTimeTextBox->SetText(FText::FromString(FString::FromInt(FMath::Max(TimeMs, 0))));
	}
}

const FHyperTwistTrainingCoachSessionQueueStateEntry* UHyperTwistCoachDashboardWidget::FindSelectedQueueEntry() const
{
	if (SelectedQueueEntryIndex < 0 || SelectedQueueEntryIndex >= CachedCoachSessionQueueState.Entries.Num())
	{
		return nullptr;
	}

	return &CachedCoachSessionQueueState.Entries[SelectedQueueEntryIndex];
}

const FHyperTwistTrainingTimingPolicy* UHyperTwistCoachDashboardWidget::FindActiveTimingPolicy() const
{
	if (!CachedRunState.Session.IsStructurallyValid() || !CachedRunState.ActiveDeck.IsStructurallyValid())
	{
		return nullptr;
	}

	return &CachedRunState.ActiveDeck.TimingPolicy;
}

bool UHyperTwistCoachDashboardWidget::IsLiveAttemptInspectionPhase() const
{
	return bHasLiveAttemptTimer && LiveAttemptPhase == EHyperTwistCoachDashboardAttemptPhase::Inspection;
}

int32 UHyperTwistCoachDashboardWidget::GetMaxManualSplitCaptureCount() const
{
	const FHyperTwistTrainingTimingPolicy* TimingPolicy = FindActiveTimingPolicy();
	if (TimingPolicy == nullptr || TimingPolicy->SplitPhases.Num() <= 1)
	{
		return 0;
	}

	return TimingPolicy->SplitPhases.Num() - 1;
}

const FHyperTwistTrainingSplitPhaseDefinition* UHyperTwistCoachDashboardWidget::FindNextSplitPhaseToCapture() const
{
	const FHyperTwistTrainingTimingPolicy* TimingPolicy = FindActiveTimingPolicy();
	if (TimingPolicy == nullptr)
	{
		return nullptr;
	}

	const int32 NextPhaseIndex = LiveAttemptSplitCaptures.Num();
	const int32 MaxManualSplitCaptureCount = GetMaxManualSplitCaptureCount();
	if (NextPhaseIndex < 0
		|| NextPhaseIndex >= MaxManualSplitCaptureCount
		|| !TimingPolicy->SplitPhases.IsValidIndex(NextPhaseIndex))
	{
		return nullptr;
	}

	return &TimingPolicy->SplitPhases[NextPhaseIndex];
}
