diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp index 8aa9b3e..486a4e9 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp @@ -36,6 +36,14 @@ namespace HyperTwistTrainingCoachLibraryInternal || IsDeferredFirstContinuationSource(SourceLabel); } + bool IsMethodDrillDashboardHandoffSource(const FString& SourceLabel) + { + return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-")) + || SourceLabel == TEXT("dashboard-handoff-method-drill-queued") + || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up") + || SourceLabel == TEXT("dashboard-handoff-method-drill-recommended"); + } + FString DescribeCoachHandoffKind(const EHyperTwistTrainingCoachHandoffKind HandoffKind) { switch (HandoffKind) @@ -1104,6 +1112,10 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna HyperTwistTrainingCoachLibraryInternal::IsDeferredOverflowDashboardHandoffSource( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel ); + const bool bMethodDrillDashboardHandoff = + HyperTwistTrainingCoachLibraryInternal::IsMethodDrillDashboardHandoffSource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ); const bool bExplicitDashboardHandoffPreference = CoachMemorySnapshot.PreferredCoachHandoffKind != EHyperTwistTrainingCoachHandoffKind::None; const bool bQueueRecoverySource = @@ -1121,6 +1133,10 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna const bool bLaunchQueueRecovery = CoachMemorySnapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; + const bool bMethodDrillRecoveryActionSource = + HyperTwistTrainingCoachLibraryInternal::IsMethodDrillDashboardHandoffSource( + CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + ); const float Score = 66.0f + FMath::Min(CoachMemorySnapshot.ScheduleExecutionPressureScore * 0.25f, 20.0f) + (bArchiveAware ? 5.0f : 0.0f) @@ -1128,7 +1144,8 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna + (bRepeatManualReschedule ? 5.0f : 0.0f) + (CoachMemorySnapshot.bHasQueueExecutionCompletionGap ? 4.0f : 0.0f) + (bQueueRecoverySource ? 2.0f : 0.0f) - + (bExplicitDashboardHandoffPreference ? 2.0f : 0.0f); + + (bExplicitDashboardHandoffPreference ? 2.0f : 0.0f) + + (bMethodDrillRecoveryActionSource ? 2.0f : 0.0f); const EHyperTwistCoachFocusLane FocusLane = bArchiveAware ? EHyperTwistCoachFocusLane::Stability @@ -1136,45 +1153,65 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna FString Headline; if (bDashboardQueuedHandoff) { - Headline = bDeferredOverflowDashboardHandoff + Headline = bMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted drill-driven queued handoffs keep drill-tipped queued recovery work active") + : TEXT("Accepted drill-driven queued handoffs favor a queue-first drill recovery launch")) + : (bDeferredOverflowDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted deferred-overflow queued handoffs favor promoting narrowed queued work first") : TEXT("Accepted deferred-overflow queued handoffs favor a queue-first narrowed recovery launch")) : (bPromoteQueueRecovery ? TEXT("Accepted queued handoffs favor promoting queued work first") - : TEXT("Accepted queued handoffs favor a queue-first recovery launch")); + : TEXT("Accepted queued handoffs favor a queue-first recovery launch"))); } else if (bDashboardFollowUpHandoff) { - Headline = bDeferredOverflowDashboardHandoff + Headline = bMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted drill-driven follow-up handoffs keep the drill-derived follow-up lane active") + : TEXT("Accepted drill-driven follow-up handoffs favor recovering the drill-derived follow-up lane next")) + : (bDeferredOverflowDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted deferred-overflow follow-up handoffs keep narrowed follow-up work active") : TEXT("Accepted deferred-overflow follow-up handoffs favor recovering narrowed follow-up work next")) : (bPromoteQueueRecovery ? TEXT("Accepted follow-up handoffs keep the deferred follow-up lane active") - : TEXT("Accepted follow-up handoffs favor recovering the follow-up lane next")); + : TEXT("Accepted follow-up handoffs favor recovering the follow-up lane next"))); } else if (bDashboardRecommendedHandoff) { - Headline = bDeferredOverflowDashboardHandoff + Headline = bMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted drill-driven recommended handoffs keep drill-tipped recommended recovery work active") + : TEXT("Accepted drill-driven recommended handoffs favor restoring drill-tipped recommended work next")) + : (bDeferredOverflowDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted deferred-overflow recommended handoffs keep narrowed recommended work active") : TEXT("Accepted deferred-overflow recommended handoffs favor restoring narrowed recommended work next")) : (bPromoteQueueRecovery ? TEXT("Accepted recommended handoffs keep the deferred recommended lane active") - : TEXT("Accepted recommended handoffs favor restoring the recommended lane next")); + : TEXT("Accepted recommended handoffs favor restoring the recommended lane next"))); } else if (bQueueRecoveryFollowUp) { - Headline = bPromoteQueueRecovery - ? TEXT("Promote the deferred follow-up lane back into active queue flow") - : TEXT("Recover the deferred follow-up lane before the queue drifts further"); + Headline = bMethodDrillRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the deferred drill-derived follow-up lane back into active queue flow") + : TEXT("Recover the drill-derived follow-up lane before the queue drifts further")) + : (bPromoteQueueRecovery + ? TEXT("Promote the deferred follow-up lane back into active queue flow") + : TEXT("Recover the deferred follow-up lane before the queue drifts further")); } else if (bQueueRecoveryRecommended) { - Headline = bPromoteQueueRecovery - ? TEXT("Promote the deferred recommended lane back into the active queue") - : TEXT("Recover the deferred recommended lane and restore queue cadence"); + Headline = bMethodDrillRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the deferred drill-tipped recommended lane back into the active queue") + : TEXT("Recover the drill-tipped recommended lane and restore queue cadence")) + : (bPromoteQueueRecovery + ? TEXT("Promote the deferred recommended lane back into the active queue") + : TEXT("Recover the deferred recommended lane and restore queue cadence")); } else if (bBlockedFollowUp) { @@ -1254,7 +1291,7 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna Score, Headline, FString::Printf( - TEXT("deferred=%d, manual=%d, archiveAware=%d, blockedFollowUp=%d, completionGap=%d, deferralReason=%s, recoverySource=%s, recoveryAction=%s, recoveryActionSource=%s, handoffPreference=%s, handoffSource=%s, deferredOverflowHandoff=%d"), + TEXT("deferred=%d, manual=%d, archiveAware=%d, blockedFollowUp=%d, completionGap=%d, deferralReason=%s, recoverySource=%s, recoveryAction=%s, recoveryActionSource=%s, handoffPreference=%s, handoffSource=%s, deferredOverflowHandoff=%d, methodDrillHandoff=%d, methodDrillRecoverySource=%d"), CoachMemorySnapshot.ScheduleDeferredEventCount, CoachMemorySnapshot.ScheduleManualRescheduleEventCount, CoachMemorySnapshot.ScheduleArchiveAwareEventCount, @@ -1266,7 +1303,9 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna *RecoveryActionSourceLabel, *HandoffPreferenceLabel, *HandoffSourceLabel, - bTightenedDeferredOverflowHandoff ? 1 : 0), + bTightenedDeferredOverflowHandoff ? 1 : 0, + bMethodDrillDashboardHandoff ? 1 : 0, + bMethodDrillRecoveryActionSource ? 1 : 0), bTightenedDeferredOverflowHandoff ? (CoachMemorySnapshot.DominantCoachSuggestedMode == EHyperTwistTrainingDeliveryMode::RecognitionAssisted diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp index 183be73..6f78eca 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp @@ -587,7 +587,10 @@ namespace HyperTwistTrainingRepositoryLibraryInternal + static_cast(ExplicitQueuedHandoffSignal) + static_cast(ExplicitDeferredOverflowQueuedHandoffSignal) + static_cast(ExplicitDeferredFirstQueuedHandoffSignal) - + static_cast(ExplicitDeferredFirstFollowUpHandoffSignal) * 0.5f; + + static_cast(ExplicitDeferredFirstFollowUpHandoffSignal) * 0.5f + + static_cast(ExplicitMethodDrillQueuedHandoffSignal) + + static_cast(ExplicitMethodDrillFollowUpHandoffSignal) + + static_cast(ExplicitMethodDrillRecommendedHandoffSignal) * 0.5f; if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f) { if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure) @@ -601,17 +604,9 @@ namespace HyperTwistTrainingRepositoryLibraryInternal Snapshot.PreferredQueueRecoveryAction = EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; Snapshot.PreferredQueueRecoveryActionSourceLabel = - ExplicitQueuedHandoffSignal > 0 - ? (ExplicitDeferredFirstQueuedHandoffSignal > 0 - ? TEXT("dashboard-handoff-deferred-first-queued") - : (ExplicitDeferredOverflowQueuedHandoffSignal > 0 - ? TEXT("dashboard-guidance-outcome-deferred-overflow-queued") - : TEXT("dashboard-handoff-queued"))) - : (ExplicitDeferredFirstFollowUpHandoffSignal > 0 - ? TEXT("dashboard-handoff-deferred-first-follow-up") - : (ExplicitFollowUpHandoffSignal > 0 - ? TEXT("dashboard-handoff-follow-up") - : TEXT("queue-history-launch-pressure"))); + !Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() + ? Snapshot.PreferredCoachHandoffSourceLabel + : TEXT("queue-history-launch-pressure"); } else { @@ -6545,7 +6540,10 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der + static_cast(ExplicitQueuedHandoffSignal) + static_cast(ExplicitDeferredOverflowQueuedHandoffSignal) + static_cast(ExplicitDeferredFirstQueuedHandoffSignal) - + static_cast(ExplicitDeferredFirstFollowUpHandoffSignal) * 0.5f; + + static_cast(ExplicitDeferredFirstFollowUpHandoffSignal) * 0.5f + + static_cast(ExplicitMethodDrillQueuedHandoffSignal) + + static_cast(ExplicitMethodDrillFollowUpHandoffSignal) + + static_cast(ExplicitMethodDrillRecommendedHandoffSignal) * 0.5f; if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f) { if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure) @@ -6559,17 +6557,9 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der Snapshot.PreferredQueueRecoveryAction = EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; Snapshot.PreferredQueueRecoveryActionSourceLabel = - ExplicitQueuedHandoffSignal > 0 - ? (ExplicitDeferredFirstQueuedHandoffSignal > 0 - ? TEXT("dashboard-handoff-deferred-first-queued") - : (ExplicitDeferredOverflowQueuedHandoffSignal > 0 - ? TEXT("dashboard-guidance-outcome-deferred-overflow-queued") - : TEXT("dashboard-handoff-queued"))) - : (ExplicitDeferredFirstFollowUpHandoffSignal > 0 - ? TEXT("dashboard-handoff-deferred-first-follow-up") - : (ExplicitFollowUpHandoffSignal > 0 - ? TEXT("dashboard-handoff-follow-up") - : TEXT("queue-history-launch-pressure"))); + !Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() + ? Snapshot.PreferredCoachHandoffSourceLabel + : TEXT("queue-history-launch-pressure"); } else {